--- python3.4-3.4.1.orig/debian/2to3-3.1 +++ python3.4-3.4.1/debian/2to3-3.1 @@ -0,0 +1,41 @@ +.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.40.4. +.TH 2TO3-3.3 "1" "January 2012" "2to3-3.3 3.3" "User Commands" +.SH NAME +2to3-3.3 \- Python2 to Python3 converter +.SH SYNOPSIS +.B 2to3 +[\fIoptions\fR] \fIfile|dir \fR... +.SH OPTIONS +.TP +\fB\-h\fR, \fB\-\-help\fR +show this help message and exit +.TP +\fB\-d\fR, \fB\-\-doctests_only\fR +Fix up doctests only +.TP +\fB\-f\fR FIX, \fB\-\-fix\fR=\fIFIX\fR +Each FIX specifies a transformation; default: all +.TP +\fB\-j\fR PROCESSES, \fB\-\-processes\fR=\fIPROCESSES\fR +Run 2to3 concurrently +.TP +\fB\-x\fR NOFIX, \fB\-\-nofix\fR=\fINOFIX\fR +Prevent a transformation from being run +.TP +\fB\-l\fR, \fB\-\-list\-fixes\fR +List available transformations +.TP +\fB\-p\fR, \fB\-\-print\-function\fR +Modify the grammar so that print() is a function +.TP +\fB\-v\fR, \fB\-\-verbose\fR +More verbose logging +.TP +\fB\-\-no\-diffs\fR +Don't show diffs of the refactoring +.TP +\fB\-w\fR, \fB\-\-write\fR +Write back modified files +.TP +\fB\-n\fR, \fB\-\-nobackups\fR +Don't write backups for modified files --- python3.4-3.4.1.orig/debian/FAQ.html +++ python3.4-3.4.1/debian/FAQ.html @@ -0,0 +1,8997 @@ + + +The Whole Python FAQ + + + +

The Whole Python FAQ

+Last changed on Wed Feb 12 21:31:08 2003 CET + +

(Entries marked with ** were changed within the last 24 hours; +entries marked with * were changed within the last 7 days.) +

+ +

+


+

1. General information and availability

+ + +

+


+

2. Python in the real world

+ + +

+


+

3. Building Python and Other Known Bugs

+ + +

+


+

4. Programming in Python

+ + +

+


+

5. Extending Python

+ + +

+


+

6. Python's design

+ + +

+


+

7. Using Python on non-UNIX platforms

+ + +

+


+

8. Python on Windows

+ + +
+

1. General information and availability

+ +
+

1.1. What is Python?

+Python is an interpreted, interactive, object-oriented programming +language. It incorporates modules, exceptions, dynamic typing, very +high level dynamic data types, and classes. Python combines +remarkable power with very clear syntax. It has interfaces to many +system calls and libraries, as well as to various window systems, and +is extensible in C or C++. It is also usable as an extension language +for applications that need a programmable interface. Finally, Python +is portable: it runs on many brands of UNIX, on the Mac, and on PCs +under MS-DOS, Windows, Windows NT, and OS/2. +

+To find out more, the best thing to do is to start reading the +tutorial from the documentation set (see a few questions further +down). +

+See also question 1.17 (what is Python good for). +

+ +Edit this entry / +Log info + +/ Last changed on Mon May 26 16:05:18 1997 by +GvR +

+ +


+

1.2. Why is it called Python?

+Apart from being a computer scientist, I'm also a fan of "Monty +Python's Flying Circus" (a BBC comedy series from the seventies, in +the -- unlikely -- case you didn't know). It occurred to me one day +that I needed a name that was short, unique, and slightly mysterious. +And I happened to be reading some scripts from the series at the +time... So then I decided to call my language Python. +

+By now I don't care any more whether you use a Python, some other +snake, a foot or 16-ton weight, or a wood rat as a logo for Python! +

+ +Edit this entry / +Log info + +/ Last changed on Thu Aug 24 00:50:41 2000 by +GvR +

+ +


+

1.3. How do I obtain a copy of the Python source?

+The latest Python source distribution is always available from +python.org, at http://www.python.org/download. The latest development sources can be obtained via anonymous CVS from SourceForge, at http://www.sf.net/projects/python . +

+The source distribution is a gzipped tar file containing the complete C source, LaTeX +documentation, Python library modules, example programs, and several +useful pieces of freely distributable software. This will compile and +run out of the box on most UNIX platforms. (See section 7 for +non-UNIX information.) +

+Older versions of Python are also available from python.org. +

+ +Edit this entry / +Log info + +/ Last changed on Tue Apr 9 17:06:16 2002 by +A.M. Kuchling +

+ +


+

1.4. How do I get documentation on Python?

+All documentation is available on-line, starting at http://www.python.org/doc/. +

+The LaTeX source for the documentation is part of the source +distribution. If you don't have LaTeX, the latest Python +documentation set is available, in various formats like postscript +and html, by anonymous ftp - visit the above URL for links to the +current versions. +

+PostScript for a high-level description of Python is in the file nluug-paper.ps +(a separate file on the ftp site). +

+ +Edit this entry / +Log info + +/ Last changed on Wed Jan 21 12:02:55 1998 by +Ken Manheimer +

+ +


+

1.5. Are there other ftp sites that mirror the Python distribution?

+The following anonymous ftp sites keep mirrors of the Python +distribution: +

+USA: +

+

+        ftp://ftp.python.org/pub/python/
+        ftp://gatekeeper.dec.com/pub/plan/python/
+        ftp://ftp.uu.net/languages/python/
+        ftp://ftp.wustl.edu/graphics/graphics/sgi-stuff/python/
+        ftp://ftp.sterling.com/programming/languages/python/
+        ftp://uiarchive.cso.uiuc.edu/pub/lang/python/
+        ftp://ftp.pht.com/mirrors/python/python/
+	ftp://ftp.cdrom.com/pub/python/
+
+Europe: +

+

+        ftp://ftp.cwi.nl/pub/python/
+        ftp://ftp.funet.fi/pub/languages/python/
+        ftp://ftp.sunet.se/pub/lang/python/
+        ftp://unix.hensa.ac.uk/mirrors/uunet/languages/python/
+        ftp://ftp.lip6.fr/pub/python/
+        ftp://sunsite.cnlab-switch.ch/mirror/python/
+        ftp://ftp.informatik.tu-muenchen.de/pub/comp/programming/languages/python/
+
+Australia: +

+

+        ftp://ftp.dstc.edu.au/pub/python/
+
+

+ +Edit this entry / +Log info + +/ Last changed on Wed Mar 24 09:20:49 1999 by +A.M. Kuchling +

+ +


+

1.6. Is there a newsgroup or mailing list devoted to Python?

+There is a newsgroup, comp.lang.python, +and a mailing list. The newsgroup and mailing list are gatewayed into +each other -- if you can read news it's unnecessary to subscribe to +the mailing list. To subscribe to the mailing list +(python-list@python.org) visit its Mailman webpage at +http://www.python.org/mailman/listinfo/python-list +

+More info about the newsgroup and mailing list, and about other lists, +can be found at +http://www.python.org/psa/MailingLists.html. +

+Archives of the newsgroup are kept by Deja News and accessible +through the "Python newsgroup search" web page, +http://www.python.org/search/search_news.html. +This page also contains pointer to other archival collections. +

+ +Edit this entry / +Log info + +/ Last changed on Wed Jun 23 09:29:36 1999 by +GvR +

+ +


+

1.7. Is there a WWW page devoted to Python?

+Yes, http://www.python.org/ is the official Python home page. +

+ +Edit this entry / +Log info + +/ Last changed on Fri May 23 14:42:59 1997 by +Ken Manheimer +

+ +


+

1.8. Is the Python documentation available on the WWW?

+Yes. Python 2.0 documentation is available from +http://www.pythonlabs.com/tech/python2.0/doc/ and from +http://www.python.org/doc/. Note that most documentation +is available for on-line browsing as well as for downloading. +

+ +Edit this entry / +Log info + +/ Last changed on Tue Jan 2 03:14:08 2001 by +Moshe Zadka +

+ +


+

1.9. Are there any books on Python?

+Yes, many, and more are being published. See +the python.org Wiki at http://www.python.org/cgi-bin/moinmoin/PythonBooks for a list. +

+You can also search online bookstores for "Python" +(and filter out the Monty Python references; or +perhaps search for "Python" and "language"). +

+ +Edit this entry / +Log info + +/ Last changed on Mon Aug 5 19:08:49 2002 by +amk +

+ +


+

1.10. Are there any published articles about Python that I can reference?

+If you can't reference the web site, and you don't want to reference the books +(see previous question), there are several articles on Python that you could +reference. +

+Most publications about Python are collected on the Python web site: +

+

+    http://www.python.org/doc/Publications.html
+
+It is no longer recommended to reference this +very old article by Python's author: +

+

+    Guido van Rossum and Jelke de Boer, "Interactively Testing Remote
+    Servers Using the Python Programming Language", CWI Quarterly, Volume
+    4, Issue 4 (December 1991), Amsterdam, pp 283-303.
+
+

+ +Edit this entry / +Log info + +/ Last changed on Sat Jul 4 20:52:31 1998 by +GvR +

+ +


+

1.11. Are there short introductory papers or talks on Python?

+There are several - you can find links to some of them collected at +http://www.python.org/doc/Hints.html#intros. +

+ +Edit this entry / +Log info + +/ Last changed on Fri May 23 15:04:05 1997 by +Ken Manheimer +

+ +


+

1.12. How does the Python version numbering scheme work?

+Python versions are numbered A.B.C or A.B. A is the major version +number -- it is only incremented for really major changes in the +language. B is the minor version number, incremented for less +earth-shattering changes. C is the micro-level -- it is +incremented for each bugfix release. See PEP 6 for more information +about bugfix releases. +

+Not all releases have bugfix releases. +Note that in the past (ending with 1.5.2), +micro releases have added significant changes; +in fact the changeover from 0.9.9 to 1.0.0 was the first time +that either A or B changed! +

+Alpha, beta and release candidate versions have an additional suffixes. +The suffix for an alpha version is "aN" for some small number N, the +suffix for a beta version is "bN" for some small number N, and the +suffix for a release candidate version is "cN" for some small number N. +

+Note that (for instance) all versions labeled 2.0aN precede the +versions labeled 2.0bN, which precede versions labeled 2.0cN, and +those precede 2.0. +

+As a rule, no changes are made between release candidates and the final +release unless there are show-stopper bugs. +

+You may also find version numbers with a "+" suffix, e.g. "2.2+". +These are unreleased versions, built directly from the CVS trunk. +

+See also the documentation for sys.version, sys.hexversion, and +sys.version_info. +

+ +Edit this entry / +Log info + +/ Last changed on Mon Jan 14 06:34:17 2002 by +GvR +

+ +


+

1.13. How do I get a beta test version of Python?

+All releases, including alphas, betas and release candidates, are announced on +comp.lang.python and comp.lang.python.announce newsgroups, +which are gatewayed into the python-list@python.org and +python-announce@python.org. In addition, all these announcements appear on +the Python home page, at http://www.python.org. +

+You can also access the development version of Python through CVS. See http://sourceforge.net/cvs/?group_id=5470 for details. If you're not familiar with CVS, documents like http://linux.oreillynet.com/pub/a/linux/2002/01/03/cvs_intro.html +provide an introduction. +

+ +Edit this entry / +Log info + +/ Last changed on Mon Jun 3 00:57:08 2002 by +Neal Norwitz +

+ +


+

1.14. Are there copyright restrictions on the use of Python?

+Hardly. You can do anything you want with the source, as long as +you leave the copyrights in, and display those copyrights in any +documentation about Python that you produce. Also, don't use the +author's institute's name in publicity without prior written +permission, and don't hold them responsible for anything (read the +actual copyright for a precise legal wording). +

+In particular, if you honor the copyright rules, it's OK to use Python +for commercial use, to sell copies of Python in source or binary form, +or to sell products that enhance Python or incorporate Python (or part +of it) in some form. I would still like to know about all commercial +use of Python! +

+ +Edit this entry / +Log info +

+ +


+

1.15. Why was Python created in the first place?

+Here's a very brief summary of what got me started: +

+I had extensive experience with implementing an interpreted language +in the ABC group at CWI, and from working with this group I had +learned a lot about language design. This is the origin of many +Python features, including the use of indentation for statement +grouping and the inclusion of very-high-level data types (although the +details are all different in Python). +

+I had a number of gripes about the ABC language, but also liked many +of its features. It was impossible to extend the ABC language (or its +implementation) to remedy my complaints -- in fact its lack of +extensibility was one of its biggest problems. +I had some experience with using Modula-2+ and talked with the +designers of Modula-3 (and read the M3 report). M3 is the origin of +the syntax and semantics used for exceptions, and some other Python +features. +

+I was working in the Amoeba distributed operating system group at +CWI. We needed a better way to do system administration than by +writing either C programs or Bourne shell scripts, since Amoeba had +its own system call interface which wasn't easily accessible from the +Bourne shell. My experience with error handling in Amoeba made me +acutely aware of the importance of exceptions as a programming +language feature. +

+It occurred to me that a scripting language with a syntax like ABC +but with access to the Amoeba system calls would fill the need. I +realized that it would be foolish to write an Amoeba-specific +language, so I decided that I needed a language that was generally +extensible. +

+During the 1989 Christmas holidays, I had a lot of time on my hand, +so I decided to give it a try. During the next year, while still +mostly working on it in my own time, Python was used in the Amoeba +project with increasing success, and the feedback from colleagues made +me add many early improvements. +

+In February 1991, after just over a year of development, I decided +to post to USENET. The rest is in the Misc/HISTORY file. +

+ +Edit this entry / +Log info + +/ Last changed on Fri May 23 00:06:23 1997 by +GvR +

+ +


+

1.16. Do I have to like "Monty Python's Flying Circus"?

+No, but it helps. Pythonistas like the occasional reference to SPAM, +and of course, nobody expects the Spanish Inquisition +

+The two main reasons to use Python are: +

+

+ - Portable
+ - Easy to learn
+
+The three main reasons to use Python are: +

+

+ - Portable
+ - Easy to learn
+ - Powerful standard library
+
+(And nice red uniforms.) +

+And remember, there is no rule six. +

+ +Edit this entry / +Log info + +/ Last changed on Wed May 28 10:39:21 1997 by +GvR +

+ +


+

1.17. What is Python good for?

+Python is used in many situations where a great deal of dynamism, +ease of use, power, and flexibility are required. +

+In the area of basic text +manipulation core Python (without any non-core extensions) is easier +to use and is roughly as fast as just about any language, and this makes Python +good for many system administration type tasks and for CGI programming +and other application areas that manipulate text and strings and such. +

+When augmented with +standard extensions (such as PIL, COM, Numeric, oracledb, kjbuckets, +tkinter, win32api, etc.) +or special purpose extensions (that you write, perhaps using helper tools such +as SWIG, or using object protocols such as ILU/CORBA or COM) Python +becomes a very convenient "glue" or "steering" +language that helps make heterogeneous collections of unrelated +software packages work together. +For example by combining Numeric with oracledb you can help your +SQL database do statistical analysis, or even Fourier transforms. +One of the features that makes Python excel in the "glue language" role +is Python's simple, usable, and powerful C language runtime API. +

+Many developers also use Python extensively as a graphical user +interface development aide. +

+ +Edit this entry / +Log info + +/ Last changed on Sat May 24 10:13:11 1997 by +Aaron Watters +

+ +


+

1.18. Can I use the FAQ Wizard software to maintain my own FAQ?

+Sure. It's in Tools/faqwiz/ of the python source tree. +

+ +Edit this entry / +Log info + +/ Last changed on Fri Mar 29 06:50:32 2002 by +Aahz +

+ +


+

1.19. Which editor has good support for editing Python source code?

+On Unix, the first choice is Emacs/XEmacs. There's an elaborate +mode for editing Python code, which is available from the Python +source distribution (Misc/python-mode.el). It's also bundled +with XEmacs (we're still working on legal details to make it possible +to bundle it with FSF Emacs). And it has its own web page: +

+

+    http://www.python.org/emacs/python-mode/index.html
+
+There are many other choices, for Unix, Windows or Macintosh. +Richard Jones compiled a table from postings on the Python newsgroup: +

+

+    http://www.bofh.asn.au/~richard/editors.html
+
+See also FAQ question 7.10 for some more Mac and Win options. +

+ +Edit this entry / +Log info + +/ Last changed on Mon Jun 15 23:21:04 1998 by +Gvr +

+ +


+

1.20. I've never programmed before. Is there a Python tutorial?

+There are several, and at least one book. +All information for beginning Python programmers is collected here: +

+

+    http://www.python.org/doc/Newbies.html
+
+

+ +Edit this entry / +Log info + +/ Last changed on Wed Sep 5 05:34:07 2001 by +GvR +

+ +


+

1.21. Where in the world is www.python.org located?

+It's currently in Amsterdam, graciously hosted by XS4ALL: +

+

+    http://www.xs4all.nl
+
+Thanks to Thomas Wouters for setting this up!!!! +

+ +Edit this entry / +Log info + +/ Last changed on Fri Aug 3 21:49:27 2001 by +GvR +

+ +


+

2. Python in the real world

+ +
+

2.1. How many people are using Python?

+Certainly thousands, and quite probably tens of thousands of users. +More are seeing the light each day. The comp.lang.python newsgroup is +very active, but overall there is no accurate estimate of the number of subscribers or Python users. +

+Jacek Artymiak has created a Python Users Counter; you can see the +current count by visiting +http://www.wszechnica.safenet.pl/cgi-bin/checkpythonuserscounter.py +(this will not increment the counter; use the link there if you haven't +added yourself already). Most Python users appear not to have registered themselves. +

+ +Edit this entry / +Log info + +/ Last changed on Thu Feb 21 23:29:18 2002 by +GvR +

+ +


+

2.2. Have any significant projects been done in Python?

+At CWI (the former home of Python), we have written a 20,000 line +authoring environment for transportable hypermedia presentations, a +5,000 line multimedia teleconferencing tool, as well as many many +smaller programs. +

+At CNRI (Python's new home), we have written two large applications: +Grail, a fully featured web browser (see +http://grail.cnri.reston.va.us), +and the Knowbot Operating Environment, +a distributed environment for mobile code. +

+The University of Virginia uses Python to control a virtual reality +engine. See http://alice.cs.cmu.edu. +

+The ILU project at Xerox PARC can generate Python glue for ILU +interfaces. See ftp://ftp.parc.xerox.com/pub/ilu/ilu.html. ILU +is a free CORBA compliant ORB which supplies distributed object +connectivity to a host of platforms using a host of languages. +

+Mark Hammond and Greg Stein and others are interfacing Python to +Microsoft's COM and ActiveX architectures. This means, among other +things, that Python may be used in active server pages or as a COM +controller (for example to automatically extract from or insert information +into Excel or MSAccess or any other COM aware application). +Mark claims Python can even be a ActiveX scripting host (which +means you could embed JScript inside a Python application, if you +had a strange sense of humor). Python/AX/COM is distributed as part +of the PythonWin distribution. +

+The University of California, Irvine uses a student administration +system called TELE-Vision written entirely in Python. Contact: Ray +Price rlprice@uci.edu. +

+The Melbourne Cricket Ground (MCG) in Australia (a 100,000+ person venue) +has it's scoreboard system written largely in Python on MS Windows. +Python expressions are used to create almost every scoring entry that +appears on the board. The move to Python/C++ away from exclusive C++ +has provided a level of functionality that would simply not have been +viable otherwise. +

+See also the next question. +

+Note: this FAQ entry is really old. +See http://www.python.org/psa/Users.html for a more recent list. +

+ +Edit this entry / +Log info + +/ Last changed on Wed Oct 25 13:24:15 2000 by +GvR +

+ +


+

2.3. Are there any commercial projects going on using Python?

+Yes, there's lots of commercial activity using Python. See +http://www.python.org/psa/Users.html for a list. +

+ +Edit this entry / +Log info + +/ Last changed on Wed Oct 14 18:17:33 1998 by +ken +

+ +


+

2.4. How stable is Python?

+Very stable. New, stable releases have been coming out roughly every 3 to 12 months since 1991, and this seems likely to continue. +

+With the introduction of retrospective "bugfix" releases the stability of the language implementations can be, and is being, improved independently of the new features offered by more recent major or minor releases. Bugfix releases, indicated by a third component of the version number, only fix known problems and do not gratuitously introduce new and possibly incompatible features or modified library functionality. +

+Release 2.2 got its first bugfix on April 10, 2002. The new version +number is now 2.2.1. The 2.1 release, at 2.1.3, can probably be +considered the "most stable" platform because it has been bugfixed +twice. +

+ +Edit this entry / +Log info + +/ Last changed on Tue Jul 23 10:20:04 2002 by +Jens Kubieziel +

+ +


+

2.5. What new developments are expected for Python in the future?

+See http://www.python.org/peps/ for the Python Enhancement +Proposals (PEPs). PEPs are design +documents +describing a suggested new feature for Python, providing +a concise technical specification and a rationale. +

+Also, follow the discussions on the python-dev mailing list. +

+ +Edit this entry / +Log info + +/ Last changed on Tue Apr 9 17:09:51 2002 by +A.M. Kuchling +

+ +


+

2.6. Is it reasonable to propose incompatible changes to Python?

+In general, no. There are already millions of lines of Python code +around the world, so any changes in the language that invalidates more +than a very small fraction of existing programs has to be frowned +upon. Even if you can provide a conversion program, there still is +the problem of updating all documentation. Providing a gradual +upgrade path is the only way if a feature has to be changed. +

+See http://www.python.org/peps/pep-0005.html for the proposed +mechanism for creating backwards-incompatibilities. +

+ +Edit this entry / +Log info + +/ Last changed on Mon Apr 1 22:13:47 2002 by +Fred Drake +

+ +


+

2.7. What is the future of Python?

+Please see http://www.python.org/peps/ for proposals of future +activities. One of the PEPs (Python Enhancement Proposals) deals +with the PEP process and PEP format -- see +http://www.python.org/peps/pep-0001.html if you want to +submit a PEP. In http://www.python.org/peps/pep-0042.html there +is a list of wishlists the Python Development team plans to tackle. +

+ +Edit this entry / +Log info + +/ Last changed on Mon Apr 1 22:15:46 2002 by +Fred Drake +

+ +


+

2.8. What was the PSA, anyway?

+The Python Software Activity was +created by a number of Python aficionados who want Python to be more +than the product and responsibility of a single individual. +The PSA was not an independent organization, but lived +under the umbrealla of CNRI. +

+The PSA has been superseded by the Python Software Foundation, +an independent non-profit organization. The PSF's home page +is at http://www.python.org/psf/. +

+Some pages created by the PSA still live at +http://www.python.org/psa/ +

+ +Edit this entry / +Log info + +/ Last changed on Thu Jul 25 18:19:44 2002 by +GvR +

+ +


+

2.9. Deleted

+

+

+ +Edit this entry / +Log info + +/ Last changed on Tue Jan 2 02:51:30 2001 by +Moshe Zadka +

+ +


+

2.10. Deleted

+

+

+ +Edit this entry / +Log info + +/ Last changed on Tue Jan 2 02:52:19 2001 by +Moshe Zadka +

+ +


+

2.11. Is Python Y2K (Year 2000) Compliant?

+As of January, 2001 no major problems have been reported and Y2K +compliance seems to be a non-issue. +

+Since Python is available free of charge, there are no absolute +guarantees. If there are unforeseen problems, liability is the +user's rather than the developers', and there is nobody you can sue for damages. +

+Python does few +date manipulations, and what it does is all based on the Unix +representation for time (even on non-Unix systems) which uses seconds +since 1970 and won't overflow until 2038. +

+ +Edit this entry / +Log info + +/ Last changed on Mon Jan 8 17:19:32 2001 by +Steve Holden +

+ +


+

2.12. Is Python a good language in a class for beginning programmers?

+Yes. This long answer attempts to address any concerns you might +have with teaching Python as a programmer's first language. +(If you want to discuss Python's use in education, then +you may be interested in joining the edu-sig mailinglist. +See http://www.python.org/sigs/edu-sig/ ) +

+It is still common to start students with a procedural +(subset of a) statically typed language such as Pascal, C, or +a subset of C++ or Java. I think that students may be better +served by learning Python as their first language. Python has +a very simple and consistent syntax and a large standard library. +Most importantly, using Python in a beginning programming course +permits students to concentrate on important programming skills, +such as problem decomposition and data type design. +

+With Python, students can be quickly introduced to basic concepts +such as loops and procedures. They can even probably work with +user-defined objects in their very first course. They could +implement a tree structure as nested Python lists, for example. +They could be introduced to objects in their first course if +desired. For a student who has never programmed before, using +a statically typed language seems unnatural. It presents +additional complexity that the student must master and slows +the pace of the course. The students are trying to learn to +think like a computer, decompose problems, design consistent +interfaces, and encapsulate data. While learning to use a +statically typed language is important, it is not necessarily the +best topic to address in the students' first programming course. +

+Many other aspects of Python make it a good first language. +Python has a large standard library (like Java) so that +students can be assigned programming projects very early in the +course that do something. Assignments aren't restricted to the +standard four-function calculator and check balancing programs. +By using the standard library, students can gain the satisfaction +of working on realistic applications as they learn the fundamentals +of programming. Using the standard library also teaches students +about code reuse. +

+Python's interactive interpreter also enables students to +test language features while they're programming. They can keep +a window with the interpreter running while they enter their +programs' source in another window. If they can't remember the +methods for a list, they can do something like this: +

+

+ >>> L = []
+ >>> dir(L)
+ ['append', 'count', 'extend', 'index', 'insert', 'pop', 'remove',
+ 'reverse', 'sort']
+ >>> print L.append.__doc__
+ L.append(object) -- append object to end
+ >>> L.append(1)
+ >>> L
+ [1]
+
+With the interpreter, documentation is never far from the +student as he's programming. +

+There are also good IDEs for Python. Guido van Rossum's IDLE +is a cross-platform IDE for Python that is written in Python +using Tk. There is also a Windows specific IDE called PythonWin. +Emacs users will be happy to know that there is a very good Python +mode for Emacs. All of these programming environments provide +syntax highlighting, auto-indenting, and access to the interactive +interpreter while coding. For more information about IDEs, see XXX. +

+If your department is currently using Pascal because it was +designed to be a teaching language, then you'll be happy to +know that Guido van Rossum designed Python to be simple to +teach to everyone but powerful enough to implement real world +applications. Python makes a good language for first time +programmers because that was one of Python's design goals. +There are papers at http://www.python.org/doc/essays/ on the Python website +by Python's creator explaining his objectives for the language. +One that may interest you is titled "Computer Programming for Everybody" +http://www.python.org/doc/essays/cp4e.html +

+If you're seriously considering Python as a language for your +school, Guido van Rossum may even be willing to correspond with +you about how the language would fit in your curriculum. +See http://www.python.org/doc/FAQ.html#2.2 for examples of +Python's use in the "real world." +

+While Python, its source code, and its IDEs are freely +available, this consideration should not rule +out other languages. There are other free languages (Java, +free C compilers), and many companies are willing to waive some +or all of their fees for student programming tools if it +guarantees that a whole graduating class will know how to +use their tools. That is, if one of the requirements for +the language that will be taught is that it be freely +available, then Python qualifies, but this requirement +does not preclude other languages. +

+While Python jobs may not be as prevalent as C/C++/Java jobs, +teachers should not worry about teaching students critical job +skills in their first course. The skills that win students a +job are those they learn in their senior classes and internships. +Their first programming courses are there to lay a solid +foundation in programming fundamentals. The primary question +in choosing the language for such a course should be which +language permits the students to learn this material without +hindering or limiting them. +

+Another argument for Python is that there are many tasks for +which something like C++ is overkill. That's where languages +like Python, Perl, Tcl, and Visual Basic thrive. It's critical +for students to know something about these languages. (Every +employer for whom I've worked used at least one such language.) +Of the languages listed above, Python probably makes the best +language in a programming curriculum since its syntax is simple, +consistent, and not unlike other languages (C/C++/Java) that +are probably in the curriculum. By starting students with +Python, a department simultaneously lays the foundations for +other programming courses and introduces students to the type +of language that is often used as a "glue" language. As an +added bonus, Python can be used to interface with Microsoft's +COM components (thanks to Mark Hammond). There is also Jython, +a Java implementation of the Python interpreter, that can be +used to connect Java components. +

+If you currently start students with Pascal or C/C++ or Java, +you may be worried they will have trouble learning a statically +typed language after starting with Python. I think that this +fear most often stems from the fact that the teacher started +with a statically typed language, and we tend to like to teach +others in the same way we were taught. In reality, the +transition from Python to one of these other languages is +quite simple. +

+To motivate a statically typed language such as C++, begin the +course by explaining that unlike Python, their first language, +C++ is compiled to a machine dependent executable. Explain +that the point is to make a very fast executable. To permit +the compiler to make optimizations, programmers must help it +by specifying the "types" of variables. By restricting each +variable to a specific type, the compiler can reduce the +book-keeping it has to do to permit dynamic types. The compiler +also has to resolve references at compile time. Thus, the +language gains speed by sacrificing some of Python's dynamic +features. Then again, the C++ compiler provides type safety +and catches many bugs at compile time instead of run time (a +critical consideration for many commercial applications). C++ +is also designed for very large programs where one may want to +guarantee that others don't touch an object's implementation. +C++ provides very strong language features to separate an object's +implementation from its interface. Explain why this separation +is a good thing. +

+The first day of a C++ course could then be a whirlwind introduction +to what C++ requires and provides. The point here is that after +a semester or two of Python, students are hopefully competent +programmers. They know how to handle loops and write procedures. +They've also worked with objects, thought about the benefits of +consistent interfaces, and used the technique of subclassing to +specialize behavior. Thus, a whirlwind introduction to C++ could +show them how objects and subclassing looks in C++. The +potentially difficult concepts of object-oriented design were +taught without the additional obstacles presented by a language +such as C++ or Java. When learning one of these languages, +the students would already understand the "road map." They +understand objects; they would just be learning how objects +fit in a statically typed languages. Language requirements +and compiler errors that seem unnatural to beginning programmers +make sense in this new context. Many students will find it +helpful to be able to write a fast prototype of their algorithms +in Python. Thus, they can test and debug their ideas before +they attempt to write the code in the new language, saving the +effort of working with C++ types for when they've discovered a +working solution for their assignments. When they get annoyed +with the rigidity of types, they'll be happy to learn about +containers and templates to regain some of the lost flexibility +Python afforded them. Students may also gain an appreciation +for the fact that no language is best for every task. They'll +see that C++ is faster, but they'll know that they can gain +flexibility and development speed with a Python when execution +speed isn't critical. +

+If you have any concerns that weren't addressed here, try +posting to the Python newsgroup. Others there have done some +work with using Python as an instructional tool. Good luck. +We'd love to hear about it if you choose Python for your course. +

+ +Edit this entry / +Log info + +/ Last changed on Mon Dec 2 19:32:35 2002 by +Bill Sconce +

+ +


+

3. Building Python and Other Known Bugs

+ +
+

3.1. Is there a test set?

+Sure. You can run it after building with "make test", or you can +run it manually with this command at the Python prompt: +

+

+ import test.autotest
+
+In Python 1.4 or earlier, use +

+

+ import autotest
+
+The test set doesn't test all features of Python, +but it goes a long way to confirm that Python is actually working. +

+NOTE: if "make test" fails, don't just mail the output to the +newsgroup -- this doesn't give enough information to debug the +problem. Instead, find out which test fails, and run that test +manually from an interactive interpreter. For example, if +"make test" reports that test_spam fails, try this interactively: +

+

+ import test.test_spam
+
+This generally produces more verbose output which can be diagnosed +to debug the problem. If you find a bug in Python or the libraries, or in the tests, please report this in the Python bug tracker at SourceForge: +

+http://sourceforge.net/tracker/?func=add&group_id=5470&atid=105470 +

+ +Edit this entry / +Log info + +/ Last changed on Fri Apr 27 10:29:36 2001 by +Fred Drake +

+ +


+

3.2. When running the test set, I get complaints about floating point operations, but when playing with floating point operations I cannot find anything wrong with them.

+The test set makes occasional unwarranted assumptions about the +semantics of C floating point operations. Until someone donates a +better floating point test set, you will have to comment out the +offending floating point tests and execute similar tests manually. +

+ +Edit this entry / +Log info +

+ +


+

3.3. Link errors after rerunning the configure script.

+It is generally necessary to run "make clean" after a configuration +change. +

+ +Edit this entry / +Log info +

+ +


+

3.4. The python interpreter complains about options passed to a script (after the script name).

+You are probably linking with GNU getopt, e.g. through -liberty. +Don't. The reason for the complaint is that GNU getopt, unlike System +V getopt and other getopt implementations, doesn't consider a +non-option to be the end of the option list. A quick (and compatible) +fix for scripts is to add "--" to the interpreter, like this: +

+

+        #! /usr/local/bin/python --
+
+You can also use this interactively: +

+

+        python -- script.py [options]
+
+Note that a working getopt implementation is provided in the Python +distribution (in Python/getopt.c) but not automatically used. +

+ +Edit this entry / +Log info +

+ +


+

3.5. When building on the SGI, make tries to run python to create glmodule.c, but python hasn't been built or installed yet.

+Comment out the line mentioning glmodule.c in Setup and build a +python without gl first; install it or make sure it is in your $PATH, +then edit the Setup file again to turn on the gl module, and make +again. You don't need to do "make clean"; you do need to run "make +Makefile" in the Modules subdirectory (or just run "make" at the +toplevel). +

+ +Edit this entry / +Log info +

+ +


+

3.6. I use VPATH but some targets are built in the source directory.

+On some systems (e.g. Sun), if the target already exists in the +source directory, it is created there instead of in the build +directory. This is usually because you have previously built without +VPATH. Try running "make clobber" in the source directory. +

+ +Edit this entry / +Log info +

+ +


+

3.7. Trouble building or linking with the GNU readline library.

+You can use the GNU readline library to improve the interactive user +interface: this gives you line editing and command history when +calling python interactively. Its sources are distributed with +Python (at least for 2.0). Uncomment the line +

+#readline readline.c -lreadline -ltermcap +

+in Modules/Setup. The configuration option --with-readline +is no longer supported, at least in Python 2.0. Some hints on +building and using the readline library: +On SGI IRIX 5, you may have to add the following +to rldefs.h: +

+

+        #ifndef sigmask
+        #define sigmask(sig) (1L << ((sig)-1))
+        #endif
+
+On some systems, you will have to add #include "rldefs.h" to the +top of several source files, and if you use the VPATH feature, you +will have to add dependencies of the form foo.o: foo.c to the +Makefile for several values of foo. +The readline library requires use of the termcap library. A +known problem with this is that it contains entry points which +cause conflicts with the STDWIN and SGI GL libraries. The STDWIN +conflict can be solved by adding a line saying '#define werase w_erase' to the +stdwin.h file (in the STDWIN distribution, subdirectory H). The +GL conflict has been solved in the Python configure script by a +hack that forces use of the static version of the termcap library. +Check the newsgroup gnu.bash.bug news:gnu.bash.bug for +specific problems with the readline library (I don't read this group +but I've been told that it is the place for readline bugs). +

+ +Edit this entry / +Log info + +/ Last changed on Sat Dec 2 18:23:48 2000 by +Issac Trotts +

+ +


+

3.8. Trouble with socket I/O on older Linux 1.x versions.

+Once you've built Python, use it to run the regen script in the +Lib/plat-linux2 directory. Apparently the files as distributed don't match the system headers on some Linux versions. +

+Note that this FAQ entry only applies to Linux kernel versions 1.x.y; +these are hardly around any more. +

+ +Edit this entry / +Log info + +/ Last changed on Tue Jul 30 20:05:52 2002 by +Jens Kubieziel +

+ +


+

3.9. Trouble with prototypes on Ultrix.

+Ultrix cc seems broken -- use gcc, or edit config.h to #undef +HAVE_PROTOTYPES. +

+ +Edit this entry / +Log info +

+ +


+

3.10. Other trouble building Python on platform X.

+Please submit the details to the SourceForge bug tracker: +

+

+  http://sourceforge.net/tracker/?group_id=5470&atid=105470
+
+and we'll look +into it. Please provide as many details as possible. In particular, +if you don't tell us what type of computer and what operating system +(and version) you are using it will be difficult for us to figure out +what is the matter. If you have compilation output logs, +please use file uploads -- don't paste everything in the message box. +

+In many cases, we won't have access to the same hardware or operating system version, so please, if you have a SourceForge account, log in before filing your report, or if you don't have an account, include an email address at which we can reach you for further questions. Logging in to SourceForge first will also cause SourceForge to send you updates as we act on your report. +

+ +Edit this entry / +Log info + +/ Last changed on Fri Apr 27 10:53:18 2001 by +Fred Drake +

+ +


+

3.11. How to configure dynamic loading on Linux.

+This is now automatic as long as your Linux version uses the ELF +object format (all recent Linuxes do). +

+ +Edit this entry / +Log info +

+ +


+

3.12. I can't get shared modules to work on Linux 2.0 (Slackware96)?

+This is a bug in the Slackware96 release. The fix is simple: Make sure +that there is a link from /lib/libdl.so to /lib/libdl.so.1 so that the +following links are setup: /lib/libdl.so -> /lib/libdl.so.1 +/lib/libdl.so.1 -> /lib/libdl.so.1.7.14 You may have to rerun the +configure script, after rm'ing the config.cache file, before you +attempt to rebuild python after this fix. +

+ +Edit this entry / +Log info + +/ Last changed on Wed May 21 15:45:03 1997 by +GvR +

+ +


+

3.13. Trouble when making modules shared on Linux.

+This happens when you have built Python for static linking and then +enable +
+  *shared*
+
+in the Setup file. Shared library code must be +compiled with "-fpic". If a .o file for the module already exist that +was compiled for static linking, you must remove it or do "make clean" +in the Modules directory. +

+ +Edit this entry / +Log info + +/ Last changed on Fri May 23 13:42:30 1997 by +GvR +

+ +


+

3.14. [deleted]

+[ancient information on threads on linux (when thread support +was not standard) used to be here] +

+ +Edit this entry / +Log info + +/ Last changed on Sun Jun 2 17:27:13 2002 by +Erno Kuusela +

+ +


+

3.15. Errors when linking with a shared library containing C++ code.

+Link the main Python binary with C++. Change the definition of +LINKCC in Modules/Makefile to be your C++ compiler. You may have to +edit config.c slightly to make it compilable with C++. +

+ +Edit this entry / +Log info +

+ +


+

3.16. Deleted

+

+

+ +Edit this entry / +Log info + +/ Last changed on Tue Sep 11 16:02:22 2001 by +GvR +

+ +


+

3.17. Deleted.

+

+

+ +Edit this entry / +Log info + +/ Last changed on Tue Sep 11 15:54:57 2001 by +GvR +

+ +


+

3.18. Compilation or link errors for the _tkinter module

+Most likely, there's a version mismatch between the Tcl/Tk header +files (tcl.h and tk.h) and the Tcl/Tk libraries you are using e.g. +"-ltk8.0" and "-ltcl8.0" arguments for _tkinter in the Setup file). +It is possible to install several versions of the Tcl/Tk libraries, +but there can only be one version of the tcl.h and tk.h header +files. If the library doesn't match the header, you'll get +problems, either when linking the module, or when importing it. +Fortunately, the version number is clearly stated in each file, +so this is easy to find. Reinstalling and using the latest +version usually fixes the problem. +

+(Also note that when compiling unpatched Python 1.5.1 against +Tcl/Tk 7.6/4.2 or older, you get an error on Tcl_Finalize. See +the 1.5.1 patch page at http://www.python.org/1.5/patches-1.5.1/.) +

+ +Edit this entry / +Log info + +/ Last changed on Thu Jun 11 00:49:14 1998 by +Gvr +

+ +


+

3.19. I configured and built Python for Tcl/Tk but "import Tkinter" fails.

+Most likely, you forgot to enable the line in Setup that says +"TKPATH=:$(DESTLIB)/tkinter". +

+ +Edit this entry / +Log info +

+ +


+

3.20. [deleted]

+[ancient information on a gcc+tkinter bug on alpha was here] +

+ +Edit this entry / +Log info + +/ Last changed on Mon Jun 3 16:46:23 2002 by +Erno Kuusela +

+ +


+

3.21. Several common system calls are missing from the posix module.

+Most likely, all test compilations run by the configure script +are failing for some reason or another. Have a look in config.log to +see what could be the reason. A common reason is specifying a +directory to the --with-readline option that doesn't contain the +libreadline.a file. +

+ +Edit this entry / +Log info +

+ +


+

3.22. ImportError: No module named string, on MS Windows.

+Most likely, your PYTHONPATH environment variable should be set to +something like: +

+set PYTHONPATH=c:\python;c:\python\lib;c:\python\scripts +

+(assuming Python was installed in c:\python) +

+ +Edit this entry / +Log info +

+ +


+

3.23. Core dump on SGI when using the gl module.

+There are conflicts between entry points in the termcap and curses +libraries and an entry point in the GL library. There's a hack of a +fix for the termcap library if it's needed for the GNU readline +library, but it doesn't work when you're using curses. Concluding, +you can't build a Python binary containing both the curses and gl +modules. +

+ +Edit this entry / +Log info +

+ +


+

3.24. "Initializer not a constant" while building DLL on MS-Windows

+Static type object initializers in extension modules may cause compiles to +fail with an error message like "initializer not a constant". +Fredrik Lundh <Fredrik.Lundh@image.combitech.se> explains: +

+This shows up when building DLL under MSVC. There's two ways to +address this: either compile the module as C++, or change your code to +something like: +

+

+  statichere PyTypeObject bstreamtype = {
+      PyObject_HEAD_INIT(NULL) /* must be set by init function */
+      0,
+      "bstream",
+      sizeof(bstreamobject),
+
+
+  ...
+
+
+  void
+  initbstream()
+  {
+      /* Patch object type */
+      bstreamtype.ob_type = &PyType_Type;
+      Py_InitModule("bstream", functions);
+      ...
+  }
+
+

+ +Edit this entry / +Log info + +/ Last changed on Sun May 25 14:58:05 1997 by +Aaron Watters +

+ +


+

3.25. Output directed to a pipe or file disappears on Linux.

+Some people have reported that when they run their script +interactively, it runs great, but that when they redirect it +to a pipe or file, no output appears. +

+

+    % python script.py
+    ...some output...
+    % python script.py >file
+    % cat file
+    % # no output
+    % python script.py | cat
+    % # no output
+    %
+
+This was a bug in Linux kernel. It is fixed and should not appear anymore. So most Linux users are not affected by this. +

+If redirection doesn't work on your Linux system, check what shell you are using. Shells like (t)csh doesn't support redirection. +

+ +Edit this entry / +Log info + +/ Last changed on Thu Jan 16 13:38:30 2003 by +Jens Kubieziel +

+ +


+

3.26. [deleted]

+[ancient libc/linux problem was here] +

+ +Edit this entry / +Log info + +/ Last changed on Mon Jun 3 16:48:08 2002 by +Erno Kuusela +

+ +


+

3.27. [deleted]

+[ancient linux + threads + tk problem was described here] +

+ +Edit this entry / +Log info + +/ Last changed on Mon Jun 3 16:49:08 2002 by +Erno Kuusela +

+ +


+

3.28. How can I test if Tkinter is working?

+Try the following: +

+

+  python
+  >>> import _tkinter
+  >>> import Tkinter
+  >>> Tkinter._test()
+
+This should pop up a window with two buttons, +one "Click me" and one "Quit". +

+If the first statement (import _tkinter) fails, your Python +installation probably has not been configured to support Tcl/Tk. +On Unix, if you have installed Tcl/Tk, you have to rebuild Python +after editing the Modules/Setup file to enable the _tkinter module +and the TKPATH environment variable. +

+It is also possible to get complaints about Tcl/Tk version +number mismatches or missing TCL_LIBRARY or TK_LIBRARY +environment variables. These have to do with Tcl/Tk installation +problems. +

+A common problem is to have installed versions of tcl.h and tk.h +that don't match the installed version of the Tcl/Tk libraries; +this usually results in linker errors or (when using dynamic +loading) complaints about missing symbols during loading +the shared library. +

+ +Edit this entry / +Log info + +/ Last changed on Thu Aug 28 17:01:46 1997 by +Guido van Rossum +

+ +


+

3.29. Is there a way to get the interactive mode of the python interpreter to perform function/variable name completion?

+(From a posting by Guido van Rossum) +

+On Unix, if you have enabled the readline module (i.e. if Emacs-style +command line editing and bash-style history works for you), you can +add this by importing the undocumented standard library module +"rlcompleter". When completing a simple identifier, it +completes keywords, built-ins and globals in __main__; when completing +NAME.NAME..., it evaluates (!) the expression up to the last dot and +completes its attributes. +

+This way, you can do "import string", type "string.", hit the +completion key twice, and see the list of names defined by the +string module. +

+Tip: to use the tab key as the completion key, call +

+

+    readline.parse_and_bind("tab: complete")
+
+You can put this in a ~/.pythonrc file, and set the PYTHONSTARTUP +environment variable to ~/.pythonrc. This will cause the completion to be enabled +whenever you run Python interactively. +

+Notes (see the docstring for rlcompleter.py for more information): +

+* The evaluation of the NAME.NAME... form may cause arbitrary +application defined code to be executed if an object with a +__getattr__ hook is found. Since it is the responsibility of the +application (or the user) to enable this feature, I consider this an +acceptable risk. More complicated expressions (e.g. function calls or +indexing operations) are not evaluated. +

+* GNU readline is also used by the built-in functions input() and +raw_input(), and thus these also benefit/suffer from the complete +features. Clearly an interactive application can benefit by +specifying its own completer function and using raw_input() for all +its input. +

+* When stdin is not a tty device, GNU readline is never +used, and this module (and the readline module) are silently inactive. +

+ +Edit this entry / +Log info + +/ Last changed on Fri Jun 12 09:55:24 1998 by +A.M. Kuchling +

+ +


+

3.30. Why is the Python interpreter not built as a shared library?

+(This is a Unix question; on Mac and Windows, it is a shared +library.) +

+It's just a nightmare to get this to work on all different platforms. +Shared library portability is a pain. And yes, I know about GNU libtool +-- but it requires me to use its conventions for filenames etc, and it +would require a complete and utter rewrite of all the makefile and +config tools I'm currently using. +

+In practice, few applications embed Python -- it's much more common to +have Python extensions, which already are shared libraries. Also, +serious embedders often want total control over which Python version +and configuration they use so they wouldn't want to use a standard +shared library anyway. So while the motivation of saving space +when lots of apps embed Python is nice in theory, I +doubt that it will save much in practice. (Hence the low priority I +give to making a shared library.) +

+For Linux systems, the simplest method of producing libpython1.5.so seems to +be (originally from the Minotaur project web page, +http://www.equi4.com/minotaur/minotaur.html): +

+

+  make distclean 
+  ./configure 
+  make OPT="-fpic -O2" 
+  mkdir .extract 
+  (cd .extract; ar xv ../libpython1.5.a) 
+  gcc -shared -o libpython1.5.so .extract/*.o 
+  rm -rf .extract
+
+In Python 2.3 this will be supported by the standard build routine +(at least on Linux) with --enable-shared. Note however that there +is little advantage, and it slows down Python because of the need +for PIC code and the extra cost at startup time to find the library. +

+ +Edit this entry / +Log info + +/ Last changed on Thu May 30 13:36:55 2002 by +GvR +

+ +


+

3.31. Build with GCC on Solaris 2.6 (SunOS 5.6) fails

+If you have upgraded Solaris 2.5 or 2.5.1 to Solaris 2.6, +but you have not upgraded +your GCC installation, the compile may fail, e.g. like this: +

+

+ In file included from /usr/include/sys/stream.h:26,
+                  from /usr/include/netinet/in.h:38,
+                  from /usr/include/netdb.h:96,
+                  from ./socketmodule.c:121:
+ /usr/include/sys/model.h:32: #error "No DATAMODEL_NATIVE specified"
+
+Solution: rebuild GCC for Solaris 2.6. +You might be able to simply re-run fixincludes, but +people have had mixed success with doing that. +

+ +Edit this entry / +Log info + +/ Last changed on Wed Oct 21 11:18:46 1998 by +GvR +

+ +


+

3.32. Running "make clean" seems to leave problematic files that cause subsequent builds to fail.

+Use "make clobber" instead. +

+Use "make clean" to reduce the size of the source/build directory +after you're happy with your build and installation. +If you have already tried to build python and you'd like to start +over, you should use "make clobber". It does a "make clean" and also +removes files such as the partially built Python library from a previous build. +

+ +Edit this entry / +Log info + +/ Last changed on Thu Jun 24 20:39:26 1999 by +TAB +

+ +


+

3.33. Submitting bug reports and patches

+To report a bug or submit a patch, please use the relevant service +from the Python project at SourceForge. +

+Bugs: http://sourceforge.net/tracker/?group_id=5470&atid=105470 +

+Patches: http://sourceforge.net/tracker/?group_id=5470&atid=305470 +

+If you have a SourceForge account, please log in before submitting your bug report; this will make it easier for us to contact you regarding your report in the event we have follow-up questions. It will also enable SourceForge to send you update information as we act on your bug. If you do not have a SourceForge account, please consider leaving your name and email address as part of the report. +

+ +Edit this entry / +Log info + +/ Last changed on Fri Apr 27 10:58:26 2001 by +Fred Drake +

+ +


+

3.34. I can't load shared libraries under Python 1.5.2, Solaris 7, and gcc 2.95.2

+When trying to load shared libraries, you may see errors like: +ImportError: ld.so.1: python: fatal: relocation error: file /usr/local/lib/python1.5/site-packages/Perp/util/du_SweepUtilc.so: +
+ symbol PyExc_RuntimeError: referenced symbol not found
+
+

+There is a problem with the configure script for Python 1.5.2 +under Solaris 7 with gcc 2.95 . configure should set the make variable +LINKFORSHARED=-Xlinker -export-dynamic +

+

+in Modules/Makefile, +

+Manually add this line to the Modules/Makefile. +This builds a Python executable that can load shared library extensions (xxx.so) . +

+ +Edit this entry / +Log info + +/ Last changed on Mon Feb 19 10:37:05 2001 by +GvR +

+ +


+

3.35. In the regression test, test___all__ fails for the profile module. What's wrong?

+If you have been using the profile module, and have properly calibrated a copy of the module as described in the documentation for the profiler: +

+http://www.python.org/doc/current/lib/profile-calibration.html +

+then it is possible that the regression test "test___all__" will fail if you run the regression test manually rather than using "make test" in the Python source directory. This will happen if you have set your PYTHONPATH environment variable to include the directory containing your calibrated profile module. You have probably calibrated the profiler using an older version of the profile module which does not define the __all__ value, added to the module as of Python 2.1. +

+The problem can be fixed by removing the old calibrated version of the profile module and using the latest version to do a fresh calibration. In general, you will need to re-calibrate for each version of Python anyway, since the performance characteristics can change in subtle ways that impact profiling. +

+ +Edit this entry / +Log info + +/ Last changed on Fri Apr 27 10:44:10 2001 by +Fred Drake +

+ +


+

3.36. relocations remain against allocatable but non-writable sections

+This linker error occurs on Solaris if you attempt to build an extension module which incorporates position-dependent (non-PIC) code. A common source of problems is that a static library (.a file), such as libreadline.a or libcrypto.a is linked with the extension module. The error specifically occurs when using gcc as the compiler, but /usr/ccs/bin/ld as the linker. +

+The following solutions and work-arounds are known: +

+1. Rebuild the libraries (libreadline, libcrypto) with -fPIC (-KPIC if using the system compiler). This is recommended; all object files in a shared library should be position-independent. +

+2. Statically link the extension module and its libraries into the Python interpreter, by editing Modules/Setup. +

+3. Use GNU ld instead of /usr/ccs/bin/ld; GNU ld will accept non-PIC code in shared libraries (and mark the section writable) +

+4. Pass -mimpure-text to GCC when linking the module. This will force gcc to not pass -z text to ld; in turn, ld will make all text sections writable. +

+Options 3 and 4 are not recommended, since the ability to share code across processes is lost. +

+ +Edit this entry / +Log info + +/ Last changed on Tue Jan 29 12:05:11 2002 by +Martin v. Löwis +

+ +


+

4. Programming in Python

+ +
+

4.1. Is there a source code level debugger with breakpoints, step, etc.?

+Yes. +

+Module pdb is a rudimentary but adequate console-mode debugger for Python. It is part of the standard Python library, and is documented in the Library Reference Manual. (You can also write your own debugger by using the code for pdb as an example.) +

+The IDLE interactive development environment, which is part of the standard Python distribution (normally available in Tools/idle), includes a graphical debugger. There is documentation for the IDLE debugger at http://www.python.org/idle/doc/idle2.html#Debugger +

+Pythonwin is a Python IDE that includes a GUI debugger based on bdb. The Pythonwin debugger colors breakpoints and has quite a few cool features (including debugging non-Pythonwin programs). A reference can be found at http://www.python.org/ftp/python/pythonwin/pwindex.html +More recent versions of PythonWin are available as a part of the ActivePython distribution (see http://www.activestate.com/Products/ActivePython/index.html). +

+Pydb is a version of the standard Python debugger pdb, modified for use with DDD (Data Display Debugger), a popular graphical debugger front end. Pydb can be found at http://packages.debian.org/unstable/devel/pydb.html +and DDD can be found at http://www.gnu.org/software/ddd/ +

+There are a number of commmercial Python IDEs that include graphical debuggers. They include: +

+

+ * Wing IDE (http://wingide.com/) 
+ * Komodo IDE (http://www.activestate.com/Products/Komodo/)
+
+

+ +Edit this entry / +Log info + +/ Last changed on Tue Jan 28 01:43:41 2003 by +Stephen Ferg +

+ +


+

4.2. Can I create an object class with some methods implemented in C and others in Python (e.g. through inheritance)? (Also phrased as: Can I use a built-in type as base class?)

+In Python 2.2, you can inherit from builtin classes such as int, list, dict, etc. +

+In previous versions of Python, you can easily create a Python class which serves as a wrapper around a built-in object, e.g. (for dictionaries): +

+

+        # A user-defined class behaving almost identical
+        # to a built-in dictionary.
+        class UserDict:
+                def __init__(self): self.data = {}
+                def __repr__(self): return repr(self.data)
+                def __cmp__(self, dict):
+                        if type(dict) == type(self.data):
+                                return cmp(self.data, dict)
+                        else:
+                                return cmp(self.data, dict.data)
+                def __len__(self): return len(self.data)
+                def __getitem__(self, key): return self.data[key]
+                def __setitem__(self, key, item): self.data[key] = item
+                def __delitem__(self, key): del self.data[key]
+                def keys(self): return self.data.keys()
+                def items(self): return self.data.items()
+                def values(self): return self.data.values()
+                def has_key(self, key): return self.data.has_key(key)
+
+A2. See Jim Fulton's ExtensionClass for an example of a mechanism +which allows you to have superclasses which you can inherit from in +Python -- that way you can have some methods from a C superclass (call +it a mixin) and some methods from either a Python superclass or your +subclass. ExtensionClass is distributed as a part of Zope (see +http://www.zope.org), but will be phased out with Zope 3, since +Zope 3 uses Python 2.2 or later which supports direct inheritance +from built-in types. Here's a link to the original paper about +ExtensionClass: +http://debian.acm.ndsu.nodak.edu/doc/python-extclass/ExtensionClass.html +

+A3. The Boost Python Library (BPL, http://www.boost.org/libs/python/doc/index.html) +provides a way of doing this from C++ (i.e. you can inherit from an +extension class written in C++ using the BPL). +

+ +Edit this entry / +Log info + +/ Last changed on Tue May 28 21:09:52 2002 by +GvR +

+ +


+

4.3. Is there a curses/termcap package for Python?

+The standard Python source distribution comes with a curses module in +the Modules/ subdirectory, though it's not compiled by default (note +that this is not available in the Windows distribution -- there is +no curses module for Windows). +

+In Python versions before 2.0 the module only supported plain curses; +you couldn't use ncurses features like colors with it (though it would +link with ncurses). +

+In Python 2.0, the curses module has been greatly extended, starting +from Oliver Andrich's enhanced version, to provide many additional +functions from ncurses and SYSV curses, such as colour, alternative +character set support, pads, and mouse support. This means the +module is no longer compatible with operating systems that only +have BSD curses, but there don't seem to be any currently +maintained OSes that fall into this category. +

+ +Edit this entry / +Log info + +/ Last changed on Sun Jun 23 20:24:06 2002 by +Tim Peters +

+ +


+

4.4. Is there an equivalent to C's onexit() in Python?

+For Python 2.0: The new atexit module provides a register function that +is similar to C's onexit. See the Library Reference for details. For +2.0 you should not assign to sys.exitfunc! +

+For Python 1.5.2: You need to import sys and assign a function to +sys.exitfunc, it will be called when your program exits, is +killed by an unhandled exception, or (on UNIX) receives a +SIGHUP or SIGTERM signal. +

+ +Edit this entry / +Log info + +/ Last changed on Thu Dec 28 12:14:55 2000 by +Bjorn Pettersen +

+ +


+

4.5. [deleted]

+[python used to lack nested scopes, it was explained here] +

+ +Edit this entry / +Log info + +/ Last changed on Thu Mar 21 05:18:22 2002 by +Erno Kuusela +

+ +


+

4.6. How do I iterate over a sequence in reverse order?

+If it is a list, the fastest solution is +

+

+        list.reverse()
+        try:
+                for x in list:
+                        "do something with x"
+        finally:
+                list.reverse()
+
+This has the disadvantage that while you are in the loop, the list +is temporarily reversed. If you don't like this, you can make a copy. +This appears expensive but is actually faster than other solutions: +

+

+        rev = list[:]
+        rev.reverse()
+        for x in rev:
+                <do something with x>
+
+If it's not a list, a more general but slower solution is: +

+

+        for i in range(len(sequence)-1, -1, -1):
+                x = sequence[i]
+                <do something with x>
+
+A more elegant solution, is to define a class which acts as a sequence +and yields the elements in reverse order (solution due to Steve +Majewski): +

+

+        class Rev:
+                def __init__(self, seq):
+                        self.forw = seq
+                def __len__(self):
+                        return len(self.forw)
+                def __getitem__(self, i):
+                        return self.forw[-(i + 1)]
+
+You can now simply write: +

+

+        for x in Rev(list):
+                <do something with x>
+
+Unfortunately, this solution is slowest of all, due to the method +call overhead... +

+ +Edit this entry / +Log info + +/ Last changed on Sun May 25 21:10:50 1997 by +GvR +

+ +


+

4.7. My program is too slow. How do I speed it up?

+That's a tough one, in general. There are many tricks to speed up +Python code; I would consider rewriting parts in C only as a last +resort. One thing to notice is that function and (especially) method +calls are rather expensive; if you have designed a purely OO interface +with lots of tiny functions that don't do much more than get or set an +instance variable or call another method, you may consider using a +more direct way, e.g. directly accessing instance variables. Also see +the standard module "profile" (described in the Library Reference +manual) which makes it possible to find out where +your program is spending most of its time (if you have some patience +-- the profiling itself can slow your program down by an order of +magnitude). +

+Remember that many standard optimization heuristics you +may know from other programming experience may well apply +to Python. For example it may be faster to send output to output +devices using larger writes rather than smaller ones in order to +avoid the overhead of kernel system calls. Thus CGI scripts +that write all output in "one shot" may be notably faster than +those that write lots of small pieces of output. +

+Also, be sure to use "aggregate" operations where appropriate. +For example the "slicing" feature allows programs to chop up +lists and other sequence objects in a single tick of the interpreter +mainloop using highly optimized C implementations. Thus to +get the same effect as +

+

+  L2 = []
+  for i in range[3]:
+       L2.append(L1[i])
+
+it is much shorter and far faster to use +

+

+  L2 = list(L1[:3]) # "list" is redundant if L1 is a list.
+
+Note that the map() function, particularly used with +builtin methods or builtin functions can be a convenient +accelerator. For example to pair the elements of two +lists together: +

+

+  >>> map(None, [1,2,3], [4,5,6])
+  [(1, 4), (2, 5), (3, 6)]
+
+or to compute a number of sines: +

+

+  >>> map( math.sin, (1,2,3,4))
+  [0.841470984808, 0.909297426826, 0.14112000806,   -0.756802495308]
+
+The map operation completes very quickly in such cases. +

+Other examples of aggregate operations include the join and split +methods of string objects. For example if s1..s7 are large (10K+) strings then +"".join([s1,s2,s3,s4,s5,s6,s7]) may be far faster than +the more obvious s1+s2+s3+s4+s5+s6+s7, since the "summation" +will compute many subexpressions, whereas join does all +copying in one pass. For manipulating strings also consider the +regular expression libraries and the "substitution" operations +String % tuple and String % dictionary. Also be sure to use +the list.sort builtin method to do sorting, and see FAQ's 4.51 +and 4.59 for examples of moderately advanced usage -- list.sort beats +other techniques for sorting in all but the most extreme +circumstances. +

+There are many other aggregate operations +available in the standard libraries and in contributed libraries +and extensions. +

+Another common trick is to "push loops into functions or methods." +For example suppose you have a program that runs slowly and you +use the profiler (profile.run) to determine that a Python function ff +is being called lots of times. If you notice that ff +

+

+   def ff(x):
+       ...do something with x computing result...
+       return result
+
+tends to be called in loops like (A) +

+

+   list = map(ff, oldlist)
+
+or (B) +

+

+   for x in sequence:
+       value = ff(x)
+       ...do something with value...
+
+then you can often eliminate function call overhead by rewriting +ff to +

+

+   def ffseq(seq):
+       resultseq = []
+       for x in seq:
+           ...do something with x computing result...
+           resultseq.append(result)
+       return resultseq
+
+and rewrite (A) to +

+

+    list = ffseq(oldlist)
+
+and (B) to +

+

+    for value in ffseq(sequence):
+        ...do something with value...
+
+Other single calls ff(x) translate to ffseq([x])[0] with little +penalty. Of course this technique is not always appropriate +and there are other variants, which you can figure out. +

+You can gain some performance by explicitly storing the results of +a function or method lookup into a local variable. A loop like +

+

+    for key in token:
+        dict[key] = dict.get(key, 0) + 1
+
+resolves dict.get every iteration. If the method isn't going to +change, a faster implementation is +

+

+    dict_get = dict.get  # look up the method once
+    for key in token:
+        dict[key] = dict_get(key, 0) + 1
+
+Default arguments can be used to determine values once, at +compile time instead of at run time. This can only be done for +functions or objects which will not be changed during program +execution, such as replacing +

+

+    def degree_sin(deg):
+        return math.sin(deg * math.pi / 180.0)
+
+with +

+

+    def degree_sin(deg, factor = math.pi/180.0, sin = math.sin):
+        return sin(deg * factor)
+
+Because this trick uses default arguments for terms which should +not be changed, it should only be used when you are not concerned +with presenting a possibly confusing API to your users. +

+

+For an anecdote related to optimization, see +

+

+	http://www.python.org/doc/essays/list2str.html
+
+

+ +Edit this entry / +Log info + +/ Last changed on Mon Jun 3 01:03:54 2002 by +Neal Norwitz +

+ +


+

4.8. When I have imported a module, then edit it, and import it again (into the same Python process), the changes don't seem to take place. What is going on?

+For reasons of efficiency as well as consistency, Python only reads +the module file on the first time a module is imported. (Otherwise a +program consisting of many modules, each of which imports the same +basic module, would read the basic module over and over again.) To +force rereading of a changed module, do this: +

+

+        import modname
+        reload(modname)
+
+Warning: this technique is not 100% fool-proof. In particular, +modules containing statements like +

+

+        from modname import some_objects
+
+will continue to work with the old version of the imported objects. +

+ +Edit this entry / +Log info +

+ +


+

4.9. How do I find the current module name?

+A module can find out its own module name by looking at the +(predefined) global variable __name__. If this has the value +'__main__' you are running as a script. +

+ +Edit this entry / +Log info +

+ +


+

4.10. I have a module in which I want to execute some extra code when it is run as a script. How do I find out whether I am running as a script?

+See the previous question. E.g. if you put the following on the +last line of your module, main() is called only when your module is +running as a script: +

+

+        if __name__ == '__main__': main()
+
+

+ +Edit this entry / +Log info +

+ +


+

4.11. I try to run a program from the Demo directory but it fails with ImportError: No module named ...; what gives?

+This is probably an optional module (written in C!) which hasn't +been configured on your system. This especially happens with modules +like "Tkinter", "stdwin", "gl", "Xt" or "Xm". For Tkinter, STDWIN and +many other modules, see Modules/Setup.in for info on how to add these +modules to your Python, if it is possible at all. Sometimes you will +have to ftp and build another package first (e.g. Tcl and Tk for Tkinter). +Sometimes the module only works on specific platforms (e.g. gl only works +on SGI machines). +

+NOTE: if the complaint is about "Tkinter" (upper case T) and you have +already configured module "tkinter" (lower case t), the solution is +not to rename tkinter to Tkinter or vice versa. There is probably +something wrong with your module search path. Check out the value of +sys.path. +

+For X-related modules (Xt and Xm) you will have to do more work: they +are currently not part of the standard Python distribution. You will +have to ftp the Extensions tar file, i.e. +ftp://ftp.python.org/pub/python/src/X-extension.tar.gz and follow +the instructions there. +

+ +Edit this entry / +Log info + +/ Last changed on Wed Feb 12 21:31:08 2003 by +Jens Kubieziel +

+ +


+

4.12. [deleted]

+[stdwin (long dead windowing library) entry deleted] +

+ +Edit this entry / +Log info + +/ Last changed on Thu Mar 21 08:30:13 2002 by +Erno Kuusela +

+ +


+

4.13. What GUI toolkits exist for Python?

+Depending on what platform(s) you are aiming at, there are several. +

+Currently supported solutions: +

+Cross-platform: +

+Tk: +

+There's a neat object-oriented interface to the Tcl/Tk widget set, +called Tkinter. It is part of the standard Python distribution and +well-supported -- all you need to do is build and install Tcl/Tk and +enable the _tkinter module and the TKPATH definition in Modules/Setup +when building Python. This is probably the easiest to install and +use, and the most complete widget set. It is also very likely that in +the future the standard Python GUI API will be based on or at least +look very much like the Tkinter interface. For more info about Tk, +including pointers to the source, see the Tcl/Tk home page at +http://www.scriptics.com. Tcl/Tk is now fully +portable to the Mac and Windows platforms (NT and 95 only); you need +Python 1.4beta3 or later and Tk 4.1patch1 or later. +

+wxWindows: +

+There's an interface to wxWindows called wxPython. wxWindows is a +portable GUI class library written in C++. It supports GTK, Motif, +MS-Windows and Mac as targets. Ports to other platforms are being +contemplated or have already had some work done on them. wxWindows +preserves the look and feel of the underlying graphics toolkit, and +there is quite a rich widget set and collection of GDI classes. +See the wxWindows page at http://www.wxwindows.org/ for more details. +wxPython is a python extension module that wraps many of the wxWindows +C++ classes, and is quickly gaining popularity amongst Python +developers. You can get wxPython as part of the source or CVS +distribution of wxWindows, or directly from its home page at +http://alldunn.com/wxPython/. +

+Gtk+: +

+PyGtk bindings for the Gtk+ Toolkit by James Henstridge exist; see ftp://ftp.daa.com.au/pub/james/python/. Note that there are two incompatible bindings. If you are using Gtk+ 1.2.x you should get the 0.6.x PyGtk bindings from +

+

+    ftp://ftp.gtk.org/pub/python/v1.2
+
+If you plan to use Gtk+ 2.0 with Python (highly recommended if you are just starting with Gtk), get the most recent distribution from +

+

+    ftp://ftp.gtk.org/pub/python/v2.0
+
+If you are adventurous, you can also check out the source from the Gnome CVS repository. Set your CVS directory to :pserver:anonymous@anoncvs.gnome.org:/cvs/gnome and check the gnome-python module out from the repository. +

+Other: +

+There are also bindings available for the Qt toolkit (PyQt), and for KDE (PyKDE); see http://www.thekompany.com/projects/pykde/. +

+For OpenGL bindings, see http://starship.python.net/~da/PyOpenGL. +

+Platform specific: +

+The Mac port has a rich and ever-growing set of modules that support +the native Mac toolbox calls. See the documentation that comes with +the Mac port. See ftp://ftp.python.org/pub/python/mac. Support +by Jack Jansen jack@cwi.nl. +

+Pythonwin by Mark Hammond (MHammond@skippinet.com.au) +includes an interface to the Microsoft Foundation +Classes and a Python programming environment using it that's written +mostly in Python. See http://www.python.org/windows/. +

+There's an object-oriented GUI based on the Microsoft Foundation +Classes model called WPY, supported by Jim Ahlstrom jim@interet.com. +Programs written in WPY run unchanged and with native look and feel on +Windows NT/95, Windows 3.1 (using win32s), and on Unix (using Tk). +Source and binaries for Windows and Linux are available in +ftp://ftp.python.org/pub/python/wpy/. +

+Obsolete or minority solutions: +

+There's an interface to X11, including the Athena and Motif widget +sets (and a few individual widgets, like Mosaic's HTML widget and +SGI's GL widget) available from +ftp://ftp.python.org/pub/python/src/X-extension.tar.gz. +Support by Sjoerd Mullender sjoerd@cwi.nl. +

+On top of the X11 interface there's the vpApp +toolkit by Per Spilling, now also maintained by Sjoerd Mullender +sjoerd@cwi.nl. See ftp://ftp.cwi.nl/pub/sjoerd/vpApp.tar.gz. +

+For SGI IRIX only, there are unsupported interfaces to the complete +GL (Graphics Library -- low level but very good 3D capabilities) as +well as to FORMS (a buttons-and-sliders-etc package built on top of GL +by Mark Overmars -- ftp'able from +ftp://ftp.cs.ruu.nl/pub/SGI/FORMS/). This is probably also +becoming obsolete, as OpenGL takes over (see above). +

+There's an interface to STDWIN, a platform-independent low-level +windowing interface for Mac and X11. This is totally unsupported and +rapidly becoming obsolete. The STDWIN sources are at +ftp://ftp.cwi.nl/pub/stdwin/. +

+There is an interface to WAFE, a Tcl interface to the X11 +Motif and Athena widget sets. WAFE is at +http://www.wu-wien.ac.at/wafe/wafe.html. +

+ +Edit this entry / +Log info + +/ Last changed on Mon May 13 21:40:39 2002 by +Skip Montanaro +

+ +


+

4.14. Are there any interfaces to database packages in Python?

+Yes! See the Database Topic Guide at +http://www.python.org/topics/database/ for details. +

+ +Edit this entry / +Log info + +/ Last changed on Tue Jan 4 20:12:19 2000 by +Barney Warplug +

+ +


+

4.15. Is it possible to write obfuscated one-liners in Python?

+Yes. See the following three examples, due to Ulf Bartelt: +

+

+        # Primes < 1000
+        print filter(None,map(lambda y:y*reduce(lambda x,y:x*y!=0,
+        map(lambda x,y=y:y%x,range(2,int(pow(y,0.5)+1))),1),range(2,1000)))
+
+
+        # First 10 Fibonacci numbers
+        print map(lambda x,f=lambda x,f:(x<=1) or (f(x-1,f)+f(x-2,f)): f(x,f),
+        range(10))
+
+
+        # Mandelbrot set
+        print (lambda Ru,Ro,Iu,Io,IM,Sx,Sy:reduce(lambda x,y:x+y,map(lambda y,
+        Iu=Iu,Io=Io,Ru=Ru,Ro=Ro,Sy=Sy,L=lambda yc,Iu=Iu,Io=Io,Ru=Ru,Ro=Ro,i=IM,
+        Sx=Sx,Sy=Sy:reduce(lambda x,y:x+y,map(lambda x,xc=Ru,yc=yc,Ru=Ru,Ro=Ro,
+        i=i,Sx=Sx,F=lambda xc,yc,x,y,k,f=lambda xc,yc,x,y,k,f:(k<=0)or (x*x+y*y
+        >=4.0) or 1+f(xc,yc,x*x-y*y+xc,2.0*x*y+yc,k-1,f):f(xc,yc,x,y,k,f):chr(
+        64+F(Ru+x*(Ro-Ru)/Sx,yc,0,0,i)),range(Sx))):L(Iu+y*(Io-Iu)/Sy),range(Sy
+        ))))(-2.1, 0.7, -1.2, 1.2, 30, 80, 24)
+        #    \___ ___/  \___ ___/  |   |   |__ lines on screen
+        #        V          V      |   |______ columns on screen
+        #        |          |      |__________ maximum of "iterations"
+        #        |          |_________________ range on y axis
+        #        |____________________________ range on x axis
+
+Don't try this at home, kids! +

+ +Edit this entry / +Log info + +/ Last changed on Wed May 21 15:48:33 1997 by +GvR +

+ +


+

4.16. Is there an equivalent of C's "?:" ternary operator?

+Not directly. In many cases you can mimic a?b:c with "a and b or +c", but there's a flaw: if b is zero (or empty, or None -- anything +that tests false) then c will be selected instead. In many cases you +can prove by looking at the code that this can't happen (e.g. because +b is a constant or has a type that can never be false), but in general +this can be a problem. +

+Tim Peters (who wishes it was Steve Majewski) suggested the following +solution: (a and [b] or [c])[0]. Because [b] is a singleton list it +is never false, so the wrong path is never taken; then applying [0] to +the whole thing gets the b or c that you really wanted. Ugly, but it +gets you there in the rare cases where it is really inconvenient to +rewrite your code using 'if'. +

+As a last resort it is possible to implement the "?:" operator as a function: +

+

+    def q(cond,on_true,on_false):
+        from inspect import isfunction
+
+
+        if cond:
+            if not isfunction(on_true): return on_true
+            else: return apply(on_true)
+        else:
+            if not isfunction(on_false): return on_false 
+            else: return apply(on_false)
+
+In most cases you'll pass b and c directly: q(a,b,c). To avoid evaluating b +or c when they shouldn't be, encapsulate them +within a lambda function, e.g.: q(a,lambda: b, lambda: c). +

+

+

+It has been asked why Python has no if-then-else expression, +since most language have one; it is a frequently requested feature. +

+There are several possible answers: just as many languages do +just fine without one; it can easily lead to less readable code; +no sufficiently "Pythonic" syntax has been discovered; a search +of the standard library found remarkably few places where using an +if-then-else expression would make the code more understandable. +

+Nevertheless, in an effort to decide once and for all whether +an if-then-else expression should be added to the language, +PEP 308 (http://www.python.org/peps/pep-0308.html) has been +put forward, proposing a specific syntax. The community can +now vote on this issue. +

+ +Edit this entry / +Log info + +/ Last changed on Fri Feb 7 19:41:13 2003 by +David Goodger +

+ +


+

4.17. My class defines __del__ but it is not called when I delete the object.

+There are several possible reasons for this. +

+The del statement does not necessarily call __del__ -- it simply +decrements the object's reference count, and if this reaches zero +__del__ is called. +

+If your data structures contain circular links (e.g. a tree where +each child has a parent pointer and each parent has a list of +children) the reference counts will never go back to zero. You'll +have to define an explicit close() method which removes those +pointers. Please don't ever call __del__ directly -- __del__ should +call close() and close() should make sure that it can be called more +than once for the same object. +

+If the object has ever been a local variable (or argument, which is +really the same thing) to a function that caught an expression in an +except clause, chances are that a reference to the object still exists +in that function's stack frame as contained in the stack trace. +Normally, deleting (better: assigning None to) sys.exc_traceback will +take care of this. If a stack was printed for an unhandled +exception in an interactive interpreter, delete sys.last_traceback +instead. +

+There is code that deletes all objects when the interpreter exits, +but it is not called if your Python has been configured to support +threads (because other threads may still be active). You can define +your own cleanup function using sys.exitfunc (see question 4.4). +

+Finally, if your __del__ method raises an exception, a warning message is printed to sys.stderr. +

+

+Starting with Python 2.0, a garbage collector periodically reclaims the space used by most cycles with no external references. (See the "gc" module documentation for details.) There are, however, pathological cases where it can be expected to fail. Moreover, the garbage collector runs some time after the last reference to your data structure vanishes, so your __del__ method may be called at an inconvenient and random time. This is inconvenient if you're trying to reproduce a problem. Worse, the order in which object's __del__ methods are executed is arbitrary. +

+Another way to avoid cyclical references is to use the "weakref" module, which allows you to point to objects without incrementing their reference count. Tree data structures, for instance, should use weak references for their parent and sibling pointers (if they need them!). +

+Question 6.14 is intended to explain the new garbage collection algorithm. +

+ +Edit this entry / +Log info + +/ Last changed on Mon Jun 10 15:27:28 2002 by +Matthias Urlichs +

+ +


+

4.18. How do I change the shell environment for programs called using os.popen() or os.system()? Changing os.environ doesn't work.

+You must be using either a version of python before 1.4, or on a +(rare) system that doesn't have the putenv() library function. +

+Before Python 1.4, modifying the environment passed to subshells was +left out of the interpreter because there seemed to be no +well-established portable way to do it (in particular, some systems, +have putenv(), others have setenv(), and some have none at all). As +of Python 1.4, almost all Unix systems do have putenv(), and so does +the Win32 API, and thus the os module was modified so that changes to +os.environ are trapped and the corresponding putenv() call is made. +

+ +Edit this entry / +Log info +

+ +


+

4.19. What is a class?

+A class is the particular object type created by executing +a class statement. Class objects are used as templates, to create +instance objects, which embody both the data structure +(attributes) and program routines (methods) specific to a datatype. +

+A class can be based on one or more other classes, called its base +class(es). It then inherits the attributes and methods of its base classes. This allows an object model to be successively refined +by inheritance. +

+The term "classic class" is used to refer to the original +class implementation in Python. One problem with classic +classes is their inability to use the built-in data types +(such as list and dictionary) as base classes. Starting +with Python 2.2 an attempt is in progress to unify user-defined +classes and built-in types. It is now possible to declare classes +that inherit from built-in types. +

+ +Edit this entry / +Log info + +/ Last changed on Mon May 27 01:31:21 2002 by +Steve Holden +

+ +


+

4.20. What is a method?

+A method is a function that you normally call as +x.name(arguments...) for some object x. The term is used for methods +of classes and class instances as well as for methods of built-in +objects. (The latter have a completely different implementation and +only share the way their calls look in Python code.) Methods of +classes (and class instances) are defined as functions inside the +class definition. +

+ +Edit this entry / +Log info +

+ +


+

4.21. What is self?

+Self is merely a conventional name for the first argument of a +method -- i.e. a function defined inside a class definition. A method +defined as meth(self, a, b, c) should be called as x.meth(a, b, c) for +some instance x of the class in which the definition occurs; +the called method will think it is called as meth(x, a, b, c). +

+ +Edit this entry / +Log info +

+ +


+

4.22. What is an unbound method?

+An unbound method is a method defined in a class that is not yet +bound to an instance. You get an unbound method if you ask for a +class attribute that happens to be a function. You get a bound method +if you ask for an instance attribute. A bound method knows which +instance it belongs to and calling it supplies the instance automatically; +an unbound method only knows which class it wants for its first +argument (a derived class is also OK). Calling an unbound method +doesn't "magically" derive the first argument from the context -- you +have to provide it explicitly. +

+Trivia note regarding bound methods: each reference to a bound +method of a particular object creates a bound method object. If you +have two such references (a = inst.meth; b = inst.meth), they will +compare equal (a == b) but are not the same (a is not b). +

+ +Edit this entry / +Log info + +/ Last changed on Wed May 6 18:07:25 1998 by +Clarence Gardner +

+ +


+

4.23. How do I call a method defined in a base class from a derived class that overrides it?

+If your class definition starts with "class Derived(Base): ..." +then you can call method meth defined in Base (or one of Base's base +classes) as Base.meth(self, arguments...). Here, Base.meth is an +unbound method (see previous question). +

+ +Edit this entry / +Log info +

+ +


+

4.24. How do I call a method from a base class without using the name of the base class?

+DON'T DO THIS. REALLY. I MEAN IT. It appears that you could call +self.__class__.__bases__[0].meth(self, arguments...) but this fails when +a doubly-derived method is derived from your class: for its instances, +self.__class__.__bases__[0] is your class, not its base class -- so +(assuming you are doing this from within Derived.meth) you would start +a recursive call. +

+Often when you want to do this you are forgetting that classes +are first class in Python. You can "point to" the class you want +to delegate an operation to either at the instance or at the +subclass level. For example if you want to use a "glorp" +operation of a superclass you can point to the right superclass +to use. +

+

+  class subclass(superclass1, superclass2, superclass3):
+      delegate_glorp = superclass2
+      ...
+      def glorp(self, arg1, arg2):
+            ... subclass specific stuff ...
+            self.delegate_glorp.glorp(self, arg1, arg2)
+       ...
+
+
+  class subsubclass(subclass):
+       delegate_glorp = superclass3
+       ...
+
+Note, however that setting delegate_glorp to subclass in +subsubclass would cause an infinite recursion on subclass.delegate_glorp. Careful! Maybe you are getting too fancy for your own good. Consider simplifying the design (?). +

+ +Edit this entry / +Log info + +/ Last changed on Mon Jul 28 13:58:22 1997 by +aaron watters +

+ +


+

4.25. How can I organize my code to make it easier to change the base class?

+You could define an alias for the base class, assign the real base +class to it before your class definition, and use the alias throughout +your class. Then all you have to change is the value assigned to the +alias. Incidentally, this trick is also handy if you want to decide +dynamically (e.g. depending on availability of resources) which base +class to use. Example: +

+

+        BaseAlias = <real base class>
+        class Derived(BaseAlias):
+                def meth(self):
+                        BaseAlias.meth(self)
+                        ...
+
+

+ +Edit this entry / +Log info + +/ Last changed on Wed May 21 15:49:57 1997 by +GvR +

+ +


+

4.26. How can I find the methods or attributes of an object?

+This depends on the object type. +

+For an instance x of a user-defined class, instance attributes are +found in the dictionary x.__dict__, and methods and attributes defined +by its class are found in x.__class__.__bases__[i].__dict__ (for i in +range(len(x.__class__.__bases__))). You'll have to walk the tree of +base classes to find all class methods and attributes. +

+Many, but not all built-in types define a list of their method names +in x.__methods__, and if they have data attributes, their names may be +found in x.__members__. However this is only a convention. +

+For more information, read the source of the standard (but +undocumented) module newdir. +

+ +Edit this entry / +Log info +

+ +


+

4.27. I can't seem to use os.read() on a pipe created with os.popen().

+os.read() is a low-level function which takes a file descriptor (a +small integer). os.popen() creates a high-level file object -- the +same type used for sys.std{in,out,err} and returned by the builtin +open() function. Thus, to read n bytes from a pipe p created with +os.popen(), you need to use p.read(n). +

+ +Edit this entry / +Log info +

+ +


+

4.28. How can I create a stand-alone binary from a Python script?

+Even though there are Python compilers being developed, +you probably don't need a real compiler, if all you want +is a stand-alone program. There are three solutions to that. +

+One is to use the freeze tool, which is included in the Python +source tree as Tools/freeze. It converts Python byte +code to C arrays. Using a C compiler, you can embed all +your modules into a new program, which is then linked +with the standard Python modules. +

+It works by scanning your source recursively for import statements +(in both forms) and looking for the modules in the standard Python path +as well as in the source directory (for built-in modules). It then +1 the modules written in Python to C code (array initializers +that can be turned into code objects using the marshal module) and +creates a custom-made config file that only contains those built-in +modules which are actually used in the program. It then compiles the +generated C code and links it with the rest of the Python interpreter +to form a self-contained binary which acts exactly like your script. +

+(Hint: the freeze program only works if your script's filename ends in +".py".) +

+There are several utilities which may be helpful. The first is Gordon McMillan's installer at +

+

+    http://www.mcmillan-inc.com/install1.html
+
+which works on Windows, Linux and at least some forms of Unix. +

+Another is Thomas Heller's py2exe (Windows only) at +

+

+    http://starship.python.net/crew/theller/py2exe/
+
+A third is Christian Tismer's SQFREEZE +(http://starship.python.net/crew/pirx/) which appends the byte code +to a specially-prepared Python interpreter, which +will find the byte code in executable. +

+A fourth is Fredrik Lundh's Squeeze +(http://www.pythonware.com/products/python/squeeze/). +

+ +Edit this entry / +Log info + +/ Last changed on Wed Jun 19 14:01:30 2002 by +Gordon McMillan +

+ +


+

4.29. What WWW tools are there for Python?

+See the chapters titled "Internet Protocols and Support" and +"Internet Data Handling" in the Library Reference +Manual. Python is full of good things which will help you build server-side and client-side web systems. +

+A summary of available frameworks is maintained by Paul Boddie at +

+

+    http://thor.prohosting.com/~pboddie/Python/web_modules.html
+
+Cameron Laird maintains a useful set of pages about Python web technologies at +

+

+   http://starbase.neosoft.com/~claird/comp.lang.python/web_python.html/
+
+There was a web browser written in Python, called Grail -- +see http://sourceforge.net/project/grail/. This project has been terminated; http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/grail/grail/README gives more details. +

+ +Edit this entry / +Log info + +/ Last changed on Mon Nov 11 22:48:25 2002 by +GvR +

+ +


+

4.30. How do I run a subprocess with pipes connected to both input and output?

+Use the standard popen2 module. For example: +

+

+	import popen2
+	fromchild, tochild = popen2.popen2("command")
+	tochild.write("input\n")
+	tochild.flush()
+	output = fromchild.readline()
+
+Warning: in general, it is unwise to +do this, because you can easily cause a deadlock where your +process is blocked waiting for output from the child, while the child +is blocked waiting for input from you. This can be caused +because the parent expects the child to output more text than it does, +or it can be caused by data being stuck in stdio buffers due to lack +of flushing. The Python parent can of course explicitly flush the data +it sends to the child before it reads any output, but if the child is +a naive C program it can easily have been written to never explicitly +flush its output, even if it is interactive, since flushing is +normally automatic. +

+Note that a deadlock is also possible if you use popen3 to read +stdout and stderr. If one of the two is too large for the internal +buffer (increasing the buffersize does not help) and you read() +the other one first, there is a deadlock, too. +

+Note on a bug in popen2: unless your program calls wait() +or waitpid(), finished child processes are never removed, +and eventually calls to popen2 will fail because of a limit on +the number of child processes. Calling os.waitpid with the +os.WNOHANG option can prevent this; a good place to insert such +a call would be before calling popen2 again. +

+Another way to produce a deadlock: Call a wait() and there is +still more output from the program than what fits into the +internal buffers. +

+In many cases, all you really need is to run some data through a +command and get the result back. Unless the data is infinite in size, +the easiest (and often the most efficient!) way to do this is to write +it to a temporary file and run the command with that temporary file as +input. The standard module tempfile exports a function mktemp() which +generates unique temporary file names. +

+

+ import tempfile
+ import os
+ class Popen3:
+    """
+    This is a deadlock-save version of popen, that returns
+    an object with errorlevel, out (a string) and err (a string).
+    (capturestderr may not work under windows.)
+    Example: print Popen3('grep spam','\n\nhere spam\n\n').out
+    """
+    def __init__(self,command,input=None,capturestderr=None):
+        outfile=tempfile.mktemp()
+        command="( %s ) > %s" % (command,outfile)
+        if input:
+            infile=tempfile.mktemp()
+            open(infile,"w").write(input)
+            command=command+" <"+infile
+        if capturestderr:
+            errfile=tempfile.mktemp()
+            command=command+" 2>"+errfile
+        self.errorlevel=os.system(command) >> 8
+        self.out=open(outfile,"r").read()
+        os.remove(outfile)
+        if input:
+            os.remove(infile)
+        if capturestderr:
+            self.err=open(errfile,"r").read()
+            os.remove(errfile)
+
+Note that many interactive programs (e.g. vi) don't work well with +pipes substituted for standard input and output. You will have to use +pseudo ttys ("ptys") instead of pipes. There is some undocumented +code to use these in the library module pty.py -- I'm afraid you're on +your own here. +

+A different answer is a Python interface to Don Libes' "expect" +library. A Python extension that interfaces to expect is called "expy" +and available from +http://expectpy.sourceforge.net/. +

+A pure Python solution that works like expect is pexpect of Noah Spurrier. +A beta version is available from +http://pexpect.sourceforge.net/ +

+ +Edit this entry / +Log info + +/ Last changed on Tue Sep 3 16:31:31 2002 by +Tobias Polzin +

+ +


+

4.31. How do I call a function if I have the arguments in a tuple?

+Use the built-in function apply(). For instance, +

+

+    func(1, 2, 3)
+
+is equivalent to +

+

+    args = (1, 2, 3)
+    apply(func, args)
+
+Note that func(args) is not the same -- it calls func() with exactly +one argument, the tuple args, instead of three arguments, the integers +1, 2 and 3. +

+In Python 2.0, you can also use extended call syntax: +

+f(*args) is equivalent to apply(f, args) +

+ +Edit this entry / +Log info + +/ Last changed on Tue Jan 2 03:42:50 2001 by +Moshe Zadka +

+ +


+

4.32. How do I enable font-lock-mode for Python in Emacs?

+If you are using XEmacs 19.14 or later, any XEmacs 20, FSF Emacs 19.34 +or any Emacs 20, font-lock should work automatically for you if you +are using the latest python-mode.el. +

+If you are using an older version of XEmacs or Emacs you will need +to put this in your .emacs file: +

+

+        (defun my-python-mode-hook ()
+          (setq font-lock-keywords python-font-lock-keywords)
+          (font-lock-mode 1))
+        (add-hook 'python-mode-hook 'my-python-mode-hook)
+
+

+ +Edit this entry / +Log info + +/ Last changed on Mon Apr 6 16:18:46 1998 by +Barry Warsaw +

+ +


+

4.33. Is there a scanf() or sscanf() equivalent?

+Not as such. +

+For simple input parsing, the easiest approach is usually to split +the line into whitespace-delimited words using string.split(), and to +convert decimal strings to numeric values using int(), +long() or float(). (Python's int() is 32-bit and its +long() is arbitrary precision.) string.split supports an optional +"sep" parameter which is useful if the line uses something other +than whitespace as a delimiter. +

+For more complicated input parsing, regular expressions (see module re) +are better suited and more powerful than C's sscanf(). +

+There's a contributed module that emulates sscanf(), by Steve Clift; +see contrib/Misc/sscanfmodule.c of the ftp site: +

+

+    http://www.python.org/ftp/python/contrib-09-Dec-1999/Misc/
+
+

+ +Edit this entry / +Log info + +/ Last changed on Mon Jun 3 01:07:51 2002 by +Neal Norwitz +

+ +


+

4.34. Can I have Tk events handled while waiting for I/O?

+Yes, and you don't even need threads! But you'll have to +restructure your I/O code a bit. Tk has the equivalent of Xt's +XtAddInput() call, which allows you to register a callback function +which will be called from the Tk mainloop when I/O is possible on a +file descriptor. Here's what you need: +

+

+        from Tkinter import tkinter
+        tkinter.createfilehandler(file, mask, callback)
+
+The file may be a Python file or socket object (actually, anything +with a fileno() method), or an integer file descriptor. The mask is +one of the constants tkinter.READABLE or tkinter.WRITABLE. The +callback is called as follows: +

+

+        callback(file, mask)
+
+You must unregister the callback when you're done, using +

+

+        tkinter.deletefilehandler(file)
+
+Note: since you don't know *how many bytes* are available for reading, +you can't use the Python file object's read or readline methods, since +these will insist on reading a predefined number of bytes. For +sockets, the recv() or recvfrom() methods will work fine; for other +files, use os.read(file.fileno(), maxbytecount). +

+ +Edit this entry / +Log info +

+ +


+

4.35. How do I write a function with output parameters (call by reference)?

+[Mark Lutz] The thing to remember is that arguments are passed by +assignment in Python. Since assignment just creates references to +objects, there's no alias between an argument name in the caller and +callee, and so no call-by-reference per se. But you can simulate it +in a number of ways: +

+1) By using global variables; but you probably shouldn't :-) +

+2) By passing a mutable (changeable in-place) object: +

+

+      def func1(a):
+          a[0] = 'new-value'     # 'a' references a mutable list
+          a[1] = a[1] + 1        # changes a shared object
+
+
+      args = ['old-value', 99]
+      func1(args)
+      print args[0], args[1]     # output: new-value 100
+
+3) By returning a tuple, holding the final values of arguments: +

+

+      def func2(a, b):
+          a = 'new-value'        # a and b are local names
+          b = b + 1              # assigned to new objects
+          return a, b            # return new values
+
+
+      x, y = 'old-value', 99
+      x, y = func2(x, y)
+      print x, y                 # output: new-value 100
+
+4) And other ideas that fall-out from Python's object model. For instance, it might be clearer to pass in a mutable dictionary: +

+

+      def func3(args):
+          args['a'] = 'new-value'     # args is a mutable dictionary
+          args['b'] = args['b'] + 1   # change it in-place
+
+
+      args = {'a':' old-value', 'b': 99}
+      func3(args)
+      print args['a'], args['b']
+
+5) Or bundle-up values in a class instance: +

+

+      class callByRef:
+          def __init__(self, **args):
+              for (key, value) in args.items():
+                  setattr(self, key, value)
+
+
+      def func4(args):
+          args.a = 'new-value'        # args is a mutable callByRef
+          args.b = args.b + 1         # change object in-place
+
+
+      args = callByRef(a='old-value', b=99)
+      func4(args)
+      print args.a, args.b
+
+
+   But there's probably no good reason to get this complicated :-).
+
+[Python's author favors solution 3 in most cases.] +

+ +Edit this entry / +Log info + +/ Last changed on Sun Jun 8 23:49:46 1997 by +David Ascher +

+ +


+

4.36. Please explain the rules for local and global variables in Python.

+[Ken Manheimer] In Python, procedure variables are implicitly +global, unless they are assigned anywhere within the block. +In that case +they are implicitly local, and you need to explicitly declare them as +'global'. +

+Though a bit surprising at first, a moment's consideration explains +this. On one hand, requirement of 'global' for assigned vars provides +a bar against unintended side-effects. On the other hand, if global +were required for all global references, you'd be using global all the +time. Eg, you'd have to declare as global every reference to a +builtin function, or to a component of an imported module. This +clutter would defeat the usefulness of the 'global' declaration for +identifying side-effects. +

+ +Edit this entry / +Log info + +/ Last changed on Fri Aug 28 09:53:27 1998 by +GvR +

+ +


+

4.37. How can I have modules that mutually import each other?

+Suppose you have the following modules: +

+foo.py: +

+

+	from bar import bar_var
+	foo_var=1
+
+bar.py: +

+

+	from foo import foo_var
+	bar_var=2
+
+The problem is that the above is processed by the interpreter thus: +

+

+	main imports foo
+	Empty globals for foo are created
+	foo is compiled and starts executing
+	foo imports bar
+	Empty globals for bar are created
+	bar is compiled and starts executing
+	bar imports foo (which is a no-op since there already is a module named foo)
+	bar.foo_var = foo.foo_var
+	...
+
+The last step fails, because Python isn't done with interpreting foo yet and the global symbol dict for foo is still empty. +

+The same thing happens when you use "import foo", and then try to access "foo.one" in global code. +

+

+There are (at least) three possible workarounds for this problem. +

+Guido van Rossum recommends to avoid all uses of "from <module> import ..." (so everything from an imported module is referenced as <module>.<name>) and to place all code inside functions. Initializations of global variables and class variables should use constants or built-in functions only. +

+

+Jim Roskind suggests the following order in each module: +

+

+ exports (globals, functions, and classes that don't need imported base classes)
+ import statements
+ active code (including globals that are initialized from imported values).
+
+Python's author doesn't like this approach much because the imports +appear in a strange place, but has to admit that it works. +

+

+

+Matthias Urlichs recommends to restructure your code so that the recursive import is not necessary in the first place. +

+

+These solutions are not mutually exclusive. +

+ +Edit this entry / +Log info + +/ Last changed on Mon Jun 3 06:52:51 2002 by +Matthias Urlichs +

+ +


+

4.38. How do I copy an object in Python?

+Try copy.copy() or copy.deepcopy() for the general case. Not all objects can be copied, but most can. +

+Dictionaries have a copy method. Sequences can be copied by slicing: +

+ new_l = l[:]
+
+

+ +Edit this entry / +Log info + +/ Last changed on Thu Mar 21 05:40:26 2002 by +Erno Kuusela +

+ +


+

4.39. How to implement persistent objects in Python? (Persistent == automatically saved to and restored from disk.)

+The library module "pickle" now solves this in a very general way +(though you still can't store things like open files, sockets or +windows), and the library module "shelve" uses pickle and (g)dbm to +create persistent mappings containing arbitrary Python objects. +For possibly better performance also look for the latest version +of the relatively recent cPickle module. +

+A more awkward way of doing things is to use pickle's little sister, +marshal. The marshal module provides very fast ways to store +noncircular basic Python types to files and strings, and back again. +Although marshal does not do fancy things like store instances or +handle shared references properly, it does run extremely fast. For +example loading a half megabyte of data may take less than a +third of a second (on some machines). This often beats doing +something more complex and general such as using gdbm with +pickle/shelve. +

+ +Edit this entry / +Log info + +/ Last changed on Sun Jun 8 22:59:00 1997 by +David Ascher +

+ +


+

4.40. I try to use __spam and I get an error about _SomeClassName__spam.

+Variables with double leading underscore are "mangled" to provide a +simple but effective way to define class private variables. See the +chapter "New in Release 1.4" in the Python Tutorial. +

+ +Edit this entry / +Log info +

+ +


+

4.41. How do I delete a file? And other file questions.

+Use os.remove(filename) or os.unlink(filename); for documentation, +see the posix section of the library manual. They are the same, +unlink() is simply the Unix name for this function. In earlier +versions of Python, only os.unlink() was available. +

+To remove a directory, use os.rmdir(); use os.mkdir() to create one. +

+To rename a file, use os.rename(). +

+To truncate a file, open it using f = open(filename, "r+"), and use +f.truncate(offset); offset defaults to the current seek position. +(The "r+" mode opens the file for reading and writing.) +There's also os.ftruncate(fd, offset) for files opened with os.open() +-- for advanced Unix hacks only. +

+The shutil module also contains a number of functions to work on files +including copyfile, copytree, and rmtree amongst others. +

+ +Edit this entry / +Log info + +/ Last changed on Thu Dec 28 12:30:01 2000 by +Bjorn Pettersen +

+ +


+

4.42. How to modify urllib or httplib to support HTTP/1.1?

+Recent versions of Python (2.0 and onwards) support HTTP/1.1 natively. +

+ +Edit this entry / +Log info + +/ Last changed on Tue Jan 2 02:56:56 2001 by +Moshe Zadka +

+ +


+

4.43. Unexplicable syntax errors in compile() or exec.

+When a statement suite (as opposed to an expression) is compiled by +compile(), exec or execfile(), it must end in a newline. In some +cases, when the source ends in an indented block it appears that at +least two newlines are required. +

+ +Edit this entry / +Log info +

+ +


+

4.44. How do I convert a string to a number?

+For integers, use the built-in int() function, e.g. int('144') == 144. Similarly, long() converts from string to long integer, e.g. long('144') == 144L; and float() to floating-point, e.g. float('144') == 144.0. +

+Note that these are restricted to decimal interpretation, so +that int('0144') == 144 and int('0x144') raises ValueError. For Python +2.0 int takes the base to convert from as a second optional argument, so +int('0x144', 16) == 324. +

+For greater flexibility, or before Python 1.5, import the module +string and use the string.atoi() function for integers, +string.atol() for long integers, or string.atof() for +floating-point. E.g., +string.atoi('100', 16) == string.atoi('0x100', 0) == 256. +See the library reference manual section for the string module for +more details. +

+While you could use the built-in function eval() instead of +any of those, this is not recommended, because someone could pass you +a Python expression that might have unwanted side effects (like +reformatting your disk). It also has the effect of interpreting numbers +as Python expressions, so that e.g. eval('09') gives a syntax error +since Python regards numbers starting with '0' as octal (base 8). +

+ +Edit this entry / +Log info + +/ Last changed on Thu Dec 28 12:37:34 2000 by +Bjorn Pettersen +

+ +


+

4.45. How do I convert a number to a string?

+To convert, e.g., the number 144 to the string '144', use the +built-in function repr() or the backquote notation (these are +equivalent). If you want a hexadecimal or octal representation, use +the built-in functions hex() or oct(), respectively. For fancy +formatting, use the % operator on strings, just like C printf formats, +e.g. "%04d" % 144 yields '0144' and "%.3f" % (1/3.0) yields '0.333'. +See the library reference manual for details. +

+ +Edit this entry / +Log info +

+ +


+

4.46. How do I copy a file?

+There's the shutil module which contains a copyfile() +function that implements a copy loop; +it isn't good enough for the Macintosh, though: +it doesn't copy the resource fork and Finder info. +

+ +Edit this entry / +Log info + +/ Last changed on Tue Jan 2 02:59:40 2001 by +Moshe Zadka +

+ +


+

4.47. How do I check if an object is an instance of a given class or of a subclass of it?

+If you are developing the classes from scratch it might be better to +program in a more proper object-oriented style -- instead of doing a different +thing based on class membership, why not use a method and define the +method differently in different classes? +

+However, there are some legitimate situations +where you need to test for class membership. +

+In Python 1.5, you can use the built-in function isinstance(obj, cls). +

+The following approaches can be used with earlier Python versions: +

+An unobvious method is to raise the object +as an exception and to try to catch the exception with the class you're +testing for: +

+

+	def is_instance_of(the_instance, the_class):
+	    try:
+		raise the_instance
+	    except the_class:
+		return 1
+	    except:
+		return 0
+
+This technique can be used to distinguish "subclassness" +from a collection of classes as well +

+

+                try:
+                              raise the_instance
+                except Audible:
+                              the_instance.play(largo)
+                except Visual:
+                              the_instance.display(gaudy)
+                except Olfactory:
+                              sniff(the_instance)
+                except:
+                              raise ValueError, "dunno what to do with this!"
+
+This uses the fact that exception catching tests for class or subclass +membership. +

+A different approach is to test for the presence of a class attribute that +is presumably unique for the given class. For instance: +

+

+	class MyClass:
+	    ThisIsMyClass = 1
+	    ...
+
+
+	def is_a_MyClass(the_instance):
+	    return hasattr(the_instance, 'ThisIsMyClass')
+
+This version is easier to inline, and probably faster (inlined it +is definitely faster). The disadvantage is that someone else could cheat: +

+

+	class IntruderClass:
+	    ThisIsMyClass = 1    # Masquerade as MyClass
+	    ...
+
+but this may be seen as a feature (anyway, there are plenty of other ways +to cheat in Python). Another disadvantage is that the class must be +prepared for the membership test. If you do not "control the +source code" for the class it may not be advisable to modify the +class to support testability. +

+ +Edit this entry / +Log info + +/ Last changed on Fri Jan 2 15:16:04 1998 by +GvR +

+ +


+

4.48. What is delegation?

+Delegation refers to an object oriented technique Python programmers +may implement with particular ease. Consider the following: +

+

+  from string import upper
+
+
+  class UpperOut:
+        def __init__(self, outfile):
+              self.__outfile = outfile
+        def write(self, str):
+              self.__outfile.write( upper(str) )
+        def __getattr__(self, name):
+              return getattr(self.__outfile, name)
+
+Here the UpperOut class redefines the write method +to convert the argument string to upper case before +calling the underlying self.__outfile.write method, but +all other methods are delegated to the underlying +self.__outfile object. The delegation is accomplished +via the "magic" __getattr__ method. Please see the +language reference for more information on the use +of this method. +

+Note that for more general cases delegation can +get trickier. Particularly when attributes must be set +as well as gotten the class must define a __settattr__ +method too, and it must do so carefully. +

+The basic implementation of __setattr__ is roughly +equivalent to the following: +

+

+   class X:
+        ...
+        def __setattr__(self, name, value):
+             self.__dict__[name] = value
+        ...
+
+Most __setattr__ implementations must modify +self.__dict__ to store local state for self without +causing an infinite recursion. +

+ +Edit this entry / +Log info + +/ Last changed on Wed Aug 13 07:11:24 1997 by +aaron watters +

+ +


+

4.49. How do I test a Python program or component.

+We presume for the purposes of this question you are interested +in standalone testing, rather than testing your components inside +a testing framework. The best-known testing framework for Python +is the PyUnit module, maintained at +

+

+    http://pyunit.sourceforge.net/
+
+For standalone testing, it helps to write the program so that +it may be easily tested by using good modular design. +In particular your program +should have almost all functionality encapsulated in either functions +or class methods -- and this sometimes has the surprising and +delightful effect of making the program run faster (because +local variable accesses are faster than global accesses). +Furthermore the program should avoid depending on mutating +global variables, since this makes testing much more difficult to do. +

+The "global main logic" of your program may be as simple +as +

+

+  if __name__=="__main__":
+       main_logic()
+
+at the bottom of the main module of your program. +

+Once your program is organized as a tractable collection +of functions and class behaviours you should write test +functions that exercise the behaviours. A test suite +can be associated with each module which automates +a sequence of tests. This sounds like a lot of work, but +since Python is so terse and flexible it's surprisingly easy. +You can make coding much more pleasant and fun by +writing your test functions in parallel with the "production +code", since this makes it easy to find bugs and even +design flaws earlier. +

+"Support modules" that are not intended to be the main +module of a program may include a "test script interpretation" +which invokes a self test of the module. +

+

+   if __name__ == "__main__":
+      self_test()
+
+Even programs that interact with complex external +interfaces may be tested when the external interfaces are +unavailable by using "fake" interfaces implemented in +Python. For an example of a "fake" interface, the following +class defines (part of) a "fake" file interface: +

+

+ import string
+ testdata = "just a random sequence of characters"
+
+
+ class FakeInputFile:
+   data = testdata
+   position = 0
+   closed = 0
+
+
+   def read(self, n=None):
+       self.testclosed()
+       p = self.position
+       if n is None:
+          result= self.data[p:]
+       else:
+          result= self.data[p: p+n]
+       self.position = p + len(result)
+       return result
+
+
+   def seek(self, n, m=0):
+       self.testclosed()
+       last = len(self.data)
+       p = self.position
+       if m==0: 
+          final=n
+       elif m==1:
+          final=n+p
+       elif m==2:
+          final=len(self.data)+n
+       else:
+          raise ValueError, "bad m"
+       if final<0:
+          raise IOError, "negative seek"
+       self.position = final
+
+
+   def isatty(self):
+       return 0
+
+
+   def tell(self):
+       return self.position
+
+
+   def close(self):
+       self.closed = 1
+
+
+   def testclosed(self):
+       if self.closed:
+          raise IOError, "file closed"
+
+Try f=FakeInputFile() and test out its operations. +

+ +Edit this entry / +Log info + +/ Last changed on Mon Jun 3 01:12:10 2002 by +Neal Norwitz +

+ +


+

4.50. My multidimensional list (array) is broken! What gives?

+You probably tried to make a multidimensional array like this. +

+

+   A = [[None] * 2] * 3
+
+This makes a list containing 3 references to the same list of length +two. Changes to one row will show in all rows, which is probably not +what you want. The following works much better: +

+

+   A = [None]*3
+   for i in range(3):
+        A[i] = [None] * 2
+
+This generates a list containing 3 different lists of length two. +

+If you feel weird, you can also do it in the following way: +

+

+   w, h = 2, 3
+   A = map(lambda i,w=w: [None] * w, range(h))
+
+For Python 2.0 the above can be spelled using a list comprehension: +

+

+   w,h = 2,3
+   A = [ [None]*w for i in range(h) ]
+
+

+ +Edit this entry / +Log info + +/ Last changed on Thu Dec 28 12:18:35 2000 by +Bjorn Pettersen +

+ +


+

4.51. I want to do a complicated sort: can you do a Schwartzian Transform in Python?

+Yes, and in Python you only have to write it once: +

+

+ def st(List, Metric):
+     def pairing(element, M = Metric):
+           return (M(element), element)
+     paired = map(pairing, List)
+     paired.sort()
+     return map(stripit, paired)
+
+
+ def stripit(pair):
+     return pair[1]
+
+This technique, attributed to Randal Schwartz, sorts the elements +of a list by a metric which maps each element to its "sort value". +For example, if L is a list of string then +

+

+   import string
+   Usorted = st(L, string.upper)
+
+
+   def intfield(s):
+         return string.atoi( string.strip(s[10:15] ) )
+
+
+   Isorted = st(L, intfield)
+
+Usorted gives the elements of L sorted as if they were upper +case, and Isorted gives the elements of L sorted by the integer +values that appear in the string slices starting at position 10 +and ending at position 15. In Python 2.0 this can be done more +naturally with list comprehensions: +

+

+  tmp1 = [ (x.upper(), x) for x in L ] # Schwartzian transform
+  tmp1.sort()
+  Usorted = [ x[1] for x in tmp1 ]
+
+
+  tmp2 = [ (int(s[10:15]), s) for s in L ] # Schwartzian transform
+  tmp2.sort()
+  Isorted = [ x[1] for x in tmp2 ]
+
+

+Note that Isorted may also be computed by +

+

+   def Icmp(s1, s2):
+         return cmp( intfield(s1), intfield(s2) )
+
+
+   Isorted = L[:]
+   Isorted.sort(Icmp)
+
+but since this method computes intfield many times for each +element of L, it is slower than the Schwartzian Transform. +

+ +Edit this entry / +Log info + +/ Last changed on Sat Jun 1 19:18:46 2002 by +Neal Norwitz +

+ +


+

4.52. How to convert between tuples and lists?

+The function tuple(seq) converts any sequence into a tuple with +the same items in the same order. +For example, tuple([1, 2, 3]) yields (1, 2, 3) and tuple('abc') +yields ('a', 'b', 'c'). If the argument is +a tuple, it does not make a copy but returns the same object, so +it is cheap to call tuple() when you aren't sure that an object +is already a tuple. +

+The function list(seq) converts any sequence into a list with +the same items in the same order. +For example, list((1, 2, 3)) yields [1, 2, 3] and list('abc') +yields ['a', 'b', 'c']. If the argument is a list, +it makes a copy just like seq[:] would. +

+ +Edit this entry / +Log info + +/ Last changed on Sun Jun 14 14:18:53 1998 by +Tim Peters +

+ +


+

4.53. Files retrieved with urllib contain leading garbage that looks like email headers.

+Extremely old versions of Python supplied libraries which +did not support HTTP/1.1; the vanilla httplib in Python 1.4 +only recognized HTTP/1.0. In Python 2.0 full HTTP/1.1 support is included. +

+ +Edit this entry / +Log info + +/ Last changed on Mon Jan 8 17:26:18 2001 by +Steve Holden +

+ +


+

4.54. How do I get a list of all instances of a given class?

+Python does not keep track of all instances of a class (or of a +built-in type). +

+You can program the class's constructor to keep track of all +instances, but unless you're very clever, this has the disadvantage +that the instances never get deleted,because your list of all +instances keeps a reference to them. +

+(The trick is to regularly inspect the reference counts of the +instances you've retained, and if the reference count is below a +certain level, remove it from the list. Determining that level is +tricky -- it's definitely larger than 1.) +

+ +Edit this entry / +Log info + +/ Last changed on Tue May 27 23:52:16 1997 by +GvR +

+ +


+

4.55. A regular expression fails with regex.error: match failure.

+This is usually caused by too much backtracking; the regular +expression engine has a fixed size stack which holds at most 4000 +backtrack points. Every character matched by e.g. ".*" accounts for a +backtrack point, so even a simple search like +

+

+  regex.match('.*x',"x"*5000)
+
+will fail. +

+This is fixed in the re module introduced with +Python 1.5; consult the Library Reference section on re for more information. +

+ +Edit this entry / +Log info + +/ Last changed on Thu Jul 30 12:35:49 1998 by +A.M. Kuchling +

+ +


+

4.56. I can't get signal handlers to work.

+The most common problem is that the signal handler is declared +with the wrong argument list. It is called as +

+

+	handler(signum, frame)
+
+so it should be declared with two arguments: +

+

+	def handler(signum, frame):
+		...
+
+

+ +Edit this entry / +Log info + +/ Last changed on Wed May 28 09:29:08 1997 by +GvR +

+ +


+

4.57. I can't use a global variable in a function? Help!

+Did you do something like this? +

+

+   x = 1 # make a global
+
+
+   def f():
+         print x # try to print the global
+         ...
+         for j in range(100):
+              if q>3:
+                 x=4
+
+Any variable assigned in a function is local to that function. +unless it is specifically declared global. Since a value is bound +to x as the last statement of the function body, the compiler +assumes that x is local. Consequently the "print x" +attempts to print an uninitialized local variable and will +trigger a NameError. +

+In such cases the solution is to insert an explicit global +declaration at the start of the function, making it +

+

+

+   def f():
+         global x
+         print x # try to print the global
+         ...
+         for j in range(100):
+              if q>3:
+                 x=4
+
+

+In this case, all references to x are interpreted as references +to the x from the module namespace. +

+ +Edit this entry / +Log info + +/ Last changed on Mon Feb 12 15:52:12 2001 by +Steve Holden +

+ +


+

4.58. What's a negative index? Why doesn't list.insert() use them?

+Python sequences are indexed with positive numbers and +negative numbers. For positive numbers 0 is the first index +1 is the second index and so forth. For negative indices -1 +is the last index and -2 is the pentultimate (next to last) index +and so forth. Think of seq[-n] as the same as seq[len(seq)-n]. +

+Using negative indices can be very convenient. For example +if the string Line ends in a newline then Line[:-1] is all of Line except +the newline. +

+Sadly the list builtin method L.insert does not observe negative +indices. This feature could be considered a mistake but since +existing programs depend on this feature it may stay around +forever. L.insert for negative indices inserts at the start of the +list. To get "proper" negative index behaviour use L[n:n] = [x] +in place of the insert method. +

+ +Edit this entry / +Log info + +/ Last changed on Wed Aug 13 07:03:18 1997 by +aaron watters +

+ +


+

4.59. How can I sort one list by values from another list?

+You can sort lists of tuples. +

+

+  >>> list1 = ["what", "I'm", "sorting", "by"]
+  >>> list2 = ["something", "else", "to", "sort"]
+  >>> pairs = map(None, list1, list2)
+  >>> pairs
+  [('what', 'something'), ("I'm", 'else'), ('sorting', 'to'), ('by', 'sort')]
+  >>> pairs.sort()
+  >>> pairs
+  [("I'm", 'else'), ('by', 'sort'), ('sorting', 'to'), ('what', 'something')]
+  >>> result = pairs[:]
+  >>> for i in xrange(len(result)): result[i] = result[i][1]
+  ...
+  >>> result
+  ['else', 'sort', 'to', 'something']
+
+And if you didn't understand the question, please see the +example above ;c). Note that "I'm" sorts before "by" because +uppercase "I" comes before lowercase "b" in the ascii order. +Also see 4.51. +

+In Python 2.0 this can be done like: +

+

+ >>> list1 = ["what", "I'm", "sorting", "by"]
+ >>> list2 = ["something", "else", "to", "sort"]
+ >>> pairs = zip(list1, list2)
+ >>> pairs
+ [('what', 'something'), ("I'm", 'else'), ('sorting', 'to'), ('by', 'sort')]
+ >>> pairs.sort()
+ >>> result = [ x[1] for x in pairs ]
+ >>> result
+ ['else', 'sort', 'to', 'something']
+
+[Followup] +

+Someone asked, why not this for the last steps: +

+

+  result = []
+  for p in pairs: result.append(p[1])
+
+This is much more legible. However, a quick test shows that +it is almost twice as slow for long lists. Why? First of all, +the append() operation has to reallocate memory, and while it +uses some tricks to avoid doing that each time, it still has +to do it occasionally, and apparently that costs quite a bit. +Second, the expression "result.append" requires an extra +attribute lookup. The attribute lookup could be done away +with by rewriting as follows: +

+

+  result = []
+  append = result.append
+  for p in pairs: append(p[1])
+
+which gains back some speed, but is still considerably slower +than the original solution, and hardly less convoluted. +

+ +Edit this entry / +Log info + +/ Last changed on Thu Dec 28 12:56:35 2000 by +Bjorn Pettersen +

+ +


+

4.60. Why doesn't dir() work on builtin types like files and lists?

+It does starting with Python 1.5. +

+Using 1.4, you can find out which methods a given object supports +by looking at its __methods__ attribute: +

+

+    >>> List = []
+    >>> List.__methods__
+    ['append', 'count', 'index', 'insert', 'remove', 'reverse', 'sort']
+
+

+ +Edit this entry / +Log info + +/ Last changed on Thu Sep 16 14:56:42 1999 by +Skip Montanaro +

+ +


+

4.61. How can I mimic CGI form submission (METHOD=POST)?

+I would like to retrieve web pages that are the result of POSTing a +form. Is there existing code that would let me do this easily? +

+Yes. Here's a simple example that uses httplib. +

+

+    #!/usr/local/bin/python
+
+
+    import httplib, sys, time
+
+
+    ### build the query string
+    qs = "First=Josephine&MI=Q&Last=Public"
+
+
+    ### connect and send the server a path
+    httpobj = httplib.HTTP('www.some-server.out-there', 80)
+    httpobj.putrequest('POST', '/cgi-bin/some-cgi-script')
+    ### now generate the rest of the HTTP headers...
+    httpobj.putheader('Accept', '*/*')
+    httpobj.putheader('Connection', 'Keep-Alive')
+    httpobj.putheader('Content-type', 'application/x-www-form-urlencoded')
+    httpobj.putheader('Content-length', '%d' % len(qs))
+    httpobj.endheaders()
+    httpobj.send(qs)
+    ### find out what the server said in response...
+    reply, msg, hdrs = httpobj.getreply()
+    if reply != 200:
+	sys.stdout.write(httpobj.getfile().read())
+
+Note that in general for "url encoded posts" (the default) query strings must be "quoted" to, for example, change equals signs and spaces to an encoded form when they occur in name or value. Use urllib.quote to perform this quoting. For example to send name="Guy Steele, Jr.": +

+

+   >>> from urllib import quote
+   >>> x = quote("Guy Steele, Jr.")
+   >>> x
+   'Guy%20Steele,%20Jr.'
+   >>> query_string = "name="+x
+   >>> query_string
+   'name=Guy%20Steele,%20Jr.'
+
+

+ +Edit this entry / +Log info + +/ Last changed on Mon Jun 21 03:47:07 1999 by +TAB +

+ +


+

4.62. If my program crashes with a bsddb (or anydbm) database open, it gets corrupted. How come?

+Databases opened for write access with the bsddb module (and often by +the anydbm module, since it will preferentially use bsddb) must +explicitly be closed using the close method of the database. The +underlying libdb package caches database contents which need to be +converted to on-disk form and written, unlike regular open files which +already have the on-disk bits in the kernel's write buffer, where they +can just be dumped by the kernel with the program exits. +

+If you have initialized a new bsddb database but not written anything to +it before the program crashes, you will often wind up with a zero-length +file and encounter an exception the next time the file is opened. +

+ +Edit this entry / +Log info + +/ Last changed on Mon Jun 3 01:15:01 2002 by +Neal Norwitz +

+ +


+

4.63. How do I make a Python script executable on Unix?

+You need to do two things: the script file's mode must be executable +(include the 'x' bit), and the first line must begin with #! +followed by the pathname for the Python interpreter. +

+The first is done by executing 'chmod +x scriptfile' or perhaps +'chmod 755 scriptfile'. +

+The second can be done in a number of way. The most straightforward +way is to write +

+

+  #!/usr/local/bin/python
+
+as the very first line of your file - or whatever the pathname is +where the python interpreter is installed on your platform. +

+If you would like the script to be independent of where the python +interpreter lives, you can use the "env" program. On almost all +platforms, the following will work, assuming the python interpreter +is in a directory on the user's $PATH: +

+

+  #! /usr/bin/env python
+
+Note -- *don't* do this for CGI scripts. The $PATH variable for +CGI scripts is often very minimal, so you need to use the actual +absolute pathname of the interpreter. +

+Occasionally, a user's environment is so full that the /usr/bin/env +program fails; or there's no env program at all. +In that case, you can try the following hack (due to Alex Rezinsky): +

+

+  #! /bin/sh
+  """:"
+  exec python $0 ${1+"$@"}
+  """
+
+The disadvantage is that this defines the script's __doc__ string. +However, you can fix that by adding +

+

+  __doc__ = """...Whatever..."""
+
+

+ +Edit this entry / +Log info + +/ Last changed on Mon Jan 15 09:19:16 2001 by +Neal Norwitz +

+ +


+

4.64. How do you remove duplicates from a list?

+See the Python Cookbook for a long discussion of many cool ways: +

+

+    http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/52560
+
+Generally, if you don't mind reordering the List +

+

+   if List:
+      List.sort()
+      last = List[-1]
+      for i in range(len(List)-2, -1, -1):
+          if last==List[i]: del List[i]
+          else: last=List[i]
+
+If all elements of the list may be used as +dictionary keys (ie, they are all hashable) +this is often faster +

+

+   d = {}
+   for x in List: d[x]=x
+   List = d.values()
+
+Also, for extremely large lists you might +consider more optimal alternatives to the first one. +The second one is pretty good whenever it can +be used. +

+ +Edit this entry / +Log info + +/ Last changed on Fri May 24 21:56:33 2002 by +Tim Peters +

+ +


+

4.65. Are there any known year 2000 problems in Python?

+I am not aware of year 2000 deficiencies in Python 1.5. Python does +very few date calculations and for what it does, it relies on the C +library functions. Python generally represent times either as seconds +since 1970 or as a tuple (year, month, day, ...) where the year is +expressed with four digits, which makes Y2K bugs unlikely. So as long +as your C library is okay, Python should be okay. Of course, I cannot +vouch for your Python code! +

+Given the nature of freely available software, I have to add that this statement is not +legally binding. The Python copyright notice contains the following +disclaimer: +

+

+  STICHTING MATHEMATISCH CENTRUM AND CNRI DISCLAIM ALL WARRANTIES WITH
+  REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF
+  MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL STICHTING MATHEMATISCH
+  CENTRUM OR CNRI BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
+  DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
+  PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
+  TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+  PERFORMANCE OF THIS SOFTWARE.
+
+The good news is that if you encounter a problem, you have full +source available to track it down and fix it! +

+ +Edit this entry / +Log info + +/ Last changed on Fri Apr 10 14:59:31 1998 by +GvR +

+ +


+

4.66. I want a version of map that applies a method to a sequence of objects! Help!

+Get fancy! +

+

+  def method_map(objects, method, arguments):
+       """method_map([a,b], "flog", (1,2)) gives [a.flog(1,2), b.flog(1,2)]"""
+       nobjects = len(objects)
+       methods = map(getattr, objects, [method]*nobjects)
+       return map(apply, methods, [arguments]*nobjects)
+
+It's generally a good idea to get to know the mysteries of map and apply +and getattr and the other dynamic features of Python. +

+ +Edit this entry / +Log info + +/ Last changed on Mon Jan 5 14:21:14 1998 by +Aaron Watters +

+ +


+

4.67. How do I generate random numbers in Python?

+The standard library module "random" implements a random number +generator. Usage is simple: +

+

+    import random
+
+
+    random.random()
+
+This returns a random floating point number in the range [0, 1). +

+There are also many other specialized generators in this module, such +as +

+

+    randrange(a, b) chooses an integer in the range [a, b)
+    uniform(a, b) chooses a floating point number in the range [a, b)
+    normalvariate(mean, sdev) sample from normal (Gaussian) distribution
+
+Some higher-level functions operate on sequences directly, such as +

+

+    choice(S) chooses random element from a given sequence
+    shuffle(L) shuffles a list in-place, i.e. permutes it randomly
+
+There's also a class, Random, which you can instantiate +to create independent multiple random number generators. +

+All this is documented in the library reference manual. Note that +the module "whrandom" is obsolete. +

+ +Edit this entry / +Log info + +/ Last changed on Mon Jun 3 01:16:51 2002 by +Neal Norwitz +

+ +


+

4.68. How do I access the serial (RS232) port?

+There's a Windows serial communication module (for communication +over RS 232 serial ports) at +

+

+  ftp://ftp.python.org/pub/python/contrib/sio-151.zip
+  http://www.python.org/ftp/python/contrib/sio-151.zip
+
+For DOS, try Hans Nowak's Python-DX, which supports this, at: +

+

+  http://www.cuci.nl/~hnowak/
+
+For Unix, see a usenet post by Mitch Chapman: +

+

+  http://groups.google.com/groups?selm=34A04430.CF9@ohioee.com
+
+For Win32, POSIX(Linux, BSD, *), Jython, Chris': +

+

+  http://pyserial.sourceforge.net
+
+

+ +Edit this entry / +Log info + +/ Last changed on Tue Jul 2 21:11:07 2002 by +Chris Liechti +

+ +


+

4.69. Images on Tk-Buttons don't work in Py15?

+They do work, but you must keep your own reference to the image +object now. More verbosely, you must make sure that, say, a global +variable or a class attribute refers to the object. +

+Quoting Fredrik Lundh from the mailinglist: +

+

+  Well, the Tk button widget keeps a reference to the internal
+  photoimage object, but Tkinter does not.  So when the last
+  Python reference goes away, Tkinter tells Tk to release the
+  photoimage.  But since the image is in use by a widget, Tk
+  doesn't destroy it.  Not completely.  It just blanks the image,
+  making it completely transparent...
+
+
+  And yes, there was a bug in the keyword argument handling
+  in 1.4 that kept an extra reference around in some cases.  And
+  when Guido fixed that bug in 1.5, he broke quite a few Tkinter
+  programs...
+
+

+ +Edit this entry / +Log info + +/ Last changed on Tue Feb 3 11:31:03 1998 by +Case Roole +

+ +


+

4.70. Where is the math.py (socket.py, regex.py, etc.) source file?

+If you can't find a source file for a module it may be a builtin +or dynamically loaded module implemented in C, C++ or other +compiled language. In this case you may not have the source +file or it may be something like mathmodule.c, somewhere in +a C source directory (not on the Python Path). +

+Fredrik Lundh (fredrik@pythonware.com) explains (on the python-list): +

+There are (at least) three kinds of modules in Python: +1) modules written in Python (.py); +2) modules written in C and dynamically loaded (.dll, .pyd, .so, .sl, etc); +3) modules written in C and linked with the interpreter; to get a list +of these, type: +

+

+    import sys
+    print sys.builtin_module_names
+
+

+ +Edit this entry / +Log info + +/ Last changed on Tue Feb 3 13:55:33 1998 by +Aaron Watters +

+ +


+

4.71. How do I send mail from a Python script?

+The standard library module smtplib does this. +Here's a very simple interactive mail +sender that uses it. This method will work on any host that +supports an SMTP listener. +

+

+    import sys, smtplib
+
+
+    fromaddr = raw_input("From: ")
+    toaddrs  = raw_input("To: ").split(',')
+    print "Enter message, end with ^D:"
+    msg = ''
+    while 1:
+        line = sys.stdin.readline()
+        if not line:
+            break
+        msg = msg + line
+
+
+    # The actual mail send
+    server = smtplib.SMTP('localhost')
+    server.sendmail(fromaddr, toaddrs, msg)
+    server.quit()
+
+If the local host doesn't have an SMTP listener, you need to find one. The simple method is to ask the user. Alternately, you can use the DNS system to find the mail gateway(s) responsible for the source address. +

+A Unix-only alternative uses sendmail. The location of the +sendmail program varies between systems; sometimes it is +/usr/lib/sendmail, sometime /usr/sbin/sendmail. The sendmail manual +page will help you out. Here's some sample code: +

+

+  SENDMAIL = "/usr/sbin/sendmail" # sendmail location
+  import os
+  p = os.popen("%s -t -i" % SENDMAIL, "w")
+  p.write("To: cary@ratatosk.org\n")
+  p.write("Subject: test\n")
+  p.write("\n") # blank line separating headers from body
+  p.write("Some text\n")
+  p.write("some more text\n")
+  sts = p.close()
+  if sts != 0:
+      print "Sendmail exit status", sts
+
+

+ +Edit this entry / +Log info + +/ Last changed on Mon Jun 3 07:05:12 2002 by +Matthias Urlichs +

+ +


+

4.72. How do I avoid blocking in connect() of a socket?

+The select module is widely known to help with asynchronous +I/O on sockets once they are connected. However, it is less +than common knowledge how to avoid blocking on the initial +connect() call. Jeremy Hylton has the following advice (slightly +edited): +

+To prevent the TCP connect from blocking, you can set the socket to +non-blocking mode. Then when you do the connect(), you will either +connect immediately (unlikely) or get an exception that contains the +errno. errno.EINPROGRESS indicates that the connection is in +progress, but hasn't finished yet. Different OSes will return +different errnos, so you're going to have to check. I can tell you +that different versions of Solaris return different errno values. +

+In Python 1.5 and later, you can use connect_ex() to avoid +creating an exception. It will just return the errno value. +

+To poll, you can call connect_ex() again later -- 0 or errno.EISCONN +indicate that you're connected -- or you can pass this socket to +select (checking to see if it is writeable). +

+ +Edit this entry / +Log info + +/ Last changed on Tue Feb 24 21:30:45 1998 by +GvR +

+ +


+

4.73. How do I specify hexadecimal and octal integers?

+To specify an octal digit, precede the octal value with a zero. For example, +to set the variable "a" to the octal value "10" (8 in decimal), type: +

+

+    >>> a = 010
+
+To verify that this works, you can type "a" and hit enter while in the +interpreter, which will cause Python to spit out the current value of "a" +in decimal: +

+

+    >>> a
+    8
+
+Hexadecimal is just as easy. Simply precede the hexadecimal number with a +zero, and then a lower or uppercase "x". Hexadecimal digits can be specified +in lower or uppercase. For example, in the Python interpreter: +

+

+    >>> a = 0xa5
+    >>> a
+    165
+    >>> b = 0XB2
+    >>> b
+    178
+
+

+ +Edit this entry / +Log info + +/ Last changed on Tue Mar 3 12:53:16 1998 by +GvR +

+ +


+

4.74. How to get a single keypress at a time?

+For Windows, see question 8.2. Here is an answer for Unix (see also 4.94). +

+There are several solutions; some involve using curses, which is a +pretty big thing to learn. Here's a solution without curses, due +to Andrew Kuchling (adapted from code to do a PGP-style +randomness pool): +

+

+        import termios, sys, os
+        fd = sys.stdin.fileno()
+        old = termios.tcgetattr(fd)
+        new = termios.tcgetattr(fd)
+        new[3] = new[3] & ~termios.ICANON & ~termios.ECHO
+        new[6][termios.VMIN] = 1
+        new[6][termios.VTIME] = 0
+        termios.tcsetattr(fd, termios.TCSANOW, new)
+        s = ''    # We'll save the characters typed and add them to the pool.
+        try:
+            while 1:
+                c = os.read(fd, 1)
+                print "Got character", `c`
+                s = s+c
+        finally:
+            termios.tcsetattr(fd, termios.TCSAFLUSH, old)
+
+You need the termios module for any of this to work, and I've only +tried it on Linux, though it should work elsewhere. It turns off +stdin's echoing and disables canonical mode, and then reads a +character at a time from stdin, noting the time after each keystroke. +

+ +Edit this entry / +Log info + +/ Last changed on Thu Oct 24 00:36:56 2002 by +chris +

+ +


+

4.75. How can I overload constructors (or methods) in Python?

+(This actually applies to all methods, but somehow the question +usually comes up first in the context of constructors.) +

+Where in C++ you'd write +

+

+    class C {
+        C() { cout << "No arguments\n"; }
+        C(int i) { cout << "Argument is " << i << "\n"; }
+    }
+
+in Python you have to write a single constructor that catches all +cases using default arguments. For example: +

+

+    class C:
+        def __init__(self, i=None):
+            if i is None:
+                print "No arguments"
+            else:
+                print "Argument is", i
+
+This is not entirely equivalent, but close enough in practice. +

+You could also try a variable-length argument list, e.g. +

+

+        def __init__(self, *args):
+            ....
+
+The same approach works for all method definitions. +

+ +Edit this entry / +Log info + +/ Last changed on Mon Apr 20 11:55:55 1998 by +GvR +

+ +


+

4.76. How do I pass keyword arguments from one method to another?

+Use apply. For example: +

+

+    class Account:
+        def __init__(self, **kw):
+            self.accountType = kw.get('accountType')
+            self.balance = kw.get('balance')
+
+
+    class CheckingAccount(Account):
+        def __init__(self, **kw):
+            kw['accountType'] = 'checking'
+            apply(Account.__init__, (self,), kw)
+
+
+    myAccount = CheckingAccount(balance=100.00)
+
+In Python 2.0 you can call it directly using the new ** syntax: +

+

+    class CheckingAccount(Account):
+        def __init__(self, **kw):
+            kw['accountType'] = 'checking'
+            Account.__init__(self, **kw)
+
+or more generally: +

+

+ >>> def f(x, *y, **z):
+ ...  print x,y,z
+ ...
+ >>> Y = [1,2,3]
+ >>> Z = {'foo':3,'bar':None}
+ >>> f('hello', *Y, **Z)
+ hello (1, 2, 3) {'foo': 3, 'bar': None}
+
+

+ +Edit this entry / +Log info + +/ Last changed on Thu Dec 28 13:04:01 2000 by +Bjorn Pettersen +

+ +


+

4.77. What module should I use to help with generating HTML?

+Check out HTMLgen written by Robin Friedrich. It's a class library +of objects corresponding to all the HTML 3.2 markup tags. It's used +when you are writing in Python and wish to synthesize HTML pages for +generating a web or for CGI forms, etc. +

+It can be found in the FTP contrib area on python.org or on the +Starship. Use the search engines there to locate the latest version. +

+It might also be useful to consider DocumentTemplate, which offers clear +separation between Python code and HTML code. DocumentTemplate is part +of the Bobo objects publishing system (http:/www.digicool.com/releases) +but can be used independantly of course! +

+ +Edit this entry / +Log info + +/ Last changed on Fri Aug 28 09:54:58 1998 by +GvR +

+ +


+

4.78. How do I create documentation from doc strings?

+Use gendoc, by Daniel Larson. See +

+http://starship.python.net/crew/danilo/ +

+It can create HTML from the doc strings in your Python source code. +

+ +Edit this entry / +Log info + +/ Last changed on Mon Oct 7 17:15:51 2002 by +Phil Rittenhouse +

+ +


+

4.79. How do I read (or write) binary data?

+For complex data formats, it's best to use +use the struct module. It's documented in the library reference. +It allows you to take a string read from a file containing binary +data (usually numbers) and convert it to Python objects; and vice +versa. +

+For example, the following code reads two 2-byte integers +and one 4-byte integer in big-endian format from a file: +

+

+  import struct
+
+
+  f = open(filename, "rb")  # Open in binary mode for portability
+  s = f.read(8)
+  x, y, z = struct.unpack(">hhl", s)
+
+The '>' in the format string forces bin-endian data; the letter +'h' reads one "short integer" (2 bytes), and 'l' reads one +"long integer" (4 bytes) from the string. +

+For data that is more regular (e.g. a homogeneous list of ints or +floats), you can also use the array module, also documented +in the library reference. +

+ +Edit this entry / +Log info + +/ Last changed on Wed Oct 7 09:16:45 1998 by +GvR +

+ +


+

4.80. I can't get key bindings to work in Tkinter

+An oft-heard complaint is that event handlers bound to events +with the bind() method don't get handled even when the appropriate +key is pressed. +

+The most common cause is that the widget to which the binding applies +doesn't have "keyboard focus". Check out the Tk documentation +for the focus command. Usually a widget is given the keyboard +focus by clicking in it (but not for labels; see the taketocus +option). +

+ +Edit this entry / +Log info + +/ Last changed on Fri Jun 12 09:37:33 1998 by +GvR +

+ +


+

4.81. "import crypt" fails

+[Unix] +

+Starting with Python 1.5, the crypt module is disabled by default. +In order to enable it, you must go into the Python source tree and +edit the file Modules/Setup to enable it (remove a '#' sign in +front of the line starting with '#crypt'). Then rebuild. +You may also have to add the string '-lcrypt' to that same line. +

+ +Edit this entry / +Log info + +/ Last changed on Wed Aug 5 08:57:09 1998 by +GvR +

+ +


+

4.82. Are there coding standards or a style guide for Python programs?

+Yes, Guido has written the "Python Style Guide". See +http://www.python.org/doc/essays/styleguide.html +

+ +Edit this entry / +Log info + +/ Last changed on Tue Sep 29 09:50:27 1998 by +Joseph VanAndel +

+ +


+

4.83. How do I freeze Tkinter applications?

+Freeze is a tool to create stand-alone applications (see 4.28). +

+When freezing Tkinter applications, the applications will not be +truly stand-alone, as the application will still need the tcl and +tk libraries. +

+One solution is to ship the application with the tcl and tk libraries, +and point to them at run-time using the TCL_LIBRARY and TK_LIBRARY +environment variables. +

+To get truly stand-alone applications, the Tcl scripts that form +the library have to be integrated into the application as well. One +tool supporting that is SAM (stand-alone modules), which is part +of the Tix distribution (http://tix.mne.com). Build Tix with SAM +enabled, perform the appropriate call to Tclsam_init etc inside +Python's Modules/tkappinit.c, and link with libtclsam +and libtksam (you might include the Tix libraries as well). +

+ +Edit this entry / +Log info + +/ Last changed on Wed Jan 20 17:35:01 1999 by +Martin v. Löwis +

+ +


+

4.84. How do I create static class data and static class methods?

+[Tim Peters, tim_one@email.msn.com] +

+Static data (in the sense of C++ or Java) is easy; static methods (again in the sense of C++ or Java) are not supported directly. +

+STATIC DATA +

+For example, +

+

+    class C:
+        count = 0   # number of times C.__init__ called
+
+
+        def __init__(self):
+            C.count = C.count + 1
+
+
+        def getcount(self):
+            return C.count  # or return self.count
+
+c.count also refers to C.count for any c such that isinstance(c, C) holds, unless overridden by c itself or by some class on the base-class search path from c.__class__ back to C. +

+Caution: within a method of C, +

+

+    self.count = 42
+
+creates a new and unrelated instance vrbl named "count" in self's own dict. So rebinding of a class-static data name needs the +

+

+    C.count = 314
+
+form whether inside a method or not. +

+

+STATIC METHODS +

+Static methods (as opposed to static data) are unnatural in Python, because +

+

+    C.getcount
+
+returns an unbound method object, which can't be invoked without supplying an instance of C as the first argument. +

+The intended way to get the effect of a static method is via a module-level function: +

+

+    def getcount():
+        return C.count
+
+If your code is structured so as to define one class (or tightly related class hierarchy) per module, this supplies the desired encapsulation. +

+Several tortured schemes for faking static methods can be found by searching DejaNews. Most people feel such cures are worse than the disease. Perhaps the least obnoxious is due to Pekka Pessi (mailto:ppessi@hut.fi): +

+

+    # helper class to disguise function objects
+    class _static:
+        def __init__(self, f):
+            self.__call__ = f
+
+
+    class C:
+        count = 0
+
+
+        def __init__(self):
+            C.count = C.count + 1
+
+
+        def getcount():
+            return C.count
+        getcount = _static(getcount)
+
+
+        def sum(x, y):
+            return x + y
+        sum = _static(sum)
+
+
+    C(); C()
+    c = C()
+    print C.getcount()  # prints 3
+    print c.getcount()  # prints 3
+    print C.sum(27, 15) # prints 42
+
+

+ +Edit this entry / +Log info + +/ Last changed on Thu Jan 21 21:35:38 1999 by +Tim Peters +

+ +


+

4.85. __import__('x.y.z') returns <module 'x'>; how do I get z?

+Try +

+

+   __import__('x.y.z').y.z
+
+For more realistic situations, you may have to do something like +

+

+   m = __import__(s)
+   for i in string.split(s, ".")[1:]:
+       m = getattr(m, i)
+
+

+ +Edit this entry / +Log info + +/ Last changed on Thu Jan 28 11:01:43 1999 by +GvR +

+ +


+

4.86. Basic thread wisdom

+Please note that there is no way to take advantage of +multiprocessor hardware using the Python thread model. The interpreter +uses a global interpreter lock (GIL), +which does not allow multiple threads to be concurrently active. +

+If you write a simple test program like this: +

+

+  import thread
+  def run(name, n):
+      for i in range(n): print name, i
+  for i in range(10):
+      thread.start_new(run, (i, 100))
+
+none of the threads seem to run! The reason is that as soon as +the main thread exits, all threads are killed. +

+A simple fix is to add a sleep to the end of the program, +sufficiently long for all threads to finish: +

+

+  import thread, time
+  def run(name, n):
+      for i in range(n): print name, i
+  for i in range(10):
+      thread.start_new(run, (i, 100))
+  time.sleep(10) # <----------------------------!
+
+But now (on many platforms) the threads don't run in parallel, +but appear to run sequentially, one at a time! The reason is +that the OS thread scheduler doesn't start a new thread until +the previous thread is blocked. +

+A simple fix is to add a tiny sleep to the start of the run +function: +

+

+  import thread, time
+  def run(name, n):
+      time.sleep(0.001) # <---------------------!
+      for i in range(n): print name, i
+  for i in range(10):
+      thread.start_new(run, (i, 100))
+  time.sleep(10)
+
+Some more hints: +

+Instead of using a time.sleep() call at the end, it's +better to use some kind of semaphore mechanism. One idea is to +use a the Queue module to create a queue object, let each thread +append a token to the queue when it finishes, and let the main +thread read as many tokens from the queue as there are threads. +

+Use the threading module instead of the thread module. It's part +of Python since version 1.5.1. It takes care of all these details, +and has many other nice features too! +

+ +Edit this entry / +Log info + +/ Last changed on Fri Feb 7 16:21:55 2003 by +GvR +

+ +


+

4.87. Why doesn't closing sys.stdout (stdin, stderr) really close it?

+Python file objects are a high-level layer of abstraction on top of C streams, which in turn are a medium-level layer of abstraction on top of (among other things) low-level C file descriptors. +

+For most file objects f you create in Python via the builtin "open" function, f.close() marks the Python file object as being closed from Python's point of view, and also arranges to close the underlying C stream. This happens automatically too, in f's destructor, when f becomes garbage. +

+But stdin, stdout and stderr are treated specially by Python, because of the special status also given to them by C: doing +

+

+    sys.stdout.close() # ditto for stdin and stderr
+
+marks the Python-level file object as being closed, but does not close the associated C stream (provided sys.stdout is still bound to its default value, which is the stream C also calls "stdout"). +

+To close the underlying C stream for one of these three, you should first be sure that's what you really want to do (e.g., you may confuse the heck out of extension modules trying to do I/O). If it is, use os.close: +

+

+    os.close(0)   # close C's stdin stream
+    os.close(1)   # close C's stdout stream
+    os.close(2)   # close C's stderr stream
+
+

+ +Edit this entry / +Log info + +/ Last changed on Sat Apr 17 02:22:35 1999 by +Tim Peters +

+ +


+

4.88. What kinds of global value mutation are thread-safe?

+[adapted from c.l.py responses by Gordon McMillan & GvR] +

+A global interpreter lock (GIL) is used internally to ensure that only one thread runs in the Python VM at a time. In general, Python offers to switch among threads only between bytecode instructions (how frequently it offers to switch can be set via sys.setcheckinterval). Each bytecode instruction-- and all the C implementation code reached from it --is therefore atomic. +

+In theory, this means an exact accounting requires an exact understanding of the PVM bytecode implementation. In practice, it means that operations on shared vrbls of builtin data types (ints, lists, dicts, etc) that "look atomic" really are. +

+For example, these are atomic (L, L1, L2 are lists, D, D1, D2 are dicts, x, y +are objects, i, j are ints): +

+

+    L.append(x)
+    L1.extend(L2)
+    x = L[i]
+    x = L.pop()
+    L1[i:j] = L2
+    L.sort()
+    x = y
+    x.field = y
+    D[x] = y
+    D1.update(D2)
+    D.keys()
+
+These aren't: +

+

+    i = i+1
+    L.append(L[-1])
+    L[i] = L[j]
+    D[x] = D[x] + 1
+
+Note: operations that replace other objects may invoke those other objects' __del__ method when their reference count reaches zero, and that can affect things. This is especially true for the mass updates to dictionaries and lists. When in doubt, use a mutex! +

+ +Edit this entry / +Log info + +/ Last changed on Fri Feb 7 16:21:03 2003 by +GvR +

+ +


+

4.89. How do I modify a string in place?

+Strings are immutable (see question 6.2) so you cannot modify a string +directly. If you need an object with this ability, try converting the +string to a list or take a look at the array module. +

+

+    >>> s = "Hello, world"
+    >>> a = list(s)
+    >>> print a
+    ['H', 'e', 'l', 'l', 'o', ',', ' ', 'w', 'o', 'r', 'l', 'd']
+    >>> a[7:] = list("there!")
+    >>> import string
+    >>> print string.join(a, '')
+    'Hello, there!'
+
+
+    >>> import array
+    >>> a = array.array('c', s)
+    >>> print a
+    array('c', 'Hello, world')
+    >>> a[0] = 'y' ; print a
+    array('c', 'yello world')
+    >>> a.tostring()
+    'yello, world'
+
+

+ +Edit this entry / +Log info + +/ Last changed on Tue May 18 01:22:47 1999 by +Andrew Dalke +

+ +


+

4.90. How to pass on keyword/optional parameters/arguments

+Q: How can I pass on optional or keyword parameters from one function to another? +

+

+	def f1(a, *b, **c):
+		...
+
+A: In Python 2.0 and above: +

+

+	def f2(x, *y, **z):
+		...
+		z['width']='14.3c'
+		...
+		f1(x, *y, **z)
+
+
+   Note: y can be any sequence (e.g., list or tuple) and z must be a dict.
+
+

+A: For versions prior to 2.0, use 'apply', like: +

+

+	def f2(x, *y, **z):
+		...
+		z['width']='14.3c'
+		...
+		apply(f1, (x,)+y, z)
+
+

+ +Edit this entry / +Log info + +/ Last changed on Mon Jun 3 07:20:56 2002 by +Matthias Urlichs +

+ +


+

4.91. How can I get a dictionary to display its keys in a consistent order?

+In general, dictionaries store their keys in an unpredictable order, +so the display order of a dictionary's elements will be similarly +unpredictable. +(See +Question 6.12 +to understand why this is so.) +

+This can be frustrating if you want to save a printable version to a +file, make some changes and then compare it with some other printed +dictionary. If you have such needs you can subclass UserDict.UserDict +to create a SortedDict class that prints itself in a predictable order. +Here's one simpleminded implementation of such a class: +

+

+  import UserDict, string
+
+
+  class SortedDict(UserDict.UserDict):
+    def __repr__(self):
+      result = []
+      append = result.append
+      keys = self.data.keys()
+      keys.sort()
+      for k in keys:
+        append("%s: %s" % (`k`, `self.data[k]`))
+      return "{%s}" % string.join(result, ", ")
+
+
+    ___str__ = __repr__
+
+

+This will work for many common situations you might encounter, though +it's far from a perfect solution. (It won't have any effect on the +pprint module and does not transparently handle values that are or +contain dictionaries. +

+ +Edit this entry / +Log info + +/ Last changed on Thu Sep 16 17:31:06 1999 by +Skip Montanaro +

+ +


+

4.92. Is there a Python tutorial?

+Yes. See question 1.20 at +http://www.python.org/doc/FAQ.html#1.20 +

+ +Edit this entry / +Log info + +/ Last changed on Sat Dec 4 16:04:00 1999 by +TAB +

+ +


+

4.93. Deleted

+See 4.28 +

+ +Edit this entry / +Log info + +/ Last changed on Tue May 28 20:40:37 2002 by +GvR +

+ +


+

4.94. How do I get a single keypress without blocking?

+There are several solutions; some involve using curses, which is a +pretty big thing to learn. Here's a solution without curses. (see also 4.74, for Windows, see question 8.2) +

+

+  import termios, fcntl, sys, os
+  fd = sys.stdin.fileno()
+
+
+  oldterm = termios.tcgetattr(fd)
+  newattr = termios.tcgetattr(fd)
+  newattr[3] = newattr[3] & ~termios.ICANON & ~termios.ECHO
+  termios.tcsetattr(fd, termios.TCSANOW, newattr)
+
+
+  oldflags = fcntl.fcntl(fd, fcntl.F_GETFL)
+  fcntl.fcntl(fd, fcntl.F_SETFL, oldflags | os.O_NONBLOCK)
+
+
+  try:
+      while 1:
+          try:
+              c = sys.stdin.read(1)
+              print "Got character", `c`
+          except IOError: pass
+  finally:
+      termios.tcsetattr(fd, termios.TCSAFLUSH, oldterm)
+      fcntl.fcntl(fd, fcntl.F_SETFL, oldflags)
+
+

+You need the termios and the fcntl module for any of this to work, +and I've only tried it on Linux, though it should work elsewhere. +

+In this code, characters are read and printed one at a time. +

+termios.tcsetattr() turns off stdin's echoing and disables canonical +mode. fcntl.fnctl() is used to obtain stdin's file descriptor flags +and modify them for non-blocking mode. Since reading stdin when it is +empty results in an IOError, this error is caught and ignored. +

+ +Edit this entry / +Log info + +/ Last changed on Thu Oct 24 00:39:06 2002 by +chris +

+ +


+

4.95. Is there an equivalent to Perl chomp()? (Remove trailing newline from string)

+There are two partial substitutes. If you want to remove all trailing +whitespace, use the method string.rstrip(). Otherwise, if there is only +one line in the string, use string.splitlines()[0]. +

+

+ -----------------------------------------------------------------------
+
+
+ rstrip() is too greedy, it strips all trailing white spaces.
+ splitlines() takes ControlM as line boundary.
+ Consider these strings as input:
+   "python python    \r\n"
+   "python\rpython\r\n"
+   "python python   \r\r\r\n"
+ The results from rstrip()/splitlines() are perhaps not what we want.
+
+
+ It seems re can perform this task.
+
+

+

+ #!/usr/bin/python 
+ # requires python2                                                             
+
+
+ import re, os, StringIO
+
+
+ lines=StringIO.StringIO(
+   "The Python Programming Language\r\n"
+   "The Python Programming Language \r \r \r\r\n"
+   "The\rProgramming\rLanguage\r\n"
+   "The\rProgramming\rLanguage\r\r\r\r\n"
+   "The\r\rProgramming\r\rLanguage\r\r\r\r\n"
+ )
+
+
+ ln=re.compile("(?:[\r]?\n|\r)$") # dos:\r\n, unix:\n, mac:\r, others: unknown
+ # os.linesep does not work if someone ftps(in binary mode) a dos/mac text file
+ # to your unix box
+ #ln=re.compile(os.linesep + "$")
+
+
+ while 1:
+   s=lines.readline()
+   if not s: break
+   print "1.(%s)" % `s.rstrip()`
+   print "2.(%s)" % `ln.sub( "", s, 1)`
+   print "3.(%s)" % `s.splitlines()[0]`
+   print "4.(%s)" % `s.splitlines()`
+   print
+
+
+ lines.close()
+
+

+ +Edit this entry / +Log info + +/ Last changed on Wed Aug 8 09:51:34 2001 by +Crystal +

+ +


+

4.96. Why is join() a string method when I'm really joining the elements of a (list, tuple, sequence)?

+Strings became much more like other standard types starting in release 1.6, when methods were added which give the same functionality that has always been available using the functions of the string module. These new methods have been widely accepted, but the one which appears to make (some) programmers feel uncomfortable is: +

+

+    ", ".join(['1', '2', '4', '8', '16'])
+
+which gives the result +

+

+    "1, 2, 4, 8, 16"
+
+There are two usual arguments against this usage. +

+The first runs along the lines of: "It looks really ugly using a method of a string literal (string constant)", to which the answer is that it might, but a string literal is just a fixed value. If the methods are to be allowed on names bound to strings there is no logical reason to make them unavailable on literals. Get over it! +

+The second objection is typically cast as: "I am really telling a sequence to join its members together with a string constant". Sadly, you aren't. For some reason there seems to be much less difficulty with having split() as a string method, since in that case it is easy to see that +

+

+    "1, 2, 4, 8, 16".split(", ")
+
+is an instruction to a string literal to return the substrings delimited by the given separator (or, by default, arbitrary runs of white space). In this case a Unicode string returns a list of Unicode strings, an ASCII string returns a list of ASCII strings, and everyone is happy. +

+join() is a string method because in using it you are telling the separator string to iterate over an arbitrary sequence, forming string representations of each of the elements, and inserting itself between the elements' representations. This method can be used with any argument which obeys the rules for sequence objects, inluding any new classes you might define yourself. +

+Because this is a string method it can work for Unicode strings as well as plain ASCII strings. If join() were a method of the sequence types then the sequence types would have to decide which type of string to return depending on the type of the separator. +

+If none of these arguments persuade you, then for the moment you can continue to use the join() function from the string module, which allows you to write +

+

+    string.join(['1', '2', '4', '8', '16'], ", ")
+
+You will just have to try and forget that the string module actually uses the syntax you are compaining about to implement the syntax you prefer! +

+ +Edit this entry / +Log info + +/ Last changed on Fri Aug 2 15:51:58 2002 by +Steve Holden +

+ +


+

4.97. How can my code discover the name of an object?

+Generally speaking, it can't, because objects don't really have names. The assignment statement does not store the assigned value in the name but a reference to it. Essentially, assignment creates a binding of a name to a value. The same is true of def and class statements, but in that case the value is a callable. Consider the following code: +

+

+    class A:
+        pass
+
+
+    B = A
+
+
+    a = B()
+    b = a
+    print b
+    <__main__.A instance at 016D07CC>
+    print a
+    <__main__.A instance at 016D07CC>
+
+

+Arguably the class has a name: even though it is bound to two names and invoked through the name B the created instance is still reported as an instance of class A. However, it is impossible to say whether the instance's name is a or b, since both names are bound to the same value. +

+Generally speaking it should not be necessary for your code to "know the names" of particular values. Unless you are deliberately writing introspective programs, this is usually an indication that a change of approach might be beneficial. +

+ +Edit this entry / +Log info + +/ Last changed on Thu Mar 8 03:53:39 2001 by +Steve Holden +

+ +


+

4.98. Why are floating point calculations so inaccurate?

+The development version of the Python Tutorial now contains an Appendix with more info: +
+    http://www.python.org/doc/current/tut/node14.html
+
+People are often very surprised by results like this: +

+

+ >>> 1.2-1.0
+ 0.199999999999999996
+
+And think it is a bug in Python. It's not. It's a problem caused by +the internal representation of a floating point number. A floating point +number is stored as a fixed number of binary digits. +

+In decimal math, there are many numbers that can't be represented +with a fixed number of decimal digits, i.e. +1/3 = 0.3333333333....... +

+In the binary case, 1/2 = 0.1, 1/4 = 0.01, 1/8 = 0.001, etc. There are +a lot of numbers that can't be represented. The digits are cut off at +some point. +

+Since Python 1.6, a floating point's repr() function prints as many +digits are necessary to make eval(repr(f)) == f true for any float f. +The str() function prints the more sensible number that was probably +intended: +

+

+ >>> 0.2
+ 0.20000000000000001
+ >>> print 0.2
+ 0.2
+
+Again, this has nothing to do with Python, but with the way the +underlying C platform handles floating points, and ultimately with +the inaccuracy you'll always have when writing down numbers of fixed +number of digit strings. +

+One of the consequences of this is that it is dangerous to compare +the result of some computation to a float with == ! +Tiny inaccuracies may mean that == fails. +

+Instead try something like this: +

+

+ epsilon = 0.0000000000001 # Tiny allowed error
+ expected_result = 0.4
+
+
+ if expected_result-epsilon <= computation() <= expected_result+epsilon:
+    ...
+
+

+ +Edit this entry / +Log info + +/ Last changed on Mon Apr 1 22:18:47 2002 by +Fred Drake +

+ +


+

4.99. I tried to open Berkeley DB file, but bsddb produces bsddb.error: (22, 'Invalid argument'). Help! How can I restore my data?

+Don't panic! Your data are probably intact. The most frequent cause +for the error is that you tried to open an earlier Berkeley DB file +with a later version of the Berkeley DB library. +

+Many Linux systems now have all three versions of Berkeley DB +available. If you are migrating from version 1 to a newer version use +db_dump185 to dump a plain text version of the database. +If you are migrating from version 2 to version 3 use db2_dump to create +a plain text version of the database. In either case, use db_load to +create a new native database for the latest version installed on your +computer. If you have version 3 of Berkeley DB installed, you should +be able to use db2_load to create a native version 2 database. +

+You should probably move away from Berkeley DB version 1 files because +the hash file code contains known bugs that can corrupt your data. +

+ +Edit this entry / +Log info + +/ Last changed on Wed Aug 29 16:04:29 2001 by +Skip Montanaro +

+ +


+

4.100. What are the "best practices" for using import in a module?

+First, the standard modules are great. Use them! The standard Python library is large and varied. Using modules can save you time and effort and will reduce maintainenance cost of your code. (Other programs are dedicated to supporting and fixing bugs in the standard Python modules. Coworkers may also be familiar with themodules that you use, reducing the amount of time it takes them to understand your code.) +

+The rest of this answer is largely a matter of personal preference, but here's what some newsgroup posters said (thanks to all who responded) +

+In general, don't use +

+ from modulename import *
+
+Doing so clutters the importer's namespace. Some avoid this idiom even with the few modules that were designed to be imported in this manner. (Modules designed in this manner include Tkinter, thread, and wxPython.) +

+Import modules at the top of a file, one module per line. Doing so makes it clear what other modules your code requires and avoids questions of whether the module name is in scope. Using one import per line makes it easy to add and delete module imports. +

+Move imports into a local scope (such as at the top of a function definition) if there are a lot of imports, and you're trying to avoid the cost (lots of initialization time) of many imports. This technique is especially helpful if many of the imports are unnecessary depending on how the program executes. You may also want to move imports into a function if the modules are only ever used in that function. Note that loading a module the first time may be expensive (because of the one time initialization of the module) but that loading a module multiple times is virtually free (a couple of dictionary lookups). Even if the module name has gone out of scope, the module is probably available in sys.modules. Thus, there isn't really anything wrong with putting no imports at the module level (if they aren't needed) and putting all of the imports at the function level. +

+It is sometimes necessary to move imports to a function or class to avoid problems with circular imports. Gordon says: +

+ Circular imports are fine where both modules use the "import <module>"
+ form of import. They fail when the 2nd module wants to grab a name
+ out of the first ("from module import name") and the import is at
+ the top level. That's because names in the 1st are not yet available,
+ (the first module is busy importing the 2nd).  
+
+In this case, if the 2nd module is only used in one function, then the import can easily be moved into that function. By the time the import is called, the first module will have finished initializing, and the second module can do its import. +

+It may also be necessary to move imports out of the top level of code +if some of the modules are platform-specific. In that case, it may not even be possible to import all of the modules at the top of the file. In this case, importing the correct modules in the corresponding platform-specific code is a good option. +

+If only instances of a specific class uses a module, then it is reasonable to import the module in the class's __init__ method and then assign the module to an instance variable so that the module is always available (via that instance variable) during the life of the object. Note that to delay an import until the class is instantiated, the import must be inside a method. Putting the import inside the class but outside of any method still causes the import to occur when the module is initialized. +

+ +Edit this entry / +Log info + +/ Last changed on Sat Aug 4 04:44:47 2001 by +TAB +

+ +


+

4.101. Is there a tool to help find bugs or perform static analysis?

+Yes. PyChecker is a static analysis tool for finding bugs +in Python source code as well as warning about code complexity +and style. +

+You can get PyChecker from: http://pychecker.sf.net. +

+ +Edit this entry / +Log info + +/ Last changed on Fri Aug 10 15:42:11 2001 by +Neal +

+ +


+

4.102. UnicodeError: ASCII [decoding,encoding] error: ordinal not in range(128)

+This error indicates that your Python installation can handle +only 7-bit ASCII strings. There are a couple ways to fix or +workaround the problem. +

+If your programs must handle data in arbitary character set encodings, the environment the application runs in will generally identify the encoding of the data it is handing you. You need to convert the input to Unicode data using that encoding. For instance, a program that handles email or web input will typically find character set encoding information in Content-Type headers. This can then be used to properly convert input data to Unicode. Assuming the string referred to by "value" is encoded as UTF-8: +

+

+    value = unicode(value, "utf-8")
+
+will return a Unicode object. If the data is not correctly encoded as UTF-8, the above call will raise a UnicodeError. +

+If you only want strings coverted to Unicode which have non-ASCII data, you can try converting them first assuming an ASCII encoding, and then generate Unicode objects if that fails: +

+

+    try:
+        x = unicode(value, "ascii")
+    except UnicodeError:
+        value = unicode(value, "utf-8")
+    else:
+        # value was valid ASCII data
+        pass
+
+

+If you normally use a character set encoding other than US-ASCII and only need to handle data in that encoding, the simplest way to fix the problem may be simply to set the encoding in sitecustomize.py. The following code is just a modified version of the encoding setup code from site.py with the relevant lines uncommented. +

+

+    # Set the string encoding used by the Unicode implementation.
+    # The default is 'ascii'
+    encoding = "ascii" # <= CHANGE THIS if you wish
+
+
+    # Enable to support locale aware default string encodings.
+    import locale
+    loc = locale.getdefaultlocale()
+    if loc[1]:
+        encoding = loc[1]
+    if encoding != "ascii":
+        import sys
+        sys.setdefaultencoding(encoding)
+
+

+Also note that on Windows, there is an encoding known as "mbcs", which uses an encoding specific to your current locale. In many cases, and particularly when working with COM, this may be an appropriate default encoding to use. +

+ +Edit this entry / +Log info + +/ Last changed on Sat Apr 13 04:45:41 2002 by +Skip Montanaro +

+ +


+

4.103. Using strings to call functions/methods

+There are various techniques: +

+* Use a dictionary pre-loaded with strings and functions. The primary +advantage of this technique is that the strings do not need to match the +names of the functions. This is also the primary technique used to +emulate a case construct: +

+

+    def a():
+        pass
+
+
+    def b():
+        pass
+
+
+    dispatch = {'go': a, 'stop': b}  # Note lack of parens for funcs
+
+
+    dispatch[get_input()]()  # Note trailing parens to call function
+
+* Use the built-in function getattr(): +

+

+    import foo
+    getattr(foo, 'bar')()
+
+Note that getattr() works on any object, including classes, class +instances, modules, and so on. +

+This is used in several places in the standard library, like +this: +

+

+    class Foo:
+        def do_foo(self):
+            ...
+
+
+        def do_bar(self):
+            ...
+
+
+     f = getattr(foo_instance, 'do_' + opname)
+     f()
+
+

+* Use locals() or eval() to resolve the function name: +

+def myFunc(): +

+    print "hello"
+
+fname = "myFunc" +

+f = locals()[fname] +f() +

+f = eval(fname) +f() +

+Note: Using eval() can be dangerous. If you don't have absolute control +over the contents of the string, all sorts of things could happen... +

+ +Edit this entry / +Log info + +/ Last changed on Thu Mar 21 08:14:58 2002 by +Erno Kuusela +

+ +


+

4.104. How fast are exceptions?

+A try/except block is extremely efficient. Actually executing an +exception is expensive. In older versions of Python (prior to 2.0), it +was common to code this idiom: +

+

+    try:
+        value = dict[key]
+    except KeyError:
+        dict[key] = getvalue(key)
+        value = dict[key]
+
+This idiom only made sense when you expected the dict to have the key +95% of the time or more; other times, you coded it like this: +

+

+    if dict.has_key(key):
+        value = dict[key]
+    else:
+        dict[key] = getvalue(key)
+        value = dict[key]
+
+In Python 2.0 and higher, of course, you can code this as +

+

+    value = dict.setdefault(key, getvalue(key))
+
+However this evaluates getvalue(key) always, regardless of whether it's needed or not. So if it's slow or has a side effect you should use one of the above variants. +

+ +Edit this entry / +Log info + +/ Last changed on Mon Dec 9 10:12:30 2002 by +Yeti +

+ +


+

4.105. Sharing global variables across modules

+The canonical way to share information across modules within a single +program is to create a special module (often called config or cfg). +Just import the config module in all modules of your application; the +module then becomes available as a global name. Because there is only +one instance of each module, any changes made to the module object get +reflected everywhere. For example: +

+config.py: +

+

+    pass
+
+mod.py: +

+

+    import config
+    config.x = 1
+
+main.py: +

+

+    import config
+    import mod
+    print config.x
+
+Note that using a module is also the basis for implementing the +Singleton design pattern, for the same reason. +

+ +Edit this entry / +Log info + +/ Last changed on Tue Apr 23 23:07:19 2002 by +Aahz +

+ +


+

4.106. Why is cPickle so slow?

+Use the binary option. We'd like to make that the default, but it would +break backward compatibility: +

+

+    largeString = 'z' * (100 * 1024)
+    myPickle = cPickle.dumps(largeString, 1)
+
+

+ +Edit this entry / +Log info + +/ Last changed on Thu Aug 22 19:54:25 2002 by +Aahz +

+ +


+

4.107. When importing module XXX, why do I get "undefined symbol: PyUnicodeUCS2_..." ?

+You are using a version of Python that uses a 4-byte representation for +Unicode characters, but the extension module you are importing (possibly +indirectly) was compiled using a Python that uses a 2-byte representation +for Unicode characters (the default). +

+If instead the name of the undefined symbol starts with PyUnicodeUCS4_, +the problem is the same by the relationship is reversed: Python was +built using 2-byte Unicode characters, and the extension module was +compiled using a Python with 4-byte Unicode characters. +

+This can easily occur when using pre-built extension packages. RedHat +Linux 7.x, in particular, provides a "python2" binary that is compiled +with 4-byte Unicode. This only causes the link failure if the extension +uses any of the PyUnicode_*() functions. It is also a problem if if an +extension uses any of the Unicode-related format specifiers for +Py_BuildValue (or similar) or parameter-specifications for +PyArg_ParseTuple(). +

+You can check the size of the Unicode character a Python interpreter is +using by checking the value of sys.maxunicode: +

+

+  >>> import sys
+  >>> if sys.maxunicode > 65535:
+  ...     print 'UCS4 build'
+  ... else:
+  ...     print 'UCS2 build'
+
+The only way to solve this problem is to use extension modules compiled +with a Python binary built using the same size for Unicode characters. +

+ +Edit this entry / +Log info + +/ Last changed on Tue Aug 27 15:00:17 2002 by +Fred Drake +

+ +


+

4.108. How do I create a .pyc file?

+QUESTION: +

+I have a module and I wish to generate a .pyc file. +How do I do it? Everything I read says that generation of a .pyc file is +"automatic", but I'm not getting anywhere. +

+

+ANSWER: +

+When a module is imported for the first time (or when the source is more +recent than the current compiled file) a .pyc file containing the compiled code should be created in the +same directory as the .py file. +

+One reason that a .pyc file may not be created is permissions problems with the directory. This can happen, for example, if you develop as one user but run as another, such as if you are testing with a web server. +

+However, in most cases, that's not the problem. +

+Creation of a .pyc file is "automatic" if you are importing a module and Python has the +ability (permissions, free space, etc...) to write the compiled module +back to the directory. But note that running Python on a top level script is not considered an +import and so no .pyc will be created automatically. For example, if you have a top-level module abc.py that imports another module xyz.py, when you run abc, xyz.pyc will be created since xyz is imported, but no abc.pyc file will be created since abc isn't imported. +

+If you need to create abc.pyc -- that is, to create a .pyc file for a +module that is not imported -- you can. (Look up +the py_compile and compileall modules in the Library Reference.) +

+You can manually compile any module using the "py_compile" module. One +way is to use the compile() function in that module interactively: +

+

+    >>> import py_compile
+    >>> py_compile.compile('abc.py')
+
+This will write the .pyc to the same location as abc.py (or you +can override that with the optional parameter cfile). +

+You can also automatically compile all files in a directory or +directories using the "compileall" module, which can also be run +straight from the command line. +

+You can do it from the shell (or DOS) prompt by entering: +

+       python compile.py abc.py
+
+or +
+       python compile.py *
+
+Or you can write a script to do it on a list of filenames that you enter. +

+

+     import sys
+     from py_compile import compile
+
+
+     if len(sys.argv) <= 1:
+        sys.exit(1)
+
+
+     for file in sys.argv[1:]:
+        compile(file)
+
+ACKNOWLEDGMENTS: +

+Steve Holden, David Bolen, Rich Somerfield, Oleg Broytmann, Steve Ferg +

+ +Edit this entry / +Log info + +/ Last changed on Wed Feb 12 15:58:25 2003 by +Stephen Ferg +

+ +


+

5. Extending Python

+ +
+

5.1. Can I create my own functions in C?

+Yes, you can create built-in modules containing functions, +variables, exceptions and even new types in C. This is explained in +the document "Extending and Embedding the Python Interpreter" (http://www.python.org/doc/current/ext/ext.html). Also read the chapter +on dynamic loading. +

+There's more information on this in each of the Python books: +Programming Python, Internet Programming with Python, and Das Python-Buch +(in German). +

+ +Edit this entry / +Log info + +/ Last changed on Mon Dec 10 05:18:57 2001 by +Fred L. Drake, Jr. +

+ +


+

5.2. Can I create my own functions in C++?

+Yes, using the C-compatibility features found in C++. Basically +you place extern "C" { ... } around the Python include files and put +extern "C" before each function that is going to be called by the +Python interpreter. Global or static C++ objects with constructors +are probably not a good idea. +

+ +Edit this entry / +Log info +

+ +


+

5.3. How can I execute arbitrary Python statements from C?

+The highest-level function to do this is PyRun_SimpleString() which takes +a single string argument which is executed in the context of module +__main__ and returns 0 for success and -1 when an exception occurred +(including SyntaxError). If you want more control, use PyRun_String(); +see the source for PyRun_SimpleString() in Python/pythonrun.c. +

+ +Edit this entry / +Log info + +/ Last changed on Fri May 23 20:08:14 1997 by +Bill Tutt +

+ +


+

5.4. How can I evaluate an arbitrary Python expression from C?

+Call the function PyRun_String() from the previous question with the +start symbol eval_input (Py_eval_input starting with 1.5a1); it +parses an expression, evaluates it and returns its value. +

+ +Edit this entry / +Log info + +/ Last changed on Wed May 21 22:23:18 1997 by +David Ascher +

+ +


+

5.5. How do I extract C values from a Python object?

+That depends on the object's type. If it's a tuple, +PyTupleSize(o) returns its length and PyTuple_GetItem(o, i) +returns its i'th item; similar for lists with PyListSize(o) +and PyList_GetItem(o, i). For strings, PyString_Size(o) returns +its length and PyString_AsString(o) a pointer to its value +(note that Python strings may contain null bytes so strlen() +is not safe). To test which type an object is, first make sure +it isn't NULL, and then use PyString_Check(o), PyTuple_Check(o), +PyList_Check(o), etc. +

+There is also a high-level API to Python objects which is +provided by the so-called 'abstract' interface -- read +Include/abstract.h for further details. It allows for example +interfacing with any kind of Python sequence (e.g. lists and tuples) +using calls like PySequence_Length(), PySequence_GetItem(), etc.) +as well as many other useful protocols. +

+ +Edit this entry / +Log info + +/ Last changed on Wed May 21 22:34:20 1997 by +David Ascher +

+ +


+

5.6. How do I use Py_BuildValue() to create a tuple of arbitrary length?

+You can't. Use t = PyTuple_New(n) instead, and fill it with +objects using PyTuple_SetItem(t, i, o) -- note that this "eats" a +reference count of o. Similar for lists with PyList_New(n) and +PyList_SetItem(l, i, o). Note that you must set all the tuple items to +some value before you pass the tuple to Python code -- +PyTuple_New(n) initializes them to NULL, which isn't a valid Python +value. +

+ +Edit this entry / +Log info + +/ Last changed on Thu Jul 31 18:15:29 1997 by +Guido van Rossum +

+ +


+

5.7. How do I call an object's method from C?

+The PyObject_CallMethod() function can be used to call an arbitrary +method of an object. The parameters are the object, the name of the +method to call, a format string like that used with Py_BuildValue(), and the argument values: +

+

+    PyObject *
+    PyObject_CallMethod(PyObject *object, char *method_name,
+                        char *arg_format, ...);
+
+This works for any object that has methods -- whether built-in or +user-defined. You are responsible for eventually DECREF'ing the +return value. +

+To call, e.g., a file object's "seek" method with arguments 10, 0 +(assuming the file object pointer is "f"): +

+

+        res = PyObject_CallMethod(f, "seek", "(ii)", 10, 0);
+        if (res == NULL) {
+                ... an exception occurred ...
+        }
+        else {
+                Py_DECREF(res);
+        }
+
+Note that since PyObject_CallObject() always wants a tuple for the +argument list, to call a function without arguments, pass "()" for the +format, and to call a function with one argument, surround the argument +in parentheses, e.g. "(i)". +

+ +Edit this entry / +Log info + +/ Last changed on Thu Jun 6 16:15:46 2002 by +Neal Norwitz +

+ +


+

5.8. How do I catch the output from PyErr_Print() (or anything that prints to stdout/stderr)?

+(Due to Mark Hammond): +

+In Python code, define an object that supports the "write()" method. +Redirect sys.stdout and sys.stderr to this object. +Call print_error, or just allow the standard traceback mechanism to +work. Then, the output will go wherever your write() method sends it. +

+The easiest way to do this is to use the StringIO class in the standard +library. +

+Sample code and use for catching stdout: +

+	>>> class StdoutCatcher:
+	...  def __init__(self):
+	...   self.data = ''
+	...  def write(self, stuff):
+	...   self.data = self.data + stuff
+	...  
+	>>> import sys
+	>>> sys.stdout = StdoutCatcher()
+	>>> print 'foo'
+	>>> print 'hello world!'
+	>>> sys.stderr.write(sys.stdout.data)
+	foo
+	hello world!
+
+

+ +Edit this entry / +Log info + +/ Last changed on Wed Dec 16 18:34:25 1998 by +Richard Jones +

+ +


+

5.9. How do I access a module written in Python from C?

+You can get a pointer to the module object as follows: +

+

+        module = PyImport_ImportModule("<modulename>");
+
+If the module hasn't been imported yet (i.e. it is not yet present in +sys.modules), this initializes the module; otherwise it simply returns +the value of sys.modules["<modulename>"]. Note that it doesn't enter +the module into any namespace -- it only ensures it has been +initialized and is stored in sys.modules. +

+You can then access the module's attributes (i.e. any name defined in +the module) as follows: +

+

+        attr = PyObject_GetAttrString(module, "<attrname>");
+
+Calling PyObject_SetAttrString(), to assign to variables in the module, also works. +

+ +Edit this entry / +Log info + +/ Last changed on Wed May 21 22:56:40 1997 by +david ascher +

+ +


+

5.10. How do I interface to C++ objects from Python?

+Depending on your requirements, there are many approaches. To do +this manually, begin by reading the "Extending and Embedding" document +(Doc/ext.tex, see also http://www.python.org/doc/). Realize +that for the Python run-time system, there isn't a whole lot of +difference between C and C++ -- so the strategy to build a new Python +type around a C structure (pointer) type will also work for C++ +objects. +

+A useful automated approach (which also works for C) is SWIG: +http://www.swig.org/. +

+ +Edit this entry / +Log info + +/ Last changed on Fri Oct 15 05:14:01 1999 by +Sjoerd Mullender +

+ +


+

5.11. mSQLmodule (or other old module) won't build with Python 1.5 (or later)

+Since python-1.4 "Python.h" will have the file includes needed in an +extension module. +Backward compatibility is dropped after version 1.4 and therefore +mSQLmodule.c will not build as "allobjects.h" cannot be found. +The following change in mSQLmodule.c is harmless when building it with +1.4 and necessary when doing so for later python versions: +

+Remove lines: +

+

+	#include "allobjects.h"
+	#include "modsupport.h"
+
+And insert instead: +

+

+	#include "Python.h"
+
+You may also need to add +

+

+                #include "rename2.h"
+
+if the module uses "old names". +

+This may happen with other ancient python modules as well, +and the same fix applies. +

+ +Edit this entry / +Log info + +/ Last changed on Sun Dec 21 02:03:35 1997 by +GvR +

+ +


+

5.12. I added a module using the Setup file and the make fails! Huh?

+Setup must end in a newline, if there is no newline there it gets +very sad. Aside from this possibility, maybe you have other +non-Python-specific linkage problems. +

+ +Edit this entry / +Log info + +/ Last changed on Tue Jun 24 15:54:01 1997 by +aaron watters +

+ +


+

5.13. I want to compile a Python module on my Red Hat Linux system, but some files are missing.

+Red Hat's RPM for Python doesn't include the +/usr/lib/python1.x/config/ directory, which contains various files required +for compiling Python extensions. +Install the python-devel RPM to get the necessary files. +

+ +Edit this entry / +Log info + +/ Last changed on Tue Jan 26 13:44:04 1999 by +A.M. Kuchling +

+ +


+

5.14. What does "SystemError: _PyImport_FixupExtension: module yourmodule not loaded" mean?

+This means that you have created an extension module named "yourmodule", but your module init function does not initialize with that name. +

+Every module init function will have a line similar to: +

+

+  module = Py_InitModule("yourmodule", yourmodule_functions);
+
+If the string passed to this function is not the same name as your extenion module, the SystemError will be raised. +

+ +Edit this entry / +Log info + +/ Last changed on Thu Mar 25 07:16:08 1999 by +Mark Hammond +

+ +


+

5.15. How to tell "incomplete input" from "invalid input"?

+Sometimes you want to emulate the Python interactive interpreter's +behavior, where it gives you a continuation prompt when the input +is incomplete (e.g. you typed the start of an "if" statement +or you didn't close your parentheses or triple string quotes), +but it gives you a syntax error message immediately when the input +is invalid. +

+In Python you can use the codeop module, which approximates the +parser's behavior sufficiently. IDLE uses this, for example. +

+The easiest way to do it in C is to call PyRun_InteractiveLoop() +(in a separate thread maybe) and let the Python interpreter handle +the input for you. You can also set the PyOS_ReadlineFunctionPointer +to point at your custom input function. See Modules/readline.c and +Parser/myreadline.c for more hints. +

+However sometimes you have to run the embedded Python interpreter +in the same thread as your rest application and you can't allow the +PyRun_InteractiveLoop() to stop while waiting for user input. +The one solution then is to call PyParser_ParseString() +and test for e.error equal to E_EOF (then the input is incomplete). +Sample code fragment, untested, inspired by code from Alex Farber: +

+

+  #include <Python.h>
+  #include <node.h>
+  #include <errcode.h>
+  #include <grammar.h>
+  #include <parsetok.h>
+  #include <compile.h>
+
+
+  int testcomplete(char *code)
+    /* code should end in \n */
+    /* return -1 for error, 0 for incomplete, 1 for complete */
+  {
+    node *n;
+    perrdetail e;
+
+
+    n = PyParser_ParseString(code, &_PyParser_Grammar,
+                             Py_file_input, &e);
+    if (n == NULL) {
+      if (e.error == E_EOF) 
+        return 0;
+      return -1;
+    }
+
+
+    PyNode_Free(n);
+    return 1;
+  }
+
+Another solution is trying to compile the received string with +Py_CompileString(). If it compiles fine - try to execute the returned +code object by calling PyEval_EvalCode(). Otherwise save the input for +later. If the compilation fails, find out if it's an error or just +more input is required - by extracting the message string from the +exception tuple and comparing it to the "unexpected EOF while parsing". +Here is a complete example using the GNU readline library (you may +want to ignore SIGINT while calling readline()): +

+

+  #include <stdio.h>
+  #include <readline.h>
+
+
+  #include <Python.h>
+  #include <object.h>
+  #include <compile.h>
+  #include <eval.h>
+
+
+  int main (int argc, char* argv[])
+  {
+    int i, j, done = 0;                          /* lengths of line, code */
+    char ps1[] = ">>> ";
+    char ps2[] = "... ";
+    char *prompt = ps1;
+    char *msg, *line, *code = NULL;
+    PyObject *src, *glb, *loc;
+    PyObject *exc, *val, *trb, *obj, *dum;
+
+
+    Py_Initialize ();
+    loc = PyDict_New ();
+    glb = PyDict_New ();
+    PyDict_SetItemString (glb, "__builtins__", PyEval_GetBuiltins ());
+
+
+    while (!done)
+    {
+      line = readline (prompt);
+
+
+      if (NULL == line)                          /* CTRL-D pressed */
+      {
+        done = 1;
+      }
+      else
+      {
+        i = strlen (line);
+
+
+        if (i > 0)
+          add_history (line);                    /* save non-empty lines */
+
+
+        if (NULL == code)                        /* nothing in code yet */
+          j = 0;
+        else
+          j = strlen (code);
+
+
+        code = realloc (code, i + j + 2);
+        if (NULL == code)                        /* out of memory */
+          exit (1);
+
+
+        if (0 == j)                              /* code was empty, so */
+          code[0] = '\0';                        /* keep strncat happy */
+
+
+        strncat (code, line, i);                 /* append line to code */
+        code[i + j] = '\n';                      /* append '\n' to code */
+        code[i + j + 1] = '\0';
+
+
+        src = Py_CompileString (code, "<stdin>", Py_single_input);       
+
+
+        if (NULL != src)                         /* compiled just fine - */
+        {
+          if (ps1  == prompt ||                  /* ">>> " or */
+              '\n' == code[i + j - 1])           /* "... " and double '\n' */
+          {                                               /* so execute it */
+            dum = PyEval_EvalCode ((PyCodeObject *)src, glb, loc);
+            Py_XDECREF (dum);
+            Py_XDECREF (src);
+            free (code);
+            code = NULL;
+            if (PyErr_Occurred ())
+              PyErr_Print ();
+            prompt = ps1;
+          }
+        }                                        /* syntax error or E_EOF? */
+        else if (PyErr_ExceptionMatches (PyExc_SyntaxError))           
+        {
+          PyErr_Fetch (&exc, &val, &trb);        /* clears exception! */
+
+
+          if (PyArg_ParseTuple (val, "sO", &msg, &obj) &&
+              !strcmp (msg, "unexpected EOF while parsing")) /* E_EOF */
+          {
+            Py_XDECREF (exc);
+            Py_XDECREF (val);
+            Py_XDECREF (trb);
+            prompt = ps2;
+          }
+          else                                   /* some other syntax error */
+          {
+            PyErr_Restore (exc, val, trb);
+            PyErr_Print ();
+            free (code);
+            code = NULL;
+            prompt = ps1;
+          }
+        }
+        else                                     /* some non-syntax error */
+        {
+          PyErr_Print ();
+          free (code);
+          code = NULL;
+          prompt = ps1;
+        }
+
+
+        free (line);
+      }
+    }
+
+
+    Py_XDECREF(glb);
+    Py_XDECREF(loc);
+    Py_Finalize();
+    exit(0);
+  }
+
+

+ +Edit this entry / +Log info + +/ Last changed on Wed Mar 15 09:47:24 2000 by +Alex Farber +

+ +


+

5.16. How do I debug an extension?

+When using gdb with dynamically loaded extensions, you can't set a +breakpoint in your extension until your extension is loaded. +

+In your .gdbinit file (or interactively), add the command +

+br _PyImport_LoadDynamicModule +

+

+$ gdb /local/bin/python +

+gdb) run myscript.py +

+gdb) continue # repeat until your extension is loaded +

+gdb) finish # so that your extension is loaded +

+gdb) br myfunction.c:50 +

+gdb) continue +

+ +Edit this entry / +Log info + +/ Last changed on Fri Oct 20 11:10:32 2000 by +Joe VanAndel +

+ +


+

5.17. How do I find undefined Linux g++ symbols, __builtin_new or __pure_virtural

+To dynamically load g++ extension modules, you must recompile python, relink python using g++ (change LINKCC in the python Modules Makefile), and link your extension module using g++ (e.g., "g++ -shared -o mymodule.so mymodule.o"). +

+ +Edit this entry / +Log info + +/ Last changed on Sun Jan 14 18:03:51 2001 by +douglas orr +

+ +


+

5.18. How do I define and create objects corresponding to built-in/extension types

+Usually you would like to be able to inherit from a Python type when +you ask this question. The bottom line for Python 2.2 is: types and classes are miscible. You build instances by calling classes, and you can build subclasses to your heart's desire. +

+You need to be careful when instantiating immutable types like integers or strings. See http://www.amk.ca/python/2.2/, section 2, for details. +

+Prior to version 2.2, Python (like Java) insisted that there are first-class and second-class objects (the former are types, the latter classes), and never the twain shall meet. +

+The library has, however, done a good job of providing class wrappers for the more commonly desired objects (see UserDict, UserList and UserString for examples), and more are always welcome if you happen to be in the mood to write code. These wrappers still exist in Python 2.2. +

+ +Edit this entry / +Log info + +/ Last changed on Mon Jun 10 15:14:07 2002 by +Matthias Urlichs +

+ +


+

6. Python's design

+ +
+

6.1. Why isn't there a switch or case statement in Python?

+You can do this easily enough with a sequence of +if... elif... elif... else. There have been some proposals for switch +statement syntax, but there is no consensus (yet) on whether and how +to do range tests. +

+ +Edit this entry / +Log info +

+ +


+

6.2. Why does Python use indentation for grouping of statements?

+Basically I believe that using indentation for grouping is +extremely elegant and contributes a lot to the clarity of the average +Python program. Most people learn to love this feature after a while. +Some arguments for it: +

+Since there are no begin/end brackets there cannot be a disagreement +between grouping perceived by the parser and the human reader. I +remember long ago seeing a C fragment like this: +

+

+        if (x <= y)
+                x++;
+                y--;
+        z++;
+
+and staring a long time at it wondering why y was being decremented +even for x > y... (And I wasn't a C newbie then either.) +

+Since there are no begin/end brackets, Python is much less prone to +coding-style conflicts. In C there are loads of different ways to +place the braces (including the choice whether to place braces around +single statements in certain cases, for consistency). If you're used +to reading (and writing) code that uses one style, you will feel at +least slightly uneasy when reading (or being required to write) +another style. +Many coding styles place begin/end brackets on a line by themself. +This makes programs considerably longer and wastes valuable screen +space, making it harder to get a good overview over a program. +Ideally, a function should fit on one basic tty screen (say, 20 +lines). 20 lines of Python are worth a LOT more than 20 lines of C. +This is not solely due to the lack of begin/end brackets (the lack of +declarations also helps, and the powerful operations of course), but +it certainly helps! +

+ +Edit this entry / +Log info + +/ Last changed on Wed May 21 16:00:15 1997 by +GvR +

+ +


+

6.3. Why are Python strings immutable?

+There are two advantages. One is performance: knowing that a +string is immutable makes it easy to lay it out at construction time +-- fixed and unchanging storage requirements. (This is also one of +the reasons for the distinction between tuples and lists.) The +other is that strings in Python are considered as "elemental" as +numbers. No amount of activity will change the value 8 to anything +else, and in Python, no amount of activity will change the string +"eight" to anything else. (Adapted from Jim Roskind) +

+ +Edit this entry / +Log info +

+ +


+

6.4. Delete

+

+

+ +Edit this entry / +Log info + +/ Last changed on Tue Jan 2 03:05:25 2001 by +Moshe Zadka +

+ +


+

6.5. Why does Python use methods for some functionality (e.g. list.index()) but functions for other (e.g. len(list))?

+The major reason is history. Functions were used for those +operations that were generic for a group of types and which +were intended to work even for objects that didn't have +methods at all (e.g. numbers before type/class unification +began, or tuples). +

+It is also convenient to have a function that can readily be applied +to an amorphous collection of objects when you use the functional features of Python (map(), apply() et al). +

+In fact, implementing len(), max(), min() as a built-in function is +actually less code than implementing them as methods for each type. +One can quibble about individual cases but it's a part of Python, +and it's too late to change such things fundamentally now. The +functions have to remain to avoid massive code breakage. +

+Note that for string operations Python has moved from external functions +(the string module) to methods. However, len() is still a function. +

+ +Edit this entry / +Log info + +/ Last changed on Thu May 30 14:08:58 2002 by +Steve Holden +

+ +


+

6.6. Why can't I derive a class from built-in types (e.g. lists or files)?

+As of Python 2.2, you can derive from built-in types. For previous versions, the answer is: +

+This is caused by the relatively late addition of (user-defined) +classes to the language -- the implementation framework doesn't easily +allow it. See the answer to question 4.2 for a work-around. This +may be fixed in the (distant) future. +

+ +Edit this entry / +Log info + +/ Last changed on Thu May 23 02:53:22 2002 by +Neal Norwitz +

+ +


+

6.7. Why must 'self' be declared and used explicitly in method definitions and calls?

+So, is your current programming language C++ or Java? :-) +When classes were added to Python, this was (again) the simplest way of +implementing methods without too many changes to the interpreter. The +idea was borrowed from Modula-3. It turns out to be very useful, for +a variety of reasons. +

+First, it makes it more obvious that you are using a method or +instance attribute instead of a local variable. Reading "self.x" or +"self.meth()" makes it absolutely clear that an instance variable or +method is used even if you don't know the class definition by heart. +In C++, you can sort of tell by the lack of a local variable +declaration (assuming globals are rare or easily recognizable) -- but +in Python, there are no local variable declarations, so you'd have to +look up the class definition to be sure. +

+Second, it means that no special syntax is necessary if you want to +explicitly reference or call the method from a particular class. In +C++, if you want to use a method from base class that is overridden in +a derived class, you have to use the :: operator -- in Python you can +write baseclass.methodname(self, <argument list>). This is +particularly useful for __init__() methods, and in general in cases +where a derived class method wants to extend the base class method of +the same name and thus has to call the base class method somehow. +

+Lastly, for instance variables, it solves a syntactic problem with +assignment: since local variables in Python are (by definition!) those +variables to which a value assigned in a function body (and that +aren't explicitly declared global), there has to be some way to tell +the interpreter that an assignment was meant to assign to an instance +variable instead of to a local variable, and it should preferably be +syntactic (for efficiency reasons). C++ does this through +declarations, but Python doesn't have declarations and it would be a +pity having to introduce them just for this purpose. Using the +explicit "self.var" solves this nicely. Similarly, for using instance +variables, having to write "self.var" means that references to +unqualified names inside a method don't have to search the instance's +directories. +

+ +Edit this entry / +Log info + +/ Last changed on Fri Jan 12 08:01:50 2001 by +Steve Holden +

+ +


+

6.8. Can't you emulate threads in the interpreter instead of relying on an OS-specific thread implementation?

+Answer 1: Unfortunately, the interpreter pushes at least one C stack +frame for each Python stack frame. Also, extensions can call back into +Python at almost random moments. Therefore a complete threads +implementation requires thread support for C. +

+Answer 2: Fortunately, there is Stackless Python, which has a completely redesigned interpreter loop that avoids the C stack. It's still experimental but looks very promising. Although it is binary compatible with standard Python, it's still unclear whether Stackless will make it into the core -- maybe it's just too revolutionary. Stackless Python currently lives here: http://www.stackless.com. A microthread implementation that uses it can be found here: http://world.std.com/~wware/uthread.html. +

+ +Edit this entry / +Log info + +/ Last changed on Sat Apr 15 08:18:16 2000 by +Just van Rossum +

+ +


+

6.9. Why can't lambda forms contain statements?

+Python lambda forms cannot contain statements because Python's +syntactic framework can't handle statements nested inside expressions. +

+However, in Python, this is not a serious problem. Unlike lambda +forms in other languages, where they add functionality, Python lambdas +are only a shorthand notation if you're too lazy to define a function. +

+Functions are already first class objects in Python, and can be +declared in a local scope. Therefore the only advantage of using a +lambda form instead of a locally-defined function is that you don't need to invent a name for the function -- but that's just a local variable to which the function object (which is exactly the same type of object that a lambda form yields) is assigned! +

+ +Edit this entry / +Log info + +/ Last changed on Sun Jun 14 14:15:17 1998 by +Tim Peters +

+ +


+

6.10. [deleted]

+[lambda vs non-nested scopes used to be here] +

+ +Edit this entry / +Log info + +/ Last changed on Thu Mar 21 05:20:56 2002 by +Erno Kuusela +

+ +


+

6.11. [deleted]

+[recursive functions vs non-nested scopes used to be here] +

+ +Edit this entry / +Log info + +/ Last changed on Thu Mar 21 05:22:04 2002 by +Erno Kuusela +

+ +


+

6.12. Why is there no more efficient way of iterating over a dictionary than first constructing the list of keys()?

+As of Python 2.2, you can now iterate over a dictionary directly, +using the new implied dictionary iterator: +

+

+    for k in d: ...
+
+There are also methods returning iterators over the values and items: +

+

+    for k in d.iterkeys(): # same as above
+    for v in d.itervalues(): # iterate over values
+    for k, v in d.iteritems(): # iterate over items
+
+All these require that you do not modify the dictionary during the loop. +

+For previous Python versions, the following defense should do: +

+Have you tried it? I bet it's fast enough for your purposes! In +most cases such a list takes only a few percent of the space occupied +by the dictionary. Apart from the fixed header, +the list needs only 4 bytes (the size of a pointer) per +key. A dictionary uses 12 bytes per key plus between 30 and 70 +percent hash table overhead, plus the space for the keys and values. +By necessity, all keys are distinct objects, and a string object (the most +common key type) costs at least 20 bytes plus the length of the +string. Add to that the values contained in the dictionary, and you +see that 4 bytes more per item really isn't that much more memory... +

+A call to dict.keys() makes one fast scan over the dictionary +(internally, the iteration function does exist) copying the pointers +to the key objects into a pre-allocated list object of the right size. +The iteration time isn't lost (since you'll have to iterate anyway -- +unless in the majority of cases your loop terminates very prematurely +(which I doubt since you're getting the keys in random order). +

+I don't expose the dictionary iteration operation to Python +programmers because the dictionary shouldn't be modified during the +entire iteration -- if it is, there's a small chance that the +dictionary is reorganized because the hash table becomes too full, and +then the iteration may miss some items and see others twice. Exactly +because this only occurs rarely, it would lead to hidden bugs in +programs: it's easy never to have it happen during test runs if you +only insert or delete a few items per iteration -- but your users will +surely hit upon it sooner or later. +

+ +Edit this entry / +Log info + +/ Last changed on Fri May 24 21:24:08 2002 by +GvR +

+ +


+

6.13. Can Python be compiled to machine code, C or some other language?

+Not easily. Python's high level data types, dynamic typing of +objects and run-time invocation of the interpreter (using eval() or +exec) together mean that a "compiled" Python program would probably +consist mostly of calls into the Python run-time system, even for +seemingly simple operations like "x+1". +

+Several projects described in the Python newsgroup or at past +Python conferences have shown that this approach is feasible, +although the speedups reached so far are only modest (e.g. 2x). +JPython uses the same strategy for compiling to Java bytecode. +(Jim Hugunin has demonstrated that in combination with whole-program +analysis, speedups of 1000x are feasible for small demo programs. +See the website for the 1997 Python conference.) +

+Internally, Python source code is always translated into a "virtual +machine code" or "byte code" representation before it is interpreted +(by the "Python virtual machine" or "bytecode interpreter"). In order +to avoid the overhead of parsing and translating modules that rarely +change over and over again, this byte code is written on a file whose +name ends in ".pyc" whenever a module is parsed (from a file whose +name ends in ".py"). When the corresponding .py file is changed, it +is parsed and translated again and the .pyc file is rewritten. +

+There is no performance difference once the .pyc file has been loaded +(the bytecode read from the .pyc file is exactly the same as the bytecode +created by direct translation). The only difference is that loading +code from a .pyc file is faster than parsing and translating a .py +file, so the presence of precompiled .pyc files will generally improve +start-up time of Python scripts. If desired, the Lib/compileall.py +module/script can be used to force creation of valid .pyc files for a +given set of modules. +

+Note that the main script executed by Python, even if its filename +ends in .py, is not compiled to a .pyc file. It is compiled to +bytecode, but the bytecode is not saved to a file. +

+If you are looking for a way to translate Python programs in order to +distribute them in binary form, without the need to distribute the +interpreter and library as well, have a look at the freeze.py script +in the Tools/freeze directory. This creates a single binary file +incorporating your program, the Python interpreter, and those parts of +the Python library that are needed by your program. Of course, the +resulting binary will only run on the same type of platform as that +used to create it. +

+Newsflash: there are now several programs that do this, to some extent. +Look for Psyco, Pyrex, PyInline, Py2Cmod, and Weave. +

+ +Edit this entry / +Log info + +/ Last changed on Fri May 24 21:26:19 2002 by +GvR +

+ +


+

6.14. How does Python manage memory?

+The details of Python memory management depend on the implementation. +The standard Python implementation (the C implementation) uses reference +counting and another mechanism to collect reference cycles. +

+Jython relies on the Java runtime; so it uses +the JVM's garbage collector. This difference can cause some subtle +porting problems if your Python code depends on the behavior of +the reference counting implementation. +

+The reference cycle collector was added in CPython 2.0. It +periodically executes a cycle detection algorithm which looks for inaccessible cycles and deletes the objects involved. A new gc module provides functions to perform a garbage collection, obtain debugging statistics, and tuning the collector's parameters. +

+The detection of cycles can be disabled when Python is compiled, if you can't afford even a tiny speed penalty or suspect that the cycle collection is buggy, by specifying the "--without-cycle-gc" switch when running the configure script. +

+Sometimes objects get stuck in "tracebacks" temporarily and hence are not deallocated when you might expect. Clear the tracebacks via +

+

+       import sys
+       sys.exc_traceback = sys.last_traceback = None
+
+Tracebacks are used for reporting errors and implementing debuggers and related things. They contain a portion of the program state extracted during the handling of an exception (usually the most recent exception). +

+In the absence of circularities and modulo tracebacks, Python programs need not explicitly manage memory. +

+Why python doesn't use a more traditional garbage collection +scheme? For one thing, unless this were +added to C as a standard feature, it's a portability pain in the ass. +And yes, I know about the Xerox library. It has bits of assembler +code for most common platforms. Not for all. And although it is +mostly transparent, it isn't completely transparent (when I once +linked Python with it, it dumped core). +

+Traditional GC also becomes a problem when Python gets embedded into +other applications. While in a stand-alone Python it may be fine to +replace the standard malloc() and free() with versions provided by the +GC library, an application embedding Python may want to have its own +substitute for malloc() and free(), and may not want Python's. Right +now, Python works with anything that implements malloc() and free() +properly. +

+In Jython, the following code (which is +fine in C Python) will probably run out of file descriptors long before +it runs out of memory: +

+

+        for file in <very long list of files>:
+                f = open(file)
+                c = f.read(1)
+
+Using the current reference counting and destructor scheme, each new +assignment to f closes the previous file. Using GC, this is not +guaranteed. Sure, you can think of ways to fix this. But it's not +off-the-shelf technology. If you want to write code that will +work with any Python implementation, you should explicitly close +the file; this will work regardless of GC: +

+

+       for file in <very long list of files>:
+                f = open(file)
+                c = f.read(1)
+                f.close()
+
+

+ +Edit this entry / +Log info + +/ Last changed on Thu Mar 21 05:35:38 2002 by +Erno Kuusela +

+ +


+

6.15. Why are there separate tuple and list data types?

+This is done so that tuples can be immutable while lists are mutable. +

+Immutable tuples are useful in situations where you need to pass a few +items to a function and don't want the function to modify the tuple; +for example, +

+

+	point1 = (120, 140)
+	point2 = (200, 300)
+	record(point1, point2)
+	draw(point1, point2)
+
+You don't want to have to think about what would happen if record() +changed the coordinates -- it can't, because the tuples are immutable. +

+On the other hand, when creating large lists dynamically, it is +absolutely crucial that they are mutable -- adding elements to a tuple +one by one requires using the concatenation operator, which makes it +quadratic in time. +

+As a general guideline, use tuples like you would use structs in C or +records in Pascal, use lists like (variable length) arrays. +

+ +Edit this entry / +Log info + +/ Last changed on Fri May 23 15:26:03 1997 by +GvR +

+ +


+

6.16. How are lists implemented?

+Despite what a Lisper might think, Python's lists are really +variable-length arrays. The implementation uses a contiguous +array of references to other objects, and keeps a pointer +to this array (as well as its length) in a list head structure. +

+This makes indexing a list (a[i]) an operation whose cost is +independent of the size of the list or the value of the index. +

+When items are appended or inserted, the array of references is resized. +Some cleverness is applied to improve the performance of appending +items repeatedly; when the array must be grown, some extra space +is allocated so the next few times don't require an actual resize. +

+ +Edit this entry / +Log info + +/ Last changed on Fri May 23 15:32:24 1997 by +GvR +

+ +


+

6.17. How are dictionaries implemented?

+Python's dictionaries are implemented as resizable hash tables. +

+Compared to B-trees, this gives better performance for lookup +(the most common operation by far) under most circumstances, +and the implementation is simpler. +

+ +Edit this entry / +Log info + +/ Last changed on Fri May 23 23:51:14 1997 by +Vladimir Marangozov +

+ +


+

6.18. Why must dictionary keys be immutable?

+The hash table implementation of dictionaries uses a hash value +calculated from the key value to find the key. If the key were +a mutable object, its value could change, and thus its hash could +change. But since whoever changes the key object can't tell that +is incorporated in a dictionary, it can't move the entry around in +the dictionary. Then, when you try to look up the same object +in the dictionary, it won't be found, since its hash value is different; +and if you try to look up the old value, it won't be found either, +since the value of the object found in that hash bin differs. +

+If you think you need to have a dictionary indexed with a list, +try to use a tuple instead. The function tuple(l) creates a tuple +with the same entries as the list l. +

+Some unacceptable solutions that have been proposed: +

+- Hash lists by their address (object ID). This doesn't work because +if you construct a new list with the same value it won't be found; +e.g., +

+

+  d = {[1,2]: '12'}
+  print d[[1,2]]
+
+will raise a KeyError exception because the id of the [1,2] used +in the second line differs from that in the first line. +In other words, dictionary keys should be compared using '==', not using 'is'. +

+- Make a copy when using a list as a key. This doesn't work because +the list (being a mutable object) could contain a reference to itself, +and then the copying code would run into an infinite loop. +

+- Allow lists as keys but tell the user not to modify them. This would +allow a class of hard-to-track bugs in programs that I'd rather not see; +it invalidates an important invariant of dictionaries (every value in +d.keys() is usable as a key of the dictionary). +

+- Mark lists as read-only once they are used as a dictionary key. +The problem is that it's not just the top-level object that could change +its value; you could use a tuple containing a list as a key. Entering +anything as a key into a dictionary would require marking all objects +reachable from there as read-only -- and again, self-referential objects +could cause an infinite loop again (and again and again). +

+There is a trick to get around this if you need to, but +use it at your own risk: You +can wrap a mutable structure inside a class instance which +has both a __cmp__ and a __hash__ method. +

+

+   class listwrapper:
+        def __init__(self, the_list):
+              self.the_list = the_list
+        def __cmp__(self, other):
+              return self.the_list == other.the_list
+        def __hash__(self):
+              l = self.the_list
+              result = 98767 - len(l)*555
+              for i in range(len(l)):
+                   try:
+                        result = result + (hash(l[i]) % 9999999) * 1001 + i
+                   except:
+                        result = (result % 7777777) + i * 333
+              return result
+
+Note that the hash computation is complicated by the +possibility that some members of the list may be unhashable +and also by the possibility of arithmetic overflow. +

+You must make +sure that the hash value for all such wrapper objects that reside in a +dictionary (or other hash based structure), remain fixed while +the object is in the dictionary (or other structure). +

+Furthermore it must always be the case that if +o1 == o2 (ie o1.__cmp__(o2)==0) then hash(o1)==hash(o2) +(ie, o1.__hash__() == o2.__hash__()), regardless of whether +the object is in a dictionary or not. +If you fail to meet these restrictions dictionaries and other +hash based structures may misbehave! +

+In the case of listwrapper above whenever the wrapper +object is in a dictionary the wrapped list must not change +to avoid anomalies. Don't do this unless you are prepared +to think hard about the requirements and the consequences +of not meeting them correctly. You've been warned! +

+ +Edit this entry / +Log info + +/ Last changed on Thu Jul 10 10:08:40 1997 by +aaron watters +

+ +


+

6.19. How the heck do you make an array in Python?

+["this", 1, "is", "an", "array"] +

+Lists are arrays in the C or Pascal sense of the word (see question +6.16). The array module also provides methods for creating arrays +of fixed types with compact representations (but they are slower to +index than lists). Also note that the Numerics extensions and others +define array-like structures with various characteristics as well. +

+To get Lisp-like lists, emulate cons cells +

+

+    lisp_list = ("like",  ("this",  ("example", None) ) )
+
+using tuples (or lists, if you want mutability). Here the analogue +of lisp car is lisp_list[0] and the analogue of cdr is lisp_list[1]. +Only do this if you're sure you really need to (it's usually a lot +slower than using Python lists). +

+Think of Python lists as mutable heterogeneous arrays of +Python objects (say that 10 times fast :) ). +

+ +Edit this entry / +Log info + +/ Last changed on Wed Aug 13 07:08:27 1997 by +aaron watters +

+ +


+

6.20. Why doesn't list.sort() return the sorted list?

+In situations where performance matters, making a copy of the list +just to sort it would be wasteful. Therefore, list.sort() sorts +the list in place. In order to remind you of that fact, it does +not return the sorted list. This way, you won't be fooled into +accidentally overwriting a list when you need a sorted copy but also +need to keep the unsorted version around. +

+As a result, here's the idiom to iterate over the keys of a dictionary +in sorted order: +

+

+	keys = dict.keys()
+	keys.sort()
+	for key in keys:
+		...do whatever with dict[key]...
+
+

+ +Edit this entry / +Log info + +/ Last changed on Thu Dec 2 17:01:52 1999 by +Fred L. Drake, Jr. +

+ +


+

6.21. How do you specify and enforce an interface spec in Python?

+An interfaces specification for a module as provided +by languages such as C++ and java describes the prototypes +for the methods and functions of the module. Many feel +that compile time enforcement of interface specifications +help aid in the construction of large programs. Python +does not support interface specifications directly, but many +of their advantages can be obtained by an appropriate +test discipline for components, which can often be very +easily accomplished in Python. There is also a tool, PyChecker, +which can be used to find problems due to subclassing. +

+A good test suite for a module can at +once provide a regression test and serve as a module interface +specification (even better since it also gives example usage). Look to +many of the standard libraries which often have a "script +interpretation" which provides a simple "self test." Even +modules which use complex external interfaces can often +be tested in isolation using trivial "stub" emulations of the +external interface. +

+An appropriate testing discipline (if enforced) can help +build large complex applications in Python as well as having interface +specifications would do (or better). Of course Python allows you +to get sloppy and not do it. Also you might want to design +your code with an eye to make it easily tested. +

+ +Edit this entry / +Log info + +/ Last changed on Thu May 23 03:05:29 2002 by +Neal Norwitz +

+ +


+

6.22. Why do all classes have the same type? Why do instances all have the same type?

+The Pythonic use of the word "type" is quite different from +common usage in much of the rest of the programming language +world. A "type" in Python is a description for an object's operations +as implemented in C. All classes have the same operations +implemented in C which sometimes "call back" to differing program +fragments implemented in Python, and hence all classes have the +same type. Similarly at the C level all class instances have the +same C implementation, and hence all instances have the same +type. +

+Remember that in Python usage "type" refers to a C implementation +of an object. To distinguish among instances of different classes +use Instance.__class__, and also look to 4.47. Sorry for the +terminological confusion, but at this point in Python's development +nothing can be done! +

+ +Edit this entry / +Log info + +/ Last changed on Tue Jul 1 12:35:47 1997 by +aaron watters +

+ +


+

6.23. Why isn't all memory freed when Python exits?

+Objects referenced from Python module global name spaces are +not always deallocated when Python exits. +

+This may happen if there are circular references (see question +4.17). There are also certain bits of memory that are allocated +by the C library that are impossible to free (e.g. a tool +like Purify will complain about these). +

+But in general, Python 1.5 and beyond +(in contrast with earlier versions) is quite agressive about +cleaning up memory on exit. +

+If you want to force Python to delete certain things on deallocation +use the sys.exitfunc hook to force those deletions. For example +if you are debugging an extension module using a memory analysis +tool and you wish to make Python deallocate almost everything +you might use an exitfunc like this one: +

+

+  import sys
+
+
+  def my_exitfunc():
+       print "cleaning up"
+       import sys
+       # do order dependant deletions here
+       ...
+       # now delete everything else in arbitrary order
+       for x in sys.modules.values():
+            d = x.__dict__
+            for name in d.keys():
+                 del d[name]
+
+
+  sys.exitfunc = my_exitfunc
+
+Other exitfuncs can be less drastic, of course. +

+(In fact, this one just does what Python now already does itself; +but the example of using sys.exitfunc to force cleanups is still +useful.) +

+ +Edit this entry / +Log info + +/ Last changed on Tue Sep 29 09:46:26 1998 by +GvR +

+ +


+

6.24. Why no class methods or mutable class variables?

+The notation +

+

+    instance.attribute(arg1, arg2)
+
+usually translates to the equivalent of +

+

+    Class.attribute(instance, arg1, arg2)
+
+where Class is a (super)class of instance. Similarly +

+

+    instance.attribute = value
+
+sets an attribute of an instance (overriding any attribute of a class +that instance inherits). +

+Sometimes programmers want to have +different behaviours -- they want a method which does not bind +to the instance and a class attribute which changes in place. +Python does not preclude these behaviours, but you have to +adopt a convention to implement them. One way to accomplish +this is to use "list wrappers" and global functions. +

+

+   def C_hello():
+         print "hello"
+
+
+   class C:
+        hello = [C_hello]
+        counter = [0]
+
+
+    I = C()
+
+Here I.hello[0]() acts very much like a "class method" and +I.counter[0] = 2 alters C.counter (and doesn't override it). +If you don't understand why you'd ever want to do this, that's +because you are pure of mind, and you probably never will +want to do it! This is dangerous trickery, not recommended +when avoidable. (Inspired by Tim Peter's discussion.) +

+In Python 2.2, you can do this using the new built-in operations +classmethod and staticmethod. +See http://www.python.org/2.2/descrintro.html#staticmethods +

+ +Edit this entry / +Log info + +/ Last changed on Tue Sep 11 15:59:37 2001 by +GvR +

+ +


+

6.25. Why are default values sometimes shared between objects?

+It is often expected that a function CALL creates new objects for default +values. This is not what happens. Default values are created when the +function is DEFINED, that is, there is only one such object that all +functions refer to. If that object is changed, subsequent calls to the +function will refer to this changed object. By definition, immutable objects +(like numbers, strings, tuples, None) are safe from change. Changes to mutable +objects (like dictionaries, lists, class instances) is what causes the +confusion. +

+Because of this feature it is good programming practice not to use mutable +objects as default values, but to introduce them in the function. +Don't write: +

+

+	def foo(dict={}):  # XXX shared reference to one dict for all calls
+	    ...
+
+but: +
+	def foo(dict=None):
+		if dict is None:
+			dict = {} # create a new dict for local namespace
+
+See page 182 of "Internet Programming with Python" for one discussion +of this feature. Or see the top of page 144 or bottom of page 277 in +"Programming Python" for another discussion. +

+ +Edit this entry / +Log info + +/ Last changed on Sat Aug 16 07:03:35 1997 by +Case Roole +

+ +


+

6.26. Why no goto?

+Actually, you can use exceptions to provide a "structured goto" +that even works across function calls. Many feel that exceptions +can conveniently emulate all reasonable uses of the "go" or "goto" +constructs of C, Fortran, and other languages. For example: +

+

+   class label: pass # declare a label
+   try:
+        ...
+        if (condition): raise label() # goto label
+        ...
+   except label: # where to goto
+        pass
+   ...
+
+This doesn't allow you to jump into the middle of a loop, but +that's usually considered an abuse of goto anyway. Use sparingly. +

+ +Edit this entry / +Log info + +/ Last changed on Wed Sep 10 07:16:44 1997 by +aaron watters +

+ +


+

6.27. How do you make a higher order function in Python?

+You have two choices: you can use default arguments and override +them or you can use "callable objects." For example suppose you +wanted to define linear(a,b) which returns a function f where f(x) +computes the value a*x+b. Using default arguments: +

+

+     def linear(a,b):
+         def result(x, a=a, b=b):
+             return a*x + b
+         return result
+
+Or using callable objects: +

+

+     class linear:
+        def __init__(self, a, b):
+            self.a, self.b = a,b
+        def __call__(self, x):
+            return self.a * x + self.b
+
+In both cases: +

+

+     taxes = linear(0.3,2)
+
+gives a callable object where taxes(10e6) == 0.3 * 10e6 + 2. +

+The defaults strategy has the disadvantage that the default arguments +could be accidentally or maliciously overridden. The callable objects +approach has the disadvantage that it is a bit slower and a bit +longer. Note however that a collection of callables can share +their signature via inheritance. EG +

+

+      class exponential(linear):
+         # __init__ inherited
+         def __call__(self, x):
+             return self.a * (x ** self.b)
+
+On comp.lang.python, zenin@bawdycaste.org points out that +an object can encapsulate state for several methods in order +to emulate the "closure" concept from functional programming +languages, for example: +

+

+    class counter:
+        value = 0
+        def set(self, x): self.value = x
+        def up(self): self.value=self.value+1
+        def down(self): self.value=self.value-1
+
+
+    count = counter()
+    inc, dec, reset = count.up, count.down, count.set
+
+Here inc, dec and reset act like "functions which share the +same closure containing the variable count.value" (if you +like that way of thinking). +

+ +Edit this entry / +Log info + +/ Last changed on Fri Sep 25 08:38:35 1998 by +Aaron Watters +

+ +


+

6.28. Why do I get a SyntaxError for a 'continue' inside a 'try'?

+This is an implementation limitation, +caused by the extremely simple-minded +way Python generates bytecode. The try block pushes something on the +"block stack" which the continue would have to pop off again. The +current code generator doesn't have the data structures around so that +'continue' can generate the right code. +

+Note that JPython doesn't have this restriction! +

+ +Edit this entry / +Log info + +/ Last changed on Fri May 22 15:01:07 1998 by +GvR +

+ +


+

6.29. Why can't raw strings (r-strings) end with a backslash?

+More precisely, they can't end with an odd number of backslashes: +the unpaired backslash at the end escapes the closing quote character, +leaving an unterminated string. +

+Raw strings were designed to ease creating input for processors (chiefly +regular expression engines) that want to do their own backslash escape processing. Such processors consider an unmatched trailing backslash to be an error anyway, so raw strings disallow that. In return, they allow you to pass on the string quote character by escaping it with a backslash. These rules work well when r-strings are used for their intended purpose. +

+If you're trying to build Windows pathnames, note that all Windows system calls accept forward slashes too: +

+

+    f = open("/mydir/file.txt") # works fine!
+
+If you're trying to build a pathname for a DOS command, try e.g. one of +

+

+    dir = r"\this\is\my\dos\dir" "\\"
+    dir = r"\this\is\my\dos\dir\ "[:-1]
+    dir = "\\this\\is\\my\\dos\\dir\\"
+
+

+ +Edit this entry / +Log info + +/ Last changed on Mon Jul 13 20:50:20 1998 by +Tim Peters +

+ +


+

6.30. Why can't I use an assignment in an expression?

+Many people used to C or Perl complain that they want to be able to +use e.g. this C idiom: +

+

+    while (line = readline(f)) {
+        ...do something with line...
+    }
+
+where in Python you're forced to write this: +

+

+    while 1:
+        line = f.readline()
+        if not line:
+            break
+        ...do something with line...
+
+This issue comes up in the Python newsgroup with alarming frequency +-- search Deja News for past messages about assignment expression. +The reason for not allowing assignment in Python expressions +is a common, hard-to-find bug in those other languages, +caused by this construct: +

+

+    if (x = 0) {
+        ...error handling...
+    }
+    else {
+        ...code that only works for nonzero x...
+    }
+
+Many alternatives have been proposed. Most are hacks that save some +typing but use arbitrary or cryptic syntax or keywords, +and fail the simple criterion that I use for language change proposals: +it should intuitively suggest the proper meaning to a human reader +who has not yet been introduced with the construct. +

+The earliest time something can be done about this will be with +Python 2.0 -- if it is decided that it is worth fixing. +An interesting phenomenon is that most experienced Python programmers +recognize the "while 1" idiom and don't seem to be missing the +assignment in expression construct much; it's only the newcomers +who express a strong desire to add this to the language. +

+One fairly elegant solution would be to introduce a new operator +for assignment in expressions spelled ":=" -- this avoids the "=" +instead of "==" problem. It would have the same precedence +as comparison operators but the parser would flag combination with +other comparisons (without disambiguating parentheses) as an error. +

+Finally -- there's an alternative way of spelling this that seems +attractive but is generally less robust than the "while 1" solution: +

+

+    line = f.readline()
+    while line:
+        ...do something with line...
+        line = f.readline()
+
+The problem with this is that if you change your mind about exactly +how you get the next line (e.g. you want to change it into +sys.stdin.readline()) you have to remember to change two places +in your program -- the second one hidden at the bottom of the loop. +

+ +Edit this entry / +Log info + +/ Last changed on Tue May 18 00:57:41 1999 by +Andrew Dalke +

+ +


+

6.31. Why doesn't Python have a "with" statement like some other languages?

+Basically, because such a construct would be terribly ambiguous. Thanks to Carlos Ribeiro for the following remarks: +

+Some languages, such as Object Pascal, Delphi, and C++, use static types. So it is possible to know, in an unambiguous way, what member is being assigned in a "with" clause. This is the main point - the compiler always knows the scope of every variable at compile time. +

+Python uses dynamic types. It is impossible to know in advance which +attribute will be referenced at runtime. Member attributes may be added or removed from objects on the fly. This would make it impossible to know, from a simple reading, what attribute is being referenced - a local one, a global one, or a member attribute. +

+For instance, take the following snippet (it is incomplete btw, just to +give you the idea): +

+

+   def with_is_broken(a):
+      with a:
+         print x
+
+The snippet assumes that "a" must have a member attribute called "x". +However, there is nothing in Python that guarantees that. What should +happen if "a" is, let us say, an integer? And if I have a global variable named "x", will it end up being used inside the with block? As you see, the dynamic nature of Python makes such choices much harder. +

+The primary benefit of "with" and similar language features (reduction of code volume) can, however, easily be achieved in Python by assignment. Instead of: +

+

+    function(args).dict[index][index].a = 21
+    function(args).dict[index][index].b = 42
+    function(args).dict[index][index].c = 63
+
+would become: +

+

+    ref = function(args).dict[index][index]
+    ref.a = 21
+    ref.b = 42
+    ref.c = 63
+
+This also has the happy side-effect of increasing execution speed, since name bindings are resolved at run-time in Python, and the second method only needs to perform the resolution once. If the referenced object does not have a, b and c attributes, of course, the end result is still a run-time exception. +

+ +Edit this entry / +Log info + +/ Last changed on Fri Jan 11 14:32:58 2002 by +Steve Holden +

+ +


+

6.32. Why are colons required for if/while/def/class?

+The colon is required primarily to enhance readability (one of the +results of the experimental ABC language). Consider this: +

+

+    if a==b
+        print a
+
+versus +

+

+    if a==b:
+        print a
+
+Notice how the second one is slightly easier to read. Notice further how +a colon sets off the example in the second line of this FAQ answer; it's +a standard usage in English. Finally, the colon makes it easier for +editors with syntax highlighting. +

+ +Edit this entry / +Log info + +/ Last changed on Mon Jun 3 07:22:57 2002 by +Matthias Urlichs +

+ +


+

6.33. Can't we get rid of the Global Interpreter Lock?

+The Global Interpreter Lock (GIL) is often seen as a hindrance to +Python's deployment on high-end multiprocessor server machines, +because a multi-threaded Python program effectively only uses +one CPU, due to the insistence that (almost) all Python code +can only run while the GIL is held. +

+Back in the days of Python 1.5, Greg Stein actually implemented +a comprehensive patch set ("free threading") +that removed the GIL, replacing it with +fine-grained locking. Unfortunately, even on Windows (where locks +are very efficient) this ran ordinary Python code about twice as +slow as the interpreter using the GIL. On Linux the performance +loss was even worse (pthread locks aren't as efficient). +

+Since then, the idea of getting rid of the GIL has occasionally +come up but nobody has found a way to deal with the expected slowdown; +Greg's free threading patch set has not been kept up-to-date for +later Python versions. +

+This doesn't mean that you can't make good use of Python on +multi-CPU machines! You just have to be creative with dividing +the work up between multiple processes rather than multiple +threads. +

+

+It has been suggested that the GIL should be a per-interpreter-state +lock rather than truly global; interpreters then wouldn't be able +to share objects. Unfortunately, this isn't likely to happen either. +

+It would be a tremendous amount of work, because many object +implementations currently have global state. E.g. small ints and +small strings are cached; these caches would have to be moved to the +interpreter state. Other object types have their own free list; these +free lists would have to be moved to the interpreter state. And so +on. +

+And I doubt that it can even be done in finite time, because the same +problem exists for 3rd party extensions. It is likely that 3rd party +extensions are being written at a faster rate than you can convert +them to store all their global state in the interpreter state. +

+And finally, once you have multiple interpreters not sharing any +state, what have you gained over running each interpreter +in a separate process? +

+ +Edit this entry / +Log info + +/ Last changed on Fri Feb 7 16:34:01 2003 by +GvR +

+ +


+

7. Using Python on non-UNIX platforms

+ +
+

7.1. Is there a Mac version of Python?

+Yes, it is maintained by Jack Jansen. See Jack's MacPython Page: +

+

+  http://www.cwi.nl/~jack/macpython.html
+
+

+ +Edit this entry / +Log info + +/ Last changed on Fri May 4 09:33:42 2001 by +GvR +

+ +


+

7.2. Are there DOS and Windows versions of Python?

+Yes. The core windows binaries are available from http://www.python.org/windows/. There is a plethora of Windows extensions available, including a large number of not-always-compatible GUI toolkits. The core binaries include the standard Tkinter GUI extension. +

+Most windows extensions can be found (or referenced) at http://www.python.org/windows/ +

+Windows 3.1/DOS support seems to have dropped off recently. You may need to settle for an old version of Python one these platforms. One such port is WPY +

+WPY: Ports to DOS, Windows 3.1(1), Windows 95, Windows NT and OS/2. +Also contains a GUI package that offers portability between Windows +(not DOS) and Unix, and native look and feel on both. +ftp://ftp.python.org/pub/python/wpy/. +

+ +Edit this entry / +Log info + +/ Last changed on Tue Jun 2 20:21:57 1998 by +Mark Hammond +

+ +


+

7.3. Is there an OS/2 version of Python?

+Yes, see http://www.python.org/download/download_os2.html. +

+ +Edit this entry / +Log info + +/ Last changed on Tue Sep 7 11:33:16 1999 by +GvR +

+ +


+

7.4. Is there a VMS version of Python?

+Jean-François Piéronne has ported 2.1.3 to OpenVMS. It can be found at +<http://vmspython.dyndns.org/>. +

+ +Edit this entry / +Log info + +/ Last changed on Thu Sep 19 15:40:38 2002 by +Skip Montanaro +

+ +


+

7.5. What about IBM mainframes, or other non-UNIX platforms?

+I haven't heard about these, except I remember hearing about an +OS/9 port and a port to Vxworks (both operating systems for embedded +systems). If you're interested in any of this, go directly to the +newsgroup and ask there, you may find exactly what you need. For +example, a port to MPE/iX 5.0 on HP3000 computers was just announced, +see http://www.allegro.com/software/. +

+On the IBM mainframe side, for Z/OS there's a port of python 1.4 that goes with their open-unix package, formely OpenEdition MVS, (http://www-1.ibm.com/servers/eserver/zseries/zos/unix/python.html). On a side note, there's also a java vm ported - so, in theory, jython could run too. +

+ +Edit this entry / +Log info + +/ Last changed on Mon Nov 18 03:18:39 2002 by +Bruno Jessen +

+ +


+

7.6. Where are the source or Makefiles for the non-UNIX versions?

+The standard sources can (almost) be used. Additional sources can +be found in the platform-specific subdirectories of the distribution. +

+ +Edit this entry / +Log info +

+ +


+

7.7. What is the status and support for the non-UNIX versions?

+I don't have access to most of these platforms, so in general I am +dependent on material submitted by volunteers. However I strive to +integrate all changes needed to get it to compile on a particular +platform back into the standard sources, so porting of the next +version to the various non-UNIX platforms should be easy. +(Note that Linux is classified as a UNIX platform here. :-) +

+Some specific platforms: +

+Windows: all versions (95, 98, ME, NT, 2000, XP) are supported, +all python.org releases come with a Windows installer. +

+MacOS: Jack Jansen does an admirable job of keeping the Mac version +up to date (both MacOS X and older versions); +see http://www.cwi.nl/~jack/macpython.html +

+For all supported platforms, see http://www.python.org/download/ +(follow the link to "Other platforms" for less common platforms) +

+ +Edit this entry / +Log info + +/ Last changed on Fri May 24 21:34:24 2002 by +GvR +

+ +


+

7.8. I have a PC version but it appears to be only a binary. Where's the library?

+If you are running any version of Windows, then you have the wrong distribution. The FAQ lists current Windows versions. Notably, Pythonwin and wpy provide fully functional installations. +

+But if you are sure you have the only distribution with a hope of working on +your system, then... +

+You still need to copy the files from the distribution directory +"python/Lib" to your system. If you don't have the full distribution, +you can get the file lib<version>.tar.gz from most ftp sites carrying +Python; this is a subset of the distribution containing just those +files, e.g. ftp://ftp.python.org/pub/python/src/lib1.4.tar.gz. +

+Once you have installed the library, you need to point sys.path to it. +Assuming the library is in C:\misc\python\lib, the following commands +will point your Python interpreter to it (note the doubled backslashes +-- you can also use single forward slashes instead): +

+

+        >>> import sys
+        >>> sys.path.insert(0, 'C:\\misc\\python\\lib')
+        >>>
+
+For a more permanent effect, set the environment variable PYTHONPATH, +as follows (talking to a DOS prompt): +

+

+        C> SET PYTHONPATH=C:\misc\python\lib
+
+

+ +Edit this entry / +Log info + +/ Last changed on Fri May 23 16:28:27 1997 by +Ken Manheimer +

+ +


+

7.9. Where's the documentation for the Mac or PC version?

+The documentation for the Unix version also applies to the Mac and +PC versions. Where applicable, differences are indicated in the text. +

+ +Edit this entry / +Log info +

+ +


+

7.10. How do I create a Python program file on the Mac or PC?

+Use an external editor. On the Mac, BBEdit seems to be a popular +no-frills text editor. I work like this: start the interpreter; edit +a module file using BBedit; import and test it in the interpreter; +edit again in BBedit; then use the built-in function reload() to +re-read the imported module; etc. In the 1.4 distribution +you will find a BBEdit extension that makes life a little easier: +it can tell the interpreter to execute the current window. +See :Mac:Tools:BBPy:README. +

+Regarding the same question for the PC, Kurt Wm. Hemr writes: "While +anyone with a pulse could certainly figure out how to do the same on +MS-Windows, I would recommend the NotGNU Emacs clone for MS-Windows. +Not only can you easily resave and "reload()" from Python after making +changes, but since WinNot auto-copies to the clipboard any text you +select, you can simply select the entire procedure (function) which +you changed in WinNot, switch to QWPython, and shift-ins to reenter +the changed program unit." +

+If you're using Windows95 or Windows NT, you should also know about +PythonWin, which provides a GUI framework, with an mouse-driven +editor, an object browser, and a GUI-based debugger. See +

+       http://www.python.org/ftp/python/pythonwin/
+
+for details. +

+ +Edit this entry / +Log info + +/ Last changed on Sun May 25 10:04:25 1997 by +GvR +

+ +


+

7.11. How can I use Tkinter on Windows 95/NT?

+Starting from Python 1.5, it's very easy -- just download and install +Python and Tcl/Tk and you're in business. See +

+

+  http://www.python.org/download/download_windows.html
+
+One warning: don't attempt to use Tkinter from PythonWin +(Mark Hammond's IDE). Use it from the command line interface +(python.exe) or the windowless interpreter (pythonw.exe). +

+ +Edit this entry / +Log info + +/ Last changed on Fri Jun 12 09:32:48 1998 by +GvR +

+ +


+

7.12. cgi.py (or other CGI programming) doesn't work sometimes on NT or win95!

+Be sure you have the latest python.exe, that you are using +python.exe rather than a GUI version of python and that you +have configured the server to execute +

+

+     "...\python.exe -u ..."
+
+for the cgi execution. The -u (unbuffered) option on NT and +win95 prevents the interpreter from altering newlines in the +standard input and output. Without it post/multipart requests +will seem to have the wrong length and binary (eg, GIF) +responses may get garbled (resulting in, eg, a "broken image"). +

+ +Edit this entry / +Log info + +/ Last changed on Wed Jul 30 10:48:02 1997 by +aaron watters +

+ +


+

7.13. Why doesn't os.popen() work in PythonWin on NT?

+The reason that os.popen() doesn't work from within PythonWin is due to a bug in Microsoft's C Runtime Library (CRT). The CRT assumes you have a Win32 console attached to the process. +

+You should use the win32pipe module's popen() instead which doesn't depend on having an attached Win32 console. +

+Example: +

+ import win32pipe
+ f = win32pipe.popen('dir /c c:\\')
+ print f.readlines()
+ f.close()
+
+

+ +Edit this entry / +Log info + +/ Last changed on Thu Jul 31 15:34:09 1997 by +Bill Tutt +

+ +


+

7.14. How do I use different functionality on different platforms with the same program?

+Remember that Python is extremely dynamic and that you +can use this dynamism to configure a program at run-time to +use available functionality on different platforms. For example +you can test the sys.platform and import different modules based +on its value. +

+

+   import sys
+   if sys.platform == "win32":
+      import win32pipe
+      popen = win32pipe.popen
+   else:
+      import os
+      popen = os.popen
+
+(See FAQ 7.13 for an explanation of why you might want to +do something like this.) Also you can try to import a module +and use a fallback if the import fails: +

+

+    try:
+         import really_fast_implementation
+         choice = really_fast_implementation
+    except ImportError:
+         import slower_implementation
+         choice = slower_implementation
+
+

+ +Edit this entry / +Log info + +/ Last changed on Wed Aug 13 07:39:06 1997 by +aaron watters +

+ +


+

7.15. Is there an Amiga version of Python?

+Yes. See the AmigaPython homepage at http://www.bigfoot.com/~irmen/python.html. +

+ +Edit this entry / +Log info + +/ Last changed on Mon Dec 14 06:53:32 1998 by +Irmen de Jong +

+ +


+

7.16. Why doesn't os.popen()/win32pipe.popen() work on Win9x?

+There is a bug in Win9x that prevents os.popen/win32pipe.popen* from working. The good news is there is a way to work around this problem. +The Microsoft Knowledge Base article that you need to lookup is: Q150956. You will find links to the knowledge base at: +http://www.microsoft.com/kb. +

+ +Edit this entry / +Log info + +/ Last changed on Fri Jun 25 10:45:38 1999 by +Bill Tutt +

+ +


+

8. Python on Windows

+ +
+

8.1. Using Python for CGI on Microsoft Windows

+** Setting up the Microsoft IIS Server/Peer Server +

+On the Microsoft IIS +server or on the Win95 MS Personal Web Server +you set up python in the same way that you +would set up any other scripting engine. +

+Run regedt32 and go to: +

+HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W3SVC\Parameters\ScriptMap +

+and enter the following line (making any specific changes that your system may need) +

+.py :REG_SZ: c:\<path to python>\python.exe -u %s %s +

+This line will allow you to call your script with a simple reference like: +http://yourserver/scripts/yourscript.py +provided "scripts" is an "executable" directory for your server (which +it usually is by default). +The "-u" flag specifies unbuffered and binary mode for stdin - needed when working with binary data +

+In addition, it is recommended by people who would know that using ".py" may +not be a good idea for the file extensions when used in this context +(you might want to reserve *.py for support modules and use *.cgi or *.cgp +for "main program" scripts). +However, that issue is beyond this Windows FAQ entry. +

+

+** Apache configuration +

+In the Apache configuration file httpd.conf, add the following line at +the end of the file: +

+ScriptInterpreterSource Registry +

+Then, give your Python CGI-scripts the extension .py and put them in the cgi-bin directory. +

+

+** Netscape Servers: +Information on this topic exists at: +http://home.netscape.com/comprod/server_central/support/fasttrack_man/programs.htm#1010870 +

+ +Edit this entry / +Log info + +/ Last changed on Wed Mar 27 12:25:54 2002 by +Gerhard Häring +

+ +


+

8.2. How to check for a keypress without blocking?

+Use the msvcrt module. This is a standard Windows-specific extensions +in Python 1.5 and beyond. It defines a function kbhit() which checks +whether a keyboard hit is present; also getch() which gets one +character without echo. Plus a few other goodies. +

+(Search for "keypress" to find an answer for Unix as well.) +

+ +Edit this entry / +Log info + +/ Last changed on Mon Mar 30 16:21:46 1998 by +GvR +

+ +


+

8.3. $PYTHONPATH

+In MS-DOS derived environments, a unix variable such as $PYTHONPATH is +set as PYTHONPATH, without the dollar sign. PYTHONPATH is useful for +specifying the location of library files. +

+ +Edit this entry / +Log info + +/ Last changed on Thu Jun 11 00:41:26 1998 by +Gvr +

+ +


+

8.4. dedent syntax errors

+The FAQ does not recommend using tabs, and Guido's Python Style Guide recommends 4 spaces for distributed Python code; this is also the Emacs python-mode default; see +

+

+    http://www.python.org/doc/essays/styleguide.html
+
+Under any editor mixing tabs and spaces is a bad idea. MSVC is no different in this respect, and is easily configured to use spaces: Take Tools -> Options -> Tabs, and for file type "Default" set "Tab size" and "Indent size" to 4, and select the "Insert spaces" radio button. +

+If you suspect mixed tabs and spaces are causing problems in leading whitespace, run Python with the -t switch or, run Tools/Scripts/tabnanny.py to check a directory tree in batch mode. +

+ +Edit this entry / +Log info + +/ Last changed on Mon Feb 12 15:04:14 2001 by +Steve Holden +

+ +


+

8.5. How do I emulate os.kill() in Windows?

+Use win32api: +

+

+    def kill(pid):
+        """kill function for Win32"""
+        import win32api
+        handle = win32api.OpenProcess(1, 0, pid)
+        return (0 != win32api.TerminateProcess(handle, 0))
+
+

+ +Edit this entry / +Log info + +/ Last changed on Sat Aug 8 18:55:06 1998 by +Jeff Bauer +

+ +


+

8.6. Why does os.path.isdir() fail on NT shared directories?

+The solution appears to be always append the "\\" on +the end of shared drives. +

+

+  >>> import os
+  >>> os.path.isdir( '\\\\rorschach\\public')
+  0
+  >>> os.path.isdir( '\\\\rorschach\\public\\')
+  1
+
+[Blake Winton responds:] +I've had the same problem doing "Start >> Run" and then a +directory on a shared drive. If I use "\\rorschach\public", +it will fail, but if I use "\\rorschach\public\", it will +work. For that matter, os.stat() does the same thing (well, +it gives an error for "\\\\rorschach\\public", but you get +the idea)... +

+I've got a theory about why this happens, but it's only +a theory. NT knows the difference between shared directories, +and regular directories. "\\rorschach\public" isn't a +directory, it's _really_ an IPC abstraction. This is sort +of lended credence to by the fact that when you're mapping +a network drive, you can't map "\\rorschach\public\utils", +but only "\\rorschach\public". +

+[Clarification by funkster@midwinter.com] +It's not actually a Python +question, as Python is working just fine; it's clearing up something +a bit muddled about Windows networked drives. +

+It helps to think of share points as being like drive letters. +Example: +

+        k: is not a directory
+        k:\ is a directory
+        k:\media is a directory
+        k:\media\ is not a directory
+
+The same rules apply if you substitute "k:" with "\\conky\foo": +
+        \\conky\foo  is not a directory
+        \\conky\foo\ is a directory
+        \\conky\foo\media is a directory
+        \\conky\foo\media\ is not a directory
+
+

+ +Edit this entry / +Log info + +/ Last changed on Sun Jan 31 08:44:48 1999 by +GvR +

+ +


+

8.7. PyRun_SimpleFile() crashes on Windows but not on Unix

+I've seen a number of reports of PyRun_SimpleFile() failing +in a Windows port of an application embedding Python that worked +fine on Unix. PyRun_SimpleString() works fine on both platforms. +

+I think this happens because the application was compiled with a +different set of compiler flags than Python15.DLL. It seems that some +compiler flags affect the standard I/O library in such a way that +using different flags makes calls fail. You need to set it for +the non-debug multi-threaded DLL (/MD on the command line, or can be set via MSVC under Project Settings->C++/Code Generation then the "Use rum-time library" dropdown.) +

+Also note that you can not mix-and-match Debug and Release versions. If you wish to use the Debug Multithreaded DLL, then your module _must_ have an "_d" appended to the base name. +

+ +Edit this entry / +Log info + +/ Last changed on Wed Nov 17 17:37:07 1999 by +Mark Hammond +

+ +


+

8.8. Import of _tkinter fails on Windows 95/98

+Sometimes, the import of _tkinter fails on Windows 95 or 98, +complaining with a message like the following: +

+

+  ImportError: DLL load failed: One of the library files needed
+  to run this application cannot be found.
+
+It could be that you haven't installed Tcl/Tk, but if you did +install Tcl/Tk, and the Wish application works correctly, +the problem may be that its installer didn't +manage to edit the autoexec.bat file correctly. It tries to add a +statement that changes the PATH environment variable to include +the Tcl/Tk 'bin' subdirectory, but sometimes this edit doesn't +quite work. Opening it with notepad usually reveals what the +problem is. +

+(One additional hint, noted by David Szafranski: you can't use +long filenames here; e.g. use C:\PROGRA~1\Tcl\bin instead of +C:\Program Files\Tcl\bin.) +

+ +Edit this entry / +Log info + +/ Last changed on Wed Dec 2 22:32:41 1998 by +GvR +

+ +


+

8.9. Can't extract the downloaded documentation on Windows

+Sometimes, when you download the documentation package to a Windows +machine using a web browser, the file extension of the saved file +ends up being .EXE. This is a mistake; the extension should be .TGZ. +

+Simply rename the downloaded file to have the .TGZ extension, and +WinZip will be able to handle it. (If your copy of WinZip doesn't, +get a newer one from http://www.winzip.com.) +

+ +Edit this entry / +Log info + +/ Last changed on Sat Nov 21 13:41:35 1998 by +GvR +

+ +


+

8.10. Can't get Py_RunSimpleFile() to work.

+This is very sensitive to the compiler vendor, version and (perhaps) +even options. If the FILE* structure in your embedding program isn't +the same as is assumed by the Python interpreter it won't work. +

+The Python 1.5.* DLLs (python15.dll) are all compiled +with MS VC++ 5.0 and with multithreading-DLL options (/MD, I think). +

+If you can't change compilers or flags, try using Py_RunSimpleString(). +A trick to get it to run an arbitrary file is to construct a call to +execfile() with the name of your file as argument. +

+ +Edit this entry / +Log info + +/ Last changed on Wed Jan 13 10:58:14 1999 by +GvR +

+ +


+

8.11. Where is Freeze for Windows?

+("Freeze" is a program that allows you to ship a Python program +as a single stand-alone executable file. It is not a compiler, +your programs don't run any faster, but they are more easily +distributable (to platforms with the same OS and CPU). Read the +README file of the freeze program for more disclaimers.) +

+You can use freeze on Windows, but you must download the source +tree (see http://www.python.org/download/download_source.html). +This is recommended for Python 1.5.2 (and betas thereof) only; +older versions don't quite work. +

+You need the Microsoft VC++ 5.0 compiler (maybe it works with +6.0 too). You probably need to build Python -- the project files +are all in the PCbuild directory. +

+The freeze program is in the Tools\freeze subdirectory of the source +tree. +

+ +Edit this entry / +Log info + +/ Last changed on Wed Feb 17 18:47:24 1999 by +GvR +

+ +


+

8.12. Is a *.pyd file the same as a DLL?

+Yes, .pyd files are dll's. But there are a few differences. If you +have a DLL named foo.pyd, then it must have a function initfoo(). You +can then write Python "import foo", and Python will search for foo.pyd +(as well as foo.py, foo.pyc) and if it finds it, will attempt to call +initfoo() to initialize it. You do not link your .exe with foo.lib, +as that would cause Windows to require the DLL to be present. +

+Note that the search path for foo.pyd is PYTHONPATH, not the same as +the path that Windows uses to search for foo.dll. Also, foo.pyd need +not be present to run your program, whereas if you linked your program +with a dll, the dll is required. Of course, foo.pyd is required if +you want to say "import foo". In a dll, linkage is declared in the +source code with __declspec(dllexport). In a .pyd, linkage is defined +in a list of available functions. +

+ +Edit this entry / +Log info + +/ Last changed on Tue Nov 23 02:40:08 1999 by +Jameson Quinn +

+ +


+

8.13. Missing cw3215mt.dll (or missing cw3215.dll)

+Sometimes, when using Tkinter on Windows, you get an error that +cw3215mt.dll or cw3215.dll is missing. +

+Cause: you have an old Tcl/Tk DLL built with cygwin in your path +(probably C:\Windows). You must use the Tcl/Tk DLLs from the +standard Tcl/Tk installation (Python 1.5.2 comes with one). +

+ +Edit this entry / +Log info + +/ Last changed on Fri Jun 11 00:54:13 1999 by +GvR +

+ +


+

8.14. How to make python scripts executable:

+[Blake Coverett] +

+Win2K: +

+The standard installer already associates the .py extension with a file type +(Python.File) and gives that file type an open command that runs the +interpreter (D:\Program Files\Python\python.exe "%1" %*). This is enough to +make scripts executable from the command prompt as 'foo.py'. If you'd +rather be able to execute the script by simple typing 'foo' with no +extension you need to add .py to the PATHEXT environment variable. +

+WinNT: +

+The steps taken by the installed as described above allow you do run a +script with 'foo.py', but a long time bug in the NT command processor +prevents you from redirecting the input or output of any script executed in +this way. This is often important. +

+An appropriate incantation for making a Python script executable under WinNT +is to give the file an extension of .cmd and add the following as the first +line: +

+

+    @setlocal enableextensions & python -x %~f0 %* & goto :EOF
+
+Win9x: +

+[Due to Bruce Eckel] +

+

+  @echo off
+  rem = """
+  rem run python on this bat file. Needs the full path where
+  rem you keep your python files. The -x causes python to skip
+  rem the first line of the file:
+  python -x c:\aaa\Python\\"%0".bat %1 %2 %3 %4 %5 %6 %7 %8 %9
+  goto endofpython
+  rem """
+
+
+  # The python program goes here:
+
+
+  print "hello, Python"
+
+
+  # For the end of the batch file:
+  rem = """
+  :endofpython
+  rem """
+
+

+ +Edit this entry / +Log info + +/ Last changed on Tue Nov 30 10:25:17 1999 by +GvR +

+ +


+

8.15. Warning about CTL3D32 version from installer

+The Python installer issues a warning like this: +

+

+  This version uses CTL3D32.DLL whitch is not the correct version.
+  This version is used for windows NT applications only.
+
+[Tim Peters] +This is a Microsoft DLL, and a notorious +source of problems. The msg means what it says: you have the wrong version +of this DLL for your operating system. The Python installation did not +cause this -- something else you installed previous to this overwrote the +DLL that came with your OS (probably older shareware of some sort, but +there's no way to tell now). If you search for "CTL3D32" using any search +engine (AltaVista, for example), you'll find hundreds and hundreds of web +pages complaining about the same problem with all sorts of installation +programs. They'll point you to ways to get the correct version reinstalled +on your system (since Python doesn't cause this, we can't fix it). +

+David A Burton has written a little program to fix this. Go to +http://www.burtonsys.com/download.html and click on "ctl3dfix.zip" +

+ +Edit this entry / +Log info + +/ Last changed on Thu Oct 26 15:42:00 2000 by +GvR +

+ +


+

8.16. How can I embed Python into a Windows application?

+Edward K. Ream <edream@tds.net> writes +

+When '##' appears in a file name below, it is an abbreviated version number. For example, for Python 2.1.1, ## will be replaced by 21. +

+Embedding the Python interpreter in a Windows app can be summarized as +follows: +

+1. Do _not_ build Python into your .exe file directly. On Windows, +Python must be a DLL to handle importing modules that are themselves +DLL's. (This is the first key undocumented fact.) Instead, link to +python##.dll; it is typically installed in c:\Windows\System. +

+You can link to Python statically or dynamically. Linking statically +means linking against python##.lib The drawback is that your app won't +run if python##.dll does not exist on your system. +

+General note: python##.lib is the so-called "import lib" corresponding +to python.dll. It merely defines symbols for the linker. +

+Borland note: convert python##.lib to OMF format using Coff2Omf.exe +first. +

+Linking dynamically greatly simplifies link options; everything happens +at run time. Your code must load python##.dll using the Windows +LoadLibraryEx() routine. The code must also use access routines and +data in python##.dll (that is, Python's C API's) using pointers +obtained by the Windows GetProcAddress() routine. Macros can make +using these pointers transparent to any C code that calls routines in +Python's C API. +

+2. If you use SWIG, it is easy to create a Python "extension module" +that will make the app's data and methods available to Python. SWIG +will handle just about all the grungy details for you. The result is C +code that you link _into your .exe file_ (!) You do _not_ have to +create a DLL file, and this also simplifies linking. +

+3. SWIG will create an init function (a C function) whose name depends +on the name of the extension module. For example, if the name of the +module is leo, the init function will be called initleo(). If you use +SWIG shadow classes, as you should, the init function will be called +initleoc(). This initializes a mostly hidden helper class used by the +shadow class. +

+The reason you can link the C code in step 2 into your .exe file is that +calling the initialization function is equivalent to importing the +module into Python! (This is the second key undocumented fact.) +

+4. In short, you can use the following code to initialize the Python +interpreter with your extension module. +

+

+    #include "python.h"
+    ...
+    Py_Initialize();  // Initialize Python.
+    initmyAppc();  // Initialize (import) the helper class. 
+    PyRun_SimpleString("import myApp") ;  // Import the shadow class.
+
+5. There are two problems with Python's C API which will become apparent +if you use a compiler other than MSVC, the compiler used to build +python##.dll. +

+Problem 1: The so-called "Very High Level" functions that take FILE * +arguments will not work in a multi-compiler environment; each compiler's +notion of a struct FILE will be different. From an implementation +standpoint these are very _low_ level functions. +

+Problem 2: SWIG generates the following code when generating wrappers to +void functions: +

+

+    Py_INCREF(Py_None);
+    _resultobj = Py_None;
+    return _resultobj;
+
+Alas, Py_None is a macro that expands to a reference to a complex data +structure called _Py_NoneStruct inside python##.dll. Again, this code +will fail in a mult-compiler environment. Replace such code by: +

+

+    return Py_BuildValue("");
+
+It may be possible to use SWIG's %typemap command to make the change +automatically, though I have not been able to get this to work (I'm a +complete SWIG newbie). +

+6. Using a Python shell script to put up a Python interpreter window +from inside your Windows app is not a good idea; the resulting window +will be independent of your app's windowing system. Rather, you (or the +wxPythonWindow class) should create a "native" interpreter window. It +is easy to connect that window to the Python interpreter. You can +redirect Python's i/o to _any_ object that supports read and write, so +all you need is a Python object (defined in your extension module) that +contains read() and write() methods. +

+ +Edit this entry / +Log info + +/ Last changed on Thu Jan 31 16:29:34 2002 by +Victor Kryukov +

+ +


+

8.17. Setting up IIS 5 to use Python for CGI

+In order to set up Internet Information Services 5 to use Python for CGI processing, please see the following links: +

+http://www.e-coli.net/pyiis_server.html (for Win2k Server) +http://www.e-coli.net/pyiis.html (for Win2k pro) +

+ +Edit this entry / +Log info + +/ Last changed on Fri Mar 22 22:05:51 2002 by +douglas savitsky +

+ +


+

8.18. How do I run a Python program under Windows?

+This is not necessarily quite the straightforward question it appears +to be. If you are already familiar with running programs from the +Windows command line then everything will seem really easy and +obvious. If your computer experience is limited then you might need a +little more guidance. Also there are differences between Windows 95, +98, NT, ME, 2000 and XP which can add to the confusion. You might +think of this as "why I pay software support charges" if you have a +helpful and friendly administrator to help you set things up without +having to understand all this yourself. If so, then great! Show them +this page and it should be a done deal. +

+Unless you use some sort of integrated development environment (such +as PythonWin or IDLE, to name only two in a growing family) then you +will end up typing Windows commands into what is variously referred +to as a "DOS window" or "Command prompt window". Usually you can +create such a window from your Start menu (under Windows 2000 I use +"Start | Programs | Accessories | Command Prompt"). You should be +able to recognize when you have started such a window because you will +see a Windows "command prompt", which usually looks like this: +

+

+    C:\>
+
+The letter may be different, and there might be other things after it, +so you might just as easily see something like: +

+

+    D:\Steve\Projects\Python>
+
+depending on how your computer has been set up and what else you have +recently done with it. Once you have started such a window, you are +well on the way to running Python programs. +

+You need to realize that your Python scripts have to be processed by +another program, usually called the "Python interpreter". The +interpreter reads your script, "compiles" it into "Python bytecodes" +(which are instructions for an imaginary computer known as the "Python +Virtual Machine") and then executes the bytecodes to run your +program. So, how do you arrange for the interpreter to handle your +Python? +

+First, you need to make sure that your command window recognises the +word "python" as an instruction to start the interpreter. If you have +opened a command window, you should try entering the command: +

+

+    python
+
+and hitting return. If you then see something like: +

+

+    Python 2.2 (#28, Dec 21 2001, 12:21:22) [MSC 32 bit (Intel)] on win32
+    Type "help", "copyright", "credits" or "license" for more information.
+    >>>
+
+then this part of the job has been correctly managed during Python's +installation process, and you have started the interpreter in +"interactive mode". That means you can enter Python statements or +expressions interactively and have them executed or evaluated while +you wait. This is one of Python's strongest features, but it takes a +little getting used to. Check it by entering a few expressions of your +choice and seeing the results... +

+

+    >>> print "Hello"
+    Hello
+    >>> "Hello" * 3
+    HelloHelloHello
+
+When you want to end your interactive Python session, enter a +terminator (hold the Ctrl key down while you enter a Z, then hit the +"Enter" key) to get back to your Windows command prompt. You may also +find that you have a Start-menu entry such as "Start | Programs | +Python 2.2 | Python (command line)" that results in you seeing the +">>>" prompt in a new window. If so, the window will disappear after +you enter the terminator -- Windows runs a single "python" command in +the window, which terminates when you terminate the interpreter. +

+If the "python" command, instead of displaying the interpreter prompt ">>>", gives you a message like +

+

+    'python' is not recognized as an internal or external command,
+    operable program or batch file.
+
+or +

+

+    Bad command or filename
+
+then you need to make sure that your computer knows where to find the +Python interpreter. To do this you will have to modify a setting +called the PATH, which is a just list of directories where Windows +will look for programs. Rather than just enter the right command every +time you create a command window, you should arrange for Python's +installation directory to be added to the PATH of every command window +as it starts. If you installed Python fairly recently then the command +

+

+    dir C:\py*
+
+will probably tell you where it is installed. Alternatively, perhaps +you made a note. Otherwise you will be reduced to a search of your +whole disk ... break out the Windows explorer and use "Tools | Find" +or hit the "Search" button and look for "python.exe". Suppose you +discover that Python is installed in the C:\Python22 directory (the +default at the time of writing) then you should make sure that +entering the command +

+

+    c:\Python22\python
+
+starts up the interpreter as above (and don't forget you'll need a +"CTRL-Z" and an "Enter" to get out of it). Once you have verified the +directory, you need to add it to the start-up routines your computer +goes through. For older versions of Windows the easiest way to do +this is to edit the C:\AUTOEXEC.BAT file. You would want to add a line +like the following to AUTOEXEC.BAT: +

+

+    PATH C:\Python22;%PATH%
+
+For Windows NT, 2000 and (I assume) XP, you will need to add a string +such as +

+

+    ;C:\Python22
+
+to the current setting for the PATH environment variable, which you +will find in the properties window of "My Computer" under the +"Advanced" tab. Note that if you have sufficient privilege you might +get a choice of installing the settings either for the Current User or +for System. The latter is preferred if you want everybody to be able +to run Python on the machine. +

+If you aren't confident doing any of these manipulations yourself, ask +for help! At this stage you may or may not want to reboot your system +to make absolutely sure the new setting has "taken" (don't you love +the way Windows gives you these freqeuent coffee breaks). You probably +won't need to for Windows NT, XP or 2000. You can also avoid it in +earlier versions by editing the file C:\WINDOWS\COMMAND\CMDINIT.BAT +instead of AUTOEXEC.BAT. +

+You should now be able to start a new command window, enter +

+

+    python
+
+at the "C:>" (or whatever) prompt, and see the ">>>" prompt that +indicates the Python interpreter is reading interactive commands. +

+Let's suppose you have a program called "pytest.py" in directory +"C:\Steve\Projects\Python". A session to run that program might look +like this: +

+

+    C:\> cd \Steve\Projects\Python
+    C:\Steve\Projects\Python> python pytest.py
+
+Because you added a file name to the command to start the interpreter, +when it starts up it reads the Python script in the named file, +compiles it, executes it, and terminates (so you see another "C:\>" +prompt). You might also have entered +

+

+    C:\> python \Steve\Projects\Python\pytest.py
+
+if you hadn't wanted to change your current directory. +

+Under NT, 2000 and XP you may well find that the installation process +has also arranged that the command +

+

+    pytest.py
+
+(or, if the file isn't in the current directory) +

+

+    C:\Steve\Projects\Python\pytest.py
+
+will automatically recognize the ".py" extension and run the Python +interpreter on the named file. Using this feature is fine, but some +versions of Windows have bugs which mean that this form isn't exactly +equivalent to using the interpreter explicitly, so be careful. Easier +to remember, for now, that +

+

+    python C:\Steve\Projects\Python\pytest.py
+
+works pretty close to the same, and redirection will work (more) +reliably. +

+The important things to remember are: +

+1. Start Python from the Start Menu, or make sure the PATH is set +correctly so Windows can find the Python interpreter. +

+

+    python
+
+should give you a '>>>" prompt from the Python interpreter. Don't +forget the CTRL-Z and ENTER to terminate the interpreter (and, if you +started the window from the Start Menu, make the window disappear). +

+2. Once this works, you run programs with commands: +

+

+    python {program-file}
+
+3. When you know the commands to use you can build Windows shortcuts +to run the Python interpreter on any of your scripts, naming +particular working directories, and adding them to your menus, but +that's another lessFAQ. Take a look at +

+

+    python --help
+
+if your needs are complex. +

+4. Interactive mode (where you see the ">>>" prompt) is best used +not for running programs, which are better executed as in steps 2 +and 3, but for checking that individual statements and expressions do +what you think they will, and for developing code by experiment. +

+ +Edit this entry / +Log info + +/ Last changed on Tue Aug 20 16:19:53 2002 by +GvR +

+ +


+Python home / +Python FAQ Wizard 1.0.3 / +Feedback to GvR +

Python Powered
+ + --- python3.4-3.4.1.orig/debian/PVER-dbg.README.Debian.in +++ python3.4-3.4.1/debian/PVER-dbg.README.Debian.in @@ -0,0 +1,52 @@ +Contents of the @PVER@-dbg package +------------------------------------- + +For debugging python and extension modules, you may want to add the contents +of /usr/share/doc/@PVER@/gdbinit (found in the @PVER@-dev package) to your +~/.gdbinit file. + +@PVER@-dbg contains two sets of packages: + + - debugging symbols for the standard @PVER@ build. When this package + is installed, gdb will automatically load up the debugging symbols + from it when debugging @PVER@ or one of the included extension + modules. + + - a separate @PVER@-dbg binary, configured --with-pydebug, enabling the + additional debugging code to help debug memory management problems. + +For the latter, all extension modules have to be recompiled to +correctly load with an pydebug enabled build. + + +Debian and Ubuntu specific changes to the debug interpreter +----------------------------------------------------------- +The python2.4 and python2.5 packages in Ubuntu feisty are modified to +first look for extension modules under a different name. + + normal build: foo.so + debug build: foo_d.so foo.so + +This naming schema allows installation of the extension modules into +the same path (The naming is directly taken from the Windows builds +which already uses this naming scheme). + +See https://wiki.ubuntu.com/PyDbgBuilds for more information. + + +Using the python-dbg builds +--------------------------- + + * Call the python-dbg or the pythonX.Y-dbg binaries instead of the + python or pythonX.Y binaries. + + * Properties of the debug build are described in + /usr/share/doc/@PVER@/SpecialBuilds.txt.gz. + The debug interpreter is built with Py_DEBUG defined. + + * From SpecialBuilds.txt: This is what is generally meant by "a debug + build" of Python. Py_DEBUG implies LLTRACE, Py_REF_DEBUG, + Py_TRACE_REFS, and PYMALLOC_DEBUG (if WITH_PYMALLOC is enabled). + In addition, C assert()s are enabled (via the C way: by not defining + NDEBUG), and some routines do additional sanity checks inside + "#ifdef Py_DEBUG" blocks. --- python3.4-3.4.1.orig/debian/PVER-dbg.overrides.in +++ python3.4-3.4.1/debian/PVER-dbg.overrides.in @@ -0,0 +1,5 @@ +# just the gdb debug file +@PVER@-dbg binary: python-script-but-no-python-dep + +# pointless lintian ... +@PVER@-dbg binary: hardening-no-fortify-functions --- python3.4-3.4.1.orig/debian/PVER-dbg.postinst.in +++ python3.4-3.4.1/debian/PVER-dbg.postinst.in @@ -0,0 +1,36 @@ +#! /bin/sh + +set -e + +if [ "$1" = configure ]; then + files=$(dpkg -L lib@PVER@-dbg@HOST_QUAL@ | sed -n '/^\/usr\/lib\/@PVER@\/.*\.py$/p') + if [ -n "$files" ]; then + @PVER@ -E -S /usr/lib/@PVER@/py_compile.py $files + if grep -sq '^byte-compile[^#]*optimize' /etc/python/debian_config; then + @PVER@ -E -S -O /usr/lib/@PVER@/py_compile.py $files + fi + else + echo >&2 "@PVER@-dbg: can't get files for byte-compilation" + fi + + if [ -d /usr/include/@PVER@_d ] && [ ! -h /usr/include/@PVER@_d ]; then + if rmdir /usr/include/@PVER@_d 2> /dev/null; then + ln -sf @PVER@dmu /usr/include/@PVER@_d + else + echo >&2 "WARNING: non-empty directory on upgrade: /usr/include/@PVER@_d" + ls -l /usr/include/@PVER@_d + fi + fi + if [ -d /usr/lib/@PVER@/config_d ] && [ ! -h /usr/lib/@PVER@/config_d ]; then + if rmdir /usr/lib/@PVER@/config_d 2> /dev/null; then + ln -sf config-dmu /usr/lib/@PVER@/config_d + else + echo >&2 "WARNING: non-empty directory on upgrade: /usr/lib/@PVER@/config_d" + ls -l /usr/lib/@PVER@/config_d + fi + fi +fi + +#DEBHELPER# + +exit 0 --- python3.4-3.4.1.orig/debian/PVER-dbg.prerm.in +++ python3.4-3.4.1/debian/PVER-dbg.prerm.in @@ -0,0 +1,35 @@ +#! /bin/sh + +set -e + +remove_bytecode() +{ + pkg=$1 + max=$(LANG=C LC_ALL=C xargs --show-limits < /dev/null 2>&1 | awk '/Maximum/ {print int($NF / 4)}') + dpkg -L $pkg \ + | awk -F/ 'BEGIN {OFS="/"} /\.py$/ {$NF=sprintf("__pycache__/%s.*.py[co]", substr($NF,1,length($NF)-3)); print}' \ + | xargs --max-chars=$max echo \ + | while read files; do rm -f $files; done + if [ -d /usr/bin/__pycache__ ]; then + rmdir --ignore-fail-on-non-empty /usr/bin/__pycache__ + fi +} + +case "$1" in + remove) + remove_bytecode lib@PVER@-dbg@HOST_QUAL@ + ;; + upgrade) + remove_bytecode lib@PVER@-dbg@HOST_QUAL@ + ;; + deconfigure) + ;; + failed-upgrade) + ;; + *) + echo "prerm called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +#DEBHELPER# --- python3.4-3.4.1.orig/debian/PVER-dev.postinst.in +++ python3.4-3.4.1/debian/PVER-dev.postinst.in @@ -0,0 +1,26 @@ +#! /bin/sh + +set -e + +if [ "$1" = configure ]; then + if [ -d /usr/include/@PVER@ ] && [ ! -h /usr/include/@PVER@ ]; then + if rmdir /usr/include/@PVER@ 2> /dev/null; then + ln -sf @PVER@mu /usr/include/@PVER@ + else + echo >&2 "WARNING: non-empty directory on upgrade: /usr/include/@PVER@" + ls -l /usr/include/@PVER@ + fi + fi + if [ -d /usr/lib/@PVER@/config ] && [ ! -h /usr/lib/@PVER@/config ]; then + if rmdir /usr/lib/@PVER@/config 2> /dev/null; then + ln -sf config-@VER@mu /usr/lib/@PVER@/config + else + echo >&2 "WARNING: non-empty directory on upgrade: /usr/lib/@PVER@/config" + ls -l /usr/lib/@PVER@/config + fi + fi +fi + +#DEBHELPER# + +exit 0 --- python3.4-3.4.1.orig/debian/PVER-doc.doc-base.PVER-api.in +++ python3.4-3.4.1/debian/PVER-doc.doc-base.PVER-api.in @@ -0,0 +1,13 @@ +Document: @PVER@-api +Title: Python/C API Reference Manual (v@VER@) +Author: Guido van Rossum +Abstract: This manual documents the API used by C (or C++) programmers who + want to write extension modules or embed Python. It is a + companion to *Extending and Embedding the Python Interpreter*, + which describes the general principles of extension writing but + does not document the API functions in detail. +Section: Programming/Python + +Format: HTML +Index: /usr/share/doc/@PVER@/html/c-api/index.html +Files: /usr/share/doc/@PVER@/html/c-api/*.html --- python3.4-3.4.1.orig/debian/PVER-doc.doc-base.PVER-dist.in +++ python3.4-3.4.1/debian/PVER-doc.doc-base.PVER-dist.in @@ -0,0 +1,13 @@ +Document: @PVER@-dist +Title: Distributing Python Modules (v@VER@) +Author: Greg Ward +Abstract: This document describes the Python Distribution Utilities + (``Distutils'') from the module developer's point-of-view, describing + how to use the Distutils to make Python modules and extensions easily + available to a wider audience with very little overhead for + build/release/install mechanics. +Section: Programming/Python + +Format: HTML +Index: /usr/share/doc/@PVER@/html/distutils/index.html +Files: /usr/share/doc/@PVER@/html/distutils/*.html --- python3.4-3.4.1.orig/debian/PVER-doc.doc-base.PVER-ext.in +++ python3.4-3.4.1/debian/PVER-doc.doc-base.PVER-ext.in @@ -0,0 +1,16 @@ +Document: @PVER@-ext +Title: Extending and Embedding the Python Interpreter (v@VER@) +Author: Guido van Rossum +Abstract: This document describes how to write modules in C or C++ to extend + the Python interpreter with new modules. Those modules can define + new functions but also new object types and their methods. The + document also describes how to embed the Python interpreter in + another application, for use as an extension language. Finally, + it shows how to compile and link extension modules so that they + can be loaded dynamically (at run time) into the interpreter, if + the underlying operating system supports this feature. +Section: Programming/Python + +Format: HTML +Index: /usr/share/doc/@PVER@/html/extending/index.html +Files: /usr/share/doc/@PVER@/html/extending/*.html --- python3.4-3.4.1.orig/debian/PVER-doc.doc-base.PVER-inst.in +++ python3.4-3.4.1/debian/PVER-doc.doc-base.PVER-inst.in @@ -0,0 +1,12 @@ +Document: @PVER@-inst +Title: Installing Python Modules (v@VER@) +Author: Greg Ward +Abstract: This document describes the Python Distribution Utilities + (``Distutils'') from the end-user's point-of-view, describing how to + extend the capabilities of a standard Python installation by building + and installing third-party Python modules and extensions. +Section: Programming/Python + +Format: HTML +Index: /usr/share/doc/@PVER@/html/install/index.html +Files: /usr/share/doc/@PVER@/html/install/*.html --- python3.4-3.4.1.orig/debian/PVER-doc.doc-base.PVER-lib.in +++ python3.4-3.4.1/debian/PVER-doc.doc-base.PVER-lib.in @@ -0,0 +1,15 @@ +Document: @PVER@-lib +Title: Python Library Reference (v@VER@) +Author: Guido van Rossum +Abstract: This library reference manual documents Python's standard library, + as well as many optional library modules (which may or may not be + available, depending on whether the underlying platform supports + them and on the configuration choices made at compile time). It + also documents the standard types of the language and its built-in + functions and exceptions, many of which are not or incompletely + documented in the Reference Manual. +Section: Programming/Python + +Format: HTML +Index: /usr/share/doc/@PVER@/html/library/index.html +Files: /usr/share/doc/@PVER@/html/library/*.html --- python3.4-3.4.1.orig/debian/PVER-doc.doc-base.PVER-new.in +++ python3.4-3.4.1/debian/PVER-doc.doc-base.PVER-new.in @@ -0,0 +1,10 @@ +Document: @PVER@-new +Title: What's new in Python @VER@ +Author: A.M. Kuchling +Abstract: This documents lists new features and changes worth mentioning + in Python @VER@. +Section: Programming/Python + +Format: HTML +Index: /usr/share/doc/@PVER@/html/whatsnew/@VER@.html +Files: /usr/share/doc/@PVER@/html/whatsnew/@VER@.html --- python3.4-3.4.1.orig/debian/PVER-doc.doc-base.PVER-ref.in +++ python3.4-3.4.1/debian/PVER-doc.doc-base.PVER-ref.in @@ -0,0 +1,18 @@ +Document: @PVER@-ref +Title: Python Reference Manual (v@VER@) +Author: Guido van Rossum +Abstract: This reference manual describes the syntax and "core semantics" of + the language. It is terse, but attempts to be exact and complete. + The semantics of non-essential built-in object types and of the + built-in functions and modules are described in the *Python + Library Reference*. For an informal introduction to the language, + see the *Python Tutorial*. For C or C++ programmers, two + additional manuals exist: *Extending and Embedding the Python + Interpreter* describes the high-level picture of how to write a + Python extension module, and the *Python/C API Reference Manual* + describes the interfaces available to C/C++ programmers in detail. +Section: Programming/Python + +Format: HTML +Index: /usr/share/doc/@PVER@/html/reference/index.html +Files: /usr/share/doc/@PVER@/html/reference/*.html --- python3.4-3.4.1.orig/debian/PVER-doc.doc-base.PVER-tut.in +++ python3.4-3.4.1/debian/PVER-doc.doc-base.PVER-tut.in @@ -0,0 +1,13 @@ +Document: @PVER@-tut +Title: Python Tutorial (v@VER@) +Author: Guido van Rossum, Fred L. Drake, Jr., editor +Abstract: This tutorial introduces the reader informally to the basic + concepts and features of the Python language and system. It helps + to have a Python interpreter handy for hands-on experience, but + all examples are self-contained, so the tutorial can be read + off-line as well. +Section: Programming/Python + +Format: HTML +Index: /usr/share/doc/@PVER@/html/tutorial/index.html +Files: /usr/share/doc/@PVER@/html/tutorial/*.html --- python3.4-3.4.1.orig/debian/PVER-doc.overrides.in +++ python3.4-3.4.1/debian/PVER-doc.overrides.in @@ -0,0 +1,2 @@ +# this is referenced by the html docs +@PVER@-doc binary: extra-license-file --- python3.4-3.4.1.orig/debian/PVER-examples.overrides.in +++ python3.4-3.4.1/debian/PVER-examples.overrides.in @@ -0,0 +1,2 @@ +# don't care about permissions of the example files +@PVER@-examples binary: executable-not-elf-or-script --- python3.4-3.4.1.orig/debian/PVER-minimal.README.Debian.in +++ python3.4-3.4.1/debian/PVER-minimal.README.Debian.in @@ -0,0 +1,169 @@ +Contents of the @PVER@-minimal package +----------------------------------------- + +@PVER@-minimal consists of a minimum set of modules which may be needed +for python scripts used during the boot process. If other packages +are needed in these scripts, don't work around the missing module, but +file a bug report against this package. The modules in this package +are: + + __builtin__ builtin + __future__ module + _ast extension + _bisect extension + _bootlocale module + _bytesio builtin + _codecs builtin + _collections extension + _collections_abc module + _compat_pickle module + _datetime extension + _elementtree extension + _fileio builtin + _functools extension + _hashlib extensionx + _heapq extension + _imp builtin + _io builtin + _locale extension + _md5 extension + _opcode extension + _operator extension + _pickle extension + _posixsubprocess extension + _random extension + _sha1 extension + _sha3 extension + _sha256 extension + _sha512 extension + _sitebuiltins module + _socket extension + _sre builtin + _ssl extensionx + _stat extension + _stringio extension + _struct extension + _string builtin + _stringio builtin + _symtable builtin + _sysconfigdata module + _thread builtin + _threading_local module + _types builtin + _weakref builtin + _weakrefset module + _warnings builtin + configparser module + abc module + argparse module + array extension + ast module + atexit extension + base64 module + binascii extension + bisect module + builtins builtin + codecs module + collections package + compileall module + contextlib module + copy module + copyreg module + dis module + encodings package + enum module + errno builtin + exceptions builtin + fcntl extension + fnmatch module + functools module + gc builtin + genericpath module + getopt module + glob module + grp extension + hashlib module + heapq module + imp module + importlib package + inspect module + io module + itertools extension + keyword module + linecache module + locale module + logging package + marshal builtin + math extension + opcode module + operator module + optparse module + os module + pickle module + pkgutil module + platform module + posix builtin + posixpath module + pwd builtin + pyexpat extension + py_compile module + random module + re module + reprlib module + runpy module + select extension + selectors module + signal builtin + socket module + spwd extension + sre_compile module + sre_constants module + sre_parse module + ssl module + stat module + string module + struct module + subprocess module + sys builtin + sysconfig module + syslog extension + tempfile module + textwrap module + threading module + time extension + token module + tokenize module + traceback module + types module + unicodedata extension + warnings module + weakref module + zipimport extension + zlib extension + +Included are as well the codecs and stringprep modules, and the encodings +modules for all encodings except the multibyte encodings and the bz2 codec. + +The following modules are excluded, their import is guarded from the +importing module: + + Used in Excluded + ------------ ------------------------------------ + io _dummy_thread + os nt ntpath os2 os2emxpath mac macpath + riscos riscospath riscosenviron + optparse gettext + pickle doctest + subprocess threading_dummy + +This list was derived by looking at the modules in the perl-base package, +then adding python specific "core modules". + +TODO's +------ + +- time.strptime cannot be used. The required _strptime module is not + included in the -minimal package yet. _strptime, locale, _locale and + calendar have to be added. + +- modules used very often in the testsuite: copy, cPickle, operator. --- python3.4-3.4.1.orig/debian/PVER-minimal.postinst.in +++ python3.4-3.4.1/debian/PVER-minimal.postinst.in @@ -0,0 +1,82 @@ +#! /bin/sh + +set -e + +if [ ! -f /etc/@PVER@/sitecustomize.py ]; then + cat <<-EOF + # Empty sitecustomize.py to avoid a dangling symlink +EOF +fi + +case "$1" in + configure) + # Create empty directories in /usr/local + if [ ! -e /usr/local/lib/@PVER@ ]; then + mkdir -p /usr/local/lib/@PVER@ 2> /dev/null || true + chmod 2775 /usr/local/lib/@PVER@ 2> /dev/null || true + chown root:staff /usr/local/lib/@PVER@ 2> /dev/null || true + fi + localsite=/usr/local/lib/@PVER@/dist-packages + if [ ! -e $localsite ]; then + mkdir -p $localsite 2> /dev/null || true + chmod 2775 $localsite 2> /dev/null || true + chown root:staff $localsite 2> /dev/null || true + fi + + if which update-binfmts >/dev/null; then + update-binfmts --import @PVER@ + fi + + ;; +esac + +if [ "$1" = configure ]; then + + # only available before removal of the packaging package + rm -f /etc/@PVER@/sysconfig.cfg + + if ls -L /usr/lib/@PVER@/sitecustomize.py >/dev/null 2>&1; then + filt='cat' + else + filt='fgrep -v sitecustomize.py' + fi + files=$(dpkg -L lib@PVER@-minimal@HOST_QUAL@ \ + | sed -n '/^\/usr\/lib\/@PVER@\/.*\.py$/p' | $filt) + if [ -n "$files" ]; then + @PVER@ -E -S /usr/lib/@PVER@/py_compile.py $files + if grep -sq '^byte-compile[^#]*optimize' /etc/python/debian_config; then + @PVER@ -E -S -O /usr/lib/@PVER@/py_compile.py $files + fi + else + echo >&2 "@PVER@-minimal: can't get files for byte-compilation" + fi + bc=no + #if [ -z "$2" ] || dpkg --compare-versions "$2" lt 2.5-3 \ + # || [ -f /var/lib/python/@PVER@_installed ]; then + # bc=yes + #fi + if ! grep -sq '^supported-versions[^#]*@PVER@' /usr/share/python/debian_defaults + then + # FIXME: byte compile anyway? + bc=no + fi + if [ "$bc" = yes ]; then + # new installation or installation of first version with hook support + if [ "$DEBIAN_FRONTEND" != noninteractive ]; then + echo "Linking and byte-compiling packages for runtime @PVER@..." + fi + version=$(dpkg -s @PVER@-minimal | awk '/^Version:/ {print $2}') + for hook in /usr/share/python3/runtime.d/*.rtinstall; do + [ -x $hook ] || continue + $hook rtinstall @PVER@ "$2" "$version" + done + if [ -f /var/lib/python/@PVER@_installed ]; then + rm -f /var/lib/python/@PVER@_installed + rmdir --ignore-fail-on-non-empty /var/lib/python 2>/dev/null + fi + fi +fi + +#DEBHELPER# + +exit 0 --- python3.4-3.4.1.orig/debian/PVER-minimal.postrm.in +++ python3.4-3.4.1/debian/PVER-minimal.postrm.in @@ -0,0 +1,13 @@ +#! /bin/sh + +set -e + +if [ "$1" = "remove" ]; then + + if [ -f /var/lib/python/@PVER@_installed ]; then + rm -f /var/lib/python/@PVER@_installed + rmdir --ignore-fail-on-non-empty /var/lib/python 2>/dev/null + fi + + rmdir --parents /usr/local/lib/@PVER@ 2>/dev/null || true +fi --- python3.4-3.4.1.orig/debian/PVER-minimal.preinst.in +++ python3.4-3.4.1/debian/PVER-minimal.preinst.in @@ -0,0 +1,26 @@ +#!/bin/sh + +set -e + +case "$1" in + install) + # remember newly installed runtime + mkdir -p /var/lib/python + touch /var/lib/python/@PVER@_installed + ;; + upgrade) + : + ;; + + abort-upgrade) + ;; + + *) + echo "preinst called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +#DEBHELPER# + +exit 0 --- python3.4-3.4.1.orig/debian/PVER-minimal.prerm.in +++ python3.4-3.4.1/debian/PVER-minimal.prerm.in @@ -0,0 +1,36 @@ +#! /bin/sh + +set -e + +case "$1" in + remove) + if [ "$DEBIAN_FRONTEND" != noninteractive ]; then + echo "Unlinking and removing bytecode for runtime @PVER@" + fi + for hook in /usr/share/python3/runtime.d/*.rtremove; do + [ -x $hook ] || continue + $hook rtremove @PVER@ || continue + done + + if which update-binfmts >/dev/null; then + update-binfmts --package @PVER@ --remove @PVER@ /usr/bin/@PVER@ + fi + + localsite=/usr/local/lib/@PVER@/dist-packages + [ -d $localsite ] && rmdir $localsite 2>/dev/null || true + [ -d $(dirname $localsite) ] \ + && rmdir $(dirname $localsite) 2>/dev/null || true + ;; + upgrade) + ;; + deconfigure) + ;; + failed-upgrade) + ;; + *) + echo "prerm called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +#DEBHELPER# --- python3.4-3.4.1.orig/debian/PVER-venv.postinst.in +++ python3.4-3.4.1/debian/PVER-venv.postinst.in @@ -0,0 +1,20 @@ +#! /bin/sh + +set -e + +case "$1" in + configure) + files=$(dpkg -L @PVER@-venv | sed -n '/^\/usr\/lib\/@PVER@\/.*\.py$/p') + if [ -n "$files" ]; then + @PVER@ -E -S /usr/lib/@PVER@/py_compile.py $files + if grep -sq '^byte-compile[^#]*optimize' /etc/python/debian_config; then + @PVER@ -E -S -O /usr/lib/@PVER@/py_compile.py $files + fi + else + echo >&2 "@PVER@: can't get files for byte-compilation" + fi +esac + +#DEBHELPER# + +exit 0 --- python3.4-3.4.1.orig/debian/PVER-venv.prerm.in +++ python3.4-3.4.1/debian/PVER-venv.prerm.in @@ -0,0 +1,35 @@ +#! /bin/sh + +set -e + +remove_bytecode() +{ + pkg=$1 + max=$(LANG=C LC_ALL=C xargs --show-limits < /dev/null 2>&1 | awk '/Maximum/ {print int($NF / 4)}') + dpkg -L $pkg \ + | awk -F/ 'BEGIN {OFS="/"} /\.py$/ {$NF=sprintf("__pycache__/%s.*.py[co]", substr($NF,1,length($NF)-3)); print}' \ + | xargs --max-chars="$max" echo \ + | while read files; do rm -f $files; done + + find /usr/lib/@PVER@/ensurepip \ + -name __pycache__ -type d -empty -print \ + | xargs -r rm -rf +} + +case "$1" in + remove) + remove_bytecode @PVER@-venv + ;; + upgrade) + ;; + deconfigure) + ;; + failed-upgrade) + ;; + *) + echo "prerm called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +#DEBHELPER# --- python3.4-3.4.1.orig/debian/PVER.desktop.in +++ python3.4-3.4.1/debian/PVER.desktop.in @@ -0,0 +1,10 @@ +[Desktop Entry] +Name=Python (v@VER@) +Comment=Python Interpreter (v@VER@) +Exec=/usr/bin/@PVER@ +Icon=/usr/share/pixmaps/@PVER@.xpm +Terminal=true +Type=Application +Categories=Development; +StartupNotify=true +NoDisplay=true --- python3.4-3.4.1.orig/debian/PVER.menu.in +++ python3.4-3.4.1/debian/PVER.menu.in @@ -0,0 +1,4 @@ +?package(@PVER@):needs="text" section="Applications/Programming"\ + title="Python (v@VER@)"\ + icon="/usr/share/pixmaps/@PVER@.xpm"\ + command="/usr/bin/python@VER@" --- python3.4-3.4.1.orig/debian/PVER.overrides.in +++ python3.4-3.4.1/debian/PVER.overrides.in @@ -0,0 +1,8 @@ +# yes, we have to +@PVER@ binary: depends-on-python-minimal + +@PVER@ binary: desktop-command-not-in-package +@PVER@ binary: menu-command-not-in-package + +# no, not useless +@PVER@ binary: manpage-has-useless-whatis-entry --- python3.4-3.4.1.orig/debian/PVER.postinst.in +++ python3.4-3.4.1/debian/PVER.postinst.in @@ -0,0 +1,20 @@ +#! /bin/sh + +set -e + +case "$1" in + configure) + files=$(dpkg -L lib@PVER@-stdlib@HOST_QUAL@ | sed -n '/^\/usr\/lib\/@PVER@\/.*\.py$/p') + if [ -n "$files" ]; then + @PVER@ -E -S /usr/lib/@PVER@/py_compile.py $files + if grep -sq '^byte-compile[^#]*optimize' /etc/python/debian_config; then + @PVER@ -E -S -O /usr/lib/@PVER@/py_compile.py $files + fi + else + echo >&2 "@PVER@: can't get files for byte-compilation" + fi +esac + +#DEBHELPER# + +exit 0 --- python3.4-3.4.1.orig/debian/PVER.prerm.in +++ python3.4-3.4.1/debian/PVER.prerm.in @@ -0,0 +1,31 @@ +#! /bin/sh + +set -e + +remove_bytecode() +{ + pkg=$1 + max=$(LANG=C LC_ALL=C xargs --show-limits < /dev/null 2>&1 | awk '/Maximum/ {print int($NF / 4)}') + dpkg -L $pkg \ + | awk -F/ 'BEGIN {OFS="/"} /\.py$/ {$NF=sprintf("__pycache__/%s.*.py[co]", substr($NF,1,length($NF)-3)); print}' \ + | xargs --max-chars="$max" echo \ + | while read files; do rm -f $files; done + find /usr/lib/python3 /usr/lib/@PVER@ -name dist-packages -prune -o -name __pycache__ -empty -print \ + | xargs -r rm -rf +} + +case "$1" in + remove|upgrade) + remove_bytecode lib@PVER@-stdlib@HOST_QUAL@ + ;; + deconfigure) + ;; + failed-upgrade) + ;; + *) + echo "prerm called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +#DEBHELPER# --- python3.4-3.4.1.orig/debian/README.Debian.in +++ python3.4-3.4.1/debian/README.Debian.in @@ -0,0 +1,8 @@ +The documentation for this package is in /usr/share/doc/@PVER@/. + +A draft of the "Debian Python Policy" can be found in + + /usr/share/doc/python + +Sometime it will be moved to /usr/share/doc/debian-policy in the +debian-policy package. --- python3.4-3.4.1.orig/debian/README.PVER.in +++ python3.4-3.4.1/debian/README.PVER.in @@ -0,0 +1,95 @@ + + Python @VER@ for Debian + --------------------- + +This is Python @VER@ packaged for Debian. + +This document contains information specific to the Debian packages of +Python @VER@. + + + + [TODO: This document is not yet up-to-date with the packages.] + +Currently, it features those two main topics: + + 1. Release notes for the Debian packages: + 2. Notes for developers using the Debian Python packages: + +Release notes and documentation from the upstream package are installed +in /usr/share/doc/@PVER@/. + +There's a mailing list for discussion of issues related to Python on Debian +systems: debian-python@lists.debian.org. The list is not intended for +general Python problems, but as a forum for maintainers of Python-related +packages and interested third parties. + + + +1. Release notes for the Debian packages: + + +Results of the regression test: +------------------------------ + +The package does successfully run the regression tests for all included +modules. Seven packages are skipped since they are platform-dependent and +can't be used with Linux. + + +2. Notes for developers using the Debian python packages: + +See the draft of the Debian Python policy in /usr/share/doc/python. + +distutils can be found in the @PVER@-dev package. Development files +like the python library or Makefiles can be found in the @PVER@-dev +package in /usr/lib/@PVER@/config. Therefore, if you need to install +a pure python extension, you only need @PVER@. On the other hand, to +install a C extension, you need @PVER@-dev. + +a) Locally installed Python add-ons + + /usr/local/lib/@PVER@/site-packages/ + /usr/local/lib/site-python/ (version-independent modules) + +b) Python add-ons packaged for Debian + + /usr/lib/@PVER@/site-packages/ + /usr/lib/site-python/ (version-independent modules) + +Note that no package must install files directly into /usr/lib/@PVER@/ +or /usr/local/lib/@PVER@/. Only the site-packages directory is allowed +for third-party extensions. + +Use of the new `package' scheme is strongly encouraged. The `ni' interface +is obsolete in python 1.5. + +Header files for extensions go into /usr/include/@PVER@/. + + +Installing extensions for local use only: +---------------------------------------- + +Consider using distutils ... + +Most extensions use Python's Makefile.pre.in. Note that Makefile.pre.in +by default will install files into /usr/lib/, not into /usr/local/lib/, +which is not allowed for local extensions. You'll have to change the +Makefile accordingly. Most times, "make prefix=/usr/local install" will +work. + + +Packaging python extensions for Debian: +-------------------------------------- + +Maintainers of Python extension packages should read + + /usr/share/doc/python/python-policy.txt.gz + + + + + 03/09/98 + Gregor Hoffleit + +Last change: 2001-12-14 --- python3.4-3.4.1.orig/debian/README.Tk +++ python3.4-3.4.1/debian/README.Tk @@ -0,0 +1,8 @@ +Tkinter documentation can be found at + + http://www.pythonware.com/library/index.htm + +more specific: + + http://www.pythonware.com/library/tkinter/introduction/index.htm + http://www.pythonware.com/library/tkinter/an-introduction-to-tkinter.pdf --- python3.4-3.4.1.orig/debian/README.dbm +++ python3.4-3.4.1/debian/README.dbm @@ -0,0 +1,72 @@ + + Python and dbm modules on Debian + -------------------------------- + +This file documents the configuration of the dbm modules for Debian. It +gives hints at the preferred use of the dbm modules. + + +The preferred way to access dbm databases in Python is the anydbm module. +dbm databases behave like mappings (dictionaries). + +Since there exist several dbm database formats, we choose the following +layout for Python on Debian: + + * creating a new database with anydbm will create a Berkeley DB 2.X Hash + database file. This is the standard format used by libdb starting + with glibc 2.1. + + * opening an existing database with anydbm will try to guess the format + of the file (using whichdb) and then load it using one of the bsddb, + bsddb1, gdbm or dbm (only if the python-gdbm package is installed) + or dumbdbm modules. + + * The modules use the following database formats: + + - bsddb: Berkeley DB 2.X Hash (as in libc6 >=2.1 or libdb2) + - bsddb1: Berkeley DB 1.85 Hash (as in libc6 >=2.1 or libdb2) + - gdbm: GNU dbm 1.x or ndbm + - dbm: " (nearly the same as the gdbm module for us) + - dumbdbm: a hand-crafted format only used in this module + + That means that all usual formats should be readable with anydbm. + + * If you want to create a database in a format different from DB 2.X, + you can still directly use the specified module. + + * I.e. bsddb is the preferred module, and DB 2.X is the preferred format. + + * Note that the db1hash and bsddb1 modules are Debian specific. anydbm + and whichdb have been modified to support DB 2.X Hash files (see + below for details). + + + +For experts only: +---------------- + +Although bsddb employs the new DB 2.X format and uses the new Sleepycat +DB 2 library as included with glibc >= 2.1, it's still using the old +DB 1.85 API (which is still supported by DB 2). + +A more recent version 1.1 of the BSD DB module (available from +http://starship.skyport.net/robind/python/) directly uses the DB 2.X API. +It has a richer set of features. + + +On a glibc 2.1 system, bsddb is linked with -ldb, bsddb1 is linked with +-ldb1 and gdbm as well as dbm are linked with -lgdbm. + +On a glibc 2.0 system (e.g. potato for m68k or slink), bsddb will be +linked with -ldb2 while bsddb1 will be linked with -ldb (therefore +python-base here depends on libdb2). + + +db1hash and bsddb1 nearly completely identical to dbhash and bsddb. The +only difference is that bsddb is linked with the real DB 2 library, while +bsddb1 is linked with an library which provides compatibility with legacy +DB 1.85 databases. + + + July 16, 1999 + Gregor Hoffleit --- python3.4-3.4.1.orig/debian/README.idle-PVER.in +++ python3.4-3.4.1/debian/README.idle-PVER.in @@ -0,0 +1,14 @@ + + The Python IDLE package for Debian + ---------------------------------- + +This package contains Python @VER@'s Integrated DeveLopment Environment, IDLE. + +IDLE is included in the Python @VER@ upstream distribution (Tools/idle) and +depends on Tkinter (available as @PVER@-tk package). + +I have written a simple man page. + + + 06/16/1999 + Gregor Hoffleit --- python3.4-3.4.1.orig/debian/README.maintainers.in +++ python3.4-3.4.1/debian/README.maintainers.in @@ -0,0 +1,88 @@ + +Hints for maintainers of Debian packages of Python extensions +------------------------------------------------------------- + +Most of the content of this README can be found in the Debian Python policy. +See /usr/share/doc/python/python-policy.txt.gz. + +Documentation Tools +------------------- + +If your package ships documentation produced in the Python +documentation format, you can generate it at build-time by +build-depending on @PVER@-dev, and you will find the +templates, tools and scripts in /usr/lib/@PVER@/doc/tools -- +adjust your build scripts accordingly. + + +Makefile.pre.in issues +---------------------- + +Python comes with a `universal Unix Makefile for Python extensions' in +/usr/lib/@PVER@/config/Makefile.pre.in (with Debian, this is included +in the python-dev package), which is used by most Python extensions. + +In general, packages using the Makefile.pre.in approach can be packaged +simply by running dh_make or by using one of debhelper's rules' templates +(see /usr/doc/debhelper/examples/). Makefile.pre.in works fine with e.g. +"make prefix=debian/tmp/usr install". + +One glitch: You may be running into the problem that Makefile.pre.in +doesn't try to create all the directories when they don't exist. Therefore, +you may have to create them manually before "make install". In most cases, +the following should work: + + ... + dh_installdirs /usr/lib/@PVER@ + $(MAKE) prefix=debian/tmp/usr install + ... + + +Byte-compilation +---------------- + +For speed reasons, Python internally compiles source files into a byte-code. +To speed up subsequent imports, it tries to save the byte-code along with +the source with an extension .pyc (resp. pyo). This will fail if the +libraries are installed in a non-writable directory, which may be the +case for /usr/lib/@PVER@/. + +Not that .pyc and .pyo files should not be relocated, since for debugging +purposes the path of the source for is hard-coded into them. + +To precompile files in batches after installation, Python has a script +compileall.py, which compiles all files in a given directory tree. The +Debian version of compileall has been enhanced to support incremental +compilation and to feature a ddir (destination dir) option. ddir is +used to compile files in debian/usr/lib/python/ when they will be +installed into /usr/lib/python/. + + +Currently, there are two ways to use compileall for Debian packages. The +first has a speed penalty, the second has a space penalty in the package. + +1.) Compiling and removing .pyc files in postinst/prerm: + + Use dh_python(1) from the debhelper packages to add commands to byte- + compile on installation and to remove the byte-compiled files on removal. + Your package has to build-depend on: debhelper (>= 4.1.67), python. + + In /usr/share/doc/@PVER@, you'll find sample.postinst and sample.prerm. + If you set the directory where the .py files are installed, these + scripts will install and remove the .pyc and .pyo files for your + package after unpacking resp. before removing the package. + +2.) Compiling the .pyc files `out of place' during installation: + + As of 1.5.1, compileall.py allows you to specify a faked installation + directory using the "-d destdir" option, so that you can precompile + the files in their temporary directory + (e.g. debian/tmp/usr/lib/python2.1/site-packages/PACKAGE). + + + + 11/02/98 + Gregor Hoffleit + + +Last modified: 2007-10-14 --- python3.4-3.4.1.orig/debian/README.python +++ python3.4-3.4.1/debian/README.python @@ -0,0 +1,153 @@ + + Python 2.x for Debian + --------------------- + +This is Python 2.x packaged for Debian. + +This document contains information specific to the Debian packages of +Python 2.x. + + + + [TODO: This document is not yet up-to-date with the packages.] + + + + + + +Currently, it features those two main topics: + + 1. Release notes for the Debian packages: + 2. Notes for developers using the Debian Python packages: + +Release notes and documentation from the upstream package are installed +in /usr/share/doc/python/. + +Up-to-date information regarding Python on Debian systems is also +available as http://www.debian.org/~flight/python/. + +There's a mailing list for discussion of issues related to Python on Debian +systems: debian-python@lists.debian.org. The list is not intended for +general Python problems, but as a forum for maintainers of Python-related +packages and interested third parties. + + + +1. Release notes for the Debian packages: + + +Results of the regression test: +------------------------------ + +The package does successfully run the regression tests for all included +modules. Seven packages are skipped since they are platform-dependent and +can't be used with Linux. + + +Noteworthy changes since the 1.4 packages: +----------------------------------------- + +- Threading support enabled. +- Tkinter for Tcl/Tk 8.x. +- New package python-zlib. +- The dbmmodule was dropped. Use bsddb instead. gdbmmodule is provided + for compatibility's sake. +- python-elisp adheres to the new emacs add-on policy; it now depends + on emacsen. python-elisp probably won't work correctly with emacs19. + Refer to /usr/doc/python-elisp/ for more information. +- Remember that 1.5 has dropped the `ni' interface in favor of a generic + `packages' concept. +- Python 1.5 regression test as additional package python-regrtest. You + don't need to install this package unless you don't trust the + maintainer ;-). +- once again, modified upstream's compileall.py and py_compile.py. + Now they support compilation of optimized byte-code (.pyo) for use + with "python -O", removal of .pyc and .pyo files where the .py source + files are missing (-d) and finally the fake of a installation directory + when .py files have to be compiled out of place for later installation + in a different directory (-i destdir, used in ./debian/rules). +- The Debian packages for python 1.4 do call + /usr/lib/python1.4/compileall.py in their postrm script. Therefore + I had to provide a link from /usr/lib/python1.5/compileall.py, otherwise + the old packages won't be removed completely. THIS IS A SILLY HACK! + + + +2. Notes for developers using the Debian python packages: + + +Embedding python: +---------------- + +The files for embedding python resp. extending the python interpreter +are included in the python-dev package. With the configuration in the +Debian GNU/Linux packages of python 1.5, you will want to use something +like + + -I/usr/include/python1.5 (e.g. for config.h) + -L/usr/lib/python1.5/config -lpython1.5 (... -lpthread) + (also for Makefile.pre.in, Setup etc.) + +Makefile.pre.in automatically gets that right. Note that unlike 1.4, +python 1.5 has only one library, libpython1.5.a. + +Currently, there's no shared version of libpython. Future version of +the Debian python packages will support this. + + +Python extension packages: +------------------------- + +According to www.python.org/doc/essays/packages.html, extension packages +should only install into /usr/lib/python1.5/site-packages/ (resp. +/usr/lib/site-python/ for packages that are definitely version independent). +No extension package should install files directly into /usr/lib/python1.5/. + +But according to the FSSTND, only Debian packages are allowed to use +/usr/lib/python1.5/. Therefore Debian Python additionally by default +searches a second hierarchy in /usr/local/lib/. These directories take +precedence over their equivalents in /usr/lib/. + +a) Locally installed Python add-ons + + /usr/local/lib/python1.5/site-packages/ + /usr/local/lib/site-python/ (version-independent modules) + +b) Python add-ons packaged for Debian + + /usr/lib/python1.5/site-packages/ + /usr/lib/site-python/ (version-independent modules) + +Note that no package must install files directly into /usr/lib/python1.5/ +or /usr/local/lib/python1.5/. Only the site-packages directory is allowed +for third-party extensions. + +Use of the new `package' scheme is strongly encouraged. The `ni' interface +is obsolete in python 1.5. + +Header files for extensions go into /usr/include/python1.5/. + + +Installing extensions for local use only: +---------------------------------------- + +Most extensions use Python's Makefile.pre.in. Note that Makefile.pre.in +by default will install files into /usr/lib/, not into /usr/local/lib/, +which is not allowed for local extensions. You'll have to change the +Makefile accordingly. Most times, "make prefix=/usr/local install" will +work. + + +Packaging python extensions for Debian: +-------------------------------------- + +Maintainers of Python extension packages should read README.maintainers. + + + + + 03/09/98 + Gregor Hoffleit + +Last change: 07/16/1999 --- python3.4-3.4.1.orig/debian/README.source +++ python3.4-3.4.1/debian/README.source @@ -0,0 +1,7 @@ +The source tarball is lacking the files Lib/profile.py and Lib/pstats.py, +which Debian considers to have a license non-suitable for main (the use +of these modules limited to python). + +The package uses quilt to apply / unapply patches. +See /usr/share/doc/quilt/README.source. The series file is generated +during the build. --- python3.4-3.4.1.orig/debian/README.venv +++ python3.4-3.4.1/debian/README.venv @@ -0,0 +1,230 @@ +========================================= + pyvenv support in Python 3.4 and beyond +========================================= + +In Python 3.3, built-in support for virtual environments (venvs) was added via +the `pyvenv`_ command. For building venvs using Python 3, this is +functionally equivalent to the standalone `virtualenv`_ tool, except that +before Python 3.4, the pyvenv created venv didn't include pip and setuptools. + +In Python 3.4, this was made even more convenient by the `automatic +inclusion`_ of the `pip`_ command into the venv so that third party libraries +can be easily installed from the Python Package Index (PyPI_). The stdlib +module `ensurepip`_ is run when the `pyvenv-3.4` command is run to create the +venv. + +This poses a problem for Debian. ensurepip comes bundled with two third party +libraries, setuptools and pip itself, as these are requirements for pip to +function properly in the venv. These are bundled in the ensurepip module of +the upstream Python 3.4 tarball as `universal wheels`_, essentially a zip of +the source code and a new ``dist-info`` metadata directory. Upstream pip +itself comes bundled with a half dozen or so of *its* dependencies, except +that these are "vendorized", meaning their unpacked source code lives within +the pip module, under a submodule from which pip imports them rather than the +top-level package namespace. + +To make matters worse, one of pip's vendorized dependencies, the `requests`_ +module, *also* vendorizes a bunch of its own dependencies. This stack of +vendorized and bundled third party libraries fundamentally violates the DFSG +and Debian policy against including code not built from source available +within Debian, and for including embedded "convenience" copies of code in +other packages. + +It's worth noting that the virtualenv package actually suffers from the same +conflict, but its current solution in Debian is `incomplete`_. + + +Solving the conflict +==================== + +This conflict between Debian policy and upstream Python convenience must be +resolved, because pyvenv is the recommended way of creating venvs in Python 3, +and because at some point, the standalone virtualenv tool will be rewritten as +a thin layer above pyvenv. Obviously, we want to provide the best Python +virtual environment experience to our developers, adherent to Debian policy. + +The approach we've taken is layered and nuanced, so I'll provide a significant +amount of detail to explain both what we do and why. + +The first thing to notice is how upstream ensurepip works to have its pip and +setuptools dependencies available, both at venv creation time and when +``/bin/pip`` is run. When pyvenv-3.4 runs, it ends up calling the +following Python command:: + + /bin/python -Im ensurepip --upgrade + +This runs the ensurepip's ``__main__.py`` module using the venv's Python in +isolation mode, with a switch to upgrade the setuptools and pip dependencies +(if for example, they've been updated in a new micro version of Python). + +Internally, ensurepip bootstraps itself by byte-copying its embedded wheels +into a temporary directory, putting those copied wheels on ``sys.path``, and +then calling into pip as a library. Because wheels are just elaborate zips, +Python can execute (pure-Python) code directly from them, if they are on +``sys.path`` of course. Once ensurepip has set up its execution environment, +it calls into pip to install both pip and setuptools into the newly created +venv. If you poke inside the venv after successful creation, you'll see +unpacked pip and setuptools directories in the venv's ``site-packages` +directory. + +The important thing to note here is that ensurepip is *already* able to import +from and install wheels, and because wheels are self-contained single files +(of zipped content), it makes manipulating them quite easy. In order to +minimize the delta from upstream (and to eventually work with upstream to +eliminate this delta), it seems optimal that Debian's solution should also be +based on wheels, and re-use as much of the existing machinery as possible. + +The difference for Debian though is that we don't want to use the embedded pip +and setuptools wheels from upstream Python's ensurepip; we want to use wheels +created from the pip and setuptools *Debian* packages. This would solve the +problem of distributing binary packages not built from source in Debian. + +Thus, we modify the python-pip and python-setuptools packages to include new +binary packages ``python-pip-whl`` and ``python-setuptools-whl` which contain +*only* the relevant universal wheels. Those packages ``debian/rules`` files +gain an extra command:: + + python3 setup.py bdist_wheel --universal -d + +The ``bdist_wheel`` command is provided by the `wheel`_ package, which as of +this writing is newly available in Jessie. + +Note that the name of the binary packages, and other details of when and how +wheels may be used in Debian, is described in `Debian Python Policy`_ 0.9.6 or +newer. + +The universal wheels (i.e. pure-Python code compatible with both Python 2 and +Python 3) are built for pip and setuptools and installed into +``/usr/share/python-wheels`` when the python-{pip,setuptols}-whl packages are +installed. These are not needed for normal, usual, and typical operation of +Python, so none of these are installed by default. + +However, this isn't enough, because since the pip and setuptools wheels are +built from the *patched* and de-vendorized versions of the code in Debian, the +wheels will not contain their own recursive dependencies. That's a good thing +for Debian policy compliance, but does add complications to the stack of hack. + +Using the same approach as for pip and setuptools, we *also* wheelify their +dependencies, recursively. As of this writing, the list of packages needing +to be wheelified are (by Debian source package name): + + * chardet + * distlib + * html5lib + * python-colorama + * python-pip + * python-setuptools + * python-urllib3 + * requests + * six + +Most of these are DPMT maintained. six, distlib, and colorama are not team +maintained, so coordination with those maintainers is required. Also note +that the `bdist_wheel` command is a setuptools extension, so since some of +those projects use ``distutils.core.setup()`` by default, they must be patched +to use ``setuptools.setup()`` instead. This isn't a problem because there's +no functional difference relevant to those packages; they likely use +distutils.core to avoid a third party dependency on setuptools. + +Each of these Debian source packages grow an additional binary package, just +like pip and setuptools, e.g. python-chardet-whl which contains the universal +wheel for that package built from patched Debian source. As above, when +installed, these binary packages drop their .whl files into the +``/usr/share/python-wheels`` directory. + +Now comes the fun part. + +In the python3.4 source package, we add a new binary package called +python3.4-venv. This will only contain the ``/usr/bin/pyvenv-3.4`` +executable, and its associated manpage. It also includes all the run-time +dependencies to make pyvenv work *including the wheel packages described +above*. + +(Technically speaking, you should substitute "Python 3.4 or later" for all +these discussions, and e.g. pyvenv-3.x for all versions subsequent to 3.4.) + +Python's ensurepip module has been modified in the following ways (see +``debian/patches/ensurepip.diff``): + + * When ensurepip is run outside of a venv as root, it raises an exception. + This use case is only to be supported by the separate python{,3}-pip + packages. + + * When ensurepip is run inside of a venv, it copies all dependent wheels from + ``/usr/share/python-wheels``. This includes the direct dependencies pip + and setuptools, as well as the recursive dependencies listed above. The + rest of the ensurepip machinery is unchanged: the wheels are still copied + into a temporary directory and placed on ``sys.path``, however only the + direct dependencies (i.e. pip and setuptools) are *installed* into the + venv's ``site-packages`` directory. The indirect dependencies are copied + to ``/lib/python-wheels`` since they'll be needed by the venv's pip + executable. + +Why do we do this latter rather than also installing the recursive +dependencies into the venv's ``site-packages``? It's because pip requires a +very specific set of dependencies and we don't want pip to break when the user +upgrades or downgrades one of those packages, which is perfectly valid in a +venv. It's exactly the same reason why pip vendorizes those libraries in the +first place; it's just that we're doing it in a more principled way (from the +point of view of the Debian distribution). + +The final piece of the puzzle is that Debian's pip will, when run inside of a +venv, introspect ``/lib/python-wheels`` and put every .whl file it sees +there *at the front of its sys.path*. Again, this is so that when pip runs, +it will find the versions of packages known to be good first, rather than any +other versions in the venv's ``site-packages``. + +As an example of the bad things that can happen if you don't do this, try +installing nose2_ into the venv, followed by genshi_. nose2 has a hard +requirement on a version of six that is older than the one used by pip +(indirectly). This older version of six is compatible with genshi, but *not* +with pip, so once nose2 is installed, if pip didn't load its version of six +from the private wheel, the installation attempt of genshi would traceback. +As it is, with the wheels early enough on ``sys.path``, pip itself works just +fine so that both nose2 and genshi can live together in the venv. + + +Updating packages +================= + +Inevitably, new versions of Python or the pyvenv dependent packages will +appear. Unfortunately, as currently implemented (by both upstream ensurepip +and in our ensurepip patch), the versions of both the direct and indirect +dependencies are hardcoded in ``Lib/ensurepip/__init__.py``. When a Debian +developer updates any of the dependent packages, you will need to: + + * *Test that the new version is compatible with ensurepip*. + + * Update the version numbers in the ``debian/control`` file, for the + python3.x-venv binary package. + + * ``quilt push`` to the ensurepip patch, and update the version number in + ``Lib/ensurepip/__init__.py`` + +Then rebuild and upload python3.4. + +Yes, this isn't ideal, and I am working with upstream to find a good solution +that we can share. + + +Author +====== + +Barry A. Warsaw +2014-05-15 + + + +.. _pyvenv: http://legacy.python.org/dev/peps/pep-0405/ +.. _virtualenv: https://pypi.python.org/pypi/virtualenv +.. _`automatic inclusion`: http://legacy.python.org/dev/peps/pep-0453/ +.. _pip: https://pypi.python.org/pypi/pip +.. _PyPI: https://pypi.python.org/pypi +.. _ensurepip: https://docs.python.org/3/library/ensurepip.html +.. _`universal wheels`: http://legacy.python.org/dev/peps/pep-0427/ +.. _requests: https://pypi.python.org/pypi/requests +.. _incomplete: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=719767 +.. _wheel: https://pypi.python.org/pypi/wheel +.. _nose2: https://pypi.python.org/pypi/nose2 +.. _genshi: https://pypi.python.org/pypi/Genshi +.. _`Debian Python Policy`: https://www.debian.org/doc/packaging-manuals/python-policy/ --- python3.4-3.4.1.orig/debian/_sysconfigdata.py +++ python3.4-3.4.1/debian/_sysconfigdata.py @@ -0,0 +1,6 @@ +import sys + +if hasattr(sys, 'gettotalrefcount'): + from _sysconfigdata_dm import * +else: + from _sysconfigdata_m import * --- python3.4-3.4.1.orig/debian/changelog +++ python3.4-3.4.1/debian/changelog @@ -0,0 +1,3007 @@ +python3.4 (3.4.1-10) unstable; urgency=medium + + * Update to 20140818 from the 3.4 branch. + * Build-depend on dpkg-dev (>= 1.17.11). + + -- Matthias Klose Mon, 18 Aug 2014 10:00:55 +0200 + +python3.4 (3.4.1-9) unstable; urgency=medium + + * Update to 20140810 from the 3.4 branch. + + -- Matthias Klose Sun, 10 Aug 2014 14:53:46 +0200 + +python3.4 (3.4.1-8) unstable; urgency=medium + + * Update to 20140726 from the 3.4 branch. + * Move turtledemo from libpython3.4-testsuite to python3.4-examples. + * Call dpkg -L in the maintainer scripts with an architecture qualifier + for M-A: same packages. Closes: #754914. + + -- Matthias Klose Sat, 26 Jul 2014 14:16:56 +0200 + +python3.4 (3.4.1-7) unstable; urgency=medium + + * Update to 20140706 from the 3.4 branch. + + -- Matthias Klose Sun, 06 Jul 2014 21:37:36 +0200 + +python3.4 (3.4.1-6) unstable; urgency=medium + + * Fix logic to disable running the pystone benchmark on KFreeBSD (Steven + Chamberlain). + + -- Matthias Klose Mon, 09 Jun 2014 12:06:18 +0200 + +python3.4 (3.4.1-5) unstable; urgency=medium + + * Update to 20140608 from the 3.4 branch. + * Disable running the pystone benchmark on KFreeBSD. + + -- Matthias Klose Sun, 08 Jun 2014 11:43:44 +0200 + +python3.4 (3.4.1-4) unstable; urgency=medium + + * Disable running the pybench benchmark on KFreeBSD. + + -- Matthias Klose Sat, 07 Jun 2014 14:01:35 +0200 + +python3.4 (3.4.1-3) unstable; urgency=medium + + * Update to 20140605 from the 3.4 branch. + - pull in pyvenv changes. + * Update the ensurepip-wheels patch (Barry Warsaw). + * Fix python3.4-venv package removal. + + -- Matthias Klose Thu, 05 Jun 2014 11:57:51 +0200 + +python3.4 (3.4.1-2) unstable; urgency=medium + + * Update to 20140603 from the 3.4 branch. + * Remove the __pycache__ directories on libpython3.4-testsuite package + removal. Closes: #749999. + * In the autopkg tests, set HOME to the temporary home directory after + the su call. + * In the autopkg tests, make $ADTTMP accessible to the su user, and + re-enable the test_site autopkg test. + * Don't try to access the pip module in ensurepip, when the wheels + are not available. + + -- Matthias Klose Tue, 03 Jun 2014 23:58:48 +0200 + +python3.4 (3.4.1-1) unstable; urgency=medium + + * Python 3.4.1 release. + * Set a temporary home directory for the build and the autopkg tests. + * Fix issue #17752, test_distutils failures in the installed location. + * Update pydoc_data/topics.py, broken in the release candidate. + * Run again the test_code_module test in the autopkg tests. + * Fix issue #21264, test_compileall test failures in the installed + location. Re-enable in autopkg tests. LP: #1264554. + * ensurepip and pyvenv: + - Split out a python3.4-venv package, include the pyvenv-3.4 binary + and the ensurepip package. + - Adjust the ensurepip patch so that the wheels are installed from + the universal wheel packages (Barry Warsaw). + - Let ensurepip read wheel dependencies from a file shipped in the + -whl packages. + - Remove any version check on required pip and setuptools versions. + These are handled within these packages if necessary. + * Re-enable the pgo build. + + -- Matthias Klose Wed, 21 May 2014 22:17:32 +0200 + +python3.4 (3.4.1~rc1-1) unstable; urgency=medium + + * Python 3.4.1 release candidate 1. + * Don't run test_code_module in the autopkg test environment, fails there + but succeeds during the build. See issue #17756. Applied workaround + for the test case. + + -- Matthias Klose Mon, 05 May 2014 16:10:23 +0200 + +python3.4 (3.4.0+20140427-1) unstable; urgency=medium + + * Update to 20140427 from the 3.4 branch. + * Fix dependency for the -testsuite package: Closes: #745879. + + -- Matthias Klose Sun, 27 Apr 2014 18:48:54 +0200 + +python3.4 (3.4.0+20140425-1) unstable; urgency=medium + + * Update to 20140425 from the 3.4 branch. + * Don't try to byte-compile bad syntax files in the testsuite. + + -- Matthias Klose Fri, 25 Apr 2014 13:52:11 +0200 + +python3.4 (3.4.0+20140417-1) unstable; urgency=medium + + * Update to 20140417 from the 3.4 branch. + - Fix the test_site test failure. + * Repackage as a new tarball and remove the wheels shipped with ensurepip. + * Re-enable running some tests, disable some tests: + - Re-enable test_platform, test_subprocess, test_code_module, test_pydoc, + - Fix a distutils test error, skip a Solaris distutils test error. + - Skip the test_platform encoding test, failing with the lsb-release patch. + - Skip tests which are failing with python3.4.zip removed from sys.path. + Tracked in issue #21249. + * Byte-compile the files in the libpython3.4-testsuite package. + * d/p/distutils-install-layout.diff, d/p/site-locations.diff: Adjust the + "am I in a virtual environment" tests to include checking + sys.base_prefix != sys.prefix. This is the definitive such test for + pyvenv created virtual environments (Barry Warsaw). + * Disallow running ensurepip with the system python, when not used in + a virtual environment (Barry Warsaw). + * Don't yet install the ensurepip module, requires further work. + ensurepip wants to install bundled modules setuptools and python-pip, + which should be built from the distro packages instead of using the + bundled code. + * python3.4-dbg: Add a python3.4-dbg.py symlink. + * Remove the linecache patch, not needed anymore in 3.4. + * Remove the disable-utimes patch, not needed anymore since glibc-2.4. + * Remove the statvfs-f_flag-constants, avoid-rpath, hurd-path_max, + kfreebsd-xattrs, freebsd-testsuite and ncurses-configure patches + applied upstream. + * Don't add runtime paths for libraries found in multiarch locations. + + -- Matthias Klose Thu, 17 Apr 2014 21:05:04 +0200 + +python3.4 (3.4.0-2) unstable; urgency=medium + + * Update to 20140407 from the 3.4 branch. + - Issue #21134: Fix segfault when str is called on an uninitialized + UnicodeEncodeError, UnicodeDecodeError, or UnicodeTranslateError object. + - Issue #19537: Fix PyUnicode_DATA() alignment under m68k. + - Issue #21155: asyncio.EventLoop.create_unix_server() now raises + a ValueError if path and sock are specified at the same time. + - Issue #21149: Improved thread-safety in logging cleanup during + interpreter shutdown. + - Issue #20145: `assertRaisesRegex` and `assertWarnsRegex` now raise a + TypeError if the second argument is not a string or compiled regex. + - Issue #21058: Fix a leak of file descriptor in + :func:`tempfile.NamedTemporaryFile`, close the file descriptor if + :func:`io.open` fails. + - Issue #21013: Enhance ssl.create_default_context() when used for server + side sockets to provide better security by default. + - Issue #20633: Replace relative import by absolute import. + - Issue #20980: Stop wrapping exception when using ThreadPool. + - Issue #21082: In os.makedirs, do not set the process-wide umask. + Note this changes behavior of makedirs when exist_ok=True. + - Issue #20990: Fix issues found by pyflakes for multiprocessing. + - Issue #21015: SSL contexts will now automatically select an elliptic + curve for ECDH key exchange on OpenSSL 1.0.2 and later, and otherwise + default to "prime256v1". + - Issue #20816: Fix inspect.getcallargs() to raise correct TypeError for + missing keyword-only arguments. + - Issue #20817: Fix inspect.getcallargs() to fail correctly if more + than 3 arguments are missing. + - Issue #6676: Ensure a meaningful exception is raised when attempting + to parse more than one XML document per pyexpat xmlparser instance. + - Issue #20942: PyImport_ImportFrozenModuleObject() no longer sets __file__ + to match what importlib does; this affects _frozen_importlib as well as + any module loaded using imp.init_frozen(). + - Documentation, tools, demo and test updates. + * Depend on the python3-tk packages in the autopkg tests. + * Fix LTO builds with GCC 4.9. + + -- Matthias Klose Mon, 07 Apr 2014 11:46:02 +0200 + +python3.4 (3.4.0-1) unstable; urgency=medium + + * Python 3.4.0 release. + * Update to 20140322 from the 3.4 branch. + + * Build without ffi on or1k. Addresses: #738519. + * Update autopkg tests (Martin Pitt): + - Don't fail if apport is not installed. + - Call su with explicit shell, as nobody has nologin as default shell now. + - Only use $SUDO_USER if that user actually exists in the testbed. + - Drop obsolete chowning of $TMPDIR and $ADTTMP; with current autopkgtest + $TMPDIR has appropriate permissions, and $ADTTMP is not being used. + + -- Matthias Klose Sat, 22 Mar 2014 13:39:34 +0100 + +python3.4 (3.4~rc2-1) unstable; urgency=medium + + * Python 3.4 release candidate 2. + + -- Matthias Klose Mon, 24 Feb 2014 10:40:55 +0100 + +python3.4 (3.4~rc1-1) unstable; urgency=medium + + * Python 3.4 release candidate 1. + + -- Matthias Klose Tue, 11 Feb 2014 13:38:50 +0100 + +python3.4 (3.4~b3-1) unstable; urgency=medium + + * Python 3.4 beta 3. + + -- Matthias Klose Mon, 27 Jan 2014 10:54:10 +0000 + +python3.4 (3.4~b2-1) unstable; urgency=medium + + * Python 3.4 beta 2. + * Configure --with-system-libmpdec. + + -- Matthias Klose Sun, 05 Jan 2014 23:34:17 +0100 + +python3.4 (3.4~b1-5ubuntu2) trusty; urgency=medium + + * Disable the test_dbm autopkg test, failing from time to time ... + + -- Matthias Klose Fri, 03 Jan 2014 02:25:31 +0100 + +python3.4 (3.4~b1-5ubuntu1) trusty; urgency=medium + + * Build for Tcl/Tk 8.6. + + -- Matthias Klose Thu, 02 Jan 2014 18:05:27 +0100 + +python3.4 (3.4~b1-5) unstable; urgency=medium + + * Update to 20131231 from the trunk. + - Fix issue #20070, don't run test_urllib2net when network resources + are not enabled. + * Move the _sitebuiltins module into libpython3.4-minimal. + * distutils: On installation with --install-layout=deb, rename extensions + to include the multiarch tag. + Renaming of extensions for python3.4 is currently not done by dh-python. + See Debian #733128. + * autopkg tests: + - Update debian/tests/control to refer to python3.4. + - Generate locales for running the autopkg tests. + - Disable some currently failing autopkg tests. LP: #1264554. + - Disable test_compileall for the autopkg tests, fails only there. + * Don't run test_faulthandler on Aarch64, hangs on the buildds. + See LP: #1264354. + + -- Matthias Klose Tue, 31 Dec 2013 13:29:08 +0100 + +python3.4 (3.4~b1-4) unstable; urgency=medium + + * Update to 20131225 from the trunk. + * Fix python3.4--config --configdir. Closes: #733050. + + -- Matthias Klose Wed, 25 Dec 2013 21:56:04 +0100 + +python3.4 (3.4~b1-3) experimental; urgency=medium + + * Update to 20131221 from the trunk. + + -- Matthias Klose Sat, 21 Dec 2013 15:20:38 +0100 + +python3.4 (3.4~b1-2) experimental; urgency=low + + * Update to 20131202 from the trunk. + * Fix dbg symbols file for i386. + * Don't provide python3.4-dbm, available in a separate package. + * (Build-)depend on net-tools, test_uuid requires ifconfig. + * Fix distutils.sysconfig.get_makefile_filename(). + * Move operator module to the -minimal package. Closes: #731100. + + -- Matthias Klose Mon, 02 Dec 2013 14:36:44 +0100 + +python3.4 (3.4~b1-1) experimental; urgency=low + + * Python 3.4 beta 1. + + -- Matthias Klose Sun, 24 Nov 2013 23:21:49 +0100 + +python3.3 (3.3.3-2) unstable; urgency=low + + * Update to 20131123 from the 3.3 branch. + * Update hurd-path_max.diff. + + -- Matthias Klose Sat, 23 Nov 2013 08:57:21 +0100 + +python3.3 (3.3.3-1) unstable; urgency=low + + * Python 3.3.3 release. + * Update to 20131119 from the 3.3 branch. + * Regenerate the patches. + * Update the symbols files. + * Fix test support when the running kernel doesn't handle port reuse. + * libpython3.3-minimal replaces libpython3.3-stdlib (<< 3.2.3-7). + Closes: #725240. + + -- Matthias Klose Tue, 19 Nov 2013 08:46:55 +0100 + +python3.3 (3.3.2-7) unstable; urgency=low + + * Update to 20130918 from the 3.3 branch. + * Update symbols file. + * Fail the build if extensions for the minimal package are not in + the libpython-minimal package. Closes: #723624. + * Fix indentation in regenerated platform-lsbrelease.diff (Dmitry Shachnev). + LP: #1220508. + * Point to the python3-tk (instead of the python-tk) package when missing. + LP: #1184082. + + -- Matthias Klose Wed, 18 Sep 2013 12:19:47 +0200 + +python3.3 (3.3.2-6) unstable; urgency=medium + + * Update to 20130917 from the 3.3 branch. + - Fix SSL module to handle NULL bytes inside subjectAltNames general + names (CVE-2013-4238). Closes: #719567. + * Don't run the curses autopkg test. + * Set Multi-Arch attributes for binary packages. + * Fix multiarch include header for sparc64. Closes: #714802. + + -- Matthias Klose Tue, 17 Sep 2013 15:12:00 +0200 + +python3.3 (3.3.2-5) unstable; urgency=low + + * Update to 20130803 from the 3.3 branch. + - Fix fcntl test case on KFreeBSD (Petr Salinger). + * Disable some socket tests on KFreeBSD (Petr Salinger). + * Fix multiarch include header for sparc64. Closes: #714802. + * Update package descriptions (Filipus Klutiero). Closes: #715801. + + -- Matthias Klose Sun, 04 Aug 2013 17:38:35 +0200 + +python3.3 (3.3.2-4) unstable; urgency=low + + * Update to 20130612 from the 3.3 branch. + * Refresh patches. + * Don't run consistency check for cross builds. + * Really skip byte compile of non-existing sitecustomize.py. + * Fix the multiarch header file for mips64 (YunQiang Su). Closes: #710374. + + -- Matthias Klose Wed, 12 Jun 2013 22:55:02 +0200 + +python3.3 (3.3.2-3) unstable; urgency=low + + * Update to 20130527 from the 3.3 branch. + - Fix #17980, possible abuse of ssl.match_hostname() for denial of service + using certificates with many wildcards (CVE-2013-2099). Closes: #708530. + * Disable the test_io test on armel, armhf, mips, mipsel. Hangs the + buildds. + * Don't try to byte-compile sitecustomize.py if the target of the + symlink doesn't exist anymore. Addresses: #709157. + * Fix directory removal in maintainer scripts. Closes: #709963. + * Handle byte compilation in python3.3{-minimal,}, byte removal in + libpython3.3{-minimal,-stdlib}. + * Backport patch to fix issue #13146, possible race conditions when writing + .pyc/.pyo files in py_compile.py (Barry Warsaw). LP: #1058884. + * Mark all _Py_dg_* symbols as optional on m68k. Closes: #709888. + + -- Matthias Klose Mon, 27 May 2013 20:44:03 +0200 + +python3.3 (3.3.2-2) unstable; urgency=high + + * Fix the multiarch header file for ppc64. Closes: #708646. + * Disable running the tests on kfreebsd and the hurd. Please + follow-up in #708652 and #708653. + + -- Matthias Klose Fri, 17 May 2013 23:16:04 +0200 + +python3.3 (3.3.2-1) unstable; urgency=low + + * Python 3.3.2 release. + * Fix sysconfig.get_makefile_name() for the multiarch location. + * Set the platinclude dir back to the non-multiarch include path, + where the multiarch pyconfig.h compatibility header is found. + * Remove obsolete profile-doc patch. + * Run the pgo profile task in batches to avoid crashes during the + pgo profile run. + * Don't set yet any Multi-Arch: attributes in Debian. + * Build a libpython3.3-testsuite package. + * Add autopkg tests to run the installed testsuite in normal and debug + mode. + * Re-enable running the tests during the build. + * Add pyconfig.h compatibility headers. + + -- Matthias Klose Wed, 15 May 2013 19:41:15 +0200 + +python3.3 (3.3.1-1ubuntu5) raring; urgency=low + + * Remove obsolete profile-doc patch. + * Run the pgo profile task in batches to avoid crashes during the + pgo profile run. + * Disable the lto build on armhf for now. + * Final (?) set of autopkg test fixes. + * Issue #17012: shutil.which() no longer fallbacks to the PATH environment. + variable if empty path argument is specified. + * Issue #17782: Fix undefined behaviour on platforms where + ``struct timespec``'s "tv_nsec" member is not a C long. + + -- Matthias Klose Wed, 17 Apr 2013 23:35:49 +0200 + +python3.3 (3.3.1-1ubuntu4) raring; urgency=low + + * Don't run the test suite in random order. + * More autopkg test fixes. + + -- Matthias Klose Wed, 17 Apr 2013 13:33:00 +0200 + +python3.3 (3.3.1-1ubuntu3) raring; urgency=low + + * Fix sysconfig.get_makefile_name() for the multiarch location. + * Set the platinclude dir back to the non-multiarch include path, + where the multiarch pyconfig.h compatibility header is found. + * Fix autopkg tests. + * More autopkgtest fixes (Jean-Baptiste Lallement): + - redirect stderr of command 'stop apport' to /dev/null. output to stderr + is an error for adt. + - script.py waits for child to exit and exit with child's return code. + - xpickle is not a valid value for option -u of regrtest.py. Removed it + LP: #1169150. + * Issue #17754, setting LANG and LC_ALL for the compiler call in ctypes/util. + * Issue #17761, platform._parse_release_file doesn't close the + /etc/lsb-release file, and doesn't know about 'Ubuntu'. + + -- Matthias Klose Tue, 16 Apr 2013 17:33:35 +0200 + +python3.3 (3.3.1-1ubuntu2) raring; urgency=low + + * Idle updates: + - Issue #17657: Show full Tk version in IDLE's about dialog. + - Issue #17613: Prevent traceback when removing syntax colorizer. + - Issue #1207589: Backwards-compatibility patch for right-click menu. + - Issue #16887: Now accepts Cancel in tabify/untabify dialog box. + - Issue #17625: Close the replace dialog after it is used. + - Issue #14254: Now handles readline correctly across shell restarts. + - Issue #17614: No longer raises exception when quickly closing a file. + - Issue #6698: Now opens just an editor window when configured to do so. + - Issue #8900: Using keyboard shortcuts in IDLE to open a file no longer + raises an exception. + - Issue #6649: Fixed missing exit status. + * Build a libpython3.3-testsuite package. LP: #301629. + * Add autopkg tests to run the installed testsuite in normal and debug + mode. + * Re-enable running the tests during the build. + * Add pyconfig.h compatibility headers. LP: #1094246. + + -- Matthias Klose Wed, 10 Apr 2013 23:05:23 +0200 + +python3.3 (3.3.1-1ubuntu1) raring; urgency=low + + * Merge with Debian; remaining changes: + - Build-depend on python3:any instead of python3. + + -- Matthias Klose Sat, 06 Apr 2013 16:21:34 +0200 + +python3.3 (3.3.1-1) unstable; urgency=low + + * Python 3.3.1 release. + * Call python with -E -S for the byte compilation. + + -- Matthias Klose Sat, 06 Apr 2013 15:12:07 +0200 + +python3.3 (3.3.1~rc1-2) experimental; urgency=low + + * Fix byte-compiliation/-removal for the split-out library packages. + LP: #1160944. + + -- Matthias Klose Sat, 30 Mar 2013 13:36:40 +0100 + +python3.3 (3.3.1~rc1-1) experimental; urgency=low + + * Python 3.3.1 release candidate 1. + + -- Matthias Klose Tue, 26 Mar 2013 10:45:37 +0100 + +python3.3 (3.3.0-12) experimental; urgency=low + + * Update to 20130306 from the 3.3 branch. + * Remove the HAVE_FSYNC configure workaround, not needed for 3.3. + * Remove the python3 manual symlink (now shipped upstream by default). + Closes: #701051. + + -- Matthias Klose Wed, 06 Mar 2013 16:38:41 +0800 + +python3.3 (3.3.0-11) experimental; urgency=low + + * Update to 20130220 from the 3.3 branch. + + -- Matthias Klose Wed, 20 Feb 2013 15:40:05 +0100 + +python3.3 (3.3.0-10) experimental; urgency=low + + * Update to 20130126 from the 3.3 branch. + * Update hurd patches. + * python3.3-dbg, libpython3.3-dbg: Drop dependency on python. + * python3.3-dbg: Make gdb (not gdb-minimal) a recommendation. + * Git rid of build-dependency on python. + * Add site-packages in virtual environments created by pyvenv. + Closes: #698777. + + -- Matthias Klose Sat, 26 Jan 2013 12:17:05 +0100 + +python3.3 (3.3.0-9) experimental; urgency=low + + * Update to 20130125 from the 3.3 branch. + * Update cross build patches, and allow the package to cross build. + + -- Matthias Klose Fri, 25 Jan 2013 17:06:25 +0100 + +python3.3 (3.3.0-8) experimental; urgency=low + + * Update to 20130105 from the 3.3 branch. + * python-config --help returns with an exit value 0. LP: #1093860. + * Update package description for the -dbg packages. Closes: #696616. + + -- Matthias Klose Sat, 05 Jan 2013 18:39:32 +0100 + +python3.3 (3.3.0-7) experimental; urgency=low + + * Update to 20121220 from the 3.3 branch. + * debian/patches/sys-multiarch.diff: Expose multiarch triplet value + as sys.implementation._multiarch (Barry Warsaw). Closes: #695959. + Note: Usage of sysconfig.get_config_var('MULTIARCH') is preferred. + * Set the install schema to `unix_prefix', if a virtual environment + is detected (VIRTUAL_ENV env var present). Closes: #695758. + * python3.3-dev, libpython3.3-dev: Drop the dependency on libssl-dev. + + -- Matthias Klose Fri, 21 Dec 2012 07:24:41 +0100 + +python3.3 (3.3.0-6) experimental; urgency=low + + * Don't use xattrs on kfreebsd and the Hurd. + + -- Matthias Klose Tue, 04 Dec 2012 04:36:42 +0100 + +python3.3 (3.3.0-5) experimental; urgency=low + + * Update to 20121203 from the 3.3 branch. + * Make python3.3, python3.3-{minimal,dev,dbg} Multi-Arch: allowed. + * Use a shell implementation for the python-config script. + + -- Matthias Klose Mon, 03 Dec 2012 21:52:33 +0100 + +python3.3 (3.3.0-4) experimental; urgency=low + + * Update to 20121128 from the 3.3 branch. + * Don't link extensions with the shared libpython library. + * Override pointless lintian warning `hardening-no-fortify-functions' + for binaries built without optimization. + + -- Matthias Klose Wed, 28 Nov 2012 13:47:16 +0100 + +python3.3 (3.3.0-3) experimental; urgency=low + + * Update to 20121106 from the 3.3 branch. + * Filter-out cflags for profiled builds from _sysconfigdata. + * Fix multiarch plat-linux installation. LP: #1075891. + * Install _sysconfigdata.py from the shared builds. LP: #1075903. + + -- Matthias Klose Wed, 07 Nov 2012 14:31:02 +0100 + +python3.3 (3.3.0-2) experimental; urgency=low + + * Update to 20121021 from the 3.3 branch. + * Fix the interpreter name for the python3.3-dbg-config script. + + -- Matthias Klose Sun, 21 Oct 2012 09:51:05 +0200 + +python3.3 (3.3.0-1) experimental; urgency=low + + * Python 3.3.0 release. + + -- Matthias Klose Sat, 29 Sep 2012 12:59:24 +0200 + +python3.3 (3.3.0~rc3-1) experimental; urgency=low + + * Python 3.3.0 release candidate 3. + * Don't try to write lib2to3's pickled grammar files. Closes: #687200. + * Fix python-config manpage symlink. Closes: #687201. + + -- Matthias Klose Mon, 24 Sep 2012 16:22:17 +0200 + +python3.3 (3.3.0~rc2-2ubuntu1) quantal; urgency=low + + * Encode the version in the devhelp documentation name. LP: #787039. + + -- Matthias Klose Mon, 10 Sep 2012 12:56:13 +0200 + +python3.3 (3.3.0~rc2-2) experimental; urgency=low + + * Fix typo fixing the pkgconfig file. + + -- Matthias Klose Mon, 10 Sep 2012 11:13:51 +0200 + +python3.3 (3.3.0~rc2-1) experimental; urgency=low + + * Python 3.3.0 release candidate 2. + * Add the platform include dir to pkgconfig's CFlags. + * Hint on installing the python-gdbm package on failing _gdbm import. + LP: #995616. + * libpython3.3: Fix libpython3.3.so symlink. Closes: #686377. + * Don't use `-n' anymore to start idle in the desktop/menu files. + + -- Matthias Klose Sun, 09 Sep 2012 13:38:55 +0200 + +python3.3 (3.3.0~rc1-2) experimental; urgency=low + + * distutils: Add the multiarch python path to the include directories. + Closes: #685041. + * Remove /etc/python3.3 in libpython3.3-minimal instead of python3.3-minimal. + Closes: #681979. + * Remove /etc/python/sysconfig.cfg, not available anymore in python3.3. + Closes: #685016. + * Don't ship the _gdbm and _tkinter extensions in the -dbg package. + Closes: #685261. + * Fix verbose parallel builds for the sharedmods target. + * Don't install the pickled lib2to3 grammar files. Closes: #685214. + * Build extensions with fortify flags. + * Overwrite arch-dependent-file-not-in-arch-specific-directory warnings. + + -- Matthias Klose Tue, 28 Aug 2012 19:47:58 +0200 + +python3.3 (3.3.0~rc1-1) experimental; urgency=low + + * Python 3.3.0 release candidate 1. + + -- Matthias Klose Sun, 26 Aug 2012 23:15:00 +0200 + +python3.3 (3.3.0~b2-1) experimental; urgency=low + + * Python 3.3.0 beta2 release. + * Fix removal of the _tkinter and dbm extensions for multiarch builds. + Closes: #684461. + * Use _sysconfigdata.py in distutils to initialize distutils. + Closes: #682475. + * Fix symlink for static libpython. Closes: #684608. + + -- Matthias Klose Mon, 13 Aug 2012 11:05:00 +0200 + +python3.3 (3.3.0~b1-3) experimental; urgency=low + + * Update to 20120712 from the trunk. + * Install separate _sysconfigdata.py for normal and debug builds. + * Install into multiarch locations. + * Split out multiarch packages libpython3.3-{minimal,stdlib,dev,dbg}. + + -- Matthias Klose Fri, 13 Jul 2012 00:43:42 +0200 + +python3.3 (3.3.0~b1-2) experimental; urgency=low + + * Update to 20120701 from the trunk. + + -- Matthias Klose Sun, 01 Jul 2012 11:45:12 +0200 + +python3.3 (3.3.0~b1-1) experimental; urgency=low + + * Python 3.3.0 beta1 release. + * Fix symlink for the -gdb.py file. + * debian/copyright: Add libmpdec license. + * Enable fortified build. + + -- Matthias Klose Wed, 27 Jun 2012 08:44:56 +0200 + +python3.3 (3.3.0~a4-1) experimental; urgency=low + + * Python 3.3.0 alpha4 release. + * Update to 20120620 from the trunk. + * Build _ctypes as an extension, not a builtin. + * Mark symbols defined in the _ctypes extension as optional. + * Remove references to the removed pyton3.3-documenting file. + * The wininst-* files cannot be built within Debian from the included + sources, needing a zlib mingw build, which the zlib maintainer isn't + going to provide. + * Use the underscore.js file provided by the libjs-underscore package. + * Let pydoc handle dist-packages the same as site-packages. + * Avoid runtime path for the sqlite extension. + + -- Matthias Klose Wed, 20 Jun 2012 13:09:19 +0200 + +python3.3 (3.3.0~a3-1) experimental; urgency=low + + * Python 3.3.0 alpha3 release. + * Build the dbm extension using db5.3. + * Update symbols file for a3. + + -- Matthias Klose Wed, 02 May 2012 23:28:46 +0200 + +python3.3 (3.3.0~a2-1) experimental; urgency=low + + * Python 3.3.0 alpha2 release. + * Update to 20120404 from the trunk. + * Build-depend on expat (>= 2.1). + + -- Matthias Klose Wed, 04 Apr 2012 16:31:34 +0200 + +python3.3 (3.3.0~a1-1) experimental; urgency=low + + * Python 3.3.0 alpha1 release. + * Update to 20120321 from the trunk. + * Update debian/copyright. + * Build-depend on expat (>= 2.1~). + + -- Matthias Klose Thu, 22 Mar 2012 06:14:01 +0100 + +python3.3 (3.3~20120109-1) experimental; urgency=low + + * 3.3 20120109 snapshot from the trunk. + * Merge packaging from python3.2 3.2.2-4. + + -- Matthias Klose Sun, 08 Jan 2012 09:44:33 +0100 + +python3.3 (3.3~20110523-1) experimental; urgency=low + + * Initial Python 3.3 packaging. + + -- Matthias Klose Mon, 23 May 2011 09:20:52 +0200 + +python3.2 (3.2.2-4) unstable; urgency=low + + * The static library belongs into the -dev package. + * Remove obsolete attributes in the control file. + + -- Matthias Klose Sat, 07 Jan 2012 20:46:39 +0100 + +python3.2 (3.2.2-3) unstable; urgency=low + + * Update to 20120106 from the 3.2 branch. + * Install manual pages for 2to3 and python-config. + * Fix file permission of token.py module. + * Add the ability to build an python3.x udeb, as copy of the + python3.x-minimal package (Colin Watson). + * Overwrite some lintian warnings: + - The -dbg interpreters are not unusual. + - The -gdb.py files don't need a python dependency. + - lintian can't handle a whatis entry starting with one word on the line. + * Fix test failures related to distutils debian installation layout. + * Update symbols files. + * Add build-arch/build-indep targets. + * Regenerate Setup and Makefiles after correcting Setup.local. + * profiled-build.diff: Pass PY_CFLAGS instead of CFLAGS for the profiled + build. + * Pass dpkg-buildflags to the build process, and build third party + extensions with these flags. + * Add support to build using -flto (and -g1) on some architectures. + * Disable pgo builds for some architectures (for now, keep just + amd64 armel armhf i386 powerpc ppc64). + * Build-depend on libgdbm-dev to build and run the gdbm tests. + * Build-depend on xvfb to run the tkinter tests. + + -- Matthias Klose Fri, 06 Jan 2012 20:10:13 +0100 + +python3.2 (3.2.2-2) unstable; urgency=low + + * Update platform patches (alpha, hppa, mips, sparc). + + -- Matthias Klose Fri, 02 Dec 2011 10:24:05 +0100 + +python3.2 (3.2.2-1) unstable; urgency=low + + * Python 3.2.2 release. + * Update to 20111201 from the 3.2 branch. + * Search headers in /usr/include/ncursesw for the curses/panel extensions. + * New patch, ctypes-arm, allow for ",hard-float" after libc6 in ldconfig -p + output (Loic Minier). LP: #898172. + + -- Matthias Klose Thu, 01 Dec 2011 13:19:16 +0100 + +python3.2 (3.2.2~rc1-1) unstable; urgency=low + + * Python 3.2.2 release candidate 1. + + -- Matthias Klose Sun, 14 Aug 2011 20:25:35 +0200 + +python3.2 (3.2.1-2) unstable; urgency=low + + * Update to 20110803 from the 3.2 branch. + * Revert previous change to treat Linux 3.x as Linux 2. Use the + plat-linux3 directory instead. + * Use linux-any for some build dependencies. Closes: #634310. + + -- Matthias Klose Wed, 03 Aug 2011 15:16:05 +0200 + +python3.2 (3.2.1-1) unstable; urgency=medium + + * Python 3.2.1 release. + * Update lib-argparse patch (Pino Toscano). Closes: #631635. + * Treat Linux 3.x as Linux 2. Closes: #633015. + + -- Matthias Klose Sun, 10 Jul 2011 21:46:36 +0200 + +python3.2 (3.2.1~rc2-1) unstable; urgency=low + + * Python 3.2.1 release candidate 2. + * Add profile/pstats to the python3.2 package, update debian copyright. + * Don't run the benchmark on hurd-i386. + * Disable threading tests on hurd-i386. Closes: #631634. + * Don't add the bsddb multilib path, if already in the standard lib path. + + -- Matthias Klose Mon, 04 Jul 2011 20:27:52 +0200 + +python3.2 (3.2.1~rc1-1) unstable; urgency=low + + * Python 3.2.1 release candidate 1. + * Only enable sphinx-0.x patches when building with sphinx-0.x. + + -- Matthias Klose Wed, 18 May 2011 12:15:47 +0200 + +python3.2 (3.2-4) unstable; urgency=low + + * Update to 20110504 from the 3.2 branch. + * Disable the profiled build on ia64 and m68k. + * Update symbols file for m68k (Thorsten Glaser). + + -- Matthias Klose Wed, 04 May 2011 21:32:08 +0200 + +python3.2 (3.2-3) unstable; urgency=low + + * Update to 20110427 from the 3.2 branch. + - Fix argparse import. Closes: #624277. + * Keep the ssl.PROTOCOL_SSLv2 module constant , just raise an exception + when trying to create a PySSL object. #624127. + * Don't depend on the locale and specific awk implementations in prerm. + Closes: #623466, #620836. + * Remove the old local site directory. Closes: #623057. + + -- Matthias Klose Wed, 27 Apr 2011 20:40:29 +0200 + +python3.2 (3.2-2) unstable; urgency=low + + * Update to 20110419 from the 3.2 branch. + * Re-enable profile-guided builds. + * Build without OpenSSL v2 support. Closes: #622004. + * Force linking the curses module against libncursesw. Closes: #622064. + * Re-enable running the testsuite during the build. + + -- Matthias Klose Tue, 19 Apr 2011 17:54:36 +0200 + +python3.2 (3.2-1) unstable; urgency=low + + * Python 3.2 final release. + + -- Matthias Klose Sun, 20 Feb 2011 19:22:24 +0100 + +python3.2 (3.2~rc3-1) experimental; urgency=low + + * Python 3.2 release candidate 3. + + -- Matthias Klose Mon, 14 Feb 2011 16:12:14 +0100 + +python3.2 (3.2~rc1-2) experimental; urgency=low + + * Fix upgrade of the python3.2-dev package. Closes: #610370. + + -- Matthias Klose Wed, 19 Jan 2011 02:21:19 +0100 + +python3.2 (3.2~rc1-1) experimental; urgency=low + + * Python 3.2 release candidate 1. + + -- Matthias Klose Sun, 16 Jan 2011 22:17:09 +0100 + +python3.2 (3.2~b2-1) experimental; urgency=low + + * Python 3.2 beta2 release. + * Fix FTBFS on hurd-i386 (Pino Toscano). Closes: #606152). + + -- Matthias Klose Tue, 21 Dec 2010 21:23:21 +0100 + +python3.2 (3.2~b1-1) experimental; urgency=low + + * Python 3.2 beta1 release. + * Configure with --enable-loadable-sqlite-extensions. + + -- Matthias Klose Mon, 06 Dec 2010 12:19:09 +0100 + +python3.2 (3.2~a4-2) experimental; urgency=low + + * Fix build failure on the hurd. + + -- Matthias Klose Fri, 26 Nov 2010 06:38:41 +0100 + +python3.2 (3.2~a4-1) experimental; urgency=low + + * Python 3.2 alpha4 release. + * Update to the py3k branch (20101124). + * Move the Makefile into the -min package, required by sysconfig. + Addresses: #603237. + + -- Matthias Klose Wed, 24 Nov 2010 22:20:32 +0100 + +python3.2 (3.2~a3-2) experimental; urgency=low + + * Update to the py3k branch (20101018). + - Issue #10094: Use versioned .so files on GNU/kfreeBSD and the GNU Hurd. + Closes: #600183. + + -- Matthias Klose Mon, 18 Oct 2010 19:34:39 +0200 + +python3.2 (3.2~a3-1) experimental; urgency=low + + * Python 3.2 alpha3 release. + * Make Lib/plat-gnukfreebsd[78] ready for python3. Closes: #597874. + + -- Matthias Klose Tue, 12 Oct 2010 16:13:15 +0200 + +python3.2 (3.2~a2-7) experimental; urgency=low + + * Update to the py3k branch (20100926). + + -- Matthias Klose Sun, 26 Sep 2010 14:41:18 +0200 + +python3.2 (3.2~a2-6) experimental; urgency=low + + * Update to the py3k branch (20100919). + * Update GNU/Hurd patches (Pino Toscano). Closes: #597320. + + -- Matthias Klose Sun, 19 Sep 2010 12:45:14 +0200 + +python3.2 (3.2~a2-5) experimental; urgency=low + + * Update to the py3k branch (20100916). + * Provide Lib/plat-gnukfreebsd[78] (Jakub Wilk). Addresses: #593818. + * Assume working semaphores, don't rely on running kernel for the check. + LP: #630511. + + -- Matthias Klose Thu, 16 Sep 2010 14:41:58 +0200 + +python3.2 (3.2~a2-4) experimental; urgency=low + + * Update to the py3k branch (20100911). + * Add the sysconfig module to python3.2-minimal. + * Remove dist-packages/README. + * Make xargs --show-limits in the maintainer scripts independent from + the locale. + + -- Matthias Klose Sat, 11 Sep 2010 20:59:47 +0200 + +python3.2 (3.2~a2-3) experimental; urgency=low + + * Update to the py3k branch (20100910). + * Disable profile feedback based optimization on armel. + * Add copyright information for expat, libffi and zlib. Sources + for the wininst-* files are in PC/bdist_wininst. Closes: #596276. + * Run the testsuite in parallel, when parallel= is set in DEB_BUILD_OPTIONS. + + -- Matthias Klose Fri, 10 Sep 2010 20:28:16 +0200 + +python3.2 (3.2~a2-2) experimental; urgency=low + + * Fix distutils.sysconfig.get_makefile_name for debug builds. + + -- Matthias Klose Thu, 09 Sep 2010 02:40:11 +0200 + +python3.2 (3.2~a2-1) experimental; urgency=low + + * Python 3.2 alpha2 release. + * Update to the py3k branch (20100908). + * Provide /usr/lib/python3/dist-packages as location for public python + packages. + + -- Matthias Klose Wed, 08 Sep 2010 17:36:06 +0200 + +python3.2 (3.2~a1-1) experimental; urgency=low + + * Python 3.2 alpha1 release. + - Files removed: Lib/profile.py, Lib/pstats.py, PC/icons/source.xar. + * Update to the py3k branch (20100827). + * Fix detection of ffi.h header file. Closes: #591408. + * python3.1-dev: Depend on libssl-dev. LP: #611845. + + -- Matthias Klose Fri, 27 Aug 2010 21:40:31 +0200 + +python3.2 (3.2~~20100707-0ubuntu1) maverick; urgency=low + + * Move the pkgconfig file into the -dev package. + * Update preremoval scripts for __pycache__ layout. + * Run hooks from /usr/share/python3/runtime.d/ + * Update distutils-install-layout and debug-build patches. + + -- Matthias Klose Wed, 07 Jul 2010 12:38:52 +0200 + +python3.2 (3.2~~20100706-0ubuntu1) maverick; urgency=low + + * Test build, taken from the py3k branch (20100706). + * Merge with the python3.1 packaging. + + -- Matthias Klose Tue, 06 Jul 2010 17:10:51 +0200 + +python3.2 (3.2~~20100704-0ubuntu1) maverick; urgency=low + + * Test build, taken from the py3k branch (20100704). + + -- Matthias Klose Sun, 04 Jul 2010 16:04:45 +0200 + +python3.2 (3.2~~20100421-0ubuntu1) lucid; urgency=low + + * Test build, taken from the py3k branch (20100421). + + -- Matthias Klose Wed, 21 Apr 2010 22:04:14 +0200 + +python3.1 (3.1.2+20100703-1) unstable; urgency=low + + * Update to the 3.1 release branch, 20100703. + * Convert internal dpatch system to quilt. + * Update module list for python3-minimal. + + -- Matthias Klose Sat, 03 Jul 2010 14:18:18 +0200 + +python3.1 (3.1.2-3) unstable; urgency=low + + * Update to the 3.1 release branch, 20100508. + * Fix backport of issue #8140. Closes: #578896. + + -- Matthias Klose Sat, 08 May 2010 15:37:35 +0200 + +python3.1 (3.1.2-2) unstable; urgency=low + + * Update to the 3.1 release branch, 20100421. + * Update patch for issue #8032, gdb7 hooks for debugging. + * Fix issue #8233: When run as a script, py_compile.py optionally + takes a single argument `-`. + * Don't build-depend on locales on avr32. + + -- Matthias Klose Wed, 21 Apr 2010 21:12:37 +0200 + +python3.1 (3.1.2-1) unstable; urgency=low + + * Python 3.1.2 release. + * Fix issue #4961: Inconsistent/wrong result of askyesno function in + tkMessageBox with Tcl8.5. LP: #462950. + * Don't complain when /usr/local is not writable on installation. + * Apply proposed patch for issue #8032, gdb7 hooks for debugging. + + -- Matthias Klose Sun, 21 Mar 2010 17:59:49 +0100 + +python3.1 (3.1.2~rc1-2) unstable; urgency=low + + * Update to the 3.1 release branch, 20100316. + * Backport issue #8140: Extend compileall to compile single files. + Add -i option. + + -- Matthias Klose Tue, 16 Mar 2010 02:38:45 +0100 + +python3.1 (3.1.2~rc1-1) unstable; urgency=low + + * Python 3.1.2 release candidate 1. + - Replace the Monty Python audio test file. Closes: #568676. + * Build using libdb4.8-dev. Only used for the dbm extension; the bsddb3 + extension isn't built from the core packages anymore. + + -- Matthias Klose Thu, 11 Mar 2010 17:26:17 +0100 + +python3.1 (3.1.1-3) unstable; urgency=low + + * Update to the 3.1 release branch, 20100119. + * Hurd fixes (Pino Toscano): + - hurd-broken-poll.dpatch: ported from 2.5. + - hurd-disable-nonworking-constants.dpatch: disable a few constants from + the public API whose C counterparts are not implemented, so using them + either always blocks or always fails (caused issues in the test suite). + - hurd-path_max.dpatch (hurd only): change few PATH_MAX occurrences to + MAXPATHLEN (which is defined by the python lib if not defined by the OS). + - cthreads.dpatch: Refresh. + - Exclude the profiled build for hurd. + - Disable six blocking tests from the test suite. + * Don't run the testsuite on armel and hppa until someone figures out + the blocking tests. + + -- Matthias Klose Tue, 19 Jan 2010 22:02:14 +0100 + +python3.1 (3.1.1-2) unstable; urgency=low + + * Update to the 3.1 release branch, 20100116. + * Fix bashism in makesetup shell script. Closes: #530170, #530171. + * Fix build issues on avr (Bradley Smith). Closes: #528439. + - Configure --without-ffi. + - Don't run lengthly tests. + + -- Matthias Klose Sat, 16 Jan 2010 23:28:05 +0100 + +python3.1 (3.1.1-1) experimental; urgency=low + + * Python 3.1.1 final release. + * Update to the 3.1 release branch, 20091011. + * Remove /usr/local/lib/python3.1 on package removal, if empty. + * Build _hashlib as a builtin. LP: #445530. + * python3.1-doc: Don't compress the sphinx inventory. + * python3.1-doc: Fix jquery.js symlink. LP: #447370. + * Run the benchmark with -C 2 -n 5 -w 4 on all architectures. + * python3.1-dbg: Don't create debug subdirectory in /usr/local. No + separate debug directory needed anymore. + * Fix title of devhelp document. LP: #423551. + + -- Matthias Klose Sun, 11 Oct 2009 22:01:57 +0200 + +python3.1 (3.1-1) experimental; urgency=low + + * Python 3.1 final release. + * Update to the 3.1 release branch, 20090723. + * Add explicit build dependency on tk8.5-dev. + + -- Matthias Klose Thu, 23 Jul 2009 15:20:35 +0200 + +python3.1 (3.1-0ubuntu2) karmic; urgency=low + + * Disable profile feedback based optimization on amd64 (GCC + PR gcov-profile/38292). + + -- Matthias Klose Fri, 24 Jul 2009 16:27:22 +0200 + +python3.1 (3.1-0ubuntu1) karmic; urgency=low + + * Python 3.1 final release. + * Update to the 3.1 release branch, 20090723. + * Add explicit build dependency on tk8.5-dev. + + -- Matthias Klose Thu, 23 Jul 2009 18:52:17 +0200 + +python3.1 (3.1~rc2+20090622-1) experimental; urgency=low + + [Matthias Klose] + * Python 3.1 rc2 release. Closes: #529320. + * Update to the trunk, 20090622, remove patches integrated upstream. + * Configure with --with-fpectl --with-dbmliborder=bdb --with-wide-unicode. + NOTE: The --with-wide-unicode configuration will break most extensions + built with 3.1~a1, but is consistent with python2.x configurations. + * Add symbols files for libpython3.1 and python3.1-dbg, don't include symbols + from builtins, which can either be built as builtins or extensions. + * Keep an empty lib-dynload in python3.1-minimal to avoid a warning on + startup. + * python3.1-doc: Depend on libjs-jquery, use jquery.js from this package. + Closes: #523485. + * Do not add /usr/lib/pythonXY.zip on sys.path. + * Add symbols files for libpython3.1 and python3.1-dbg, don't include symbols + from builtins, which can either be built as builtins or extensions. + * Keep an empty lib-dynload in python3.1-minimal to avoid a warning on + startup. + * Fix some lintian warnings. + * Use the information in /etc/lsb-release for platform.dist(). LP: #196526. + * Move the bdist_wininst files into the -dev package (only needed to build + windows installers). + * Document changes to the site directory name in the installation manual. + * Don't build a profiled binary. Closes: #521811. + + * Address issues when working with PYTHONUSERBASE and non standard prefix + (pointed out by Larry Hastings): + - distutils.sysconfig.get_python_lib(): Only return ".../dist-packages" if + prefix is the default prefix and if PYTHONUSERBASE is not set in the + environment. + - site.addusersitepackages(): Add USER_BASE/.../dist-packages to sys.path. + * Always use the `unix_prefix' scheme for setup.py install in a virtualenv + setup. LP: #339904. + * Don't make the setup.py install options --install-layout=deb and --prefix + conflict with each other. + * distutils: Always install into `/usr/local/lib/python3.1/dist-packages' + if an option `--prefix=/usr/local' is present (except for virtualenv + and PYTHONUSERBASE installations). LP: #362570. + * Always use `site-packages' as site directory name in virtualenv. + + [Marc Deslauriers] + * debian/pyhtml2devhelp.py: update for sphinx generated documentation. + * debian/rules: re-enable documentation files for devhelp. + + -- Matthias Klose Mon, 22 Jun 2009 16:18:39 +0200 + +python3.1 (3.1~a1+20090322-1) experimental; urgency=low + + * Python 3.1 alpha1 release. + * Update to the trunk, 20090322. + * Update installation schemes: LP: #338395. + - When the --prefix option is used for setup.py install, Use the + `unix_prefix' scheme. + - Use the `deb_system' scheme if --install-layout=deb is specified. + - Use the the `unix_local' scheme if neither --install-layout=deb + nor --prefix is specified. + * Use the information in /etc/lsb-release for platform.dist(). LP: #196526. + * pydoc: Fix detection of local documentation files. + * Build a shared library configured --with-pydebug. LP: #322580. + * Fix some lintian warnings. + + -- Matthias Klose Mon, 23 Mar 2009 00:01:27 +0100 + +python3.1 (3.1~~20090226-1) experimental; urgency=low + + * Python-3.1 snapshot (20090226), upload to experimental. + + -- Matthias Klose Thu, 26 Feb 2009 16:18:41 +0100 + +python3.1 (3.1~~20090222-0ubuntu1) jaunty; urgency=low + + * Python-3.1 snapshot (20090222). + * Build the _dbm extension using the Berkeley DB backend. + + -- Matthias Klose Sun, 22 Feb 2009 12:58:58 +0100 + +python3.0 (3.0.1-0ubuntu4) jaunty; urgency=low + + * Don't build-depend on locales on sparc. Currently not installable. + + -- Matthias Klose Sun, 22 Feb 2009 12:48:38 +0100 + +python3.0 (3.0.1-0ubuntu3) jaunty; urgency=low + + * Update to 20090222 from the release30-maint branch. + + -- Matthias Klose Sun, 22 Feb 2009 11:09:58 +0100 + +python3.0 (3.0.1-0ubuntu2) jaunty; urgency=low + + * Allow docs to be built with Sphinx 0.5.x. + + -- Matthias Klose Tue, 17 Feb 2009 12:58:02 +0100 + +python3.0 (3.0.1-0ubuntu1) jaunty; urgency=low + + * New upstream version. + + -- Matthias Klose Mon, 16 Feb 2009 17:18:23 +0100 + +python3.0 (3.0-0ubuntu2) jaunty; urgency=low + + * Update to 20090213 from the release30-maint branch. + + -- Matthias Klose Fri, 13 Feb 2009 15:49:12 +0100 + +python3.0 (3.0-0ubuntu1) jaunty; urgency=low + + * Final Python-3.0 release. + + -- Matthias Klose Thu, 04 Dec 2008 09:00:09 +0100 + +python3.0 (3.0~rc3-0ubuntu4) jaunty; urgency=low + + * Update to 20081127 from the py3k branch. + * Ensure that all extensions from the -minimal package are statically + linked into the interpreter. LP: #301597. + * Include expat, _elementtree, datetime in -minimal to link + these extensions statically. + + -- Matthias Klose Thu, 27 Nov 2008 08:49:02 +0100 + +python3.0 (3.0~rc3-0ubuntu3) jaunty; urgency=low + + * Ignore errors when running the profile task. + + -- Matthias Klose Sun, 23 Nov 2008 15:50:17 +0100 + +python3.0 (3.0~rc3-0ubuntu2) jaunty; urgency=low + + * Don't run test_ioctl on the buildd, before the buildd chroot is fixed: + Unable to open /dev/tty. + + -- Matthias Klose Sun, 23 Nov 2008 15:28:02 +0100 + +python3.0 (3.0~rc3-0ubuntu1) jaunty; urgency=low + + * Update to the python-3.0 release candidate 3. + + -- Matthias Klose Sun, 23 Nov 2008 13:14:20 +0100 + +python3.0 (3.0~rc1+20081027-0ubuntu1) intrepid; urgency=low + + * Update to 20081027 from the py3k branch. LP: #279227. + * Fix typos and section names in doc-base files. LP: #273344. + * Build a new package libpython3.0. + * For locally installed packages, create a directory + /usr/local/lib/python3.0/dist-packages. This is the default for + installations done with distutils and setuptools. Third party stuff + packaged within the distribution goes to /usr/lib/python3.0/dist-packages. + There is no /usr/lib/python3.0/site-packages in the file system and + on sys.path. No package within the distribution must not install + anything in this location. + * distutils: Add an option --install-layout=deb, which + - installs into $prefix/dist-packages instead of $prefix/site-packages. + - doesn't encode the python version into the egg name. + + -- Matthias Klose Mon, 27 Oct 2008 23:38:42 +0100 + +python3.0 (3.0~b3+20080915-0ubuntu1) intrepid; urgency=low + + * Update to 20080915 from the py3k branch. + * Build gdbm + + -- Matthias Klose Mon, 15 Sep 2008 23:56:44 +0200 + +python3.0 (3.0~b3-0ubuntu1~ppa1) intrepid; urgency=low + + * Python 3.0 beta3 release. + + -- Matthias Klose Sun, 24 Aug 2008 03:49:26 +0200 + +python3.0 (3.0~b2-0ubuntu1~ppa1) intrepid; urgency=low + + * Python 3.0 beta2 release. + + -- Matthias Klose Thu, 07 Aug 2008 14:57:02 +0000 + +python3.0 (3.0~b1-0ubuntu1~ppa1) intrepid; urgency=low + + * Python 3.0 beta1 release. + + -- Matthias Klose Tue, 15 Jul 2008 16:10:52 +0200 + +python3.0 (3.0~a5+0530-0ubuntu1) intrepid; urgency=low + + * Update to snapshot taken from the py3k branch. + + -- Matthias Klose Thu, 29 May 2008 15:50:55 +0200 + +python3.0 (3.0~a1-0ubuntu2) gutsy; urgency=low + + * Disable running the benchmark. + + -- Matthias Klose Fri, 31 Aug 2007 23:22:34 +0000 + +python3.0 (3.0~a1-0ubuntu1) gutsy; urgency=low + + * First Python-3.0 alpha release. + + -- Matthias Klose Fri, 31 Aug 2007 21:26:21 +0200 + +python2.6 (2.6~alpha~pre1-~0ubuntu1~ppa1) gutsy; urgency=low + + * Snapshot build, an "how to use tilde in version numbers" upload. + * SVN 20070831. + + -- Matthias Klose Fri, 31 Aug 2007 15:56:09 +0200 + +python2.5 (2.5.2-4) unstable; urgency=low + + * Update to 20080427, taken from the 2.5 release branch. + - Fix issues #2670, #2682. + * Disable running pybench on the hppa buildd (ftbfs). + * Allow setting BASECFLAGS, OPT and EXTRA_LDFLAGS (like, CC, CXX, CPP, + CFLAGS, CPPFLAGS, CCSHARED, LDSHARED) from the environment. + * Support parallel= in DEB_BUILD_OPTIONS (see #209008). + + -- Matthias Klose Sun, 27 Apr 2008 10:40:51 +0200 + +python2.5 (2.5.2-3) unstable; urgency=medium + + * Update to 20080416, taken from the 2.5 release branch. + - Fix CVE-2008-1721, integer signedness error in the zlib extension module. + - Fix urllib2 file descriptor happens byte-at-a-time, reverting + a fix for excessively large memory allocations when calling .read() + on a socket object wrapped with makefile(). + * Disable some regression tests on some architectures: + - arm: test_compiler, test_ctypes. + - armel: test_compiler. + - hppa: test_fork1, test_wait3. + - m68k: test_bsddb3, test_compiler. + * Build-depend on libffi-dev instead of libffi4-dev. + * Fix CVE-2008-1679, integer overflows in the imageop module. + + -- Matthias Klose Wed, 16 Apr 2008 23:37:46 +0200 + +python2.5 (2.5.2-2) unstable; urgency=low + + * Use site.addsitedir() to add directories in /usr/local to sys.path. + Addresses: #469157, #469818. + + -- Matthias Klose Sat, 08 Mar 2008 16:11:23 +0100 + +python2.5 (2.5.2-1) unstable; urgency=low + + * Python 2.5.2 release. + * Merge from Ubuntu: + - Move site customization into sitecustomize.py, don't make site.py + a config file. Addresses: #309719, #413172, #457361. + - Move site.py to python2.4-minimal, remove `addbuilddir' from site.py, + which is unnecessary for installed builds. + - python2.5-dev: Recommend libc-dev instead of suggesting it. LP: #164909. + - Fix issue 961805, Tk Text.edit_modified() fails. LP: #84720. + + -- Matthias Klose Thu, 28 Feb 2008 23:18:52 +0100 + +python2.5 (2.5.1-7) unstable; urgency=low + + * Update to 20080209, taken from the 2.5 release branch. + * Build the _bsddb extension with db-4.5 again; 4.6 is seriously + broken when used with the _bsddb extension. + * Do not run pybench on arm and armel. + * python2.5: Provide python2.5-wsgiref. + * Fix a pseudo RC report with duplicated attributes in the control + file. Closes: #464307. + + -- Matthias Klose Sun, 10 Feb 2008 00:22:57 +0100 + +python2.5 (2.5.1-6) unstable; urgency=low + + * Update to 20080102, taken from the 2.5 release branch. + - Only define _BSD_SOURCE on OpenBSD systems. Closes: #455400. + * Fix handling of packages in linecache.py (Kevin Goodsell). LP: #70902. + * Bump debhelper to v5. + * Register binfmt for .py[co] files. + * Use absolute paths when byte-compiling files. Addresses: #453346. + Closes: #413566, LP: #177722. + * CVE-2007-4965, http://bugs.python.org/issue1179: + Multiple integer overflows in the imageop module in Python 2.5.1 and + earlier allow context-dependent attackers to cause a denial of service + (application crash) and possibly obtain sensitive information (memory + contents) via crafted arguments to (1) the tovideo method, and unspecified + other vectors related to (2) imageop.c, (3) rbgimgmodule.c, and other + files, which trigger heap-based buffer overflows. + Patch prepared by Stephan Herrmann. Closes: #443333, LP: #163845. + * Register info docs when doing source only uploads. LP: #174786. + * Remove deprecated value from categories in desktop file. LP: #172874. + * python2.5-dbg: Don't include the gdbm and _tkinter extensions, now provided + in separate packages. + * Provide a symlink changelog -> NEWS. Closes: #439271. + * Fix build failure on hurd, working around poll() on systems on which it + returns an error on invalid FDs. Closes: #438914. + * Configure --with-system-ffi on all architectures. Closes: #448520. + * Fix version numbers in copyright and README files (Dan O'Huiginn). + Closes: #446682. + * Move some documents from python2.5 to python2.5-dev. + + -- Matthias Klose Wed, 02 Jan 2008 22:22:19 +0100 + +python2.5 (2.5.1-5) unstable; urgency=low + + * Build the _bsddb extension with db-4.6. + + -- Matthias Klose Fri, 17 Aug 2007 00:39:35 +0200 + +python2.5 (2.5.1-4) unstable; urgency=low + + * Update to 20070813, taken from the 2.5 release branch. + * Include plat-mac/plistlib.py (plat-mac is not in sys.path by default. + Closes: #435826. + * Use emacs22 to build the documentation in info format. Closes: #434969. + * Build-depend on db-dev (>= 4.6). Closes: #434965. + + -- Matthias Klose Mon, 13 Aug 2007 22:22:44 +0200 + +python2.5 (2.5.1-3) unstable; urgency=high + + * Support mixed-endian IEEE floating point, as found in the ARM old-ABI + (Aurelien Jarno). Closes: #434905. + + -- Matthias Klose Fri, 27 Jul 2007 20:01:35 +0200 + +python2.5 (2.5.1-2) unstable; urgency=low + + * Update to 20070717, taken from the 2.5 release branch. + * Fix reference count for sys.pydebug variable. Addresses: #431393. + * Build depend on libbluetooth-dev instead of libbluetooth2-dev. + + -- Matthias Klose Tue, 17 Jul 2007 14:09:47 +0200 + +python2.5 (2.5.1-1) unstable; urgency=low + + * Python-2.5.1 release. + * Build-depend on gcc-4.1 (>= 4.1.2-4) on alpha, powerpc, s390, sparc. + * Merge from Ubuntu: + - Add debian/patches/subprocess-eintr-safety.dpatch (LP: #87292): + - Create and use wrappers around read(), write(), and os.waitpid() in the + subprocess module which retry the operation on an EINTR (which happens + if e. g. an alarm was raised while the system call was in progress). + It is incredibly hard and inconvenient to sensibly handle this in + applications, so let's fix this at the right level. + - Patch based on original proposal of Peter <85>strand + in http://python.org/sf/1068268. + - Add two test cases. + - Change the interpreter to build and install python extensions + built with the python-dbg interpreter with a different name into + the same path (by appending `_d' to the extension name). The debug build + of the interpreter tries to first load a foo_d.so or foomodule_d.so + extension, then tries again with the normal name. + - When trying to import the profile and pstats modules, don't + exit, add a hint to the exception pointing to the python-profiler + package, don't exit. + - Keep the module version in the .egg-info name, only remove the + python version. + - python2.5-dbg: Install Misc/SpecialBuilds.txt, document the + debug changes in README.debug. + * Update to 20070425, taken from the 2.5 release branch. + + -- Matthias Klose Wed, 25 Apr 2007 22:12:50 +0200 + +python2.5 (2.5-6) unstable; urgency=medium + + * webbrowser.py: Recognize other browsers: www-browser, x-www-browser, + iceweasel, iceape. + * Move pyconfig.h from the python2.5-dev into the python2.5 package; + required by builds for pure python modules without having python2.5-dev + installed (matching the functionality in python2.4). + * Move the unicodedata module into python2.5-minimal; allows byte compilation + of UTF8 encoded files. + * Do not install anymore outdated debhelper sample scripts. + * Install Misc/SpecialBuilds.txt as python2.5-dbg document. + + -- Matthias Klose Wed, 21 Feb 2007 01:17:12 +0100 + +python2.5 (2.5-5) unstable; urgency=high + + * Do not run the python benchmark on m68k. Timer problems. + Fixes FTBFS on m68k. + * Update to 20061209, taken from the 2.5 release branch. + - Fixes building the library reference in info format. + + -- Matthias Klose Sat, 9 Dec 2006 13:40:48 +0100 + +python2.5 (2.5-4) unstable; urgency=medium + + * Update to 20061203, taken from the 2.5 release branch. + - Fixes build failures on knetfreebsd and the hurd. Closes: #397000. + * Clarify README about distutils. Closes: #396394. + * Move python2.5-config to python2.5-dev. Closes: #401451. + * Cleanup build-conflicts. Addresses: #394512. + + -- Matthias Klose Sun, 3 Dec 2006 18:22:49 +0100 + +python2.5 (2.5-3.1) unstable; urgency=low + + * Non-maintainer upload. + * python2.5-minimal depends on python-minimal (>= 2.4.4-1) because it's the + first version which lists python2.5 as an unsupported runtime (ie a + runtime that is available but for which modules are not auto-compiled). + And being listed there is required for python-central to accept the + installation of python2.5-minimal. Closes: #397006 + + -- Raphael Hertzog Wed, 22 Nov 2006 15:41:06 +0100 + +python2.5 (2.5-3) unstable; urgency=medium + + * Update to 20061029 (2.4.4 was released on 20061019), taken from + the 2.5 release branch. We do not want to have regressions in + 2.5 compared to the 2.4.4 release. + * Don't run pybench on m68k, fails in the calibration loop. Closes: #391030. + * Run the installation/removal hooks. Closes: #383292, #391036. + + -- Matthias Klose Sun, 29 Oct 2006 11:35:19 +0100 + +python2.5 (2.5-2) unstable; urgency=medium + + * Update to 20061003, taken from the 2.5 release branch. + * On arm and m68k, don't run the pybench in debug mode. + * Fix building the source within exec_prefix (Alexander Wirt). + Closes: #385336. + + -- Matthias Klose Tue, 3 Oct 2006 10:08:36 +0200 + +python2.5 (2.5-1) unstable; urgency=low + + * Python 2.5 release. + * Update to 20060926, taken from the 2.5 release branch. + * Run the Python benchmark during the build, compare the results + of the static and shared builds. + * Fix invalid html in python2.5.devhelp.gz. + * Add a python2.5 console entry to the menu (hidden by default). + * python2.5: Suggest python-profiler. + + -- Matthias Klose Tue, 26 Sep 2006 02:36:11 +0200 + +python2.5 (2.5~c1-1) unstable; urgency=low + + * Python 2.5 release candidate 1. + * Update to trunk 20060818. + + -- Matthias Klose Sat, 19 Aug 2006 19:21:05 +0200 + +python2.5 (2.5~b3-1) unstable; urgency=low + + * Build the _ctypes module for m68k-linux. + + -- Matthias Klose Fri, 11 Aug 2006 18:19:19 +0000 + +python2.5 (2.5~b3-0ubuntu1) edgy; urgency=low + + * Python 2.5 beta3 release. + * Update to trunk 20060811. + * Rebuild the documentation. + * Fix value of sys.exec_prefix in the debug build. + * Do not build the library reference in info format; fails to build. + * Link the interpreter against the shared runtime library. With + gcc-4.1 the difference in the pystones benchmark dropped from about + 12% to about 6%. + * Install the statically linked version of the interpreter as + python2.5-static for now. + * Link the shared libpython with -O1. + + -- Matthias Klose Thu, 10 Aug 2006 14:04:48 +0000 + +python2.5 (2.4.3+2.5b2-3) unstable; urgency=low + + * Disable the testsuite on s390; don't care about "minimally configured" + buildd's. + + -- Matthias Klose Sun, 23 Jul 2006 11:45:03 +0200 + +python2.5 (2.4.3+2.5b2-2) unstable; urgency=low + + * Update to trunk 20060722. + * Merge idle-lib from idle-python2.5 into python2.5. + * Merge lib-tk from python-tk into python2.5. + * Tkinter.py: Suggest installation of python-tk package on failed + import of the _tkinter extension. + * Don't run the testsuite for the debug build on alpha. + * Don't run the test_compiler test on m68k. Just takes too long. + * Disable building ctypes on m68k (requires support for closures). + + -- Matthias Klose Sat, 22 Jul 2006 22:26:42 +0200 + +python2.5 (2.4.3+2.5b2-1) unstable; urgency=low + + * Python 2.5 beta2 release. + * Update to trunk 20060716. + * When built on a buildd, do not run the following test which try to + access the network: test_codecmaps_cn, test_codecmaps_hk, test_codecmaps_jp, + test_codecmaps_kr, test_codecmaps_tw, test_normalization. + * When built on a buildd, do not run tests requiring missing write permissions: + test_ossaudiodev. + + -- Matthias Klose Sun, 16 Jul 2006 02:53:50 +0000 + +python2.5 (2.4.3+2.5b2-0ubuntu1) edgy; urgency=low + + * Python 2.5 beta2 release. + + -- Matthias Klose Thu, 13 Jul 2006 17:16:52 +0000 + +python2.5 (2.4.3+2.5b1-1ubuntu2) edgy; urgency=low + + * Fix python-dev dependencies. + * Update to trunk 20060709. + + -- Matthias Klose Sun, 9 Jul 2006 18:50:32 +0200 + +python2.5 (2.4.3+2.5b1-1ubuntu1) edgy; urgency=low + + * Python 2.5 beta1 release. + * Update to trunk 20060623. + * Merge changes from the python2.4 packages. + * python2.5-minimal: Add _struct. + + -- Matthias Klose Fri, 23 Jun 2006 16:04:46 +0200 + +python2.5 (2.4.3+2.5a1-1) experimental; urgency=low + + * Update to trunk 20060409. + * Run testsuite for debug build as well. + * Build-depend on gcc-4.1. + + -- Matthias Klose Sun, 9 Apr 2006 22:27:05 +0200 + +python2.5 (2.4.3+2.5a1-0ubuntu1) dapper; urgency=low + + * Python 2.5 alpha1 release. + * Drop integrated patches. + * Add build dependencies on libsqlite3-dev and libffi4-dev. + * Add (build-)dependency on mime-support, libgpmg1 (test suite). + * Build using the system FFI. + * python2.5 provides python2.5-ctypes and python2.5-pysqlite2, + python2.5-elementtree. + * Move hashlib.py to python-minimal. + * Lib/hotshot/pstats.py: Error out on missing profile/pstats modules. + + -- Matthias Klose Wed, 5 Apr 2006 14:56:15 +0200 + +python2.4 (2.4.3-8ubuntu1) edgy; urgency=low + + * Resynchronize with Debian unstable. Remaining changes: + - Apply langpack-gettext patch. + - diff.gz contains pregenerated html and info docs. + - Build the -doc package from this source. + + -- Matthias Klose Thu, 22 Jun 2006 18:39:57 +0200 + +python2.4 (2.4.3-8) unstable; urgency=low + + * Remove python2.4's dependency on python-central. On installation of + the runtime, call hooks /usr/share/python/runtime.d/*.rtinstall. + On removal, call hooks /usr/share/python/runtime.d/*.rtremove. + Addresses: #372658. + * Call the rtinstall hooks only, if it's a new installation, or the first + installation using the hooks. Adresses: #373677. + + -- Matthias Klose Sun, 18 Jun 2006 00:56:13 +0200 + +python2.4 (2.4.3-7) unstable; urgency=medium + + * Reupload, depend on python-central (>= 0.4.15). + * Add build-conflict on python-xml. + + -- Matthias Klose Wed, 14 Jun 2006 18:56:57 +0200 + +python2.4 (2.4.3-6) medium; urgency=low + + * idle-python2.4: Remove the old postinst and prerm scripts. + * Name the runtime correctly in python2.4-minimal's installation + scripts. + + -- Matthias Klose Mon, 12 Jun 2006 17:39:56 +0000 + +python2.4 (2.4.3-5) unstable; urgency=low + + * python2.4-prerm: Handle the case, when python-central is not installed. + * idle-python2.4: Depend on python-tk instead of python2.4-tk. + + -- Matthias Klose Fri, 9 Jun 2006 05:17:17 +0200 + +python2.4 (2.4.3-4) unstable; urgency=low + + * SVN update up to 2006-06-07 + * Use python-central. + * Don't build the -tk and -gdbm packages from this source; now built + from the python-stdlib-extensions source. + * Remove leftover build dependency on libgmp3-dev. + * Do not build-depend on libbluetooth1-dev and libgpmg1-dev on + hurd-i386, kfreebsd-i386, kfreebsd-amd64. Closes: #365830. + * Do not run the test_tcl test; hangs for unknown reasons on at least + the following buildds: vivaldi(m68k), goedel (alpha), mayer (mipsel). + And no virtual package to file bug reports for the buildds ... + Closes: #364419. + * Move the Makefile from python2.4-dev to python2.4. Closes: #366473. + * Fix typo in pdb(1). Closes: #365772. + * New autoconf likes the mandir in /usr/share instead of /usr; work + with both locations. Closes: #367618. + + -- Matthias Klose Wed, 7 Jun 2006 21:37:20 +0200 + +python2.4 (2.4.3-3) unstable; urgency=low + + * SVN update up to 2006-04-21 + * Update locale aliases from /usr/share/X11/locale/locale.alias. + * Start idle with option -n from the desktop menu, so that the program + can be started in parallel. + * Testsuite related changes only: + - Add build dependencies mime-support, libgpmg1 (needed by test cases). + - Run the testsuite with bsddb, audio and curses resources enabled. + - Re-run the failed tests in verbose mode. + - Run the test suite for the debug build as well. + - Build depend on netbase, needed by test_socketmodule. + - Build depend on libgpmg1, needed by test_curses. + - On the buildds do not run the tests needing the network resource. + * Update python logo. + * Check for the availability of the profile and pstats modules when + importing hotshot.pstats. Closes: #334067. + * Don't build the -doc package from the python2.4 source. + * Set OPT in the installed Makefile to -O2. + + -- Matthias Klose Fri, 21 Apr 2006 19:58:43 +0200 + +python2.4 (2.4.3-2) unstable; urgency=low + + * Add (build-)dependency on mime-support. + + -- Matthias Klose Tue, 4 Apr 2006 22:21:41 +0200 + +python2.4 (2.4.3-1) unstable; urgency=low + + * Python 2.4.3 release. + + -- Matthias Klose Thu, 30 Mar 2006 23:42:37 +0200 + +python2.4 (2.4.3-0ubuntu1) dapper; urgency=low + + * Python 2.4.3 release. + - Fixed a bug that the gb18030 codec raises RuntimeError on encoding + surrogate pair area on UCS4 build. Ubuntu: #29289. + + -- Matthias Klose Thu, 30 Mar 2006 10:57:32 +0200 + +python2.4 (2.4.2+2.4.3c1-0ubuntu1) dapper; urgency=low + + * SVN update up to 2006-03-25 (2.4.3 candidate 1). + - Regenerate the documentation. + + -- Matthias Klose Mon, 27 Mar 2006 12:03:05 +0000 + +python2.4 (2.4.2-1ubuntu3) dapper; urgency=low + + * SVN update up to 2006-03-04 + - Regenerate the documentation. + - map.mmap(-1, size, ...) can return anonymous memory again on Unix. + Ubuntu #26201. + * Build-depend on libncursesw5-dev, ncursesw5 is preferred for linking. + Provides UTF-8 compliant curses bindings. + * Fix difflib where certain patterns of differences were making difflib + touch the recursion limit. + + -- Matthias Klose Sat, 4 Mar 2006 21:38:24 +0000 + +python2.4 (2.4.2-1ubuntu2) dapper; urgency=low + + * SVN update up to 2006-01-17 + - pwd is now a builtin module, remove it from python-minimal. + - Regenerate the documentation. + * python2.4-tk: Suggest tix instead of tix8.1. + * Move config/Makefile from the -dev package into the runtime package + to be able to use the bdist_wininst distutils command. Closes: #348335. + + -- Matthias Klose Tue, 17 Jan 2006 11:02:24 +0000 + +python2.4 (2.4.2-1ubuntu1) dapper; urgency=low + + * Temporarily remove build dependency on lsb-release. + + -- Matthias Klose Sun, 20 Nov 2005 17:40:18 +0100 + +python2.4 (2.4.2-1build1) dapper; urgency=low + + * Rebuild (openssl-0.9.8). + + -- Matthias Klose Sun, 20 Nov 2005 15:27:24 +0000 + +python2.4 (2.4.2-1) unstable; urgency=low + + * Python 2.4.2 release. + + -- Matthias Klose Thu, 29 Sep 2005 01:49:28 +0200 + +python2.4 (2.4.1+2.4.2rc1-1) unstable; urgency=low + + * Python 2.4.2 release candidate 1. + * Fix "Fatal Python error" from cStringIO's writelines. + Patch by Andrew Bennetts. + + -- Matthias Klose Thu, 22 Sep 2005 10:33:22 +0200 + +python2.4 (2.4.1-5) unstable; urgency=low + + * CVS update up to 2005-09-14 + - Regenerate the html and info docs. + * Add some more locale aliases. + * Fix substitution pf python version in README.python2.4-minimal. + Closes: #327487. + * On m68k, build using -O2 (closes: #326903). + * On Debian, don't configure --with-fpectl, which stopped working with + glibc-2.3.5. + + -- Matthias Klose Wed, 14 Sep 2005 17:32:56 +0200 + +python2.4 (2.4.1-4) unstable; urgency=low + + * CVS update up to 2005-09-04 + - teTeX 3.0 related fixes (closes: #322407). + - Regenerate the html and info docs. + * Add entry for IDLE in the Gnome menus. + * Don't build-depend on libbluetooth-dev on the Hurd (closes: #307037). + * Reenable the cthreads patch for the Hurd (closes: #307052). + + -- Matthias Klose Sun, 4 Sep 2005 18:31:42 +0200 + +python2.4 (2.4.1-3) unstable; urgency=low + + * Synchronise with Ubuntu: + - Build a python2.4-minimal package. + + -- Matthias Klose Tue, 12 Jul 2005 00:23:10 +0000 + +python2.4 (2.4.1-2ubuntu3) breezy; urgency=low + + * CVS update up to 2005-07-07 + * Regenerate the documentation. + + -- Matthias Klose Thu, 7 Jul 2005 09:21:28 +0200 + +python2.4 (2.4.1-2ubuntu2) breezy; urgency=low + + * CVS update up to 2005-06-15 + * Regenerate the documentation. + * Synchronize with Debian. Ubuntu 10485. + * idle-python2.4 enhances python2.4. Ubuntu 11562. + * README.Debian: Fix reference to the doc directory (closes: #311677). + + -- Matthias Klose Wed, 15 Jun 2005 08:56:57 +0200 + +python2.4 (2.4.1-2ubuntu1) breezy; urgency=low + + * Update build dependencies: + db4.2-dev -> db4.3-dev, + libreadline4-dev -> libreadline5-dev. + * python2.4-dev: Add missing templates to generate HTML docs. Ubuntu 11531. + + -- Matthias Klose Sun, 29 May 2005 00:01:05 +0200 + +python2.4 (2.4.1-2) unstable; urgency=low + + * Add the debug symbols for the python2.4, python2.4-gdbm + and python2.4-tk packages to the python2.4-dbg package. + * Add gdbinit example to doc directory. + + -- Matthias Klose Thu, 5 May 2005 11:12:32 +0200 + +python2.4 (2.4.1-1ubuntu2) breezy; urgency=low + + * Add the debug symbols for the python2.4, python2.4-minimal, python2.4-gdbm + and python2.4-tk packages to the python2.4-dbg package. Ubuntu 10261, + * Add gdbinit example to doc directory. + * For os.utime, use utimes(2), correctly working with glibc-2.3.5. + Ubuntu 10294. + + -- Matthias Klose Thu, 5 May 2005 09:06:07 +0200 + +python2.4 (2.4.1-1ubuntu1) breezy; urgency=low + + * Reupload as 2.4.1-1ubuntu1. + + -- Matthias Klose Thu, 14 Apr 2005 10:46:32 +0200 + +python2.4 (2.4.1-1) unstable; urgency=low + + * Python 2.4.1 release. + * Fix noise in python-doc installation/removal. + * New Python section for the info docs. + + -- Matthias Klose Wed, 30 Mar 2005 19:42:03 +0200 + +python2.4 (2.4.1-0) hoary; urgency=low + + * Python 2.4.1 release. + * Fix noise in python-doc installation/removal. + * New Python section for the info docs. + + -- Matthias Klose Wed, 30 Mar 2005 16:35:34 +0200 + +python2.4 (2.4+2.4.1rc2-2) unstable; urgency=low + + * Add the valgrind support file to /etc/python2.4 + * Build the -dbg package with -DPy_USING_MEMORY_DEBUGGER. + * Lib/locale.py: + - correctly parse LANGUAGE as a colon separated list of languages. + - prefer LC_ALL, LC_CTYPE and LANG over LANGUAGE to get the correct + encoding. + - Don't map 'utf8', 'utf-8' to 'utf', which is not a known encoding + for glibc. + * Fix two typos in python(1). Addresses: #300124. + + -- Matthias Klose Sat, 19 Mar 2005 21:50:14 +0100 + +python2.4 (2.4+2.4.1rc2-1) unstable; urgency=low + + * Python 2.4.1 release candidate 2. + * Build-depend on libbluetooth1-dev. + + -- Matthias Klose Sat, 19 Mar 2005 00:57:14 +0100 + +python2.4 (2.4dfsg-2) unstable; urgency=low + + * CVS update up to 2005-03-03 + + -- Matthias Klose Thu, 3 Mar 2005 22:22:16 +0100 + +python2.4 (2.4dfsg-1ubuntu4) hoary; urgency=medium + + * Move exception finalisation later in the shutdown process - this + fixes the crash seen in bug #1165761, taken from CVS. + * codecs.StreamReader: Reset codec when seeking. Ubuntu #6972. + * Apply fix for SF1124295, fixing an obscure bit of Zope's security machinery. + * distutils: Don't add standard library dirs to library_dirs + and runtime_library_dirs. On amd64, runtime paths pointing to /usr/lib64 + aren't recognized by dpkg-shlibdeps, and the packages containing these + libraries aren't added to ${shlibs:Depends}. + * Lib/locale.py: + - correctly parse LANGUAGE as a colon separated list of languages. + - prefer LC_ALL, LC_CTYPE and LANG over LANGUAGE to get the correct + encoding. + - Don't map 'utf8', 'utf-8' to 'utf', which is not a known encoding + for glibc. + * os.py: Avoid using items() in environ.update(). Fixes #1124513. + * Python/pythonrun.c: + * Build depend on locales, generate the locales needed for the + testsuite. + * Add build dependency on libbluetooth1-dev, adding some bluetooth + functionality to the socket module. + * Lib/test/test_sundry.py: Don't fail on import of profile & pstats, + which are separated out to the python-profiler package. + * Fix typos in manpage. + + -- Matthias Klose Tue, 29 Mar 2005 13:35:53 +0200 + + +python2.4 (2.4dfsg-1ubuntu3) hoary; urgency=low + + * debian/patches/langpack-gettext.dpatch: + - langpack support for python-gettext added + + -- Michael Vogt Tue, 1 Mar 2005 13:13:36 +0100 + +python2.4 (2.4dfsg-1ubuntu2) hoary; urgency=low + + * Revert 'essential' status on python2.4-minimal. This status on + on python-minimal is sufficient (Ubuntu #6392). + + -- Matthias Klose Wed, 9 Feb 2005 23:09:42 +0100 + +python2.4 (2.4dfsg-1ubuntu1) hoary; urgency=low + + * Resyncronise with Debian. + * Mark the python2.4-minimal package as 'essential'. + + -- Matthias Klose Wed, 9 Feb 2005 13:31:09 +0100 + +python2.4 (2.4dfsg-1) unstable; urgency=medium + + * Add licenses and acknowledgements for incorporated software in the + debian/copyright file (addresses: #293932). + * Replace md5 implementation with one having a DFSG conforming license. + * Remove the profile.py and pstats.py modules from the source package, + not having a DFSG conforming license. The modules can be found in + the python2.x-profile package in the non-free section. + Addresses: #293932. + * Add missing norwegian locales (Tollef Fog Heen). + * CVS updates of the release24-maint branch upto 2005-02-08 (date of + the Python 2.3.5 release). + + -- Matthias Klose Tue, 8 Feb 2005 19:13:10 +0100 + +python2.4 (2.4-7ubuntu1) hoary; urgency=low + + * Fix the name of the python-dbg man page. + * Resyncronise with Debian. + * Move more modules to -minimal (new code in copy.py requires these): + dis, inspect, opcode, token, tokenize. + + -- Matthias Klose Tue, 8 Feb 2005 19:13:10 +0100 + +python2.4 (2.4-7) unstable; urgency=medium + + * Add licenses and acknowledgements for incorporated software in the + debian/copyright file (addresses: #293932). + * Replace md5 implementation with one having a DFSG conforming license. + * Add missing norwegian locales (Tollef Fog Heen). + * CVS updates of the release24-maint branch upto 2005-02-08 (date of + the Python 2.3.5 release). + + -- Matthias Klose Tue, 8 Feb 2005 19:13:10 +0100 + +python2.4 (2.4-6) unstable; urgency=low + + * Build a python2.4-dbg package using --with-pydebug. Add a debug + directory /lib-dynload/debug to sys.path instead of + /lib-dynload und install the extension modules of the + debug build in this directory. + Change the module load path to load extension modules from other + site-packages/debug directories (for further details see the + README in the python2.4-dbg package). Closes: #5415. + * Apply the pydebug-path patch. The package was already built in -5. + + -- Matthias Klose Fri, 4 Feb 2005 22:15:13 +0100 + +python2.4 (2.4-5) unstable; urgency=high + + * Fix a flaw in SimpleXMLRPCServerthat can affect any XML-RPC servers. + This affects any programs have been written that allow remote + untrusted users to do unrestricted traversal and can allow them to + access or change function internals using the im_* and func_* attributes. + References: CAN-2005-0089. + * CVS updates of the release24-maint branch upto 2005-02-04. + + -- Matthias Klose Fri, 4 Feb 2005 08:12:10 +0100 + +python2.4 (2.4-4) unstable; urgency=medium + + * Update debian/copyright to the 2.4 license text (closes: #290898). + * Remove /usr/bin/smtpd.py (closes: #291049). + + -- Matthias Klose Mon, 17 Jan 2005 23:54:37 +0100 + +python2.4 (2.4-3ubuntu6) hoary; urgency=low + + * Use old-style dpatches instead of dpatch-run. + + -- Tollef Fog Heen Mon, 7 Feb 2005 15:58:05 +0100 + +python2.4 (2.4-3ubuntu5) hoary; urgency=low + + * Actually apply the patch as well (add to list of patches in + debian/rules) + + -- Tollef Fog Heen Sun, 6 Feb 2005 15:12:58 +0100 + +python2.4 (2.4-3ubuntu4) hoary; urgency=low + + * Add nb_NO and nn_NO locales to Lib/locale.py + + -- Tollef Fog Heen Sun, 6 Feb 2005 14:33:05 +0100 + +python2.4 (2.4-3ubuntu3) hoary; urgency=low + + * Fix a flaw in SimpleXMLRPCServerthat can affect any XML-RPC servers. + This affects any programs have been written that allow remote + untrusted users to do unrestricted traversal and can allow them to + access or change function internals using the im_* and func_* attributes. + References: CAN-2005-0089. + + -- Matthias Klose Wed, 2 Feb 2005 09:08:20 +0000 + +python2.4 (2.4-3ubuntu2) hoary; urgency=low + + * Build a python2.4-dbg package using --with-pydebug. Add a debug + directory /lib-dynload/debug to sys.path instead of + /lib-dynload und install the extension modules of the + debug build in this directory. + Change the module load path to load extension modules from other + site-packages/debug directories (for further details see the + README in the python2.4-dbg package). Closes: #5415. + * Update debian/copyright to the 2.4 license text (closes: #290898). + * Add operator and copy to the -minimal package. + + -- Matthias Klose Mon, 17 Jan 2005 23:19:47 +0100 + +python2.4 (2.4-3ubuntu1) hoary; urgency=low + + * Resynchronise with Debian. + * python2.4: Depend on the very same version of python2.4-minimal. + * Docment, that time.strptime currently cannot be used, if the + python-minimal package is installed without the python package. + + -- Matthias Klose Sun, 9 Jan 2005 19:35:48 +0100 + +python2.4 (2.4-3) unstable; urgency=medium + + * Build the fpectl module. + * Updated to CVS release24-maint 20050107. + + -- Matthias Klose Sat, 8 Jan 2005 19:05:21 +0100 + +python2.4 (2.4-2ubuntu5) hoary; urgency=low + + * Updated to CVS release24-maint 20050102. + * python-minimal: + - os.py: Use dict instead of UserDict, remove UserDict from -minimal. + - add pickle, threading, needed for subprocess module. + - optparse.py: conditionally import gettext, if not available, + define _ as the identity function. Patch taken from the trunk. + Avoids import of _locale, locale, gettext, copy, repr, itertools, + collections, token, tokenize. + - Add a build check to make sure that the minimal module list is + closed under dependency. + * Fix lintian warnings. + + -- Matthias Klose Sun, 2 Jan 2005 22:00:14 +0100 + +python2.4 (2.4-2ubuntu4) hoary; urgency=low + + * Add UserDict.py to the -minimal package, since os.py needs it. + + -- Colin Watson Thu, 30 Dec 2004 20:41:28 +0000 + +python2.4 (2.4-2ubuntu3) hoary; urgency=low + + * Add os.py and traceback.py to the -minimal package, get the list + of modules from the README. + + -- Matthias Klose Mon, 27 Dec 2004 08:20:45 +0100 + +python2.4 (2.4-2ubuntu2) hoary; urgency=low + + * Add compileall.py and py_compile.py to the -minimal package, not + just to the README ... + + -- Matthias Klose Sat, 25 Dec 2004 22:24:56 +0100 + +python2.4 (2.4-2ubuntu1) hoary; urgency=low + + * Separate the interpreter and a minimal subset of modules into + a python2.4-minimal package. See the README.Debian.gz in this + package. + * Move site.py to python2.4-minimal as well. + * Add documentation files for devhelp. + + -- Matthias Klose Sun, 19 Dec 2004 22:47:32 +0100 + +python2.4 (2.4-2) unstable; urgency=medium + + * Updated patch for #283108. Thanks to Jim Meyering. + + -- Matthias Klose Fri, 3 Dec 2004 17:00:16 +0100 + +python2.4 (2.4-1) unstable; urgency=low + + * Final 2.4 release. + * Flush stdout/stderr if closed (SF #1074011). + + -- Matthias Klose Wed, 1 Dec 2004 07:54:34 +0100 + +python2.4 (2.3.97-2) unstable; urgency=low + + * Don't run test_tcl, hanging on the buildds. + + -- Matthias Klose Fri, 19 Nov 2004 23:48:42 +0100 + +python2.4 (2.3.97-1) unstable; urgency=low + + * Python 2.4 Release Candidate 1. + + -- Matthias Klose Fri, 19 Nov 2004 21:27:02 +0100 + +python2.4 (2.3.96-1) experimental; urgency=low + + * Updated to CVS release24-maint 20041113. + * Build the docs in info format again. + + -- Matthias Klose Sat, 13 Nov 2004 21:21:10 +0100 + +python2.4 (2.3.95-2) experimental; urgency=low + + * Move distutils package from the python2.4-dev into the python2.4 + package. + + -- Matthias Klose Thu, 11 Nov 2004 22:56:14 +0100 + +python2.4 (2.3.95-1) experimental; urgency=low + + * Python 2.4 beta2 release. + + -- Matthias Klose Thu, 4 Nov 2004 23:43:47 +0100 + +python2.4 (2.3.94-1) experimental; urgency=low + + * Python 2.4 beta1 release. + + -- Matthias Klose Sat, 16 Oct 2004 08:33:57 +0200 + +python2.4 (2.3.93-1) experimental; urgency=low + + * Python 2.4 alpha3 release. + + -- Matthias Klose Fri, 3 Sep 2004 21:53:47 +0200 + +python2.4 (2.3.92-1) experimental; urgency=low + + * Python 2.4 alpha2 release. + + -- Matthias Klose Thu, 5 Aug 2004 23:53:18 +0200 + +python2.4 (2.3.91-1) experimental; urgency=low + + * Python 2.4 alpha1 release. + Highlights: http://www.python.org/2.4/highlights.html + + -- Matthias Klose Fri, 9 Jul 2004 17:38:54 +0200 + +python2.4 (2.3.90-1) experimental; urgency=low + + * Package HEAD branch (pre alpha ..). + + -- Matthias Klose Mon, 14 Jun 2004 23:19:57 +0200 + +python2.3 (2.3.4-1) unstable; urgency=medium + + * Final Python 2.3.4 Release. + * In the API docs, fix signature of PyModule_AddIntConstant (closes: #250826). + * locale.getdefaultlocale: don't fail with empty environment variables. + Closes: #249816. + * Include distutils/command/wininst.exe in -dev package (closes: #249006). + * Disable cthreads on the Hurd (Michael Banck). Closes: #247211. + * Add a note to pygettext(1), that this program is deprecated in favour + of xgettext, which now includes support for Python as well. + Closes: #246332. + + -- Matthias Klose Fri, 28 May 2004 22:59:42 +0200 + +python2.3 (2.3.3.91-1) unstable; urgency=low + + * Python 2.3.4 Release Candidate 1. + * Do not use the default namespace for attributes. Patch taken from the + 2.3 maintenance branch. + The xmllib module is obsolete. Use xml.sax instead. + * http://python.org/sf/945642 - fix nonblocking i/o with ssl socket. + + -- Matthias Klose Thu, 13 May 2004 21:24:52 +0200 + +python2.3 (2.3.3-7) unstable; urgency=low + + * Add a workaround for GNU libc nl_langinfo()'s returning NULL. + Closes: #239237. + Patch taken from 2.3 maintenance branch. + * threading.py: Remove calls to currentThread() in _Condition methods that + were side-effect. Side-effects were deemed unnecessary and were causing + problems at shutdown time when threads were catching exceptions at start + time and then triggering exceptions trying to call currentThread() after + gc'ed. Masked the initial exception which was deemed bad. + Closes: #195812. + * Properly support normalization of empty unicode strings. Closes: #239986. + Patch taken from 2.3 maintenance branch. + * README.maintainers: Add section where to find the documentation tools. + * Fix crash in pyexpat module (closes: #229281). + * For the Hurd, set the interpreters recursion limit to 930. + * Do not try to byte-compile the test files on installation; this + currently breaks the Hurd install. + + -- Matthias Klose Sat, 1 May 2004 07:50:46 +0200 + +python2.3 (2.3.3-6) unstable; urgency=low + + * Don't build the unversioned python{,-*} packages anymore. Now + built from the python-defaults package. + * Update to the proposed python-policy: byte-compile using -E. + * Remove python-elisp's dependency on emacs20 (closes: #232785). + * Don't build python-elisp from the python2.3 source anymore, + get it from python-mode.sf.net as a separate source package. + * python2.3-dev suggests libc-dev (closes: #231091). + * get LDSHARED and CCSHARED (like, CC, CXX, CPP, CFLAGS) from + the environment + * Set CXX in installed config/Makefile (closes: #230273). + + -- Matthias Klose Tue, 24 Feb 2004 07:07:51 +0100 + +python2.3 (2.3.3-5) unstable; urgency=low + + * Build-depend on libdb4.2-dev, instead of libdb4.1-dev. According + to the docs the file format is compatible. + + -- Matthias Klose Mon, 12 Jan 2004 10:37:45 +0100 + +python2.3 (2.3.3-4) unstable; urgency=low + + * Fix broken _bsddb module. setup.py picked up the wrong library. + + -- Matthias Klose Sun, 4 Jan 2004 11:30:00 +0100 + +python2.3 (2.3.3-3) unstable; urgency=low + + * Fix typo in patch (closes: #224797, #226064). + + -- Matthias Klose Sun, 4 Jan 2004 09:23:21 +0100 + +python2.3 (2.3.3-2) unstable; urgency=medium + + * Lib/email/Charset: use locale unaware function to lower case of locale + name (closes: #224797). + * Update python-mode to version from python-mode.sf.net. Fixes highlighting + problems (closes: #223520). + * Backport from mainline: Add IPV6_ socket options from RFCs 3493 and 3542. + + -- Matthias Klose Fri, 2 Jan 2004 14:03:26 +0100 + +python2.3 (2.3.3-1) unstable; urgency=low + + * New upstream release. + * Copy the templates, tools and scripts from the Doc dir in the source + to /usr/share/lib/python2.3/doc in the python2.3-dev package. Needed + for packages building documentation like python does (closes: #207337). + + -- Matthias Klose Fri, 19 Dec 2003 10:57:39 +0100 + +python2.3 (2.3.2.91-1) unstable; urgency=low + + * New upstream version (2.3.3 release candidate). + * Update python-mode.el (closes: #158811, #159630). + Closing unreproducible report (closes: #159628). + + -- Matthias Klose Sat, 6 Dec 2003 14:41:14 +0100 + +python2.3 (2.3.2-7) unstable; urgency=low + + * Put the conflict in the correct direction. python2.3 (2.3.2-6) doesn't + conflict with python (<= 2.3.2-5) but python (2.3.2-6) conflicts with + python2.3 (<= 2.3.2-5) (thanks to Brian May). Really closes #221791. + + -- Matthias Klose Fri, 21 Nov 2003 00:20:02 +0100 + +python2.3 (2.3.2-6) unstable; urgency=low + + * Add conflicts with older python{,2.3} packages to fix overwrite + errors (closes: #221791). + + -- Matthias Klose Thu, 20 Nov 2003 07:24:36 +0100 + +python2.3 (2.3.2-5) unstable; urgency=low + + * Updated to CVS release23-maint 20031119. + * Re-upgrade the dependency of python2.3 on python (>= 2.3) to + a dependency (closes: #221523). + + -- Matthias Klose Wed, 19 Nov 2003 00:30:27 +0100 + +python2.3 (2.3.2-4) unstable; urgency=low + + * Don't build-depend on latex2html (moved to non-free), but keep + the prebuilt docs in debian/patches (closes: #221347). + * Fix typos in the library reference (closes: #220510, #220954). + * Fix typo in python-elisp's autoloading code (closes: #220308). + * Update proposed python policy: private modules can be installed + into /usr/lib/ (arch dependent) and into /usr/share/ + (arch independent). + + -- Matthias Klose Tue, 18 Nov 2003 00:41:39 +0100 + +python2.3 (2.3.2-3) unstable; urgency=low + + * Downgrade the dependency of python2.3 on python (>= 2.3) to + a recommendation. + * Fix path to interpreter in binfmt file. + * Fix segfault in unicodedata module (closes: #218697). + * Adjust python-elisp autoload code (closes: #219821). + + -- Matthias Klose Sun, 9 Nov 2003 19:43:37 +0100 + +python2.3 (2.3.2-2) unstable; urgency=medium + + * Fix broken doc link (closes: #214217). + * Disable wrongly detected large file support for GNU/Hurd. + * Really fix the FTBFS for the binary-indep target (closes: #214303). + + -- Matthias Klose Mon, 6 Oct 2003 07:54:58 +0200 + +python2.3 (2.3.2-1) unstable; urgency=low + + * New upstream version. + * Fix a FTBFS for the binary-indep target. + + -- Matthias Klose Sat, 4 Oct 2003 10:20:15 +0200 + +python2.3 (2.3.1-3) unstable; urgency=low + + * Fix names of codec packages in recommends. + * On alpha compile using -mieee (see #212912). + + -- Matthias Klose Sun, 28 Sep 2003 10:48:12 +0200 + +python2.3 (2.3.1-2) unstable; urgency=low + + * Update python policy draft (closes: #128911, #163785). + * Re-add os.fsync function (closes: #212672). + * Let python2.3-doc conflict with older python2.3 versions (closes: #211882). + * Add recommends for pythonX.Y-japanese-codecs, pythonX.Y-iconvcodec, + pythonX.Y-cjkcodecs, pythonX.Y-korean-codecs (closes: #207161). + * Generate binfmt file (closes: #208005). + * Add IPPROTO_IPV6 option to the socketmodule (closes: #206569). + * Bugs reported against python2.2 and fixed in python2.3: + - Crashes in idle (closes: #186887, #200084). + + -- Matthias Klose Sat, 27 Sep 2003 11:21:47 +0200 + +python2.3 (2.3.1-1) unstable; urgency=low + + * New upstream version (bug fix release). + + -- Matthias Klose Wed, 24 Sep 2003 11:27:43 +0200 + +python2.3 (2.3-4) unstable; urgency=high + + * Disable check for utimes function, which is broken in glibc-2.3.2. + Packages using distutils had '1970/01/01-01:00:01' timestamps in files. + * Bugs fixed by making python2.3 the default python version: + - Canvas.scan_dragto() takes a 3rd optional parmeter "gain". + Closes: #158168. + - New command line parsing module (closes: #38628). + - compileall.py allows compiling single files (closes: #139971). + * Bugs reported for 2.2 and fixed in 2.3: + - Idle does save files with ASCII characters (closes: #179313). + - imaplib support for prefix-quoted strings (closes: #150485). + - posixpath includes getctime (closes: #173827). + - pydoc has support for keywords (closes: #186775). + * Bugs reported for 2.1 and fixed in 2.3: + - Fix handling of "#anchor" URLs in urlparse (closes: #147844). + - Fix readline if C stdin is not a tty, even if sys.stdin is. + Closes: #131810. + * Updated to CVS release23-maint 20030810 (fixing memory leaks in + array and socket modules). + * pydoc's usage output uses the basename of the script. + * Don't explicitely remove /etc/python2.3 on purge (closes: #202864). + * python conflicts with python-xmlbase (closes: #204773). + * Add dependency python (>= 2.3) to python2.3, so make sure the + unversioned names can be used. + + -- Matthias Klose Sun, 10 Aug 2003 09:27:52 +0200 + +python2.3 (2.3-3) unstable; urgency=medium + + * Fix shlibs file. + + -- Matthias Klose Fri, 8 Aug 2003 08:45:12 +0200 + +python2.3 (2.3-2) unstable; urgency=medium + + * Make python2.3 the default python version. + + -- Matthias Klose Tue, 5 Aug 2003 22:13:22 +0200 + +python2.3 (2.3-1) unstable; urgency=low + + * Python 2.3 final release. + + -- Matthias Klose Wed, 30 Jul 2003 08:12:28 +0200 + +python2.3 (2.2.107-1rc2) unstable; urgency=medium + + * Python 2.3 release candidate 2. + * Don't compress .txt files referenced by the html docs (closes: #200298). + * Include the email/_compat* files (closes: #200349). + + -- Matthias Klose Fri, 25 Jul 2003 07:08:09 +0200 + +python2.3 (2.2.106-2beta2) unstable; urgency=medium + + * Python 2.3 beta2 release, updated to CVS 20030704. + - Fixes AssertionError in httplib (closed: #192452). + - Fixes uncaught division by zero in difflib.py (closed: #199287). + * Detect presence of setgroups(2) at configure time (closes: #199839). + * Use default gcc on arm as well. + + -- Matthias Klose Sat, 5 Jul 2003 10:21:33 +0200 + +python2.3 (2.2.105-1beta2) unstable; urgency=low + + * Python 2.3 beta2 release. + - Includes merged idle fork. + - Fixed socket.setdefaulttimeout(). Closes: #189380. + - socket.ssl works with _socketobj. Closes: #196082. + * Do not link libtix to the _tkinter module. It's loaded via + 'package require tix' at runtime. python2.3-tkinter now + suggests tix8.1 instead. + * On arm, use gcc-3.2 to build. + * Add -fno-strict-aliasing rules to OPT to avoid warnings + "dereferencing type-punned pointer will break strict-aliasing rules", + when building with gcc-3.3. + + -- Matthias Klose Mon, 30 Jun 2003 00:19:32 +0200 + +python2.3 (2.2.104-1beta1.1) unstable; urgency=low + + * Non-maintainer upload with maintainer consent. + * debian/control (Build-Depends): s/libgdbmg1-dev/libgdbm-dev/. + + -- James Troup Wed, 4 Jun 2003 02:24:27 +0100 + +python2.3 (2.2.104-1beta1) unstable; urgency=low + + * Python 2.3 beta1 release, updated to CVS 20030514. + - build the current documentation. + * Reenable Tix support. + + -- Matthias Klose Wed, 14 May 2003 07:38:57 +0200 + +python2.3 (2.2.103-1beta1) unstable; urgency=low + + * Python 2.3 beta1 release, updated to CVS 20030506. + - updated due to build problems on mips/mipsel. + - keep the 2.3b1 documentation (doc build problems with cvs). + + -- Matthias Klose Wed, 7 May 2003 06:26:39 +0200 + +python2.3 (2.2.102-1beta1) unstable; urgency=low + + * Python 2.3 beta1 release. + + -- Matthias Klose Sat, 3 May 2003 22:45:16 +0200 + +python2.3 (2.2.101-1exp1) unstable; urgency=medium + + * Python 2.3 alpha2 release, updated to CVS 20030321. + * Tkinter: Catch exceptions thrown for undefined substitutions in + events (needed for tk 8.4.2). + + -- Matthias Klose Fri, 21 Mar 2003 21:32:14 +0100 + +python2.3 (2.2.100-1exp1) unstable; urgency=low + + * Python 2.3 alpha2 release, updated to CVS 20030221. + + -- Matthias Klose Fri, 21 Feb 2003 19:37:17 +0100 + +python2.3 (2.2.99-1exp1) unstable; urgency=low + + * Python 2.3 alpha1 release updated to CVS 20030123. + - should fix the testsuite (and package build) failure on alpha. + * Remove build dependency on libexpat1-dev. Merge the python2.3-xmlbase + package into python2.3 (closes: #177739). + + -- Matthias Klose Thu, 23 Jan 2003 22:48:12 +0100 + +python2.3 (2.2.98-1exp1) unstable; urgency=low + + * Python 2.3 alpha1 release updated to CVS 20030117. + * Build using libdb4.1. + + -- Matthias Klose Sat, 18 Jan 2003 00:14:01 +0100 + +python2.3 (2.2.97-1exp1) unstable; urgency=low + + * Python 2.3 alpha1 release updated to CVS 20030109. + * Build-Depend on g++ (>= 3:3.2). + * Python package maintainers: please wait uploading python dependent + packages until python2.2 and python2.1 are compiled using gcc-3.2. + + -- Matthias Klose Thu, 9 Jan 2003 23:56:42 +0100 + +python2.3 (2.2.96-1exp1) unstable; urgency=low + + * Python 2.3 alpha1 release (not exactly the tarball, but taken from + CVS 20030101). + - Includes support for linking with threaded tk8.4 (closes: #172714). + * Install and register whatsnew document (closes: #173859). + * Properly unregister info documentation. + + -- Matthias Klose Wed, 1 Jan 2003 17:38:54 +0100 + +python2.3 (2.2.95-1exp1) unstable; urgency=low + + * Experimental packages from CVS 021212. + - data in unicodedate module is up to date (closes: #171061). + * Fix idle packaging (closes: #170394). + * Configure using unicode UCS-4 (closes: #171062). + This change breaks compatibility with binary modules, but what do you + expect from experimental packages ... Please recompile dependent packages. + * Don't strip binaries for now. + + -- Matthias Klose Thu, 12 Dec 2002 21:42:27 +0100 + +python2.3 (2.2.94-1exp1) unstable; urgency=low + + * Experimental packages from CVS 021120. + * Remove outdated README.dbm. + * Depend on tk8.4. + * python-elisp: Install emacsen install file with mode 644 (closes: #167718). + + -- Matthias Klose Thu, 21 Nov 2002 01:04:51 +0100 + +python2.3 (2.2.93-1exp1) unstable; urgency=medium + + * Experimental packages from CVS 021015. + * Build a static library libpython2.3-pic.a. + * Enable large file support for the Hurd (closes: #164602). + + -- Matthias Klose Tue, 15 Oct 2002 21:06:27 +0200 + +python2.3 (2.2.92-1exp1) unstable; urgency=low + + * Experimental packages from CVS 020922. + * Fix build error on ia64 (closes: #161234). + * Build depend on gcc-3.2-3.2.1-0pre2 to fix build error on arm. + + -- Matthias Klose Sun, 22 Sep 2002 18:30:28 +0200 + +python2.3 (2.2.91-1exp1) unstable; urgency=low + + * Experimental packages from CVS 020906. + * idle-python2.3: Fix conflict (closes: #159267). + * Fix location of python-mode.el (closes: #159564, #159619). + * Use tix8.1. + * Apply fix for distutils/ccompiler problem (closes: #159288). + + -- Matthias Klose Sat, 7 Sep 2002 09:55:07 +0200 + +python2.3 (2.2.90-1exp1) unstable; urgency=low + + * Experimental packages from CVS 020820. + * Don't build python2.3-elisp, but put the latest version into + python-elisp. + + -- Matthias Klose Thu, 22 Aug 2002 21:52:04 +0200 + +python2.2 (2.2.1-6) unstable; urgency=low + + * CVS updates of the release22-maint branch upto 2002-07-23. + * Enable IPv6 support (closes: #152543). + * Add python2.2-tk suggestion for python2.2 (pydoc -g). + * Fix from SF patch #527518: proxy config with user+pass authentication. + * Point pydoc to the correct location of the docs (closes: #147579). + * Remove '*.py[co]' files, when removing the python package, + not when purging (closes: #147130). + * Update to new py2texi.el version (Milan Zamazal). + + -- Matthias Klose Mon, 29 Jul 2002 23:11:32 +0200 + +python2.2 (2.2.1-5) unstable; urgency=low + + * CVS updates of the release22-maint branch upto 2002-05-03. + * Build the info docs (closes: #145653). + + -- Matthias Klose Fri, 3 May 2002 22:35:46 +0200 + +python2.2 (2.2.1-4) unstable; urgency=high + + * Fix indentation errors introduced in last upload (closes: #143809). + + -- Matthias Klose Sun, 21 Apr 2002 01:00:14 +0200 + +python2.2 (2.2.1-3) unstable; urgency=high + + * Add Build-Conflicts: tcl8.0-dev, tk8.0-dev, tcl8.2-dev, tk8.2-dev. + Closes: #143534 (build a working _tkinter module, on machines, where + 8.0's tk.h gets included). + * CVS updates of the release22-maint branch upto 2002-04-20. + + -- Matthias Klose Sat, 20 Apr 2002 09:22:37 +0200 + +python2.2 (2.2.1-2) unstable; urgency=low + + * Forgot to copy the dlmodule patch from the 2.1.3 package. Really + closes: #141681. + + -- Matthias Klose Sat, 13 Apr 2002 01:28:05 +0200 + +python2.2 (2.2.1-1) unstable; urgency=high + + * Final 2.2.1 release. + * According to report #131813, the python interpreter is much faster on some + architectures, when beeing linked statically with the python library (25%). + Gregor and me tested on i386, m68k and alpha, but we could not reproduce + such a speedup (generally between 5% and 10%). But we are linking the + python executable now statically ... + * Build info docs from the tex source, merge the python-doc-info + package into the python-doc package. + * Always build the dl module. Failure in case of + sizeof(int)!=sizeof(long)!=sizeof(void*) + is delayed until dl.open is called. Closes: #141681. + + -- Matthias Klose Thu, 11 Apr 2002 00:19:19 +0200 + +python2.2 (2.2.0.92-0) unstable; urgency=low + + * Package CVS sources, omit cvs-updates.dpatch (closes: #140977). + + -- Matthias Klose Wed, 3 Apr 2002 08:20:52 +0200 + +python2.2 (2.2-6) unstable; urgency=medium + + * Update to python-2.2.1 release candidate 2 (final release scheduled + for April 10). + * Enable dl module (closes: #138992). + * Build doc files with python binary from package (closes: #139657). + * Build _tkinter module with BLT and Tix support. + * python2.2-elisp: Conflict with python2-elisp (closes: #138970). + * string.split docs updated in python-2.2.1 (closes: #129272). + + -- Matthias Klose Mon, 1 Apr 2002 13:52:36 +0200 + +python2.2 (2.2-5) unstable; urgency=low + + * CVS updates of the release22-maint branch upto 20020310 (aproaching + the first 2.2.1 release candidate). + * Stolen from HEAD: check argument of locale.nl_langinfo (closes: #137371). + + -- Matthias Klose Fri, 15 Mar 2002 01:05:59 +0100 + +python2.2 (2.2-4) unstable; urgency=medium + + * Include test/{__init__.py,README,pystone.py} in package (closes: #129013). + * Fix python-elisp conflict (closes: #129046). + * Don't compress stylesheets (closes: #133179). + * CVS updates of the release22-maint branch upto 20020310. + + -- Matthias Klose Sun, 10 Mar 2002 23:32:28 +0100 + +python2.2 (2.2-3) unstable; urgency=medium + + * Updates from the CVS python22-maint branch up to 20020107. + webbrowser.py: properly escape url's. + * The Hurd does not have large file support: disabled. + + -- Matthias Klose Mon, 7 Jan 2002 21:55:57 +0100 + +python2.2 (2.2-2) unstable; urgency=medium + + * CVS updates of the release22-maint branch upto 20011229. Fixes: + - Include TCP_CORK flag in plat-linux2 headers (fixes: #84340). + - Update CDROM.py module (fixes: #125785). + * Add missing chunk of the GNU/Hurd patch (therefore urgency medium). + * Send anonymous password when using anonftp (closes: #126814). + + -- Matthias Klose Sat, 29 Dec 2001 20:18:26 +0100 + +python2.2 (2.2-1) unstable; urgency=low + + * New upstream version: 2.2. + * Bugs fixed upstream: + - Docs for os.kill reference the signal module for constants. + - Documentation strings in the tutorial end with a period (closes: #94770). + - Tk: grid_location method moved from Grid to Misc (closes: #98338). + - mhlib.SubMessage.getbodytext takes decode parameter (closes: #31876). + - Strings in modules are locale aware (closes: #51444). + - Printable 8-bit characters in strings are correctly printed + (closes: #64354). + - Dictionary can be updated with abstract mapping object (closes: #46566). + * Make site.py a config files. + + -- Matthias Klose Sat, 22 Dec 2001 00:51:46 +0100 + +python2.2 (2.1.99c1-1) unstable; urgency=low + + * New upstream version: 2.2c1 (release candidate). + * Do not provide python2.2-base anymore. + * Install correct README.Debian for python2.2 package. Include hint + where to find Makefile.pre.in. + * Suggest installation of python-ssl. + * Remove idle config files on purge. + * Remove empty /usr/lib/python2.2 directory on purge. + + -- Matthias Klose Sat, 15 Dec 2001 17:56:27 +0100 + +python2.2 (2.1.99beta2-1) unstable; urgency=high + + * debian/rules: Reflect removal of regrtest package (closes: #122278). + Resulted in build failures on all architectures. + * Build -doc package from source. + + -- Matthias Klose Sat, 8 Dec 2001 00:38:41 +0100 + +python2.2 (2.1.99beta2-0.1) unstable; urgency=low + + * Non maintainer upload. + * New upstream version (this is 2.2beta2). + * Do not build the python-regrtest package anymore; keep the test framework + components test/regrtest.py and test/test_support.py in the python + package (closes: #119408). + + -- Gregor Hoffleit Tue, 27 Nov 2001 09:53:26 +0100 + +python2.2 (2.1.99beta1-4) unstable; urgency=low + + * Configure with --with-fpectl (closes: #118125). + * setup.py: Remove broken check for _curses_panel module (#116081). + * idle: Move config-* files to /etc and mark as conffiles (#106390). + * Move idle packages to section `devel'. + + -- Matthias Klose Wed, 31 Oct 2001 10:56:45 +0100 + +python2.2 (2.1.99beta1-3) unstable; urgency=low + + * Fix shlibs file (was still referring to 2.1). Closes: #116810. + * README.Debian: point to draft of python-policy in the python package. + + -- Matthias Klose Wed, 31 Oct 2001 10:56:45 +0100 + +python2.2 (2.1.99beta1-2) unstable; urgency=medium + + * Fix shlibs file (was still referring to 2.1). Closes: #116810. + * Rename package python2.2-base to python2.2. + + -- Matthias Klose Wed, 24 Oct 2001 23:00:50 +0200 + +python2.2 (2.1.99beta1-1) unstable; urgency=low + + * New upstream version (beta). Call the package version 2.1.99beta1-1. + * New maintainer until the final 2.2 release. + * Updated the debian patches. + + -- Matthias Klose Sat, 20 Oct 2001 18:56:26 +0200 + +python2.1 (2.1.1-1.2) unstable; urgency=low + + * Really remove the python alternative. + + -- Matthias Klose Sat, 20 Oct 2001 15:16:56 +0200 + +python2.1 (2.1.1-1.1) unstable; urgency=low + + * README FOR PACKAGE MAINTAINERS: It is planned to remove the python2-XXX + packages from unstable and move on to python2.1. + If you repackage/adapt your modules for python2.1, don't build + python2-XXX and python2.1-XXX packages from the same source package, + so that the python2-XXX package can be removed without influencing the + python2.1-XXX package. + + See the debian-python mailing list at http://lists.debian.org/devel.html + for details and the current discussion and a draft for a debian-python + policy (August to October 2001). + + * Remove alternative for /usr/bin/python. The python-base package now + provides the default python version. + + * Regenerate control file to fix build dependencies (closes: #116190). + * Remove alternative for /usr/bin/{python,pydoc}. + * Provide a libpython2.1.so symlink in /usr/lib/python2.1/config, + so that the shared library is found when -L/usr/lib/python2.1/config + is specified. + * Conflict with old package versions, where /usr/bin/python is a real + program (closes: #115943). + * python2.1-elisp conflicts with python-elisp (closes: #115895). + * We now have 2.1 (closes: #96851, #107849, #110243). + + -- Matthias Klose Fri, 19 Oct 2001 17:34:41 +0200 + +python2.1 (2.1.1-1) unstable; urgency=low + + * Incorporated Matthias' modifications. + + -- Gregor Hoffleit Thu, 11 Oct 2001 00:16:42 +0200 + +python2.1 (2.1.1-0.2) unstable; urgency=low + + * New upstream 2.1.1. + * GPL compatible licence (fixes #84080, #102949, #110643). + * Fixed upstream (closes: #99692, #111340). + * Build in separate build directory. + * Split Debian patches into debian/patches directory. + * Build dependencies: Add libgmp3-dev, libexpat1-dev, tighten + debhelper dependency. + * debian/rules: Updated a "bit". + * python-elisp: Remove custom dependency (closes: #87783), + fix emacs path (closes: #89712), remove emacs19 dependency (#82694). + * Mention distutils in python-dev package description (closes: #108170). + * Update README.Debian (closes: #85430). + * Run versioned python in postinsts (closes: #113349). + * debian/sample.{postinst,prerm}: Change to version independent scripts. + * Use '/usr/bin/env python2.1' as interpreter for all python scripts. + * Add libssl-dev to Build-Conflicts. + * python-elisp: Add support for emacs21 (closes: #98635). + * Do not compress .py files in doc directories. + * Don't link explicitely with libc. + + -- Matthias Klose Wed, 3 Oct 2001 09:53:08 +0200 + +python2.1 (2.1.1-0.1) unstable; urgency=low + + * New upstream version (CVS branch release21-maint, will become 2.1.1): + This CVS branch will be released as 2.1.1 under a GPL compatible + license. + + -- Gregor Hoffleit Wed, 27 Jun 2001 22:47:58 +0200 + +python2 (2.1-0.1) unstable; urgency=low + + * Fixed Makefile.pre.in. + * Fixed the postinst files in order to use 2.1 (instead of 2.0). + * Mention the immanent release of 2.0.1 and 2.1.1, with a GPL + compatible license. + + -- Gregor Hoffleit Sun, 17 Jun 2001 21:05:25 +0200 + +python2 (2.1-0) unstable; urgency=low + + * New upstream version. + * Experimental packages. + + -- Gregor Hoffleit Thu, 10 May 2001 00:20:04 +0200 + +python2 (2.0-7) unstable; urgency=low + + * Rebuilt with recent tcl8.3-dev/tk8.3-dev in order to fix a + dependency problem with python2-tk (closes: #87793, #92962). + * Change postinst to create and update /usr/local/lib/python2.0 and + site-python with permissions and owner as mandated by policy: + 2775 and root:staff (closes: #89047). + * Fix to compileall.py: A superfluous argument made compileall without + options fail (cf. #92990 for python). + * Move the distutils module into python2-dev. It needs Makefile.pre.in + in order to work (closes: #89900). + * Remove build-dependency on libgdbm2-dev (which isn't built anyway). + * Add a build-dependency on libdb2-dev (cf. #90220 for python). + + -- Gregor Hoffleit Sat, 14 Apr 2001 21:07:51 +0200 + +python2 (2.0-6) unstable; urgency=low + + * Remove python-zlib package; merge it into python-base. + * Mark that README.python2 is not yet updated. + + -- Gregor Hoffleit Wed, 21 Feb 2001 12:34:18 +0100 + +python2 (2.0-5) unstable; urgency=low + + * Recompile with tcl/tk8.3 (closes: #82088). + * Modifications to README.why-python2 (closes: #82116). + * Add menu hint to idle2 menu entry. + * idle2 is renamed idle-python2 and now build correctly (closes: #82218). + * Add build-dependency on autoconf (closes: #85339). + * Build bsddbmodule as shared module (Modules/Setup.config.in), + and link libpython2.so with -lm in Makefile (closes: #86027). + * various cleanups in debian/rules, e.g. removing dh_suidregister. + * Make pdb available as /usr/bin/pdb-python2 in python2-dev + (cf. #79870 in python-base). + * Remove libgmp3 from build-dependencies, since we currently can't + build the mpzmodule for Python2 due to license problems. + + -- Gregor Hoffleit Sun, 18 Feb 2001 00:12:17 +0100 + +python2 (2.0-4) unstable; urgency=low + + * control: make python2-elisp conflict with python-elisp (it doesn't + make sense to have both of them installed, does it ?) + * include build-depend on libxmltok1-dev. + * again, build with tcl/tk8.0. + + -- Gregor Hoffleit Wed, 10 Jan 2001 23:37:01 +0100 + +python2 (2.0-3) unstable; urgency=low + + * Modules/Setup.in: Added a missing \ that made _tkinter be built + incorrectly. + * rules: on the fly, change all '#!' python scripts to use python2. + + -- Gregor Hoffleit Wed, 13 Dec 2000 20:07:24 +0100 + +python2 (2.0-2) unstable; urgency=low + + * Aaargh. Remove conflicts/provides/replaces on python-base to make + parallel installation of python-base and python2-base possible. + * Install examples into /usr/share/doc/python2 (not python) and fix + symlink to python2.0 (thanks to Rick Younie for + pointing out this). + * Rename man page to python2.1. + + -- Gregor Hoffleit Wed, 13 Dec 2000 09:31:05 +0100 + +python2 (2.0-1) unstable; urgency=low + + * New upstream version. Initial release for python2. + + -- Gregor Hoffleit Mon, 11 Dec 2000 22:39:46 +0100 --- python3.4-3.4.1.orig/debian/changelog.shared +++ python3.4-3.4.1/debian/changelog.shared @@ -0,0 +1,3 @@ + * Link the interpreter against the shared runtime library. With + gcc-4.1 the difference in the pystones benchmark dropped from about + 12% to about 5%. --- python3.4-3.4.1.orig/debian/compat +++ python3.4-3.4.1/debian/compat @@ -0,0 +1 @@ +5 --- python3.4-3.4.1.orig/debian/control +++ python3.4-3.4.1/debian/control @@ -0,0 +1,216 @@ +Source: python3.4 +Section: python +Priority: optional +Maintainer: Matthias Klose +Build-Depends: debhelper (>= 5.0.51~), dpkg-dev (>= 1.17.11), + quilt, autoconf, + lsb-release, sharutils, + libreadline6-dev, libncursesw5-dev (>= 5.3), gcc (>= 4:4.9.1-1), + zlib1g-dev, libbz2-dev, liblzma-dev, + libgdbm-dev, libdb-dev, + tk-dev, blt-dev (>= 2.4z), libssl-dev, + libexpat1-dev, libmpdec-dev (>= 2.4), + libbluetooth-dev [!hurd-i386 !kfreebsd-i386 !kfreebsd-amd64], + locales [!armel !avr32 !hppa !ia64 !mipsel], + libsqlite3-dev, libffi-dev (>= 3.0.5) [!or1k !avr32], + libgpm2 [!hurd-i386 !kfreebsd-i386 !kfreebsd-amd64], + mime-support, netbase, bzip2, python3:any, + net-tools, xvfb, xauth +Build-Depends-Indep: python-sphinx +Standards-Version: 3.9.5 +Vcs-Browser: https://code.launchpad.net/~doko/python/pkg3.4-debian +Vcs-Bzr: http://bazaar.launchpad.net/~doko/python/pkg3.4-debian +XS-Testsuite: autopkgtest + +Package: python3.4 +Architecture: any +Multi-Arch: allowed +Priority: optional +Depends: python3.4-minimal (= ${binary:Version}), libpython3.4-stdlib (= ${binary:Version}), mime-support, ${shlibs:Depends}, ${misc:Depends} +Suggests: python3.4-venv, python3.4-doc, binutils +Description: Interactive high-level object-oriented language (version 3.4) + Python is a high-level, interactive, object-oriented language. Its 3.4 version + includes an extensive class library with lots of goodies for + network programming, system administration, sounds and graphics. + +Package: python3.4-venv +Architecture: any +Multi-Arch: allowed +Priority: optional +Depends: python3.4 (= ${binary:Version}), + python-setuptools-whl, python-pip-whl, ${shlibs:Depends}, ${misc:Depends} +Replaces: python3.4 (<< 3.4.1) +Description: Interactive high-level object-oriented language (pyvenv binary, version 3.4) + Python is a high-level, interactive, object-oriented language. Its 3.4 version + includes an extensive class library with lots of goodies for + network programming, system administration, sounds and graphics. + . + This package contains the pyvenv-3.4 binary. + +Package: libpython3.4-stdlib +Architecture: any +Multi-Arch: same +Priority: optional +Pre-Depends: multiarch-support +Depends: libpython3.4-minimal (= ${binary:Version}), mime-support, ${shlibs:Depends}, ${misc:Depends} +Description: Interactive high-level object-oriented language (standard library, version 3.4) + Python is a high-level, interactive, object-oriented language. Its 3.4 version + includes an extensive class library with lots of goodies for + network programming, system administration, sounds and graphics. + . + This package contains Python 3.4's standard library. It is normally not + used on its own, but as a dependency of python3.4. + +Package: python3.4-minimal +Architecture: any +Multi-Arch: allowed +Priority: optional +Pre-Depends: ${shlibs:Pre-Depends} +Depends: libpython3.4-minimal (= ${binary:Version}), ${shlibs:Depends}, ${misc:Depends} +Recommends: python3.4 +Suggests: binfmt-support +Conflicts: binfmt-support (<< 1.1.2) +Description: Minimal subset of the Python language (version 3.4) + This package contains the interpreter and some essential modules. It can + be used in the boot process for some basic tasks. + See /usr/share/doc/python3.4-minimal/README.Debian for a list of the modules + contained in this package. + +Package: libpython3.4-minimal +Architecture: any +Multi-Arch: same +Priority: optional +Pre-Depends: multiarch-support +Depends: ${shlibs:Depends}, ${misc:Depends} +Recommends: libpython3.4-stdlib +Conflicts: binfmt-support (<< 1.1.2) +Replaces: libpython3.4-stdlib (<< 3.4.0+20140425-1) +Description: Minimal subset of the Python language (version 3.4) + This package contains some essential modules. It is normally not + used on it's own, but as a dependency of python3.4-minimal. + +Package: libpython3.4 +Architecture: any +Multi-Arch: same +Section: libs +Priority: optional +Pre-Depends: multiarch-support +Depends: libpython3.4-stdlib (= ${binary:Version}), ${shlibs:Depends}, ${misc:Depends} +Description: Shared Python runtime library (version 3.4) + Python is a high-level, interactive, object-oriented language. Its 3.4 version + includes an extensive class library with lots of goodies for + network programming, system administration, sounds and graphics. + . + This package contains the shared runtime library, normally not needed + for programs using the statically linked interpreter. + +Package: python3.4-examples +Architecture: all +Depends: python3.4 (>= ${source:Version}), ${misc:Depends} +Replaces: libpython3.4-testsuite (<< 3.4.1-8~) +Description: Examples for the Python language (v3.4) + Examples, Demos and Tools for Python (v3.4). These are files included in + the upstream Python distribution (v3.4). + +Package: python3.4-dev +Architecture: any +Multi-Arch: allowed +Depends: python3.4 (= ${binary:Version}), libpython3.4-dev (= ${binary:Version}), libpython3.4 (= ${binary:Version}), libexpat1-dev, ${shlibs:Depends}, ${misc:Depends} +Recommends: libc6-dev | libc-dev +Description: Header files and a static library for Python (v3.4) + Header files, a static library and development tools for building + Python (v3.4) modules, extending the Python interpreter or embedding + Python (v3.4) in applications. + . + Maintainers of Python packages should read README.maintainers. + +Package: libpython3.4-dev +Section: libdevel +Architecture: any +Multi-Arch: same +Pre-Depends: multiarch-support +Depends: libpython3.4-stdlib (= ${binary:Version}), libpython3.4 (= ${binary:Version}), libexpat1-dev, ${shlibs:Depends}, ${misc:Depends} +Recommends: libc6-dev | libc-dev +Description: Header files and a static library for Python (v3.4) + Header files, a static library and development tools for building + Python (v3.4) modules, extending the Python interpreter or embedding + Python (v3.4) in applications. + . + Maintainers of Python packages should read README.maintainers. + . + This package contains development files. It is normally not + used on it's own, but as a dependency of python3.4-dev. + +Package: libpython3.4-testsuite +Section: libdevel +Architecture: all +Depends: python3.4 (>= ${binary:Version}), ${misc:Depends}, net-tools +Suggests: python3-gdbm, python3-tk +Description: Testsuite for the Python standard library (v3.4) + The complete testsuite for the Python standard library. Note that + a subset is found in the libpython3.4-stdlib package, which should + be enough for other packages to use (please do not build-depend + on this package, but file a bug report to include additional + testsuite files in the libpython3.4-stdlib package). + +Package: idle-python3.4 +Architecture: all +Depends: python3.4, python3-tk, python3.4-tk, ${misc:Depends} +Enhances: python3.4 +Description: IDE for Python (v3.4) using Tkinter + IDLE is an Integrated Development Environment for Python (v3.4). + IDLE is written using Tkinter and therefore quite platform-independent. + +Package: python3.4-doc +Section: doc +Architecture: all +Depends: libjs-jquery, libjs-underscore, ${misc:Depends} +Suggests: python3.4 +Description: Documentation for the high-level object-oriented language Python (v3.4) + These is the official set of documentation for the interactive high-level + object-oriented language Python (v3.4). All documents are provided + in HTML format. The package consists of ten documents: + . + * What's New in Python3.4 + * Tutorial + * Python Library Reference + * Macintosh Module Reference + * Python Language Reference + * Extending and Embedding Python + * Python/C API Reference + * Installing Python Modules + * Documenting Python + * Distributing Python Modules + +Package: python3.4-dbg +Section: debug +Architecture: any +Multi-Arch: allowed +Priority: extra +Depends: python3.4 (= ${binary:Version}), libpython3.4-dbg (= ${binary:Version}), ${shlibs:Depends}, ${misc:Depends} +Recommends: gdb +Suggests: python3-gdbm-dbg, python3-tk-dbg +Description: Debug Build of the Python Interpreter (version 3.4) + The package holds two things: + . + - A Python interpreter configured with --pydebug. Dynamically loaded modules + are searched as _d.so first. Third party extensions need a separate + build to be used by this interpreter. + - Debug information for standard python interpreter and extensions. + . + See the README.debug for more information. + +Package: libpython3.4-dbg +Section: debug +Architecture: any +Multi-Arch: same +Priority: extra +Pre-Depends: multiarch-support +Depends: libpython3.4-stdlib (= ${binary:Version}), ${shlibs:Depends}, ${misc:Depends} +Description: Debug Build of the Python Interpreter (version 3.4) + The package holds two things: + . + - Extensions for a Python interpreter configured with --pydebug. + - Debug information for standard python extensions. + . + See the README.debug for more information. --- python3.4-3.4.1.orig/debian/control.in +++ python3.4-3.4.1/debian/control.in @@ -0,0 +1,216 @@ +Source: @PVER@ +Section: python +Priority: optional +Maintainer: Matthias Klose +Build-Depends: debhelper (>= 5.0.51~), @bd_dpkgdev@ + quilt, autoconf, + lsb-release, sharutils, + libreadline6-dev, libncursesw5-dev (>= 5.3), @bd_gcc@ + zlib1g-dev, libbz2-dev, liblzma-dev, + libgdbm-dev, libdb-dev, + tk-dev, blt-dev (>= 2.4z), libssl-dev, + libexpat1-dev, libmpdec-dev (>= 2.4), + libbluetooth-dev [!hurd-i386 !kfreebsd-i386 !kfreebsd-amd64], + locales [!armel !avr32 !hppa !ia64 !mipsel], + libsqlite3-dev, libffi-dev (>= 3.0.5) [!or1k !avr32], + libgpm2 [!hurd-i386 !kfreebsd-i386 !kfreebsd-amd64], + mime-support, netbase, bzip2, python3@bd_qual@, + net-tools, xvfb, xauth +Build-Depends-Indep: python-sphinx +Standards-Version: 3.9.5 +Vcs-Browser: https://code.launchpad.net/~doko/python/pkg@VER@-debian +Vcs-Bzr: http://bazaar.launchpad.net/~doko/python/pkg@VER@-debian +XS-Testsuite: autopkgtest + +Package: @PVER@ +Architecture: any +Multi-Arch: allowed +Priority: @PRIO@ +Depends: @PVER@-minimal (= ${binary:Version}), lib@PVER@-stdlib (= ${binary:Version}), mime-support, ${shlibs:Depends}, ${misc:Depends} +Suggests: @PVER@-venv, @PVER@-doc, binutils +Description: Interactive high-level object-oriented language (version @VER@) + Python is a high-level, interactive, object-oriented language. Its @VER@ version + includes an extensive class library with lots of goodies for + network programming, system administration, sounds and graphics. + +Package: @PVER@-venv +Architecture: any +Multi-Arch: allowed +Priority: @PRIO@ +Depends: @PVER@ (= ${binary:Version}), + python-setuptools-whl, python-pip-whl, ${shlibs:Depends}, ${misc:Depends} +Replaces: python3.4 (<< 3.4.1) +Description: Interactive high-level object-oriented language (pyvenv binary, version @VER@) + Python is a high-level, interactive, object-oriented language. Its @VER@ version + includes an extensive class library with lots of goodies for + network programming, system administration, sounds and graphics. + . + This package contains the pyvenv-@VER@ binary. + +Package: lib@PVER@-stdlib +Architecture: any +Multi-Arch: same +Priority: @PRIO@ +Pre-Depends: multiarch-support +Depends: lib@PVER@-minimal (= ${binary:Version}), mime-support, ${shlibs:Depends}, ${misc:Depends} +Description: Interactive high-level object-oriented language (standard library, version @VER@) + Python is a high-level, interactive, object-oriented language. Its @VER@ version + includes an extensive class library with lots of goodies for + network programming, system administration, sounds and graphics. + . + This package contains Python @VER@'s standard library. It is normally not + used on its own, but as a dependency of python@VER@. + +Package: @PVER@-minimal +Architecture: any +Multi-Arch: allowed +Priority: @MINPRIO@ +Pre-Depends: ${shlibs:Pre-Depends} +Depends: lib@PVER@-minimal (= ${binary:Version}), ${shlibs:Depends}, ${misc:Depends} +Recommends: @PVER@ +Suggests: binfmt-support +Conflicts: binfmt-support (<< 1.1.2) +Description: Minimal subset of the Python language (version @VER@) + This package contains the interpreter and some essential modules. It can + be used in the boot process for some basic tasks. + See /usr/share/doc/@PVER@-minimal/README.Debian for a list of the modules + contained in this package. + +Package: lib@PVER@-minimal +Architecture: any +Multi-Arch: same +Priority: @MINPRIO@ +Pre-Depends: multiarch-support +Depends: ${shlibs:Depends}, ${misc:Depends} +Recommends: lib@PVER@-stdlib +Conflicts: binfmt-support (<< 1.1.2) +Replaces: libpython3.4-stdlib (<< 3.4.0+20140425-1) +Description: Minimal subset of the Python language (version @VER@) + This package contains some essential modules. It is normally not + used on it's own, but as a dependency of @PVER@-minimal. + +Package: lib@PVER@ +Architecture: any +Multi-Arch: same +Section: libs +Priority: @PRIO@ +Pre-Depends: multiarch-support +Depends: lib@PVER@-stdlib (= ${binary:Version}), ${shlibs:Depends}, ${misc:Depends} +Description: Shared Python runtime library (version @VER@) + Python is a high-level, interactive, object-oriented language. Its @VER@ version + includes an extensive class library with lots of goodies for + network programming, system administration, sounds and graphics. + . + This package contains the shared runtime library, normally not needed + for programs using the statically linked interpreter. + +Package: @PVER@-examples +Architecture: all +Depends: @PVER@ (>= ${source:Version}), ${misc:Depends} +Replaces: lib@PVER@-testsuite (<< 3.4.1-8~) +Description: Examples for the Python language (v@VER@) + Examples, Demos and Tools for Python (v@VER@). These are files included in + the upstream Python distribution (v@VER@). + +Package: @PVER@-dev +Architecture: any +Multi-Arch: allowed +Depends: @PVER@ (= ${binary:Version}), lib@PVER@-dev (= ${binary:Version}), lib@PVER@ (= ${binary:Version}), libexpat1-dev, ${shlibs:Depends}, ${misc:Depends} +Recommends: libc6-dev | libc-dev +Description: Header files and a static library for Python (v@VER@) + Header files, a static library and development tools for building + Python (v@VER@) modules, extending the Python interpreter or embedding + Python (v@VER@) in applications. + . + Maintainers of Python packages should read README.maintainers. + +Package: lib@PVER@-dev +Section: libdevel +Architecture: any +Multi-Arch: same +Pre-Depends: multiarch-support +Depends: lib@PVER@-stdlib (= ${binary:Version}), lib@PVER@ (= ${binary:Version}), libexpat1-dev, ${shlibs:Depends}, ${misc:Depends} +Recommends: libc6-dev | libc-dev +Description: Header files and a static library for Python (v@VER@) + Header files, a static library and development tools for building + Python (v@VER@) modules, extending the Python interpreter or embedding + Python (v@VER@) in applications. + . + Maintainers of Python packages should read README.maintainers. + . + This package contains development files. It is normally not + used on it's own, but as a dependency of @PVER@-dev. + +Package: lib@PVER@-testsuite +Section: libdevel +Architecture: all +Depends: @PVER@ (>= ${binary:Version}), ${misc:Depends}, net-tools +Suggests: python3-gdbm, python3-tk +Description: Testsuite for the Python standard library (v@VER@) + The complete testsuite for the Python standard library. Note that + a subset is found in the lib@PVER@-stdlib package, which should + be enough for other packages to use (please do not build-depend + on this package, but file a bug report to include additional + testsuite files in the lib@PVER@-stdlib package). + +Package: idle-@PVER@ +Architecture: all +Depends: @PVER@, python3-tk, @PVER@-tk, ${misc:Depends} +Enhances: @PVER@ +Description: IDE for Python (v@VER@) using Tkinter + IDLE is an Integrated Development Environment for Python (v@VER@). + IDLE is written using Tkinter and therefore quite platform-independent. + +Package: @PVER@-doc +Section: doc +Architecture: all +Depends: libjs-jquery, libjs-underscore, ${misc:Depends} +Suggests: @PVER@ +Description: Documentation for the high-level object-oriented language Python (v@VER@) + These is the official set of documentation for the interactive high-level + object-oriented language Python (v@VER@). All documents are provided + in HTML format. The package consists of ten documents: + . + * What's New in Python@VER@ + * Tutorial + * Python Library Reference + * Macintosh Module Reference + * Python Language Reference + * Extending and Embedding Python + * Python/C API Reference + * Installing Python Modules + * Documenting Python + * Distributing Python Modules + +Package: @PVER@-dbg +Section: debug +Architecture: any +Multi-Arch: allowed +Priority: extra +Depends: @PVER@ (= ${binary:Version}), lib@PVER@-dbg (= ${binary:Version}), ${shlibs:Depends}, ${misc:Depends} +Recommends: gdb +Suggests: python3-gdbm-dbg, python3-tk-dbg +Description: Debug Build of the Python Interpreter (version @VER@) + The package holds two things: + . + - A Python interpreter configured with --pydebug. Dynamically loaded modules + are searched as _d.so first. Third party extensions need a separate + build to be used by this interpreter. + - Debug information for standard python interpreter and extensions. + . + See the README.debug for more information. + +Package: lib@PVER@-dbg +Section: debug +Architecture: any +Multi-Arch: same +Priority: extra +Pre-Depends: multiarch-support +Depends: lib@PVER@-stdlib (= ${binary:Version}), ${shlibs:Depends}, ${misc:Depends} +Description: Debug Build of the Python Interpreter (version @VER@) + The package holds two things: + . + - Extensions for a Python interpreter configured with --pydebug. + - Debug information for standard python extensions. + . + See the README.debug for more information. --- python3.4-3.4.1.orig/debian/control.stdlib +++ python3.4-3.4.1/debian/control.stdlib @@ -0,0 +1,16 @@ +Package: @PVER@-tk +Architecture: any +Depends: @PVER@ (= ${Source-Version}), ${shlibs:Depends} +Suggests: tix +XB-Python-Version: @VER@ +Description: Tkinter - Writing Tk applications with Python (v@VER@) + A module for writing portable GUI applications with Python (v@VER@) using Tk. + Also known as Tkinter. + +Package: @PVER@-gdbm +Architecture: any +Depends: @PVER@ (= ${Source-Version}), ${shlibs:Depends} +Description: GNU dbm database support for Python (v@VER@) + GNU dbm database module for Python. Install this if you want to + create or read GNU dbm database files with Python. + --- python3.4-3.4.1.orig/debian/control.udeb +++ python3.4-3.4.1/debian/control.udeb @@ -0,0 +1,11 @@ + +Package: @PVER@-udeb +XC-Package-Type: udeb +Section: debian-installer +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends} +XB-Python-Runtime: @PVER@ +XB-Python-Version: @VER@ +Description: A minimal subset of the Python language (version @VER@) + This package contains the interpreter and some essential modules, packaged + for use in the installer. --- python3.4-3.4.1.orig/debian/copyright +++ python3.4-3.4.1/debian/copyright @@ -0,0 +1,1028 @@ +This package was put together by Klee Dienes from +sources from ftp.python.org:/pub/python, based on the Debianization by +the previous maintainers Bernd S. Brentrup and +Bruce Perens. Current maintainer is Matthias Klose . + +It was downloaded from http://python.org/ + +Copyright: + +Upstream Author: Guido van Rossum and others. + +License: + +The following text includes the Python license and licenses and +acknowledgements for incorporated software. The licenses can be read +in the HTML and texinfo versions of the documentation as well, after +installing the pythonx.y-doc package. Licenses for files not licensed +under the Python Licenses are found at the end of this file. + + +Python License +============== + +A. HISTORY OF THE SOFTWARE +========================== + +Python was created in the early 1990s by Guido van Rossum at Stichting +Mathematisch Centrum (CWI, see http://www.cwi.nl) in the Netherlands +as a successor of a language called ABC. Guido remains Python's +principal author, although it includes many contributions from others. + +In 1995, Guido continued his work on Python at the Corporation for +National Research Initiatives (CNRI, see http://www.cnri.reston.va.us) +in Reston, Virginia where he released several versions of the +software. + +In May 2000, Guido and the Python core development team moved to +BeOpen.com to form the BeOpen PythonLabs team. In October of the same +year, the PythonLabs team moved to Digital Creations (now Zope +Corporation, see http://www.zope.com). In 2001, the Python Software +Foundation (PSF, see http://www.python.org/psf/) was formed, a +non-profit organization created specifically to own Python-related +Intellectual Property. Zope Corporation is a sponsoring member of +the PSF. + +All Python releases are Open Source (see http://www.opensource.org for +the Open Source Definition). Historically, most, but not all, Python +releases have also been GPL-compatible; the table below summarizes +the various releases. + + Release Derived Year Owner GPL- + from compatible? (1) + + 0.9.0 thru 1.2 1991-1995 CWI yes + 1.3 thru 1.5.2 1.2 1995-1999 CNRI yes + 1.6 1.5.2 2000 CNRI no + 2.0 1.6 2000 BeOpen.com no + 1.6.1 1.6 2001 CNRI yes (2) + 2.1 2.0+1.6.1 2001 PSF no + 2.0.1 2.0+1.6.1 2001 PSF yes + 2.1.1 2.1+2.0.1 2001 PSF yes + 2.2 2.1.1 2001 PSF yes + 2.1.2 2.1.1 2002 PSF yes + 2.1.3 2.1.2 2002 PSF yes + 2.2.1 2.2 2002 PSF yes + 2.2.2 2.2.1 2002 PSF yes + 2.2.3 2.2.2 2003 PSF yes + 2.3 2.2.2 2002-2003 PSF yes + 2.3.1 2.3 2002-2003 PSF yes + 2.3.2 2.3.1 2002-2003 PSF yes + 2.3.3 2.3.2 2002-2003 PSF yes + 2.3.4 2.3.3 2004 PSF yes + 2.3.5 2.3.4 2005 PSF yes + 2.4 2.3 2004 PSF yes + 2.4.1 2.4 2005 PSF yes + 2.4.2 2.4.1 2005 PSF yes + 2.4.3 2.4.2 2006 PSF yes + 2.5 2.4 2006 PSF yes + 2.5.1 2.5 2007 PSF yes + 2.5.2 2.5.1 2008 PSF yes + 2.5.3 2.5.2 2008 PSF yes + 2.6 2.5 2008 PSF yes + 2.6.1 2.6 2008 PSF yes + 2.6.2 2.6.1 2009 PSF yes + 2.6.3 2.6.2 2009 PSF yes + 2.6.4 2.6.3 2009 PSF yes + 2.6.5 2.6.4 2010 PSF yes + 3.0 2.6 2008 PSF yes + 3.0.1 3.0 2009 PSF yes + 3.1 3.0.1 2009 PSF yes + 3.1.1 3.1 2009 PSF yes + 3.1.2 3.1.1 2010 PSF yes + 3.1.3 3.1.2 2010 PSF yes + 3.1.4 3.1.3 2011 PSF yes + 3.2 3.1 2011 PSF yes + 3.2.1 3.2 2011 PSF yes + 3.2.2 3.2.1 2011 PSF yes + 3.3 3.2 2012 PSF yes + +Footnotes: + +(1) GPL-compatible doesn't mean that we're distributing Python under + the GPL. All Python licenses, unlike the GPL, let you distribute + a modified version without making your changes open source. The + GPL-compatible licenses make it possible to combine Python with + other software that is released under the GPL; the others don't. + +(2) According to Richard Stallman, 1.6.1 is not GPL-compatible, + because its license has a choice of law clause. According to + CNRI, however, Stallman's lawyer has told CNRI's lawyer that 1.6.1 + is "not incompatible" with the GPL. + +Thanks to the many outside volunteers who have worked under Guido's +direction to make these releases possible. + + +B. TERMS AND CONDITIONS FOR ACCESSING OR OTHERWISE USING PYTHON +=============================================================== + +PYTHON SOFTWARE FOUNDATION LICENSE VERSION 2 +-------------------------------------------- + +1. This LICENSE AGREEMENT is between the Python Software Foundation +("PSF"), and the Individual or Organization ("Licensee") accessing and +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, 2009, 2010, 2011, 2012, +2013, 2014 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 +the derivative work available to others as provided herein, then +Licensee hereby agrees to include in any such work a brief summary of +the changes made to Python. + +4. PSF is making Python available to Licensee on an "AS IS" +basis. PSF MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR +IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, PSF MAKES NO AND +DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS +FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF PYTHON WILL NOT +INFRINGE ANY THIRD PARTY RIGHTS. + +5. PSF SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF PYTHON +FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS AS +A RESULT OF MODIFYING, DISTRIBUTING, OR OTHERWISE USING PYTHON, +OR ANY DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF. + +6. This License Agreement will automatically terminate upon a material +breach of its terms and conditions. + +7. Nothing in this License Agreement shall be deemed to create any +relationship of agency, partnership, or joint venture between PSF and +Licensee. This License Agreement does not grant permission to use PSF +trademarks or trade name in a trademark sense to endorse or promote +products or services of Licensee, or any third party. + +8. By copying, installing or otherwise using Python, Licensee +agrees to be bound by the terms and conditions of this License +Agreement. + + +BEOPEN.COM LICENSE AGREEMENT FOR PYTHON 2.0 +------------------------------------------- + +BEOPEN PYTHON OPEN SOURCE LICENSE AGREEMENT VERSION 1 + +1. This LICENSE AGREEMENT is between BeOpen.com ("BeOpen"), having an +office at 160 Saratoga Avenue, Santa Clara, CA 95051, and the +Individual or Organization ("Licensee") accessing and otherwise using +this software in source or binary form and its associated +documentation ("the Software"). + +2. Subject to the terms and conditions of this BeOpen Python License +Agreement, BeOpen hereby grants Licensee a non-exclusive, +royalty-free, world-wide license to reproduce, analyze, test, perform +and/or display publicly, prepare derivative works, distribute, and +otherwise use the Software alone or in any derivative version, +provided, however, that the BeOpen Python License is retained in the +Software, alone or in any derivative version prepared by Licensee. + +3. BeOpen is making the Software available to Licensee on an "AS IS" +basis. BEOPEN MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR +IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, BEOPEN MAKES NO AND +DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS +FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF THE SOFTWARE WILL NOT +INFRINGE ANY THIRD PARTY RIGHTS. + +4. BEOPEN SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF THE +SOFTWARE FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS +AS A RESULT OF USING, MODIFYING OR DISTRIBUTING THE SOFTWARE, OR ANY +DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF. + +5. This License Agreement will automatically terminate upon a material +breach of its terms and conditions. + +6. This License Agreement shall be governed by and interpreted in all +respects by the law of the State of California, excluding conflict of +law provisions. Nothing in this License Agreement shall be deemed to +create any relationship of agency, partnership, or joint venture +between BeOpen and Licensee. This License Agreement does not grant +permission to use BeOpen trademarks or trade names in a trademark +sense to endorse or promote products or services of Licensee, or any +third party. As an exception, the "BeOpen Python" logos available at +http://www.pythonlabs.com/logos.html may be used according to the +permissions granted on that web page. + +7. By copying, installing or otherwise using the software, Licensee +agrees to be bound by the terms and conditions of this License +Agreement. + + +CNRI LICENSE AGREEMENT FOR PYTHON 1.6.1 +--------------------------------------- + +1. This LICENSE AGREEMENT is between the Corporation for National +Research Initiatives, having an office at 1895 Preston White Drive, +Reston, VA 20191 ("CNRI"), and the Individual or Organization +("Licensee") accessing and otherwise using Python 1.6.1 software in +source or binary form and its associated documentation. + +2. Subject to the terms and conditions of this License Agreement, CNRI +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 1.6.1 +alone or in any derivative version, provided, however, that CNRI's +License Agreement and CNRI's notice of copyright, i.e., "Copyright (c) +1995-2001 Corporation for National Research Initiatives; All Rights +Reserved" are retained in Python 1.6.1 alone or in any derivative +version prepared by Licensee. Alternately, in lieu of CNRI's License +Agreement, Licensee may substitute the following text (omitting the +quotes): "Python 1.6.1 is made available subject to the terms and +conditions in CNRI's License Agreement. This Agreement together with +Python 1.6.1 may be located on the Internet using the following +unique, persistent identifier (known as a handle): 1895.22/1013. This +Agreement may also be obtained from a proxy server on the Internet +using the following URL: http://hdl.handle.net/1895.22/1013". + +3. In the event Licensee prepares a derivative work that is based on +or incorporates Python 1.6.1 or any part thereof, and wants to make +the derivative work available to others as provided herein, then +Licensee hereby agrees to include in any such work a brief summary of +the changes made to Python 1.6.1. + +4. CNRI is making Python 1.6.1 available to Licensee on an "AS IS" +basis. CNRI MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR +IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, CNRI MAKES NO AND +DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS +FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF PYTHON 1.6.1 WILL NOT +INFRINGE ANY THIRD PARTY RIGHTS. + +5. CNRI SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF PYTHON +1.6.1 FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS AS +A RESULT OF MODIFYING, DISTRIBUTING, OR OTHERWISE USING PYTHON 1.6.1, +OR ANY DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF. + +6. This License Agreement will automatically terminate upon a material +breach of its terms and conditions. + +7. This License Agreement shall be governed by the federal +intellectual property law of the United States, including without +limitation the federal copyright law, and, to the extent such +U.S. federal law does not apply, by the law of the Commonwealth of +Virginia, excluding Virginia's conflict of law provisions. +Notwithstanding the foregoing, with regard to derivative works based +on Python 1.6.1 that incorporate non-separable material that was +previously distributed under the GNU General Public License (GPL), the +law of the Commonwealth of Virginia shall govern this License +Agreement only as to issues arising under or with respect to +Paragraphs 4, 5, and 7 of this License Agreement. Nothing in this +License Agreement shall be deemed to create any relationship of +agency, partnership, or joint venture between CNRI and Licensee. This +License Agreement does not grant permission to use CNRI trademarks or +trade name in a trademark sense to endorse or promote products or +services of Licensee, or any third party. + +8. By clicking on the "ACCEPT" button where indicated, or by copying, +installing or otherwise using Python 1.6.1, Licensee agrees to be +bound by the terms and conditions of this License Agreement. + + ACCEPT + + +CWI LICENSE AGREEMENT FOR PYTHON 0.9.0 THROUGH 1.2 +-------------------------------------------------- + +Copyright (c) 1991 - 1995, Stichting Mathematisch Centrum Amsterdam, +The Netherlands. All rights reserved. + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of Stichting Mathematisch +Centrum or CWI not be used in advertising or publicity pertaining to +distribution of the software without specific, written prior +permission. + +STICHTING MATHEMATISCH CENTRUM DISCLAIMS ALL WARRANTIES WITH REGARD TO +THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS, IN NO EVENT SHALL STICHTING MATHEMATISCH CENTRUM BE LIABLE +FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT +OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + + +Licenses and Acknowledgements for Incorporated Software +======================================================= + +Mersenne Twister +---------------- + +The `_random' module includes code based on a download from +`http://www.math.keio.ac.jp/~matumoto/MT2002/emt19937ar.html'. The +following are the verbatim comments from the original code: + + A C-program for MT19937, with initialization improved 2002/1/26. + Coded by Takuji Nishimura and Makoto Matsumoto. + + Before using, initialize the state by using init_genrand(seed) + or init_by_array(init_key, key_length). + + Copyright (C) 1997 - 2002, Makoto Matsumoto and Takuji Nishimura, + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + 3. The names of its contributors may not be used to endorse or promote + products derived from this software without specific prior written + permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED + TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + Any feedback is very welcome. + http://www.math.keio.ac.jp/matumoto/emt.html + email: matumoto@math.keio.ac.jp + + +Sockets +------- + +The `socket' module uses the functions, `getaddrinfo', and +`getnameinfo', which are coded in separate source files from the WIDE +Project, `http://www.wide.ad.jp/about/index.html'. + + Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + 3. Neither the name of the project nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND + GAI_ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE + FOR GAI_ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON GAI_ANY THEORY OF LIABILITY, WHETHER + IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN GAI_ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + OF THE POSSIBILITY OF SUCH DAMAGE. + + +Floating point exception control +-------------------------------- + +The source for the `fpectl' module includes the following notice: + + --------------------------------------------------------------------- + / Copyright (c) 1996. \ + | The Regents of the University of California. | + | All rights reserved. | + | | + | Permission to use, copy, modify, and distribute this software for | + | any purpose without fee is hereby granted, provided that this en- | + | tire notice is included in all copies of any software which is or | + | includes a copy or modification of this software and in all | + | copies of the supporting documentation for such software. | + | | + | This work was produced at the University of California, Lawrence | + | Livermore National Laboratory under contract no. W-7405-ENG-48 | + | between the U.S. Department of Energy and The Regents of the | + | University of California for the operation of UC LLNL. | + | | + | DISCLAIMER | + | | + | This software was prepared as an account of work sponsored by an | + | agency of the United States Government. Neither the United States | + | Government nor the University of California nor any of their em- | + | ployees, makes any warranty, express or implied, or assumes any | + | liability or responsibility for the accuracy, completeness, or | + | usefulness of any information, apparatus, product, or process | + | disclosed, or represents that its use would not infringe | + | privately-owned rights. Reference herein to any specific commer- | + | cial products, process, or service by trade name, trademark, | + | manufacturer, or otherwise, does not necessarily constitute or | + | imply its endorsement, recommendation, or favoring by the United | + | States Government or the University of California. The views and | + | 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. / + --------------------------------------------------------------------- + + +Cookie management +----------------- + +The `Cookie' module contains the following notice: + + Copyright 2000 by Timothy O'Malley + + All Rights Reserved + + Permission to use, copy, modify, and distribute this software + and its documentation for any purpose and without fee is hereby + granted, provided that the above copyright notice appear in all + copies and that both that copyright notice and this permission + notice appear in supporting documentation, and that the name of + Timothy O'Malley not be used in advertising or publicity + pertaining to distribution of the software without specific, written + prior permission. + + Timothy O'Malley DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS + SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY + AND FITNESS, IN NO EVENT SHALL Timothy O'Malley BE LIABLE FOR + ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, + WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS + ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + PERFORMANCE OF THIS SOFTWARE. + + +Execution tracing +----------------- + +The `trace' module contains the following notice: + + portions copyright 2001, Autonomous Zones Industries, Inc., all rights... + err... reserved and offered to the public under the terms of the + Python 2.2 license. + Author: Zooko O'Whielacronx + http://zooko.com/ + mailto:zooko@zooko.com + + Copyright 2000, Mojam Media, Inc., all rights reserved. + Author: Skip Montanaro + + Copyright 1999, Bioreason, Inc., all rights reserved. + Author: Andrew Dalke + + Copyright 1995-1997, Automatrix, Inc., all rights reserved. + Author: Skip Montanaro + + Copyright 1991-1995, Stichting Mathematisch Centrum, all rights reserved. + + Permission to use, copy, modify, and distribute this Python software and + its associated documentation for any purpose without fee is hereby + granted, provided that the above copyright notice appears in all copies, + and that both that copyright notice and this permission notice appear in + supporting documentation, and that the name of neither Automatrix, + Bioreason or Mojam Media be used in advertising or publicity pertaining + to distribution of the software without specific, written prior + permission. + + +UUencode and UUdecode functions +------------------------------- + +The `uu' module contains the following notice: + + Copyright 1994 by Lance Ellinghouse + Cathedral City, California Republic, United States of America. + All Rights Reserved + Permission to use, copy, modify, and distribute this software and its + documentation for any purpose and without fee is hereby granted, + provided that the above copyright notice appear in all copies and that + both that copyright notice and this permission notice appear in + supporting documentation, and that the name of Lance Ellinghouse + not be used in advertising or publicity pertaining to distribution + of the software without specific, written prior permission. + LANCE ELLINGHOUSE DISCLAIMS ALL WARRANTIES WITH REGARD TO + THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND + FITNESS, IN NO EVENT SHALL LANCE ELLINGHOUSE CENTRUM BE LIABLE + FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT + OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + + Modified by Jack Jansen, CWI, July 1995: + - Use binascii module to do the actual line-by-line conversion + between ascii and binary. This results in a 1000-fold speedup. The C + version is still 5 times faster, though. + - Arguments more compliant with python standard + + +XML Remote Procedure Calls +-------------------------- + +The `xmlrpclib' module contains the following notice: + + The XML-RPC client interface is + + Copyright (c) 1999-2002 by Secret Labs AB + Copyright (c) 1999-2002 by Fredrik Lundh + + By obtaining, using, and/or copying this software and/or its + associated documentation, you agree that you have read, understood, + and will comply with the following terms and conditions: + + Permission to use, copy, modify, and distribute this software and + its associated documentation for any purpose and without fee is + hereby granted, provided that the above copyright notice appears in + all copies, and that both that copyright notice and this permission + notice appear in supporting documentation, and that the name of + Secret Labs AB or the author not be used in advertising or publicity + pertaining to distribution of the software without specific, written + prior permission. + + SECRET LABS AB AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD + TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANT- + ABILITY AND FITNESS. IN NO EVENT SHALL SECRET LABS AB OR THE AUTHOR + BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY + DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, + WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS + ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE + OF THIS SOFTWARE. + +Licenses for Software linked to +=============================== + +Note that the choice of GPL compatibility outlined above doesn't extend +to modules linked to particular libraries, since they change the +effective License of the module binary. + + +GNU Readline +------------ + +The 'readline' module makes use of GNU Readline. + + The GNU Readline Library is free software; you can redistribute it + and/or modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2, or (at + your option) any later version. + + On Debian systems, you can find the complete statement in + /usr/share/doc/readline-common/copyright'. A copy of the GNU General + Public License is available in /usr/share/common-licenses/GPL-2'. + + +OpenSSL +------- + +The '_ssl' module makes use of OpenSSL. + + The OpenSSL toolkit stays under a dual license, i.e. both the + conditions of the OpenSSL License and the original SSLeay license + apply to the toolkit. Actually both licenses are BSD-style Open + Source licenses. Note that both licenses are incompatible with + the GPL. + + On Debian systems, you can find the complete license text in + /usr/share/doc/openssl/copyright'. + + +Files with other licenses than the Python License +------------------------------------------------- + +Files: Include/dynamic_annotations.h +Files: Python/dynamic_annotations.c +Copyright: (c) 2008-2009, Google Inc. +License: Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +Files: Include/unicodeobject.h +Copyright: (c) Corporation for National Research Initiatives. +Copyright: (c) 1999 by Secret Labs AB. +Copyright: (c) 1999 by Fredrik Lundh. +License: By obtaining, using, and/or copying this software and/or its + associated documentation, you agree that you have read, understood, + and will comply with the following terms and conditions: + + Permission to use, copy, modify, and distribute this software and its + associated documentation for any purpose and without fee is hereby + granted, provided that the above copyright notice appears in all + copies, and that both that copyright notice and this permission notice + appear in supporting documentation, and that the name of Secret Labs + AB or the author not be used in advertising or publicity pertaining to + distribution of the software without specific, written prior + permission. + + SECRET LABS AB AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO + THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND + FITNESS. IN NO EVENT SHALL SECRET LABS AB OR THE AUTHOR BE LIABLE FOR + ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT + OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + +Files: Lib/logging/* +Copyright: 2001-2010 by Vinay Sajip. All Rights Reserved. +License: Permission to use, copy, modify, and distribute this software and + its documentation for any purpose and without fee is hereby granted, + provided that the above copyright notice appear in all copies and that + both that copyright notice and this permission notice appear in + supporting documentation, and that the name of Vinay Sajip + not be used in advertising or publicity pertaining to distribution + of the software without specific, written prior permission. + VINAY SAJIP DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING + ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL + VINAY SAJIP BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR + ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER + IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT + OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + +Files: Lib/multiprocessing/* +Files: Modules/_multiprocessing/* +Copyright: (c) 2006-2008, R Oudkerk. All rights reserved. +License: Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + 3. Neither the name of author nor the names of any contributors may be + used to endorse or promote products derived from this software + without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + SUCH DAMAGE. + +Files: Lib/sqlite3/* +Files: Modules/_sqlite/* +Copyright: (C) 2004-2005 Gerhard Häring +License: This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. + +Files: Lib/async* +Copyright: Copyright 1996 by Sam Rushing +License: Permission to use, copy, modify, and distribute this software and + its documentation for any purpose and without fee is hereby + granted, provided that the above copyright notice appear in all + copies and that both that copyright notice and this permission + notice appear in supporting documentation, and that the name of Sam + Rushing not be used in advertising or publicity pertaining to + distribution of the software without specific, written prior + permission. + + SAM RUSHING DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, + INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN + NO EVENT SHALL SAM RUSHING BE LIABLE FOR ANY SPECIAL, INDIRECT OR + CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS + OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, + NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN + CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + +Files: Lib/tarfile.py +Copyright: (C) 2002 Lars Gustaebel +License: Permission is hereby granted, free of charge, to any person + obtaining a copy of this software and associated documentation + files (the "Software"), to deal in the Software without + restriction, including without limitation the rights to use, + copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the + Software is furnished to do so, subject to the following + conditions: + + The above copyright notice and this permission notice shall be + included in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + OTHER DEALINGS IN THE SOFTWARE. + +Files: Lib/turtle.py +Copyright: (C) 2006 - 2010 Gregor Lingl +License: This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. + + is copyright Gregor Lingl and licensed under a BSD-like license + +Files: Modules/_ctypes/libffi/* +Copyright: Copyright (C) 1996-2011 Red Hat, Inc and others. + Copyright (C) 1996-2011 Anthony Green + Copyright (C) 1996-2010 Free Software Foundation, Inc + Copyright (c) 2003, 2004, 2006, 2007, 2008 Kaz Kojima + Copyright (c) 2010, 2011, Plausible Labs Cooperative , Inc. + Copyright (c) 2010 CodeSourcery + Copyright (c) 1998 Andreas Schwab + Copyright (c) 2000 Hewlett Packard Company + Copyright (c) 2009 Bradley Smith + Copyright (c) 2008 David Daney + Copyright (c) 2004 Simon Posnjak + Copyright (c) 2005 Axis Communications AB + Copyright (c) 1998 Cygnus Solutions + Copyright (c) 2004 Renesas Technology + Copyright (c) 2002, 2007 Bo Thorsen + Copyright (c) 2002 Ranjit Mathew + Copyright (c) 2002 Roger Sayle + Copyright (c) 2000, 2007 Software AG + Copyright (c) 2003 Jakub Jelinek + Copyright (c) 2000, 2001 John Hornkvist + Copyright (c) 1998 Geoffrey Keating + Copyright (c) 2008 Björn König + +License: Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + ``Software''), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + DEALINGS IN THE SOFTWARE. + + Documentation: + Permission is granted to copy, distribute and/or modify this document + under the terms of the GNU General Public License as published by the + Free Software Foundation; either version 2, or (at your option) any + later version. A copy of the license is included in the + section entitled ``GNU General Public License''. + +Files: Modules/_gestalt.c +Copyright: 1991-1997 by Stichting Mathematisch Centrum, Amsterdam. +License: Permission to use, copy, modify, and distribute this software and its + documentation for any purpose and without fee is hereby granted, + provided that the above copyright notice appear in all copies and that + both that copyright notice and this permission notice appear in + supporting documentation, and that the names of Stichting Mathematisch + Centrum or CWI not be used in advertising or publicity pertaining to + distribution of the software without specific, written prior permission. + + STICHTING MATHEMATISCH CENTRUM DISCLAIMS ALL WARRANTIES WITH REGARD TO + THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND + FITNESS, IN NO EVENT SHALL STICHTING MATHEMATISCH CENTRUM BE LIABLE + FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT + OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + +Files: Modules/syslogmodule.c +Copyright: 1994 by Lance Ellinghouse +License: Permission to use, copy, modify, and distribute this software and its + documentation for any purpose and without fee is hereby granted, + provided that the above copyright notice appear in all copies and that + both that copyright notice and this permission notice appear in + supporting documentation, and that the name of Lance Ellinghouse + not be used in advertising or publicity pertaining to distribution + of the software without specific, written prior permission. + + LANCE ELLINGHOUSE DISCLAIMS ALL WARRANTIES WITH REGARD TO + THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND + FITNESS, IN NO EVENT SHALL LANCE ELLINGHOUSE BE LIABLE FOR ANY SPECIAL, + INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING + FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, + NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION + WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + +Files: Modules/zlib/* +Copyright: (C) 1995-2010 Jean-loup Gailly and Mark Adler +License: This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. + + Jean-loup Gailly Mark Adler + jloup@gzip.org madler@alumni.caltech.edu + + If you use the zlib library in a product, we would appreciate *not* receiving + lengthy legal documents to sign. The sources are provided for free but without + warranty of any kind. The library has been entirely written by Jean-loup + Gailly and Mark Adler; it does not include third-party code. + +Files: Modules/expat/* +Copyright: Copyright (c) 1998, 1999, 2000 Thai Open Source Software Center Ltd + and Clark Cooper + Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006 Expat maintainers +License: Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + "Software"), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY + CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Files: Modules/_decimal/libmpdec/* +Copyright: Copyright (c) 2008-2012 Stefan Krah. All rights reserved. +License: Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + . + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + . + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + , + THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + SUCH DAMAGE. + +Files: Misc/python-mode.el +Copyright: Copyright (C) 1992,1993,1994 Tim Peters +License: This software is provided as-is, without express or implied + warranty. Permission to use, copy, modify, distribute or sell this + software, without fee, for any purpose and by any individual or + organization, is hereby granted, provided that the above copyright + notice and this paragraph appear in all copies. + +Files: Python/dtoa.c +Copyright: (c) 1991, 2000, 2001 by Lucent Technologies. +License: Permission to use, copy, modify, and distribute this software for any + purpose without fee is hereby granted, provided that this entire notice + is included in all copies of any software which is or includes a copy + or modification of this software and in all copies of the supporting + documentation for such software. + + THIS SOFTWARE IS BEING PROVIDED "AS IS", WITHOUT ANY EXPRESS OR IMPLIED + WARRANTY. IN PARTICULAR, NEITHER THE AUTHOR NOR LUCENT MAKES ANY + REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY + OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE. + +Files: Python/getopt.c +Copyright: 1992-1994, David Gottner +License: Permission to use, copy, modify, and distribute this software and its + documentation for any purpose and without fee is hereby granted, + provided that the above copyright notice, this permission notice and + the following disclaimer notice appear unmodified in all copies. + + I DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL I + BE LIABLE FOR ANY SPECIAL, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY + DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA, OR PROFITS, WHETHER + IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT + OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + +Files: PC/_subprocess.c +Copyright: Copyright (c) 2004 by Fredrik Lundh + Copyright (c) 2004 by Secret Labs AB, http://www.pythonware.com + Copyright (c) 2004 by Peter Astrand +License: + * Permission to use, copy, modify, and distribute this software and + * its associated documentation for any purpose and without fee is + * hereby granted, provided that the above copyright notice appears in + * all copies, and that both that copyright notice and this permission + * notice appear in supporting documentation, and that the name of the + * authors not be used in advertising or publicity pertaining to + * distribution of the software without specific, written prior + * permission. + * + * THE AUTHORS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, + * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. + * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY SPECIAL, INDIRECT OR + * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS + * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, + * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION + * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + +Files: PC/winsound.c +Copyright: Copyright (c) 1999 Toby Dickenson +License: * Permission to use this software in any way is granted without + * fee, provided that the copyright notice above appears in all + * copies. This software is provided "as is" without any warranty. + */ + +/* Modified by Guido van Rossum */ +/* Beep added by Mark Hammond */ +/* Win9X Beep and platform identification added by Uncle Timmy */ + +Files: Tools/pybench/* +Copyright: (c), 1997-2006, Marc-Andre Lemburg (mal@lemburg.com) + (c), 2000-2006, eGenix.com Software GmbH (info@egenix.com) +License: Permission to use, copy, modify, and distribute this software and its + documentation for any purpose and without fee or royalty is hereby + granted, provided that the above copyright notice appear in all copies + and that both that copyright notice and this permission notice appear + in supporting documentation or portions thereof, including + modifications, that you make. + + THE AUTHOR MARC-ANDRE LEMBURG DISCLAIMS ALL WARRANTIES WITH REGARD TO + THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND + FITNESS, IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, + INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING + FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, + NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION + WITH THE USE OR PERFORMANCE OF THIS SOFTWARE ! --- python3.4-3.4.1.orig/debian/depgraph.py +++ python3.4-3.4.1/debian/depgraph.py @@ -0,0 +1,199 @@ +#! /usr/bin/python3 + +# Copyright 2004 Toby Dickenson +# +# Permission is hereby granted, free of charge, to any person obtaining +# a copy of this software and associated documentation files (the +# "Software"), to deal in the Software without restriction, including +# without limitation the rights to use, copy, modify, merge, publish, +# distribute, sublicense, and/or sell copies of the Software, and to +# permit persons to whom the Software is furnished to do so, subject +# to the following conditions: +# +# The above copyright notice and this permission notice shall be included +# in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +# IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +# CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + +import sys, getopt, colorsys, imp, hashlib + +class pydepgraphdot: + + def main(self,argv): + opts,args = getopt.getopt(argv,'',['mono']) + self.colored = 1 + for o,v in opts: + if o=='--mono': + self.colored = 0 + self.render() + + def fix(self,s): + # Convert a module name to a syntactically correct node name + return s.replace('.','_') + + def render(self): + p,t = self.get_data() + + # normalise our input data + for k,d in list(p.items()): + for v in list(d.keys()): + if v not in p: + p[v] = {} + + f = self.get_output_file() + + f.write('digraph G {\n') + #f.write('concentrate = true;\n') + #f.write('ordering = out;\n') + f.write('ranksep=1.0;\n') + f.write('node [style=filled,fontname=Helvetica,fontsize=10];\n') + allkd = list(p.items()) + allkd.sort() + for k,d in allkd: + tk = t.get(k) + if self.use(k,tk): + allv = list(d.keys()) + allv.sort() + for v in allv: + tv = t.get(v) + if self.use(v,tv) and not self.toocommon(v,tv): + f.write('%s -> %s' % ( self.fix(k),self.fix(v) ) ) + self.write_attributes(f,self.edge_attributes(k,v)) + f.write(';\n') + f.write(self.fix(k)) + self.write_attributes(f,self.node_attributes(k,tk)) + f.write(';\n') + f.write('}\n') + + def write_attributes(self,f,a): + if a: + f.write(' [') + f.write(','.join(a)) + f.write(']') + + def node_attributes(self,k,type): + a = [] + a.append('label="%s"' % self.label(k)) + if self.colored: + a.append('fillcolor="%s"' % self.color(k,type)) + else: + a.append('fillcolor=white') + if self.toocommon(k,type): + a.append('peripheries=2') + return a + + def edge_attributes(self,k,v): + a = [] + weight = self.weight(k,v) + if weight!=1: + a.append('weight=%d' % weight) + length = self.alien(k,v) + if length: + a.append('minlen=%d' % length) + return a + + def get_data(self): + t = eval(sys.stdin.read()) + return t['depgraph'],t['types'] + + def get_output_file(self): + return sys.stdout + + def use(self,s,type): + # Return true if this module is interesting and should be drawn. Return false + # if it should be completely omitted. This is a default policy - please override. + if s=='__main__': + return 0 + #if s in ('os','sys','time','__future__','types','re','string'): + if s in ('sys'): + # nearly all modules use all of these... more or less. They add nothing to + # our diagram. + return 0 + if s.startswith('encodings.'): + return 0 + if self.toocommon(s,type): + # A module where we dont want to draw references _to_. Dot doesnt handle these + # well, so it is probably best to not draw them at all. + return 0 + return 1 + + def toocommon(self,s,type): + # Return true if references to this module are uninteresting. Such references + # do not get drawn. This is a default policy - please override. + # + if s=='__main__': + # references *to* __main__ are never interesting. omitting them means + # that main floats to the top of the page + return 1 + #if type==imp.PKG_DIRECTORY: + # # dont draw references to packages. + # return 1 + return 0 + + def weight(self,a,b): + # Return the weight of the dependency from a to b. Higher weights + # usually have shorter straighter edges. Return 1 if it has normal weight. + # A value of 4 is usually good for ensuring that a related pair of modules + # are drawn next to each other. This is a default policy - please override. + # + if b.split('.')[-1].startswith('_'): + # A module that starts with an underscore. You need a special reason to + # import these (for example random imports _random), so draw them close + # together + return 4 + return 1 + + def alien(self,a,b): + # Return non-zero if references to this module are strange, and should be drawn + # extra-long. the value defines the length, in rank. This is also good for putting some + # vertical space between seperate subsystems. This is a default policy - please override. + # + return 0 + + def label(self,s): + # Convert a module name to a formatted node label. This is a default policy - please override. + # + return '\\.\\n'.join(s.split('.')) + + def color(self,s,type): + # Return the node color for this module name. This is a default policy - please override. + # + # Calculate a color systematically based on the hash of the module name. Modules in the + # same package have the same color. Unpackaged modules are grey + t = self.normalise_module_name_for_hash_coloring(s,type) + return self.color_from_name(t) + + def normalise_module_name_for_hash_coloring(self,s,type): + if type==imp.PKG_DIRECTORY: + return s + else: + i = s.rfind('.') + if i<0: + return '' + else: + return s[:i] + + def color_from_name(self,name): + n = hashlib.md5(name.encode('utf-8')).digest() + hf = float(n[0]+n[1]*0xff)/0xffff + sf = float(n[2])/0xff + vf = float(n[3])/0xff + r,g,b = colorsys.hsv_to_rgb(hf, 0.3+0.6*sf, 0.8+0.2*vf) + return '#%02x%02x%02x' % (r*256,g*256,b*256) + + +def main(): + pydepgraphdot().main(sys.argv[1:]) + +if __name__=='__main__': + main() + + + --- python3.4-3.4.1.orig/debian/dh_doclink +++ python3.4-3.4.1/debian/dh_doclink @@ -0,0 +1,28 @@ +#! /bin/sh + +pkg=`echo $1 | sed 's/^-p//'` +target=$2 + +ln -sf $target debian/$pkg/usr/share/doc/$pkg + +f=debian/$pkg.postinst.debhelper +if [ ! -e $f ] || [ "`grep -c '^# dh_doclink' $f`" -eq 0 ]; then +cat >> $f <> $f <. +# + +set -e + +DIRLIST="/usr/lib/python@VER@/idlelib" + +case "$1" in + configure|abort-upgrade|abort-remove|abort-deconfigure) + + for i in $DIRLIST ; do + @PVER@ /usr/lib/@PVER@/compileall.py -q $i + if grep -sq '^byte-compile[^#]*optimize' /etc/python/debian_config + then + @PVER@ -O /usr/lib/@PVER@/compileall.py -q $i + fi + done + ;; + + *) + echo "postinst called with unknown argument \`$1'" >&2 + exit 1 + ;; + +esac + +#DEBHELPER# + +exit 0 --- python3.4-3.4.1.orig/debian/idle-PVER.postrm.in +++ python3.4-3.4.1/debian/idle-PVER.postrm.in @@ -0,0 +1,11 @@ +#! /bin/sh + +set -e + +if [ "$1" = "purge" ]; then + rm -rf /etc/idle-@PVER@ +fi + +#DEBHELPER# + +exit 0 --- python3.4-3.4.1.orig/debian/idle-PVER.prerm.in +++ python3.4-3.4.1/debian/idle-PVER.prerm.in @@ -0,0 +1,33 @@ +#! /bin/sh + +set -e + +remove_bytecode() +{ + pkg=$1 + max=$(LANG=C LC_ALL=C xargs --show-limits < /dev/null 2>&1 | awk '/Maximum/ {print int($NF / 4)}') + dpkg -L $pkg \ + | awk -F/ 'BEGIN {OFS="/"} /\.py$/ {$NF=sprintf("__pycache__/%s.*.py[co]", substr($NF,1,length($NF)-3)); print}' \ + | xargs --max-chars=$max echo \ + | while read files; do rm -f $files; done + find /usr/lib/@PVER@ -name dist-packages -prune -o -name __pycache__ -empty -print \ + | xargs -r rm -rf +} + +case "$1" in + remove|upgrade) + remove_bytecode idle-@PVER@ + ;; + deconfigure) + ;; + failed-upgrade) + ;; + *) + echo "prerm called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +#DEBHELPER# + +exit 0 --- python3.4-3.4.1.orig/debian/idle.desktop.in +++ python3.4-3.4.1/debian/idle.desktop.in @@ -0,0 +1,9 @@ +[Desktop Entry] +Name=IDLE (using Python-@VER@) +Comment=Integrated Development Environment for Python (using Python-@VER@) +Exec=/usr/bin/idle-@PVER@ +Icon=/usr/share/pixmaps/@PVER@.xpm +Terminal=false +Type=Application +Categories=Application;Development; +StartupNotify=true --- python3.4-3.4.1.orig/debian/libPVER-dbg.overrides.in +++ python3.4-3.4.1/debian/libPVER-dbg.overrides.in @@ -0,0 +1,13 @@ +lib@PVER@-dbg binary: package-name-doesnt-match-sonames +lib@PVER@-dbg binary: non-dev-pkg-with-shlib-symlink + +# no, it's not unusual +lib@PVER@-dbg binary: unusual-interpreter + +# just the gdb debug file +lib@PVER@-dbg binary: python-script-but-no-python-dep + +# pointless lintian ... +lib@PVER@-dbg binary: hardening-no-fortify-functions + +lib@PVER@-dbg binary: arch-dependent-file-not-in-arch-specific-directory --- python3.4-3.4.1.orig/debian/libPVER-dbg.prerm.in +++ python3.4-3.4.1/debian/libPVER-dbg.prerm.in @@ -0,0 +1,23 @@ +#! /bin/sh + +set -e + +case "$1" in + remove) + dpkg -L lib@PVER@-dbg@HOST_QUAL@ \ + | awk '/\.py$/ {print $0"c\n" $0"o"}' \ + | xargs -r rm -f >&2 + ;; + upgrade) + ;; + deconfigure) + ;; + failed-upgrade) + ;; + *) + echo "prerm called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +#DEBHELPER# --- python3.4-3.4.1.orig/debian/libPVER-dbg.symbols.i386.in +++ python3.4-3.4.1/debian/libPVER-dbg.symbols.i386.in @@ -0,0 +1,30 @@ +libpython@VER@dm.so.1.0 libpython@VER@-dbg #MINVER# +#include "libpython.symbols" + _Py_force_double@Base @SVER@ + _Py_get_387controlword@Base @SVER@ + _Py_set_387controlword@Base @SVER@ + _PyDict_Dummy@Base @SVER@ + _PyObject_DebugMallocStats@Base @SVER@ + _PySet_Dummy@Base @SVER@ + _PyUnicode_CheckConsistency@Base @SVER@ + _PyUnicode_Dump@Base @SVER@ + _PyUnicode_compact_data@Base @SVER@ + _PyUnicode_data@Base @SVER@ + _PyUnicode_utf8@Base @SVER@ + _Py_AddToAllObjects@Base @SVER@ + _Py_Dealloc@Base @SVER@ + _Py_ForgetReference@Base @SVER@ + _Py_GetObjects@Base @SVER@ + _Py_GetRefTotal@Base @SVER@ + _Py_HashSecret_Initialized@Base @SVER@ + _Py_NegativeRefcount@Base @SVER@ + _Py_NewReference@Base @SVER@ + _Py_PrintReferenceAddresses@Base @SVER@ + _Py_PrintReferences@Base @SVER@ + _Py_RefTotal@Base @SVER@ + _Py_dumptree@Base @SVER@ + _Py_hashtable_print_stats@Base @SVER@ + _Py_printtree@Base @SVER@ + _Py_showtree@Base @SVER@ + _Py_tok_dump@Base @SVER@ + PyModule_Create2TraceRefs@Base @SVER@ --- python3.4-3.4.1.orig/debian/libPVER-dbg.symbols.in +++ python3.4-3.4.1/debian/libPVER-dbg.symbols.in @@ -0,0 +1,27 @@ +libpython@VER@dm.so.1.0 libpython@VER@-dbg #MINVER# +#include "libpython.symbols" + _PyDict_Dummy@Base @SVER@ + _PyObject_DebugMallocStats@Base @SVER@ + _PySet_Dummy@Base @SVER@ + _PyUnicode_CheckConsistency@Base @SVER@ + _PyUnicode_Dump@Base @SVER@ + _PyUnicode_compact_data@Base @SVER@ + _PyUnicode_data@Base @SVER@ + _PyUnicode_utf8@Base @SVER@ + _Py_AddToAllObjects@Base @SVER@ + _Py_Dealloc@Base @SVER@ + _Py_ForgetReference@Base @SVER@ + _Py_GetObjects@Base @SVER@ + _Py_GetRefTotal@Base @SVER@ + _Py_HashSecret_Initialized@Base @SVER@ + _Py_NegativeRefcount@Base @SVER@ + _Py_NewReference@Base @SVER@ + _Py_PrintReferenceAddresses@Base @SVER@ + _Py_PrintReferences@Base @SVER@ + _Py_RefTotal@Base @SVER@ + _Py_dumptree@Base @SVER@ + _Py_hashtable_print_stats@Base @SVER@ + _Py_printtree@Base @SVER@ + _Py_showtree@Base @SVER@ + _Py_tok_dump@Base @SVER@ + PyModule_Create2TraceRefs@Base @SVER@ --- python3.4-3.4.1.orig/debian/libPVER-dev.overrides.in +++ python3.4-3.4.1/debian/libPVER-dev.overrides.in @@ -0,0 +1,3 @@ +lib@PVER@-dev binary: python-script-but-no-python-dep + +lib@PVER@-dev binary: arch-dependent-file-not-in-arch-specific-directory --- python3.4-3.4.1.orig/debian/libPVER-minimal.overrides.in +++ python3.4-3.4.1/debian/libPVER-minimal.overrides.in @@ -0,0 +1,5 @@ +# intentional +lib@PVER@-minimal binary: python-script-but-no-python-dep + +# lintian omission, multiarch string is encoded in the filename +lib@PVER@-minimal binary: arch-dependent-file-not-in-arch-specific-directory --- python3.4-3.4.1.orig/debian/libPVER-minimal.postinst.in +++ python3.4-3.4.1/debian/libPVER-minimal.postinst.in @@ -0,0 +1,13 @@ +#! /bin/sh + +set -e + +if [ ! -f /etc/@PVER@/sitecustomize.py ]; then + cat <<-EOF + # Empty sitecustomize.py to avoid a dangling symlink +EOF +fi + +#DEBHELPER# + +exit 0 --- python3.4-3.4.1.orig/debian/libPVER-minimal.postrm.in +++ python3.4-3.4.1/debian/libPVER-minimal.postrm.in @@ -0,0 +1,21 @@ +#! /bin/sh + +set -e + +if [ "$1" = "purge" ]; then + pc=$(dpkg-query -f '${db:Status-Abbrev} ${binary:Package}\n' -W pkgname \ + | grep -v '^.n' | wc -l) + if [ "$pc" -lt 1 ]; then + find /usr/lib/@PVER@ -depth -type d -name __pycache__ \ + | xargs -r rm -rf + rm -f /etc/@PVER@/sitecustomize.py + rm -rf /etc/@PVER@/__pycache__ + if [ -d /etc/@PVER@ ]; then + rmdir --ignore-fail-on-non-empty /etc/@PVER@ + fi + fi +fi + +#DEBHELPER# + +exit 0 --- python3.4-3.4.1.orig/debian/libPVER-minimal.prerm.in +++ python3.4-3.4.1/debian/libPVER-minimal.prerm.in @@ -0,0 +1,41 @@ +#! /bin/sh + +set -e + +remove_bytecode() +{ + pkg=$1 + max=$(LANG=C LC_ALL=C xargs --show-limits < /dev/null 2>&1 | awk '/Maximum/ {print int($NF / 4)}') + dpkg -L $pkg \ + | awk -F/ 'BEGIN {OFS="/"} /\.py$/ {$NF=sprintf("__pycache__/%s.*.py[co]", substr($NF,1,length($NF)-3)); print}' \ + | xargs --max-chars="$max" echo \ + | while read files; do rm -f $files; done + find /usr/lib/python3 /usr/lib/@PVER@ \ + \( -name dist-packages -prune \) -o \ + \( -name __pycache__ -type d -empty -print \) \ + | xargs -r rm -rf +} + +case "$1" in + remove) + pc=$(dpkg-query -f '${db:Status-Abbrev} ${binary:Package}\n' -W pkgname \ + | grep -v '^.n' | wc -l) + if [ "$pc" -le 1 ]; then + remove_bytecode lib@PVER@-minimal@HOST_QUAL@ + fi + ;; + upgrade) + remove_bytecode lib@PVER@-minimal@HOST_QUAL@ + # byte compilation in @PVER@-minimal postinst, strict dependency + ;; + deconfigure) + ;; + failed-upgrade) + ;; + *) + echo "prerm called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +#DEBHELPER# --- python3.4-3.4.1.orig/debian/libPVER-stdlib.overrides.in +++ python3.4-3.4.1/debian/libPVER-stdlib.overrides.in @@ -0,0 +1,15 @@ +# idlelib images +lib@PVER@-stdlib binary: image-file-in-usr-lib + +# license file referred by the standard library +lib@PVER@-stdlib binary: extra-license-file + +# template files +lib@PVER@-stdlib binary: interpreter-not-absolute usr/lib/@PVER@/venv/scripts/posix/pydoc #!__VENV_PYTHON__ +lib@PVER@-stdlib binary: unusual-interpreter usr/lib/@PVER@/venv/scripts/posix/pydoc #!__VENV_PYTHON__ + +# the split is the reason for that +lib@PVER@-stdlib binary: python-script-but-no-python-dep + +# lintian omission, multiarch string is encoded in the filename +lib@PVER@-stdlib binary: arch-dependent-file-not-in-arch-specific-directory --- python3.4-3.4.1.orig/debian/libPVER-stdlib.prerm.in +++ python3.4-3.4.1/debian/libPVER-stdlib.prerm.in @@ -0,0 +1,41 @@ +#! /bin/sh + +set -e + +remove_bytecode() +{ + pkg=$1 + max=$(LANG=C LC_ALL=C xargs --show-limits < /dev/null 2>&1 | awk '/Maximum/ {print int($NF / 4)}') + dpkg -L $pkg \ + | awk -F/ 'BEGIN {OFS="/"} /\.py$/ {$NF=sprintf("__pycache__/%s.*.py[co]", substr($NF,1,length($NF)-3)); print}' \ + | xargs --max-chars="$max" echo \ + | while read files; do rm -f $files; done + find /usr/lib/python3 /usr/lib/@PVER@ \ + \( -name dist-packages -prune \) -o \ + \( -name __pycache__ -type d -empty -print \) \ + | xargs -r rm -rf +} + +case "$1" in + remove) + pc=$(dpkg-query -f '${db:Status-Abbrev} ${binary:Package}\n' -W pkgname \ + | grep -v '^.n' | wc -l) + if [ "$pc" -le 1 ]; then + remove_bytecode lib@PVER@-stdlib@HOST_QUAL@ + fi + ;; + upgrade) + remove_bytecode lib@PVER@-stdlib@HOST_QUAL@ + # byte compilation in @PVER@ postinst, strict dependency + ;; + deconfigure) + ;; + failed-upgrade) + ;; + *) + echo "prerm called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +#DEBHELPER# --- python3.4-3.4.1.orig/debian/libPVER-testsuite.overrides.in +++ python3.4-3.4.1/debian/libPVER-testsuite.overrides.in @@ -0,0 +1,2 @@ +lib@PVER@-testsuite binary: python-script-but-no-python-dep +lib@PVER@-testsuite binary: image-file-in-usr-lib --- python3.4-3.4.1.orig/debian/libPVER-testsuite.postinst.in +++ python3.4-3.4.1/debian/libPVER-testsuite.postinst.in @@ -0,0 +1,20 @@ +#! /bin/sh + +set -e + +case "$1" in + configure) + files=$(dpkg -L lib@PVER@-testsuite | sed -n '/^\/usr\/lib\/@PVER@\/.*\.py$/p' | egrep -v '/lib2to3/tests/data|/test/bad') + if [ -n "$files" ]; then + @PVER@ -E -S /usr/lib/@PVER@/py_compile.py $files + if grep -sq '^byte-compile[^#]*optimize' /etc/python/debian_config; then + @PVER@ -E -S -O /usr/lib/@PVER@/py_compile.py $files + fi + else + echo >&2 "@PVER@: can't get files for byte-compilation" + fi +esac + +#DEBHELPER# + +exit 0 --- python3.4-3.4.1.orig/debian/libPVER-testsuite.prerm.in +++ python3.4-3.4.1/debian/libPVER-testsuite.prerm.in @@ -0,0 +1,36 @@ +#! /bin/sh + +set -e + +remove_bytecode() +{ + pkg=$1 + max=$(LANG=C LC_ALL=C xargs --show-limits < /dev/null 2>&1 | awk '/Maximum/ {print int($NF / 4)}') + dpkg -L $pkg \ + | awk -F/ 'BEGIN {OFS="/"} /\.py$/ {$NF=sprintf("__pycache__/%s.*.py[co]", substr($NF,1,length($NF)-3)); print}' \ + | xargs --max-chars="$max" echo \ + | while read files; do rm -f $files; done + + find /usr/lib/@PVER@ \ + -name __pycache__ -type d -empty -print \ + | xargs -r rm -rf +} + +case "$1" in + remove) + remove_bytecode lib@PVER@-testsuite + ;; + upgrade) + remove_bytecode lib@PVER@-testsuite + ;; + deconfigure) + ;; + failed-upgrade) + ;; + *) + echo "prerm called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +#DEBHELPER# --- python3.4-3.4.1.orig/debian/libPVER.overrides.in +++ python3.4-3.4.1/debian/libPVER.overrides.in @@ -0,0 +1 @@ +lib@PVER@ binary: package-name-doesnt-match-sonames --- python3.4-3.4.1.orig/debian/libPVER.symbols.i386.in +++ python3.4-3.4.1/debian/libPVER.symbols.i386.in @@ -0,0 +1,8 @@ +libpython@VER@m.so.1.0 libpython@VER@ #MINVER# +#include "libpython.symbols" + PyModule_Create2@Base @SVER@ + _Py_force_double@Base @SVER@ + _Py_get_387controlword@Base @SVER@ + _Py_set_387controlword@Base @SVER@ + + (optional)__gnu_lto_v1@Base @SVER@ --- python3.4-3.4.1.orig/debian/libPVER.symbols.in +++ python3.4-3.4.1/debian/libPVER.symbols.in @@ -0,0 +1,5 @@ +libpython@VER@m.so.1.0 libpython@VER@ #MINVER# +#include "libpython.symbols" + PyModule_Create2@Base @SVER@ + + (optional)__gnu_lto_v1@Base @SVER@ --- python3.4-3.4.1.orig/debian/libPVER.symbols.lpia.in +++ python3.4-3.4.1/debian/libPVER.symbols.lpia.in @@ -0,0 +1,6 @@ +libpython@VER@m.so.1.0 libpython@VER@ #MINVER# +#include "libpython.symbols" + PyModule_Create2@Base @SVER@ + _Py_force_double@Base @SVER@ + _Py_get_387controlword@Base @SVER@ + _Py_set_387controlword@Base @SVER@ --- python3.4-3.4.1.orig/debian/libpython.symbols.in +++ python3.4-3.4.1/debian/libpython.symbols.in @@ -0,0 +1,1566 @@ + PyAST_Check@Base @SVER@ + PyAST_Compile@Base @SVER@ + PyAST_CompileEx@Base @SVER@ + PyAST_CompileObject@Base @SVER@ + PyAST_FromNode@Base @SVER@ + PyAST_FromNodeObject@Base @SVER@ + PyAST_Validate@Base @SVER@ + PyAST_mod2obj@Base @SVER@ + PyAST_obj2mod@Base @SVER@ + PyArena_AddPyObject@Base @SVER@ + PyArena_Free@Base @SVER@ + PyArena_Malloc@Base @SVER@ + PyArena_New@Base @SVER@ + PyArg_Parse@Base @SVER@ + PyArg_ParseTuple@Base @SVER@ + PyArg_ParseTupleAndKeywords@Base @SVER@ + PyArg_UnpackTuple@Base @SVER@ + PyArg_VaParse@Base @SVER@ + PyArg_VaParseTupleAndKeywords@Base @SVER@ + PyArg_ValidateKeywordArguments@Base @SVER@ + PyBaseObject_Type@Base @SVER@ + PyBool_FromLong@Base @SVER@ + PyBool_Type@Base @SVER@ + PyBuffer_FillContiguousStrides@Base @SVER@ + PyBuffer_FillInfo@Base @SVER@ + PyBuffer_FromContiguous@Base @SVER@ + PyBuffer_GetPointer@Base @SVER@ + PyBuffer_IsContiguous@Base @SVER@ + PyBuffer_Release@Base @SVER@ + PyBuffer_ToContiguous@Base @SVER@ + PyBufferedIOBase_Type@Base @SVER@ + PyBufferedRWPair_Type@Base @SVER@ + PyBufferedRandom_Type@Base @SVER@ + PyBufferedReader_Type@Base @SVER@ + PyBufferedWriter_Type@Base @SVER@ + PyByteArrayIter_Type@Base @SVER@ + PyByteArray_AsString@Base @SVER@ + PyByteArray_Concat@Base @SVER@ + PyByteArray_Fini@Base @SVER@ + PyByteArray_FromObject@Base @SVER@ + PyByteArray_FromStringAndSize@Base @SVER@ + PyByteArray_Init@Base @SVER@ + PyByteArray_Resize@Base @SVER@ + PyByteArray_Size@Base @SVER@ + PyByteArray_Type@Base @SVER@ + PyBytesIO_Type@Base @SVER@ + PyBytesIter_Type@Base @SVER@ + PyBytes_AsString@Base @SVER@ + PyBytes_AsStringAndSize@Base @SVER@ + PyBytes_Concat@Base @SVER@ + PyBytes_ConcatAndDel@Base @SVER@ + PyBytes_DecodeEscape@Base @SVER@ + PyBytes_Fini@Base @SVER@ + PyBytes_FromFormat@Base @SVER@ + PyBytes_FromFormatV@Base @SVER@ + PyBytes_FromObject@Base @SVER@ + PyBytes_FromString@Base @SVER@ + PyBytes_FromStringAndSize@Base @SVER@ + PyBytes_Repr@Base @SVER@ + PyBytes_Size@Base @SVER@ + PyBytes_Type@Base @SVER@ + (optional)PyCArgObject_new@Base @SVER@ + (optional)PyCArg_Type@Base @SVER@ + (optional)PyCArrayType_Type@Base @SVER@ + (optional)PyCArrayType_from_ctype@Base @SVER@ + (optional)PyCArray_Type@Base @SVER@ + (optional)PyCData_AtAddress@Base @SVER@ + (optional)PyCData_FromBaseObj@Base @SVER@ + (optional)PyCData_Type@Base @SVER@ + (optional)PyCData_get@Base @SVER@ + (optional)PyCData_set@Base @SVER@ + (optional)PyCField_FromDesc@Base @SVER@ + (optional)PyCField_Type@Base @SVER@ + (optional)PyCFuncPtrType_Type@Base @SVER@ + (optional)PyCFuncPtr_Type@Base @SVER@ + PyCFunction_Call@Base @SVER@ + PyCFunction_ClearFreeList@Base @SVER@ + PyCFunction_Fini@Base @SVER@ + PyCFunction_GetFlags@Base @SVER@ + PyCFunction_GetFunction@Base @SVER@ + PyCFunction_GetSelf@Base @SVER@ + PyCFunction_New@Base @SVER@ + PyCFunction_NewEx@Base @SVER@ + PyCFunction_Type@Base @SVER@ + (optional)PyCPointerType_Type@Base @SVER@ + (optional)PyCPointer_Type@Base @SVER@ + (optional)PyCSimpleType_Type@Base @SVER@ + (optional)PyCStgDict_Type@Base @SVER@ + (optional)PyCStgDict_clone@Base @SVER@ + (optional)PyCStructType_Type@Base @SVER@ + (optional)PyCStructUnionType_update_stgdict@Base @SVER@ + (optional)PyCThunk_Type@Base @SVER@ + PyCallIter_New@Base @SVER@ + PyCallIter_Type@Base @SVER@ + PyCallable_Check@Base @SVER@ + PyCapsule_GetContext@Base @SVER@ + PyCapsule_GetDestructor@Base @SVER@ + PyCapsule_GetName@Base @SVER@ + PyCapsule_GetPointer@Base @SVER@ + PyCapsule_Import@Base @SVER@ + PyCapsule_IsValid@Base @SVER@ + PyCapsule_New@Base @SVER@ + PyCapsule_SetContext@Base @SVER@ + PyCapsule_SetDestructor@Base @SVER@ + PyCapsule_SetName@Base @SVER@ + PyCapsule_SetPointer@Base @SVER@ + PyCapsule_Type@Base @SVER@ + PyCell_Get@Base @SVER@ + PyCell_New@Base @SVER@ + PyCell_Set@Base @SVER@ + PyCell_Type@Base @SVER@ + PyClassMethodDescr_Type@Base @SVER@ + PyClassMethod_New@Base @SVER@ + PyClassMethod_Type@Base @SVER@ + PyCode_Addr2Line@Base @SVER@ + PyCode_New@Base @SVER@ + PyCode_NewEmpty@Base @SVER@ + PyCode_Optimize@Base @SVER@ + PyCode_Type@Base @SVER@ + PyCodec_BackslashReplaceErrors@Base @SVER@ + PyCodec_Decode@Base @SVER@ + PyCodec_Decoder@Base @SVER@ + PyCodec_Encode@Base @SVER@ + PyCodec_Encoder@Base @SVER@ + PyCodec_IgnoreErrors@Base @SVER@ + PyCodec_IncrementalDecoder@Base @SVER@ + PyCodec_IncrementalEncoder@Base @SVER@ + PyCodec_KnownEncoding@Base @SVER@ + PyCodec_LookupError@Base @SVER@ + PyCodec_Register@Base @SVER@ + PyCodec_RegisterError@Base @SVER@ + PyCodec_ReplaceErrors@Base @SVER@ + PyCodec_StreamReader@Base @SVER@ + PyCodec_StreamWriter@Base @SVER@ + PyCodec_StrictErrors@Base @SVER@ + PyCodec_XMLCharRefReplaceErrors@Base @SVER@ + PyCompileString@Base @SVER@ + PyCompile_OpcodeStackEffect@Base @SVER@ + PyComplex_AsCComplex@Base @SVER@ + PyComplex_FromCComplex@Base @SVER@ + PyComplex_FromDoubles@Base @SVER@ + PyComplex_ImagAsDouble@Base @SVER@ + PyComplex_RealAsDouble@Base @SVER@ + PyComplex_Type@Base @SVER@ + PyDescr_NewClassMethod@Base @SVER@ + PyDescr_NewGetSet@Base @SVER@ + PyDescr_NewMember@Base @SVER@ + PyDescr_NewMethod@Base @SVER@ + PyDescr_NewWrapper@Base @SVER@ + PyDictItems_Type@Base @SVER@ + PyDictIterItem_Type@Base @SVER@ + PyDictIterKey_Type@Base @SVER@ + PyDictIterValue_Type@Base @SVER@ + PyDictKeys_Type@Base @SVER@ + PyDictProxy_New@Base @SVER@ + PyDictProxy_Type@Base @SVER@ + PyDictValues_Type@Base @SVER@ + PyDict_Clear@Base @SVER@ + PyDict_ClearFreeList@Base @SVER@ + PyDict_Contains@Base @SVER@ + PyDict_Copy@Base @SVER@ + PyDict_DelItem@Base @SVER@ + PyDict_DelItemString@Base @SVER@ + PyDict_Fini@Base @SVER@ + PyDict_GetItem@Base @SVER@ + (optional)PyDict_GetItemProxy@Base @SVER@ + PyDict_GetItemString@Base @SVER@ + PyDict_GetItemWithError@Base @SVER@ + PyDict_Items@Base @SVER@ + PyDict_Keys@Base @SVER@ + PyDict_Merge@Base @SVER@ + PyDict_MergeFromSeq2@Base @SVER@ + PyDict_New@Base @SVER@ + PyDict_Next@Base @SVER@ + PyDict_SetDefault@Base @SVER@ + PyDict_SetItem@Base @SVER@ + (optional)PyDict_SetItemProxy@Base @SVER@ + PyDict_SetItemString@Base @SVER@ + PyDict_Size@Base @SVER@ + PyDict_Type@Base @SVER@ + PyDict_Update@Base @SVER@ + PyDict_Values@Base @SVER@ + PyEllipsis_Type@Base @SVER@ + PyEnum_Type@Base @SVER@ + PyErr_BadArgument@Base @SVER@ + PyErr_BadInternalCall@Base @SVER@ + PyErr_CheckSignals@Base @SVER@ + PyErr_Clear@Base @SVER@ + PyErr_Display@Base @SVER@ + PyErr_ExceptionMatches@Base @SVER@ + PyErr_Fetch@Base @SVER@ + PyErr_Format@Base @SVER@ + PyErr_GetExcInfo@Base @SVER@ + PyErr_GivenExceptionMatches@Base @SVER@ + PyErr_NewException@Base @SVER@ + PyErr_NewExceptionWithDoc@Base @SVER@ + PyErr_NoMemory@Base @SVER@ + PyErr_NormalizeException@Base @SVER@ + PyErr_Occurred@Base @SVER@ + PyErr_Print@Base @SVER@ + PyErr_PrintEx@Base @SVER@ + PyErr_ProgramText@Base @SVER@ + PyErr_ProgramTextObject@Base @SVER@ + PyErr_Restore@Base @SVER@ + PyErr_SetExcInfo@Base @SVER@ + PyErr_SetFromErrno@Base @SVER@ + PyErr_SetFromErrnoWithFilename@Base @SVER@ + PyErr_SetFromErrnoWithFilenameObject@Base @SVER@ + PyErr_SetFromErrnoWithFilenameObjects@Base @SVER@ + PyErr_SetImportError@Base @SVER@ + PyErr_SetInterrupt@Base @SVER@ + PyErr_SetNone@Base @SVER@ + PyErr_SetObject@Base @SVER@ + PyErr_SetString@Base @SVER@ + PyErr_SyntaxLocation@Base @SVER@ + PyErr_SyntaxLocationEx@Base @SVER@ + PyErr_SyntaxLocationObject@Base @SVER@ + PyErr_Warn@Base @SVER@ + PyErr_WarnEx@Base @SVER@ + PyErr_WarnExplicit@Base @SVER@ + PyErr_WarnExplicitFormat@Base @SVER@ + PyErr_WarnExplicitObject@Base @SVER@ + PyErr_WarnFormat@Base @SVER@ + PyErr_WriteUnraisable@Base @SVER@ + PyEval_AcquireLock@Base @SVER@ + PyEval_AcquireThread@Base @SVER@ + PyEval_CallFunction@Base @SVER@ + PyEval_CallMethod@Base @SVER@ + PyEval_CallObjectWithKeywords@Base @SVER@ + PyEval_EvalCode@Base @SVER@ + PyEval_EvalCodeEx@Base @SVER@ + PyEval_EvalFrame@Base @SVER@ + PyEval_EvalFrameEx@Base @SVER@ + PyEval_GetBuiltins@Base @SVER@ + PyEval_GetCallStats@Base @SVER@ + PyEval_GetFrame@Base @SVER@ + PyEval_GetFuncDesc@Base @SVER@ + PyEval_GetFuncName@Base @SVER@ + PyEval_GetGlobals@Base @SVER@ + PyEval_GetLocals@Base @SVER@ + PyEval_InitThreads@Base @SVER@ + PyEval_MergeCompilerFlags@Base @SVER@ + PyEval_ReInitThreads@Base @SVER@ + PyEval_ReleaseLock@Base @SVER@ + PyEval_ReleaseThread@Base @SVER@ + PyEval_RestoreThread@Base @SVER@ + PyEval_SaveThread@Base @SVER@ + PyEval_SetProfile@Base @SVER@ + PyEval_SetTrace@Base @SVER@ + PyEval_ThreadsInitialized@Base @SVER@ + (optional)PyExc_ArgError@Base @SVER@ + PyExc_ArithmeticError@Base @SVER@ + PyExc_AssertionError@Base @SVER@ + PyExc_AttributeError@Base @SVER@ + PyExc_BaseException@Base @SVER@ + PyExc_BlockingIOError@Base @SVER@ + PyExc_BrokenPipeError@Base @SVER@ + PyExc_BufferError@Base @SVER@ + PyExc_BytesWarning@Base @SVER@ + PyExc_ChildProcessError@Base @SVER@ + PyExc_ConnectionAbortedError@Base @SVER@ + PyExc_ConnectionError@Base @SVER@ + PyExc_ConnectionRefusedError@Base @SVER@ + PyExc_ConnectionResetError@Base @SVER@ + PyExc_DeprecationWarning@Base @SVER@ + PyExc_EOFError@Base @SVER@ + PyExc_EnvironmentError@Base @SVER@ + PyExc_Exception@Base @SVER@ + PyExc_FileExistsError@Base @SVER@ + PyExc_FileNotFoundError@Base @SVER@ + PyExc_FloatingPointError@Base @SVER@ + PyExc_FutureWarning@Base @SVER@ + PyExc_GeneratorExit@Base @SVER@ + PyExc_IOError@Base @SVER@ + PyExc_ImportError@Base @SVER@ + PyExc_ImportWarning@Base @SVER@ + PyExc_IndentationError@Base @SVER@ + PyExc_IndexError@Base @SVER@ + PyExc_InterruptedError@Base @SVER@ + PyExc_IsADirectoryError@Base @SVER@ + PyExc_KeyError@Base @SVER@ + PyExc_KeyboardInterrupt@Base @SVER@ + PyExc_LookupError@Base @SVER@ + PyExc_MemoryError@Base @SVER@ + PyExc_NameError@Base @SVER@ + PyExc_NotADirectoryError@Base @SVER@ + PyExc_NotImplementedError@Base @SVER@ + PyExc_OSError@Base @SVER@ + PyExc_OverflowError@Base @SVER@ + PyExc_PendingDeprecationWarning@Base @SVER@ + PyExc_PermissionError@Base @SVER@ + PyExc_ProcessLookupError@Base @SVER@ + PyExc_RecursionErrorInst@Base @SVER@ + PyExc_ReferenceError@Base @SVER@ + PyExc_ResourceWarning@Base @SVER@ + PyExc_RuntimeError@Base @SVER@ + PyExc_RuntimeWarning@Base @SVER@ + PyExc_StopIteration@Base @SVER@ + PyExc_SyntaxError@Base @SVER@ + PyExc_SyntaxWarning@Base @SVER@ + PyExc_SystemError@Base @SVER@ + PyExc_SystemExit@Base @SVER@ + PyExc_TabError@Base @SVER@ + PyExc_TimeoutError@Base @SVER@ + PyExc_TypeError@Base @SVER@ + PyExc_UnboundLocalError@Base @SVER@ + PyExc_UnicodeDecodeError@Base @SVER@ + PyExc_UnicodeEncodeError@Base @SVER@ + PyExc_UnicodeError@Base @SVER@ + PyExc_UnicodeTranslateError@Base @SVER@ + PyExc_UnicodeWarning@Base @SVER@ + PyExc_UserWarning@Base @SVER@ + PyExc_ValueError@Base @SVER@ + PyExc_Warning@Base @SVER@ + PyExc_ZeroDivisionError@Base @SVER@ + PyException_GetCause@Base @SVER@ + PyException_GetContext@Base @SVER@ + PyException_GetTraceback@Base @SVER@ + PyException_SetCause@Base @SVER@ + PyException_SetContext@Base @SVER@ + PyException_SetTraceback@Base @SVER@ + PyFPE_counter@Base @SVER@ + PyFPE_dummy@Base @SVER@ + PyFPE_jbuf@Base @SVER@ + PyFileIO_Type@Base @SVER@ + PyFile_FromFd@Base @SVER@ + PyFile_GetLine@Base @SVER@ + PyFile_NewStdPrinter@Base @SVER@ + PyFile_WriteObject@Base @SVER@ + PyFile_WriteString@Base @SVER@ + PyFilter_Type@Base @SVER@ + PyFloat_AsDouble@Base @SVER@ + PyFloat_ClearFreeList@Base @SVER@ + PyFloat_Fini@Base @SVER@ + PyFloat_FromDouble@Base @SVER@ + PyFloat_FromString@Base @SVER@ + PyFloat_GetInfo@Base @SVER@ + PyFloat_GetMax@Base @SVER@ + PyFloat_GetMin@Base @SVER@ + PyFloat_Type@Base @SVER@ + PyFrame_BlockPop@Base @SVER@ + PyFrame_BlockSetup@Base @SVER@ + PyFrame_ClearFreeList@Base @SVER@ + PyFrame_FastToLocals@Base @SVER@ + PyFrame_FastToLocalsWithError@Base @SVER@ + PyFrame_Fini@Base @SVER@ + PyFrame_GetLineNumber@Base @SVER@ + PyFrame_LocalsToFast@Base @SVER@ + PyFrame_New@Base @SVER@ + PyFrame_Type@Base @SVER@ + PyFrozenSet_New@Base @SVER@ + PyFrozenSet_Type@Base @SVER@ + PyFunction_GetAnnotations@Base @SVER@ + PyFunction_GetClosure@Base @SVER@ + PyFunction_GetCode@Base @SVER@ + PyFunction_GetDefaults@Base @SVER@ + PyFunction_GetGlobals@Base @SVER@ + PyFunction_GetKwDefaults@Base @SVER@ + PyFunction_GetModule@Base @SVER@ + PyFunction_New@Base @SVER@ + PyFunction_NewWithQualName@Base @SVER@ + PyFunction_SetAnnotations@Base @SVER@ + PyFunction_SetClosure@Base @SVER@ + PyFunction_SetDefaults@Base @SVER@ + PyFunction_SetKwDefaults@Base @SVER@ + PyFunction_Type@Base @SVER@ + PyFuture_FromAST@Base @SVER@ + PyFuture_FromASTObject@Base @SVER@ + PyGC_Collect@Base @SVER@ + PyGILState_Check@Base @SVER@ + PyGILState_Ensure@Base @SVER@ + PyGILState_GetThisThreadState@Base @SVER@ + PyGILState_Release@Base @SVER@ + PyGen_NeedsFinalizing@Base @SVER@ + PyGen_New@Base @SVER@ + PyGen_Type@Base @SVER@ + PyGetSetDescr_Type@Base @SVER@ + PyGrammar_AddAccelerators@Base @SVER@ + PyGrammar_FindDFA@Base @SVER@ + PyGrammar_LabelRepr@Base @SVER@ + PyGrammar_RemoveAccelerators@Base @SVER@ + PyHash_GetFuncDef@Base @SVER@ + PyIOBase_Type@Base @SVER@ + PyImport_AddModule@Base @SVER@ + PyImport_AddModuleObject@Base @SVER@ + PyImport_AppendInittab@Base @SVER@ + PyImport_Cleanup@Base @SVER@ + PyImport_ExecCodeModule@Base @SVER@ + PyImport_ExecCodeModuleEx@Base @SVER@ + PyImport_ExecCodeModuleObject@Base @SVER@ + PyImport_ExecCodeModuleWithPathnames@Base @SVER@ + PyImport_ExtendInittab@Base @SVER@ + PyImport_FrozenModules@Base @SVER@ + PyImport_GetImporter@Base @SVER@ + PyImport_GetMagicNumber@Base @SVER@ + PyImport_GetMagicTag@Base @SVER@ + PyImport_GetModuleDict@Base @SVER@ + PyImport_Import@Base @SVER@ + PyImport_ImportFrozenModule@Base @SVER@ + PyImport_ImportFrozenModuleObject@Base @SVER@ + PyImport_ImportModule@Base @SVER@ + PyImport_ImportModuleLevel@Base @SVER@ + PyImport_ImportModuleLevelObject@Base @SVER@ + PyImport_ImportModuleNoBlock@Base @SVER@ + PyImport_Inittab@Base @SVER@ + PyImport_ReloadModule@Base @SVER@ + PyIncrementalNewlineDecoder_Type@Base @SVER@ + PyInstanceMethod_Function@Base @SVER@ + PyInstanceMethod_New@Base @SVER@ + PyInstanceMethod_Type@Base @SVER@ + PyInterpreterState_Clear@Base @SVER@ + PyInterpreterState_Delete@Base @SVER@ + PyInterpreterState_Head@Base @SVER@ + PyInterpreterState_New@Base @SVER@ + PyInterpreterState_Next@Base @SVER@ + PyInterpreterState_ThreadHead@Base @SVER@ + PyIter_Next@Base @SVER@ + PyListIter_Type@Base @SVER@ + PyListRevIter_Type@Base @SVER@ + PyList_Append@Base @SVER@ + PyList_AsTuple@Base @SVER@ + PyList_ClearFreeList@Base @SVER@ + PyList_Fini@Base @SVER@ + PyList_GetItem@Base @SVER@ + PyList_GetSlice@Base @SVER@ + PyList_Insert@Base @SVER@ + PyList_New@Base @SVER@ + PyList_Reverse@Base @SVER@ + PyList_SetItem@Base @SVER@ + PyList_SetSlice@Base @SVER@ + PyList_Size@Base @SVER@ + PyList_Sort@Base @SVER@ + PyList_Type@Base @SVER@ + PyLongRangeIter_Type@Base @SVER@ + PyLong_AsDouble@Base @SVER@ + PyLong_AsLong@Base @SVER@ + PyLong_AsLongAndOverflow@Base @SVER@ + PyLong_AsLongLong@Base @SVER@ + PyLong_AsLongLongAndOverflow@Base @SVER@ + PyLong_AsSize_t@Base @SVER@ + PyLong_AsSsize_t@Base @SVER@ + PyLong_AsUnsignedLong@Base @SVER@ + PyLong_AsUnsignedLongLong@Base @SVER@ + PyLong_AsUnsignedLongLongMask@Base @SVER@ + PyLong_AsUnsignedLongMask@Base @SVER@ + PyLong_AsVoidPtr@Base @SVER@ + PyLong_Fini@Base @SVER@ + PyLong_FromDouble@Base @SVER@ + PyLong_FromLong@Base @SVER@ + PyLong_FromLongLong@Base @SVER@ + PyLong_FromSize_t@Base @SVER@ + PyLong_FromSsize_t@Base @SVER@ + PyLong_FromString@Base @SVER@ + PyLong_FromUnicode@Base @SVER@ + PyLong_FromUnicodeObject@Base @SVER@ + PyLong_FromUnsignedLong@Base @SVER@ + PyLong_FromUnsignedLongLong@Base @SVER@ + PyLong_FromVoidPtr@Base @SVER@ + PyLong_GetInfo@Base @SVER@ + PyLong_Type@Base @SVER@ + PyMap_Type@Base @SVER@ + PyMapping_Check@Base @SVER@ + PyMapping_GetItemString@Base @SVER@ + PyMapping_HasKey@Base @SVER@ + PyMapping_HasKeyString@Base @SVER@ + PyMapping_Items@Base @SVER@ + PyMapping_Keys@Base @SVER@ + PyMapping_Length@Base @SVER@ + PyMapping_SetItemString@Base @SVER@ + PyMapping_Size@Base @SVER@ + PyMapping_Values@Base @SVER@ + PyMarshal_Init@Base @SVER@ + PyMarshal_ReadLastObjectFromFile@Base @SVER@ + PyMarshal_ReadLongFromFile@Base @SVER@ + PyMarshal_ReadObjectFromFile@Base @SVER@ + PyMarshal_ReadObjectFromString@Base @SVER@ + PyMarshal_ReadShortFromFile@Base @SVER@ + PyMarshal_WriteLongToFile@Base @SVER@ + PyMarshal_WriteObjectToFile@Base @SVER@ + PyMarshal_WriteObjectToString@Base @SVER@ + PyMem_Free@Base @SVER@ + PyMem_GetAllocator@Base @SVER@ + PyMem_Malloc@Base @SVER@ + PyMem_RawFree@Base @SVER@ + PyMem_RawMalloc@Base @SVER@ + PyMem_RawRealloc@Base @SVER@ + PyMem_Realloc@Base @SVER@ + PyMem_SetAllocator@Base @SVER@ + PyMem_SetupDebugHooks@Base @SVER@ + PyMemberDescr_Type@Base @SVER@ + PyMember_GetOne@Base @SVER@ + PyMember_SetOne@Base @SVER@ + PyMemoryView_FromBuffer@Base @SVER@ + PyMemoryView_FromMemory@Base @SVER@ + PyMemoryView_FromObject@Base @SVER@ + PyMemoryView_GetContiguous@Base @SVER@ + PyMemoryView_Type@Base @SVER@ + PyMethodDescr_Type@Base @SVER@ + PyMethod_ClearFreeList@Base @SVER@ + PyMethod_Fini@Base @SVER@ + PyMethod_Function@Base @SVER@ + PyMethod_New@Base @SVER@ + PyMethod_Self@Base @SVER@ + PyMethod_Type@Base @SVER@ + PyModule_AddIntConstant@Base @SVER@ + PyModule_AddObject@Base @SVER@ + PyModule_AddStringConstant@Base @SVER@ + PyModule_GetDef@Base @SVER@ + PyModule_GetDict@Base @SVER@ + PyModule_GetFilename@Base @SVER@ + PyModule_GetFilenameObject@Base @SVER@ + PyModule_GetName@Base @SVER@ + PyModule_GetNameObject@Base @SVER@ + PyModule_GetState@Base @SVER@ + PyModule_GetWarningsModule@Base @SVER@ + PyModule_New@Base @SVER@ + PyModule_NewObject@Base @SVER@ + PyModule_Type@Base @SVER@ + PyNode_AddChild@Base @SVER@ + PyNode_Compile@Base @SVER@ + PyNode_Free@Base @SVER@ + PyNode_ListTree@Base @SVER@ + PyNode_New@Base @SVER@ + PyNumber_Absolute@Base @SVER@ + PyNumber_Add@Base @SVER@ + PyNumber_And@Base @SVER@ + PyNumber_AsOff_t@Base @SVER@ + PyNumber_AsSsize_t@Base @SVER@ + PyNumber_Check@Base @SVER@ + PyNumber_Divmod@Base @SVER@ + PyNumber_Float@Base @SVER@ + PyNumber_FloorDivide@Base @SVER@ + PyNumber_InPlaceAdd@Base @SVER@ + PyNumber_InPlaceAnd@Base @SVER@ + PyNumber_InPlaceFloorDivide@Base @SVER@ + PyNumber_InPlaceLshift@Base @SVER@ + PyNumber_InPlaceMultiply@Base @SVER@ + PyNumber_InPlaceOr@Base @SVER@ + PyNumber_InPlacePower@Base @SVER@ + PyNumber_InPlaceRemainder@Base @SVER@ + PyNumber_InPlaceRshift@Base @SVER@ + PyNumber_InPlaceSubtract@Base @SVER@ + PyNumber_InPlaceTrueDivide@Base @SVER@ + PyNumber_InPlaceXor@Base @SVER@ + PyNumber_Index@Base @SVER@ + PyNumber_Invert@Base @SVER@ + PyNumber_Long@Base @SVER@ + PyNumber_Lshift@Base @SVER@ + PyNumber_Multiply@Base @SVER@ + PyNumber_Negative@Base @SVER@ + PyNumber_Or@Base @SVER@ + PyNumber_Positive@Base @SVER@ + PyNumber_Power@Base @SVER@ + PyNumber_Remainder@Base @SVER@ + PyNumber_Rshift@Base @SVER@ + PyNumber_Subtract@Base @SVER@ + PyNumber_ToBase@Base @SVER@ + PyNumber_TrueDivide@Base @SVER@ + PyNumber_Xor@Base @SVER@ + PyOS_AfterFork@Base @SVER@ + PyOS_FiniInterrupts@Base @SVER@ + PyOS_InitInterrupts@Base @SVER@ + PyOS_InputHook@Base @SVER@ + PyOS_InterruptOccurred@Base @SVER@ + PyOS_Readline@Base @SVER@ + PyOS_ReadlineFunctionPointer@Base @SVER@ + PyOS_StdioReadline@Base @SVER@ + PyOS_double_to_string@Base @SVER@ + PyOS_getsig@Base @SVER@ + PyOS_mystricmp@Base @SVER@ + PyOS_mystrnicmp@Base @SVER@ + PyOS_setsig@Base @SVER@ + PyOS_snprintf@Base @SVER@ + PyOS_string_to_double@Base @SVER@ + PyOS_strtol@Base @SVER@ + PyOS_strtoul@Base @SVER@ + PyOS_vsnprintf@Base @SVER@ + PyObject_ASCII@Base @SVER@ + PyObject_AsCharBuffer@Base @SVER@ + PyObject_AsFileDescriptor@Base @SVER@ + PyObject_AsReadBuffer@Base @SVER@ + PyObject_AsWriteBuffer@Base @SVER@ + PyObject_Bytes@Base @SVER@ + PyObject_Call@Base @SVER@ + PyObject_CallFinalizer@Base @SVER@ + PyObject_CallFinalizerFromDealloc@Base @SVER@ + PyObject_CallFunction@Base @SVER@ + PyObject_CallFunctionObjArgs@Base @SVER@ + PyObject_CallMethod@Base @SVER@ + PyObject_CallMethodObjArgs@Base @SVER@ + PyObject_CallObject@Base @SVER@ + PyObject_CheckReadBuffer@Base @SVER@ + PyObject_ClearWeakRefs@Base @SVER@ + PyObject_CopyData@Base @SVER@ + PyObject_DelItem@Base @SVER@ + PyObject_DelItemString@Base @SVER@ + PyObject_Dir@Base @SVER@ + PyObject_Format@Base @SVER@ + PyObject_Free@Base @SVER@ + PyObject_GC_Del@Base @SVER@ + PyObject_GC_Track@Base @SVER@ + PyObject_GC_UnTrack@Base @SVER@ + PyObject_GenericGetAttr@Base @SVER@ + PyObject_GenericGetDict@Base @SVER@ + PyObject_GenericSetAttr@Base @SVER@ + PyObject_GenericSetDict@Base @SVER@ + PyObject_GetArenaAllocator@Base @SVER@ + PyObject_GetAttr@Base @SVER@ + PyObject_GetAttrString@Base @SVER@ + PyObject_GetBuffer@Base @SVER@ + PyObject_GetItem@Base @SVER@ + PyObject_GetIter@Base @SVER@ + PyObject_HasAttr@Base @SVER@ + PyObject_HasAttrString@Base @SVER@ + PyObject_Hash@Base @SVER@ + PyObject_HashNotImplemented@Base @SVER@ + PyObject_Init@Base @SVER@ + PyObject_InitVar@Base @SVER@ + PyObject_IsInstance@Base @SVER@ + PyObject_IsSubclass@Base @SVER@ + PyObject_IsTrue@Base @SVER@ + PyObject_Length@Base @SVER@ + PyObject_LengthHint@Base @SVER@ + PyObject_Malloc@Base @SVER@ + PyObject_Not@Base @SVER@ + PyObject_Print@Base @SVER@ + PyObject_Realloc@Base @SVER@ + PyObject_Repr@Base @SVER@ + PyObject_RichCompare@Base @SVER@ + PyObject_RichCompareBool@Base @SVER@ + PyObject_SelfIter@Base @SVER@ + PyObject_SetArenaAllocator@Base @SVER@ + PyObject_SetAttr@Base @SVER@ + PyObject_SetAttrString@Base @SVER@ + PyObject_SetItem@Base @SVER@ + PyObject_Size@Base @SVER@ + PyObject_Str@Base @SVER@ + PyObject_Type@Base @SVER@ + (optional)PyObject_stgdict@Base @SVER@ + PyParser_ASTFromFile@Base @SVER@ + PyParser_ASTFromFileObject@Base @SVER@ + PyParser_ASTFromString@Base @SVER@ + PyParser_ASTFromStringObject@Base @SVER@ + PyParser_AddToken@Base @SVER@ + PyParser_ClearError@Base @SVER@ + PyParser_Delete@Base @SVER@ + PyParser_New@Base @SVER@ + PyParser_ParseFile@Base @SVER@ + PyParser_ParseFileFlags@Base @SVER@ + PyParser_ParseFileFlagsEx@Base @SVER@ + PyParser_ParseFileObject@Base @SVER@ + PyParser_ParseString@Base @SVER@ + PyParser_ParseStringFlags@Base @SVER@ + PyParser_ParseStringFlagsFilename@Base @SVER@ + PyParser_ParseStringFlagsFilenameEx@Base @SVER@ + PyParser_ParseStringObject@Base @SVER@ + PyParser_SetError@Base @SVER@ + PyParser_SimpleParseFile@Base @SVER@ + PyParser_SimpleParseFileFlags@Base @SVER@ + PyParser_SimpleParseString@Base @SVER@ + PyParser_SimpleParseStringFilename@Base @SVER@ + PyParser_SimpleParseStringFlags@Base @SVER@ + PyParser_SimpleParseStringFlagsFilename@Base @SVER@ + PyProperty_Type@Base @SVER@ + PyRangeIter_Type@Base @SVER@ + PyRange_Type@Base @SVER@ + PyRawIOBase_Type@Base @SVER@ + PyReversed_Type@Base @SVER@ + PyRun_AnyFile@Base @SVER@ + PyRun_AnyFileEx@Base @SVER@ + PyRun_AnyFileExFlags@Base @SVER@ + PyRun_AnyFileFlags@Base @SVER@ + PyRun_File@Base @SVER@ + PyRun_FileEx@Base @SVER@ + PyRun_FileExFlags@Base @SVER@ + PyRun_FileFlags@Base @SVER@ + PyRun_InteractiveLoop@Base @SVER@ + PyRun_InteractiveLoopFlags@Base @SVER@ + PyRun_InteractiveOne@Base @SVER@ + PyRun_InteractiveOneFlags@Base @SVER@ + PyRun_InteractiveOneObject@Base @SVER@ + PyRun_SimpleFile@Base @SVER@ + PyRun_SimpleFileEx@Base @SVER@ + PyRun_SimpleFileExFlags@Base @SVER@ + PyRun_SimpleString@Base @SVER@ + PyRun_SimpleStringFlags@Base @SVER@ + PyRun_String@Base @SVER@ + PyRun_StringFlags@Base @SVER@ + PySTEntry_Type@Base @SVER@ + PyST_GetScope@Base @SVER@ + PySeqIter_New@Base @SVER@ + PySeqIter_Type@Base @SVER@ + PySequence_Check@Base @SVER@ + PySequence_Concat@Base @SVER@ + PySequence_Contains@Base @SVER@ + PySequence_Count@Base @SVER@ + PySequence_DelItem@Base @SVER@ + PySequence_DelSlice@Base @SVER@ + PySequence_Fast@Base @SVER@ + PySequence_GetItem@Base @SVER@ + PySequence_GetSlice@Base @SVER@ + PySequence_In@Base @SVER@ + PySequence_InPlaceConcat@Base @SVER@ + PySequence_InPlaceRepeat@Base @SVER@ + PySequence_Index@Base @SVER@ + PySequence_Length@Base @SVER@ + PySequence_List@Base @SVER@ + PySequence_Repeat@Base @SVER@ + PySequence_SetItem@Base @SVER@ + PySequence_SetSlice@Base @SVER@ + PySequence_Size@Base @SVER@ + PySequence_Tuple@Base @SVER@ + PySetIter_Type@Base @SVER@ + PySet_Add@Base @SVER@ + PySet_Clear@Base @SVER@ + PySet_ClearFreeList@Base @SVER@ + PySet_Contains@Base @SVER@ + PySet_Discard@Base @SVER@ + PySet_Fini@Base @SVER@ + PySet_New@Base @SVER@ + PySet_Pop@Base @SVER@ + PySet_Size@Base @SVER@ + PySet_Type@Base @SVER@ + PySignal_SetWakeupFd@Base @SVER@ + PySlice_Fini@Base @SVER@ + PySlice_GetIndices@Base @SVER@ + PySlice_GetIndicesEx@Base @SVER@ + PySlice_New@Base @SVER@ + PySlice_Type@Base @SVER@ + PyState_AddModule@Base @SVER@ + PyState_FindModule@Base @SVER@ + PyState_RemoveModule@Base @SVER@ + PyStaticMethod_New@Base @SVER@ + PyStaticMethod_Type@Base @SVER@ + PyStdPrinter_Type@Base @SVER@ + PyStringIO_Type@Base @SVER@ + PyStructSequence_GetItem@Base @SVER@ + PyStructSequence_InitType2@Base @SVER@ + PyStructSequence_InitType@Base @SVER@ + PyStructSequence_New@Base @SVER@ + PyStructSequence_NewType@Base @SVER@ + PyStructSequence_SetItem@Base @SVER@ + PyStructSequence_UnnamedField@Base @SVER@ + PySuper_Type@Base @SVER@ + PySymtable_Build@Base @SVER@ + PySymtable_BuildObject@Base @SVER@ + PySymtable_Free@Base @SVER@ + PySymtable_Lookup@Base @SVER@ + PySys_AddWarnOption@Base @SVER@ + PySys_AddWarnOptionUnicode@Base @SVER@ + PySys_AddXOption@Base @SVER@ + PySys_FormatStderr@Base @SVER@ + PySys_FormatStdout@Base @SVER@ + PySys_GetObject@Base @SVER@ + PySys_GetXOptions@Base @SVER@ + PySys_HasWarnOptions@Base @SVER@ + PySys_ResetWarnOptions@Base @SVER@ + PySys_SetArgv@Base @SVER@ + PySys_SetArgvEx@Base @SVER@ + PySys_SetObject@Base @SVER@ + PySys_SetPath@Base @SVER@ + PySys_WriteStderr@Base @SVER@ + PySys_WriteStdout@Base @SVER@ + PyTextIOBase_Type@Base @SVER@ + PyTextIOWrapper_Type@Base @SVER@ + PyThreadState_Clear@Base @SVER@ + PyThreadState_Delete@Base @SVER@ + PyThreadState_DeleteCurrent@Base @SVER@ + PyThreadState_Get@Base @SVER@ + PyThreadState_GetDict@Base @SVER@ + PyThreadState_New@Base @SVER@ + PyThreadState_Next@Base @SVER@ + PyThreadState_SetAsyncExc@Base @SVER@ + PyThreadState_Swap@Base @SVER@ + PyThread_GetInfo@Base @SVER@ + PyThread_ReInitTLS@Base @SVER@ + PyThread_acquire_lock@Base @SVER@ + PyThread_acquire_lock_timed@Base @SVER@ + PyThread_allocate_lock@Base @SVER@ + PyThread_create_key@Base @SVER@ + PyThread_delete_key@Base @SVER@ + PyThread_delete_key_value@Base @SVER@ + PyThread_exit_thread@Base @SVER@ + PyThread_free_lock@Base @SVER@ + PyThread_get_key_value@Base @SVER@ + PyThread_get_stacksize@Base @SVER@ + PyThread_get_thread_ident@Base @SVER@ + PyThread_init_thread@Base @SVER@ + PyThread_release_lock@Base @SVER@ + PyThread_set_key_value@Base @SVER@ + PyThread_set_stacksize@Base @SVER@ + PyThread_start_new_thread@Base @SVER@ + PyToken_OneChar@Base @SVER@ + PyToken_ThreeChars@Base @SVER@ + PyToken_TwoChars@Base @SVER@ + PyTokenizer_FindEncoding@Base @SVER@ + PyTokenizer_FindEncodingFilename@Base @SVER@ + PyTokenizer_Free@Base @SVER@ + PyTokenizer_FromFile@Base @SVER@ + PyTokenizer_FromString@Base @SVER@ + PyTokenizer_FromUTF8@Base @SVER@ + PyTokenizer_Get@Base @SVER@ + PyTraceBack_Here@Base @SVER@ + PyTraceBack_Print@Base @SVER@ + PyTraceBack_Type@Base @SVER@ + PyTupleIter_Type@Base @SVER@ + PyTuple_ClearFreeList@Base @SVER@ + PyTuple_Fini@Base @SVER@ + PyTuple_GetItem@Base @SVER@ + PyTuple_GetSlice@Base @SVER@ + PyTuple_New@Base @SVER@ + PyTuple_Pack@Base @SVER@ + PyTuple_SetItem@Base @SVER@ + PyTuple_Size@Base @SVER@ + PyTuple_Type@Base @SVER@ + PyType_ClearCache@Base @SVER@ + PyType_FromSpec@Base @SVER@ + PyType_FromSpecWithBases@Base @SVER@ + PyType_GenericAlloc@Base @SVER@ + PyType_GenericNew@Base @SVER@ + PyType_GetFlags@Base @SVER@ + PyType_GetSlot@Base @SVER@ + PyType_IsSubtype@Base @SVER@ + PyType_Modified@Base @SVER@ + PyType_Ready@Base @SVER@ + PyType_Type@Base @SVER@ + (optional)PyType_stgdict@Base @SVER@ + PyUnicodeDecodeError_Create@Base @SVER@ + PyUnicodeDecodeError_GetEncoding@Base @SVER@ + PyUnicodeDecodeError_GetEnd@Base @SVER@ + PyUnicodeDecodeError_GetObject@Base @SVER@ + PyUnicodeDecodeError_GetReason@Base @SVER@ + PyUnicodeDecodeError_GetStart@Base @SVER@ + PyUnicodeDecodeError_SetEnd@Base @SVER@ + PyUnicodeDecodeError_SetReason@Base @SVER@ + PyUnicodeDecodeError_SetStart@Base @SVER@ + PyUnicodeEncodeError_Create@Base @SVER@ + PyUnicodeEncodeError_GetEncoding@Base @SVER@ + PyUnicodeEncodeError_GetEnd@Base @SVER@ + PyUnicodeEncodeError_GetObject@Base @SVER@ + PyUnicodeEncodeError_GetReason@Base @SVER@ + PyUnicodeEncodeError_GetStart@Base @SVER@ + PyUnicodeEncodeError_SetEnd@Base @SVER@ + PyUnicodeEncodeError_SetReason@Base @SVER@ + PyUnicodeEncodeError_SetStart@Base @SVER@ + PyUnicodeIter_Type@Base @SVER@ + PyUnicodeTranslateError_Create@Base @SVER@ + PyUnicodeTranslateError_GetEnd@Base @SVER@ + PyUnicodeTranslateError_GetObject@Base @SVER@ + PyUnicodeTranslateError_GetReason@Base @SVER@ + PyUnicodeTranslateError_GetStart@Base @SVER@ + PyUnicodeTranslateError_SetEnd@Base @SVER@ + PyUnicodeTranslateError_SetReason@Base @SVER@ + PyUnicodeTranslateError_SetStart@Base @SVER@ + PyUnicode_Append@Base @SVER@ + PyUnicode_AppendAndDel@Base @SVER@ + PyUnicode_AsASCIIString@Base @SVER@ + PyUnicode_AsCharmapString@Base @SVER@ + PyUnicode_AsDecodedObject@Base @SVER@ + PyUnicode_AsDecodedUnicode@Base @SVER@ + PyUnicode_AsEncodedObject@Base @SVER@ + PyUnicode_AsEncodedString@Base @SVER@ + PyUnicode_AsEncodedUnicode@Base @SVER@ + PyUnicode_AsLatin1String@Base @SVER@ + PyUnicode_AsRawUnicodeEscapeString@Base @SVER@ + PyUnicode_AsUCS4@Base @SVER@ + PyUnicode_AsUCS4Copy@Base @SVER@ + PyUnicode_AsUTF16String@Base @SVER@ + PyUnicode_AsUTF32String@Base @SVER@ + PyUnicode_AsUTF8@Base @SVER@ + PyUnicode_AsUTF8AndSize@Base @SVER@ + PyUnicode_AsUTF8String@Base @SVER@ + PyUnicode_AsUnicode@Base @SVER@ + PyUnicode_AsUnicodeAndSize@Base @SVER@ + PyUnicode_AsUnicodeCopy@Base @SVER@ + PyUnicode_AsUnicodeEscapeString@Base @SVER@ + PyUnicode_AsWideChar@Base @SVER@ + PyUnicode_AsWideCharString@Base @SVER@ + PyUnicode_BuildEncodingMap@Base @SVER@ + PyUnicode_ClearFreeList@Base @SVER@ + PyUnicode_Compare@Base @SVER@ + PyUnicode_CompareWithASCIIString@Base @SVER@ + PyUnicode_Concat@Base @SVER@ + PyUnicode_Contains@Base @SVER@ + PyUnicode_CopyCharacters@Base @SVER@ + PyUnicode_Count@Base @SVER@ + PyUnicode_Decode@Base @SVER@ + PyUnicode_DecodeASCII@Base @SVER@ + PyUnicode_DecodeCharmap@Base @SVER@ + PyUnicode_DecodeFSDefault@Base @SVER@ + PyUnicode_DecodeFSDefaultAndSize@Base @SVER@ + PyUnicode_DecodeLatin1@Base @SVER@ + PyUnicode_DecodeLocale@Base @SVER@ + PyUnicode_DecodeLocaleAndSize@Base @SVER@ + PyUnicode_DecodeRawUnicodeEscape@Base @SVER@ + PyUnicode_DecodeUTF16@Base @SVER@ + PyUnicode_DecodeUTF16Stateful@Base @SVER@ + PyUnicode_DecodeUTF32@Base @SVER@ + PyUnicode_DecodeUTF32Stateful@Base @SVER@ + PyUnicode_DecodeUTF7@Base @SVER@ + PyUnicode_DecodeUTF7Stateful@Base @SVER@ + PyUnicode_DecodeUTF8@Base @SVER@ + PyUnicode_DecodeUTF8Stateful@Base @SVER@ + PyUnicode_DecodeUnicodeEscape@Base @SVER@ + PyUnicode_Encode@Base @SVER@ + PyUnicode_EncodeASCII@Base @SVER@ + PyUnicode_EncodeCharmap@Base @SVER@ + PyUnicode_EncodeDecimal@Base @SVER@ + PyUnicode_EncodeFSDefault@Base @SVER@ + PyUnicode_EncodeUTF8@Base @SVER@ + PyUnicode_EncodeUnicodeEscape@Base @SVER@ + PyUnicode_FSConverter@Base @SVER@ + PyUnicode_FSDecoder@Base @SVER@ + PyUnicode_Fill@Base @SVER@ + PyUnicode_Find@Base @SVER@ + PyUnicode_FindChar@Base @SVER@ + PyUnicode_Format@Base @SVER@ + PyUnicode_FromEncodedObject@Base @SVER@ + PyUnicode_FromFormat@Base @SVER@ + PyUnicode_FromFormatV@Base @SVER@ + PyUnicode_FromKindAndData@Base @SVER@ + PyUnicode_FromObject@Base @SVER@ + PyUnicode_FromOrdinal@Base @SVER@ + PyUnicode_FromString@Base @SVER@ + PyUnicode_FromStringAndSize@Base @SVER@ + PyUnicode_FromUnicode@Base @SVER@ + PyUnicode_FromWideChar@Base @SVER@ + PyUnicode_GetDefaultEncoding@Base @SVER@ + PyUnicode_GetLength@Base @SVER@ + PyUnicode_GetMax@Base @SVER@ + PyUnicode_GetSize@Base @SVER@ + PyUnicode_EncodeLatin1@Base @SVER@ + PyUnicode_EncodeLocale@Base @SVER@ + PyUnicode_EncodeRawUnicodeEscape@Base @SVER@ + PyUnicode_EncodeUTF16@Base @SVER@ + PyUnicode_EncodeUTF32@Base @SVER@ + PyUnicode_EncodeUTF7@Base @SVER@ + PyUnicode_InternFromString@Base @SVER@ + PyUnicode_InternImmortal@Base @SVER@ + PyUnicode_InternInPlace@Base @SVER@ + PyUnicode_IsIdentifier@Base @SVER@ + PyUnicode_Join@Base @SVER@ + PyUnicode_New@Base @SVER@ + PyUnicode_Partition@Base @SVER@ + PyUnicode_RPartition@Base @SVER@ + PyUnicode_RSplit@Base @SVER@ + PyUnicode_ReadChar@Base @SVER@ + PyUnicode_Replace@Base @SVER@ + PyUnicode_Resize@Base @SVER@ + PyUnicode_RichCompare@Base @SVER@ + PyUnicode_Split@Base @SVER@ + PyUnicode_Splitlines@Base @SVER@ + PyUnicode_Substring@Base @SVER@ + PyUnicode_Tailmatch@Base @SVER@ + PyUnicode_TransformDecimalToASCII@Base @SVER@ + PyUnicode_Translate@Base @SVER@ + PyUnicode_TranslateCharmap@Base @SVER@ + PyUnicode_Type@Base @SVER@ + PyUnicode_WriteChar@Base @SVER@ + PyWeakref_GetObject@Base @SVER@ + PyWeakref_NewProxy@Base @SVER@ + PyWeakref_NewRef@Base @SVER@ + PyWrapperDescr_Type@Base @SVER@ + PyWrapper_New@Base @SVER@ + PyZip_Type@Base @SVER@ + Py_AddPendingCall@Base @SVER@ + Py_AtExit@Base @SVER@ + Py_BuildValue@Base @SVER@ + Py_BytesWarningFlag@Base @SVER@ + Py_CompileString@Base @SVER@ + Py_CompileStringExFlags@Base @SVER@ + Py_CompileStringFlags@Base @SVER@ + Py_CompileStringObject@Base @SVER@ + Py_DebugFlag@Base @SVER@ + Py_DecRef@Base @SVER@ + Py_DontWriteBytecodeFlag@Base @SVER@ + Py_EndInterpreter@Base @SVER@ + Py_Exit@Base @SVER@ + Py_FatalError@Base @SVER@ + Py_FdIsInteractive@Base @SVER@ + Py_FileSystemDefaultEncoding@Base @SVER@ + Py_Finalize@Base @SVER@ + Py_FrozenFlag@Base @SVER@ + Py_FrozenMain@Base @SVER@ + Py_GetArgcArgv@Base @SVER@ + Py_GetBuildInfo@Base @SVER@ + Py_GetCompiler@Base @SVER@ + Py_GetCopyright@Base @SVER@ + Py_GetExecPrefix@Base @SVER@ + Py_GetPath@Base @SVER@ + Py_GetPlatform@Base @SVER@ + Py_GetPrefix@Base @SVER@ + Py_GetProgramFullPath@Base @SVER@ + Py_GetProgramName@Base @SVER@ + Py_GetPythonHome@Base @SVER@ + Py_GetRecursionLimit@Base @SVER@ + Py_GetVersion@Base @SVER@ + Py_HasFileSystemDefaultEncoding@Base @SVER@ + Py_HashRandomizationFlag@Base @SVER@ + Py_IgnoreEnvironmentFlag@Base @SVER@ + Py_IncRef@Base @SVER@ + Py_Initialize@Base @SVER@ + Py_InitializeEx@Base @SVER@ + Py_InspectFlag@Base @SVER@ + Py_InteractiveFlag@Base @SVER@ + Py_IsInitialized@Base @SVER@ + Py_IsolatedFlag@Base @SVER@ + Py_Main@Base @SVER@ + Py_MakePendingCalls@Base @SVER@ + Py_NewInterpreter@Base @SVER@ + Py_NoSiteFlag@Base @SVER@ + Py_NoUserSiteDirectory@Base @SVER@ + Py_OptimizeFlag@Base @SVER@ + Py_QuietFlag@Base @SVER@ + Py_ReprEnter@Base @SVER@ + Py_ReprLeave@Base @SVER@ + Py_SetPath@Base @SVER@ + Py_SetProgramName@Base @SVER@ + Py_SetPythonHome@Base @SVER@ + Py_SetRecursionLimit@Base @SVER@ + Py_SetStandardStreamEncoding@Base @SVER@ + Py_SymtableString@Base @SVER@ + Py_SymtableStringObject@Base @SVER@ + Py_UNICODE_strcat@Base @SVER@ + Py_UNICODE_strchr@Base @SVER@ + Py_UNICODE_strcmp@Base @SVER@ + Py_UNICODE_strcpy@Base @SVER@ + Py_UNICODE_strlen@Base @SVER@ + Py_UNICODE_strncmp@Base @SVER@ + Py_UNICODE_strncpy@Base @SVER@ + Py_UNICODE_strrchr@Base @SVER@ + Py_UnbufferedStdioFlag@Base @SVER@ + Py_UniversalNewlineFgets@Base @SVER@ + Py_UseClassExceptionsFlag@Base @SVER@ + Py_VaBuildValue@Base @SVER@ + Py_VerboseFlag@Base @SVER@ + Py_hexdigits@Base @SVER@ + Py_meta_grammar@Base @SVER@ + Py_pgen@Base @SVER@ + _PyAccu_Accumulate@Base @SVER@ + _PyAccu_Destroy@Base @SVER@ + _PyAccu_Finish@Base @SVER@ + _PyAccu_FinishAsList@Base @SVER@ + _PyAccu_Init@Base @SVER@ + _PyArg_NoKeywords@Base @SVER@ + _PyArg_NoPositional@Base @SVER@ + _PyArg_ParseTupleAndKeywords_SizeT@Base @SVER@ + _PyArg_ParseTuple_SizeT@Base @SVER@ + _PyArg_Parse_SizeT@Base @SVER@ + _PyArg_VaParseTupleAndKeywords_SizeT@Base @SVER@ + _PyArg_VaParse_SizeT@Base @SVER@ + _PyBuiltin_Init@Base @SVER@ + _PyByteArray_empty_string@Base @SVER@ + _PyBytesIOBuffer_Type@Base @SVER@ + _PyBytes_Join@Base @SVER@ + _PyBytes_Resize@Base @SVER@ + _PyCFunction_DebugMallocStats@Base @SVER@ + _PyCapsule_hack@Base @SVER@ + _PyCode_CheckLineNumber@Base @SVER@ + _PyCodecInfo_GetIncrementalDecoder@Base @SVER@ + _PyCodecInfo_GetIncrementalEncoder@Base @SVER@ + _PyCodec_DecodeText@Base @SVER@ + _PyCodec_EncodeText@Base @SVER@ + _PyCodec_Lookup@Base @SVER@ + _PyCodec_LookupTextEncoding@Base @SVER@ + _PyComplex_FormatAdvancedWriter@Base @SVER@ + _PyDebugAllocatorStats@Base @SVER@ + _PyDictKeys_DecRef@Base @SVER@ + _PyDict_Contains@Base @SVER@ + _PyDict_DebugMallocStats@Base @SVER@ + _PyDict_DelItemId@Base @SVER@ + _PyDict_GetItemId@Base @SVER@ + _PyDict_GetItemIdWithError@Base @SVER@ + _PyDict_HasOnlyStringKeys@Base @SVER@ + _PyDict_KeysSize@Base @SVER@ + _PyDict_LoadGlobal@Base @SVER@ + _PyDict_MaybeUntrack@Base @SVER@ + _PyDict_NewKeysForClass@Base @SVER@ + _PyDict_NewPresized@Base @SVER@ + _PyDict_Next@Base @SVER@ + _PyErr_BadInternalCall@Base @SVER@ + _PyErr_SetKeyError@Base @SVER@ + _PyErr_TrySetFromCause@Base @SVER@ + _PyDict_SetItemId@Base @SVER@ + _PyEval_CallTracing@Base @SVER@ + _PyEval_FiniThreads@Base @SVER@ + _PyEval_GetSwitchInterval@Base @SVER@ + _PyEval_SetSwitchInterval@Base @SVER@ + _PyEval_SignalAsyncExc@Base @SVER@ + _PyEval_SliceIndex@Base @SVER@ + _PyExc_Fini@Base @SVER@ + _PyExc_Init@Base @SVER@ + _PyFaulthandler_Fini@Base @SVER@ + _PyFaulthandler_Init@Base @SVER@ + _PyFileIO_closed@Base @SVER@ + _PyFloat_DebugMallocStats@Base @SVER@ + _PyFloat_FormatAdvancedWriter@Base @SVER@ + _PyFloat_Init@Base @SVER@ + _PyFloat_Pack4@Base @SVER@ + _PyFloat_Pack8@Base @SVER@ + _PyFloat_Unpack4@Base @SVER@ + _PyFloat_Unpack8@Base @SVER@ + _PyFrame_DebugMallocStats@Base @SVER@ + _PyFrame_Init@Base @SVER@ + _PyGC_CollectNoFail@Base @SVER@ + _PyGC_Dump@Base @SVER@ + _PyGC_DumpShutdownStats@Base @SVER@ + _PyGC_Fini@Base @SVER@ + _PyGC_generation0@Base @SVER@ + _PyGILState_Fini@Base @SVER@ + _PyGILState_Init@Base @SVER@ + _PyGILState_Reinit@Base @SVER@ + _PyGen_FetchStopIterationValue@Base @SVER@ + _PyGen_Finalize@Base @SVER@ + _PyGen_Send@Base @SVER@ + _PyHash_Fini@Base @SVER@ + _PyIOBase_check_closed@Base @SVER@ + _PyIOBase_check_readable@Base @SVER@ + _PyIOBase_check_seekable@Base @SVER@ + _PyIOBase_check_writable@Base @SVER@ + _PyIOBase_finalize@Base @SVER@ + _PyIO_ConvertSsize_t@Base @SVER@ + _PyIO_Module@Base @SVER@ + _PyIO_empty_bytes@Base @SVER@ + _PyIO_empty_str@Base @SVER@ + _PyIO_find_line_ending@Base @SVER@ + _PyIO_get_locale_module@Base @SVER@ + _PyIO_get_module_state@Base @SVER@ + _PyIO_str_close@Base @SVER@ + _PyIO_str_closed@Base @SVER@ + _PyIO_str_decode@Base @SVER@ + _PyIO_str_encode@Base @SVER@ + _PyIO_str_fileno@Base @SVER@ + _PyIO_str_flush@Base @SVER@ + _PyIO_str_getstate@Base @SVER@ + _PyIO_str_isatty@Base @SVER@ + _PyIO_str_newlines@Base @SVER@ + _PyIO_str_nl@Base @SVER@ + _PyIO_str_read1@Base @SVER@ + _PyIO_str_read@Base @SVER@ + _PyIO_str_readable@Base @SVER@ + _PyIO_str_readall@Base @SVER@ + _PyIO_str_readinto@Base @SVER@ + _PyIO_str_readline@Base @SVER@ + _PyIO_str_reset@Base @SVER@ + _PyIO_str_seek@Base @SVER@ + _PyIO_str_seekable@Base @SVER@ + _PyIO_str_setstate@Base @SVER@ + _PyIO_str_tell@Base @SVER@ + _PyIO_str_truncate@Base @SVER@ + _PyIO_str_writable@Base @SVER@ + _PyIO_str_write@Base @SVER@ + _PyIO_trap_eintr@Base @SVER@ + _PyIO_zero@Base @SVER@ + _PyImportHooks_Init@Base @SVER@ + _PyImportZip_Init@Base @SVER@ + _PyImport_AcquireLock@Base @SVER@ + _PyImport_DynLoadFiletab@Base @SVER@ + _PyImport_FindBuiltin@Base @SVER@ + _PyImport_FindExtensionObject@Base @SVER@ + _PyImport_Fini@Base @SVER@ + _PyImport_FixupBuiltin@Base @SVER@ + _PyImport_FixupExtensionObject@Base @SVER@ + _PyImport_GetDynLoadFunc@Base @SVER@ + _PyImport_Init@Base @SVER@ + _PyImport_Inittab@Base @SVER@ + _PyImport_LoadDynamicModule@Base @SVER@ + _PyImport_ReInitLock@Base @SVER@ + _PyImport_ReleaseLock@Base @SVER@ + _PyIncrementalNewlineDecoder_decode@Base @SVER@ + _PyList_DebugMallocStats@Base @SVER@ + _PyList_Extend@Base @SVER@ + _PyLong_AsByteArray@Base @SVER@ + _PyLong_AsInt@Base @SVER@ + _PyLong_AsTime_t@Base @SVER@ + _PyLong_Copy@Base @SVER@ + _PyLong_DigitValue@Base @SVER@ + _PyLong_DivmodNear@Base @SVER@ + _PyLong_Format@Base @SVER@ + _PyLong_FormatAdvancedWriter@Base @SVER@ + _PyLong_FormatWriter@Base @SVER@ + _PyLong_Frexp@Base @SVER@ + _PyLong_FromByteArray@Base @SVER@ + _PyLong_FromBytes@Base @SVER@ + _PyLong_FromGid@Base @SVER@ + _PyLong_FromNbInt@Base @SVER@ + _PyLong_FromTime_t@Base @SVER@ + _PyLong_FromUid@Base @SVER@ + _PyLong_Init@Base @SVER@ + _PyLong_New@Base @SVER@ + _PyLong_NumBits@Base @SVER@ + _PyLong_Sign@Base @SVER@ + _PyManagedBuffer_Type@Base @SVER@ + _PyMem_RawStrdup@Base @SVER@ + _PyMem_Strdup@Base @SVER@ + _PyMethodWrapper_Type@Base @SVER@ + _PyMethod_DebugMallocStats@Base @SVER@ + _PyModule_Clear@Base @SVER@ + _PyModule_ClearDict@Base @SVER@ + _PyNamespace_New@Base @SVER@ + _PyNamespace_Type@Base @SVER@ + _PyNode_SizeOf@Base @SVER@ + _PyNone_Type@Base @SVER@ + _PyNotImplemented_Type@Base @SVER@ + _PyOS_GetOpt@Base @SVER@ + _PyOS_IsMainThread@Base @SVER@ + _PyOS_ReadlineTState@Base @SVER@ + _PyOS_ResetGetOpt@Base @SVER@ + _PyOS_URandom@Base @SVER@ + _PyOS_mystrnicmp_hack@Base @SVER@ + _PyOS_optarg@Base @SVER@ + _PyOS_opterr@Base @SVER@ + _PyOS_optind@Base @SVER@ + _PyObjectDict_SetItem@Base @SVER@ + _PyObject_CallFunction_SizeT@Base @SVER@ + _PyObject_CallMethodId@Base @SVER@ + _PyObject_CallMethodIdObjArgs@Base @SVER@ + _PyObject_CallMethodId_SizeT@Base @SVER@ + _PyObject_CallMethod_SizeT@Base @SVER@ + _PyObject_DebugMallocStats@Base @SVER@ + _PyObject_DebugTypeStats@Base @SVER@ + _PyObject_Dump@Base @SVER@ + _PyObject_GC_Malloc@Base @SVER@ + _PyObject_GC_New@Base @SVER@ + _PyObject_GC_NewVar@Base @SVER@ + _PyObject_GC_Resize@Base @SVER@ + _PyObject_GenericGetAttrWithDict@Base @SVER@ + _PyObject_GenericSetAttrWithDict@Base @SVER@ + _PyObject_GetAttrId@Base @SVER@ + _PyObject_GetBuiltin@Base @SVER@ + _PyObject_GetDictPtr@Base @SVER@ + _PyObject_HasAttrId@Base @SVER@ + _PyObject_HasLen@Base @SVER@ + _PyObject_IsAbstract@Base @SVER@ + _PyObject_LookupSpecial@Base @SVER@ + _PyObject_New@Base @SVER@ + _PyObject_NewVar@Base @SVER@ + _PyObject_NextNotImplemented@Base @SVER@ + _PyObject_RealIsInstance@Base @SVER@ + _PyObject_RealIsSubclass@Base @SVER@ + _PyObject_SetAttrId@Base @SVER@ + _PyParser_Grammar@Base @SVER@ + _PyParser_TokenNames@Base @SVER@ + _PyRandom_Fini@Base @SVER@ + _PyRandom_Init@Base @SVER@ + _PySequence_BytesToCharpArray@Base @SVER@ + _PySequence_IterSearch@Base @SVER@ + _PySet_Dummy@Base @SVER@ + _PySet_NextEntry@Base @SVER@ + _PySet_Update@Base @SVER@ + _PySlice_FromIndices@Base @SVER@ + _PySlice_GetLongIndices@Base @SVER@ + _PyState_AddModule@Base @SVER@ + _PyState_ClearModules@Base @SVER@ + _PyStructSequence_Init@Base @SVER@ + _PySys_GetObjectId@Base @SVER@ + _PySys_GetSizeOf@Base @SVER@ + _PySys_ImplCacheTag@Base @SVER@ + _PySys_ImplName@Base @SVER@ + _PySys_Init@Base @SVER@ + _PySys_SetObjectId@Base @SVER@ + _PyThreadState_Current@Base @SVER@ + _PyThreadState_DeleteExcept@Base @SVER@ + _PyThreadState_GetFrame@Base @SVER@ + _PyThreadState_Init@Base @SVER@ + _PyThreadState_Prealloc@Base @SVER@ + _PyThread_CurrentFrames@Base @SVER@ + _PyTime_Init@Base @SVER@ + _PyTime_ObjectToTime_t@Base @SVER@ + _PyTime_ObjectToTimespec@Base @SVER@ + _PyTime_ObjectToTimeval@Base @SVER@ + _PyTime_gettimeofday@Base @SVER@ + _PyTime_gettimeofday_info@Base @SVER@ + _PyTraceMalloc_Init@Base @SVER@ + _PyTraceMalloc_Fini@Base @SVER@ + _PyTrash_delete_later@Base @SVER@ + _PyTrash_delete_nesting@Base @SVER@ + _PyTrash_deposit_object@Base @SVER@ + _PyTrash_destroy_chain@Base @SVER@ + _PyTrash_thread_deposit_object@Base @SVER@ + _PyTrash_thread_destroy_chain@Base @SVER@ + _PyTuple_DebugMallocStats@Base @SVER@ + _PyTuple_MaybeUntrack@Base @SVER@ + _PyTuple_Resize@Base @SVER@ + _PyType_CalculateMetaclass@Base @SVER@ + _PyType_Fini@Base @SVER@ + _PyType_GetDocFromInternalDoc@Base @SVER@ + _PyType_GetTextSignatureFromInternalDoc@Base @SVER@ + _PyType_Lookup@Base @SVER@ + _PyType_LookupId@Base @SVER@ + _PyUnicodeTranslateError_Create@Base @SVER@ + _PyUnicodeWriter_Dealloc@Base @SVER@ + _PyUnicodeWriter_Finish@Base @SVER@ + _PyUnicodeWriter_Init@Base @SVER@ + _PyUnicodeWriter_PrepareInternal@Base @SVER@ + _PyUnicodeWriter_WriteASCIIString@Base @SVER@ + _PyUnicodeWriter_WriteChar@Base @SVER@ + _PyUnicodeWriter_WriteLatin1String@Base @SVER@ + _PyUnicodeWriter_WriteStr@Base @SVER@ + _PyUnicodeWriter_WriteSubstring@Base @SVER@ + _PyUnicode_AsASCIIString@Base @SVER@ + _PyUnicode_AsKind@Base @SVER@ + _PyUnicode_AsLatin1String@Base @SVER@ + _PyUnicode_AsUTF8String@Base @SVER@ + _PyUnicode_BidirectionalNames@Base @SVER@ + _PyUnicode_CategoryNames@Base @SVER@ + _PyUnicode_ClearStaticStrings@Base @SVER@ + _PyUnicode_CompareWithId@Base @SVER@ + _PyUnicode_Copy@Base @SVER@ + _PyUnicode_Database_Records@Base @SVER@ + _PyUnicode_DecodeUnicodeInternal@Base @SVER@ + _PyUnicode_EastAsianWidthNames@Base @SVER@ + _PyUnicode_EncodeCharmap@Base @SVER@ + _PyUnicode_EncodeUTF16@Base @SVER@ + _PyUnicode_EncodeUTF32@Base @SVER@ + _PyUnicode_EncodeUTF7@Base @SVER@ + _PyUnicode_ExtendedCase@Base @SVER@ + _PyUnicode_FastCopyCharacters@Base @SVER@ + _PyUnicode_FastFill@Base @SVER@ + _PyUnicode_FindMaxChar@Base @SVER@ + _PyUnicode_Fini@Base @SVER@ + _PyUnicode_FormatAdvancedWriter@Base @SVER@ + _PyUnicode_FromASCII@Base @SVER@ + _PyUnicode_FromId@Base @SVER@ + _PyUnicode_Init@Base @SVER@ + _PyUnicode_HasNULChars@Base @SVER@ + _PyUnicode_InsertThousandsGrouping@Base @SVER@ + _PyUnicode_IsAlpha@Base @SVER@ + _PyUnicode_IsCaseIgnorable@Base @SVER@ + _PyUnicode_IsCased@Base @SVER@ + _PyUnicode_IsDecimalDigit@Base @SVER@ + _PyUnicode_IsDigit@Base @SVER@ + _PyUnicode_IsLinebreak@Base @SVER@ + _PyUnicode_IsLowercase@Base @SVER@ + _PyUnicode_IsNumeric@Base @SVER@ + _PyUnicode_IsPrintable@Base @SVER@ + _PyUnicode_IsTitlecase@Base @SVER@ + _PyUnicode_IsUppercase@Base @SVER@ + _PyUnicode_IsWhitespace@Base @SVER@ + _PyUnicode_IsXidContinue@Base @SVER@ + _PyUnicode_IsXidStart@Base @SVER@ + _PyUnicode_Ready@Base @SVER@ + _PyUnicode_ToDecimalDigit@Base @SVER@ + _PyUnicode_ToDigit@Base @SVER@ + _PyUnicode_ToFoldedFull@Base @SVER@ + _PyUnicode_ToLowerFull@Base @SVER@ + _PyUnicode_ToLowercase@Base @SVER@ + _PyUnicode_ToNumeric@Base @SVER@ + _PyUnicode_ToTitleFull@Base @SVER@ + _PyUnicode_ToTitlecase@Base @SVER@ + _PyUnicode_ToUpperFull@Base @SVER@ + _PyUnicode_ToUppercase@Base @SVER@ + _PyUnicode_TransformDecimalAndSpaceToASCII@Base @SVER@ + _PyUnicode_TranslateCharmap@Base @SVER@ + _PyUnicode_TypeRecords@Base @SVER@ + _PyUnicode_XStrip@Base @SVER@ + _PyWarnings_Init@Base @SVER@ + _PyWeakref_CallableProxyType@Base @SVER@ + _PyWeakref_ClearRef@Base @SVER@ + _PyWeakref_GetWeakrefCount@Base @SVER@ + _PyWeakref_ProxyType@Base @SVER@ + _PyWeakref_RefType@Base @SVER@ + _Py_Assert@Base @SVER@ + _Py_Assign@Base @SVER@ + _Py_Attribute@Base @SVER@ + _Py_AugAssign@Base @SVER@ + _Py_BinOp@Base @SVER@ + _Py_BoolOp@Base @SVER@ + _Py_Break@Base @SVER@ + _Py_BreakPoint@Base @SVER@ + _Py_BuildValue_SizeT@Base @SVER@ + _Py_Bytes@Base @SVER@ + _Py_Call@Base @SVER@ + _Py_CheckRecursionLimit@Base @SVER@ + _Py_CheckRecursiveCall@Base @SVER@ + _Py_ClassDef@Base @SVER@ + _Py_Compare@Base @SVER@ + _Py_Continue@Base @SVER@ + _Py_Dealloc@Base @SVER@ + _Py_Delete@Base @SVER@ + _Py_Dict@Base @SVER@ + _Py_DictComp@Base @SVER@ + _Py_DisplaySourceLine@Base @SVER@ + _Py_DumpTraceback@Base @SVER@ + _Py_DumpTracebackThreads@Base @SVER@ + _Py_Ellipsis@Base @SVER@ + _Py_EllipsisObject@Base @SVER@ + _Py_ExceptHandler@Base @SVER@ + _Py_Expr@Base @SVER@ + _Py_Expression@Base @SVER@ + _Py_ExtSlice@Base @SVER@ + _Py_FalseStruct@Base @SVER@ + _Py_Finalizing@Base @SVER@ + _Py_For@Base @SVER@ + _Py_FreeCharPArray@Base @SVER@ + _Py_FunctionDef@Base @SVER@ + _Py_GeneratorExp@Base @SVER@ + _Py_GetAllocatedBlocks@Base @SVER@ + _Py_Global@Base @SVER@ + _Py_Gid_Converter@Base @SVER@ + _Py_HashBytes@Base @SVER@ + _Py_HashDouble@Base @SVER@ + _Py_HashPointer@Base @SVER@ + _Py_HashSecret@Base @SVER@ + _Py_If@Base @SVER@ + _Py_IfExp@Base @SVER@ + _Py_Import@Base @SVER@ + _Py_ImportFrom@Base @SVER@ + _Py_Index@Base @SVER@ + _Py_InitializeEx_Private@Base @SVER@ + _Py_Interactive@Base @SVER@ + _Py_Lambda@Base @SVER@ + _Py_List@Base @SVER@ + _Py_ListComp@Base @SVER@ + _Py_M__importlib@Base @SVER@ + _Py_Mangle@Base @SVER@ + _Py_Module@Base @SVER@ + _Py_Name@Base @SVER@ + _Py_NameConstant@Base @SVER@ + _Py_NoneStruct@Base @SVER@ + _Py_Nonlocal@Base @SVER@ + _Py_NotImplementedStruct@Base @SVER@ + _Py_Num@Base @SVER@ + _Py_PackageContext@Base @SVER@ + _Py_Pass@Base @SVER@ + _Py_PyAtExit@Base @SVER@ + _Py_Raise@Base @SVER@ + _Py_ReadyTypes@Base @SVER@ + _Py_ReleaseInternedUnicodeStrings@Base @SVER@ + _Py_RestoreSignals@Base @SVER@ + _Py_Return@Base @SVER@ + _Py_Set@Base @SVER@ + _Py_SetComp@Base @SVER@ + _Py_Slice@Base @SVER@ + _Py_Starred@Base @SVER@ + _Py_Str@Base @SVER@ + _Py_Subscript@Base @SVER@ + _Py_Suite@Base @SVER@ + _Py_SwappedOp@Base @SVER@ + _Py_TrueStruct@Base @SVER@ + _Py_Try@Base @SVER@ + _Py_Tuple@Base @SVER@ + _Py_Uid_Converter@Base @SVER@ + _Py_UnaryOp@Base @SVER@ + _Py_VaBuildValue_SizeT@Base @SVER@ + _Py_While@Base @SVER@ + _Py_With@Base @SVER@ + _Py_Yield@Base @SVER@ + _Py_YieldFrom@Base @SVER@ + _Py_abstract_hack@Base @SVER@ + _Py_acosh@Base @SVER@ + _Py_add_one_to_index_C@Base @SVER@ + _Py_add_one_to_index_F@Base @SVER@ + _Py_addarc@Base @SVER@ + _Py_addbit@Base @SVER@ + _Py_adddfa@Base @SVER@ + _Py_addfirstsets@Base @SVER@ + _Py_addlabel@Base @SVER@ + _Py_addstate@Base @SVER@ + _Py_alias@Base @SVER@ + _Py_arg@Base @SVER@ + _Py_arguments@Base @SVER@ + _Py_ascii_whitespace@Base @SVER@ + _Py_asdl_int_seq_new@Base @SVER@ + _Py_asdl_seq_new@Base @SVER@ + _Py_asinh@Base @SVER@ + _Py_atanh@Base @SVER@ + _Py_bytes_capitalize@Base @SVER@ + _Py_bytes_isalnum@Base @SVER@ + _Py_bytes_isalpha@Base @SVER@ + _Py_bytes_isdigit@Base @SVER@ + _Py_bytes_islower@Base @SVER@ + _Py_bytes_isspace@Base @SVER@ + _Py_bytes_istitle@Base @SVER@ + _Py_bytes_isupper@Base @SVER@ + _Py_bytes_lower@Base @SVER@ + _Py_bytes_maketrans@Base @SVER@ + _Py_bytes_swapcase@Base @SVER@ + _Py_bytes_title@Base @SVER@ + _Py_bytes_upper@Base @SVER@ + _Py_c_abs@Base @SVER@ + _Py_c_diff@Base @SVER@ + _Py_c_neg@Base @SVER@ + _Py_c_pow@Base @SVER@ + _Py_c_prod@Base @SVER@ + _Py_c_quot@Base @SVER@ + _Py_c_sum@Base @SVER@ + _Py_capitalize__doc__@Base @SVER@ + _Py_char2wchar@Base @SVER@ + _Py_comprehension@Base @SVER@ + _Py_ctype_table@Base @SVER@ + _Py_ctype_tolower@Base @SVER@ + _Py_ctype_toupper@Base @SVER@ + _Py_delbitset@Base @SVER@ + _Py_device_encoding@Base @SVER@ + (arch=!m68k)_Py_dg_dtoa@Base @SVER@ + (arch=!m68k)_Py_dg_freedtoa@Base @SVER@ + (arch=!m68k)_Py_dg_infinity@Base @SVER@ + (arch=!m68k)_Py_dg_stdnan@Base @SVER@ + (arch=!m68k)_Py_dg_strtod@Base @SVER@ + _Py_dup@Base @SVER@ + _Py_expm1@Base @SVER@ + _Py_findlabel@Base @SVER@ + _Py_fopen@Base @SVER@ + _Py_fopen_obj@Base @SVER@ + (arch=i386 lpia m68k)_Py_force_double@Base @SVER@ + (arch=amd64 i386 lpia)_Py_get_387controlword@Base @SVER@ + _Py_get_inheritable@Base @SVER@ + _Py_hashtable_clear@Base @SVER@ + _Py_hashtable_compare_direct@Base @SVER@ + _Py_hashtable_copy@Base @SVER@ + _Py_hashtable_delete@Base @SVER@ + _Py_hashtable_destroy@Base @SVER@ + _Py_hashtable_foreach@Base @SVER@ + _Py_hashtable_get@Base @SVER@ + _Py_hashtable_get_entry@Base @SVER@ + _Py_hashtable_hash_int@Base @SVER@ + _Py_hashtable_hash_ptr@Base @SVER@ + _Py_hashtable_new@Base @SVER@ + _Py_hashtable_new_full@Base @SVER@ + _Py_hashtable_pop@Base @SVER@ + _Py_hashtable_set@Base @SVER@ + _Py_hashtable_size@Base @SVER@ + _Py_hgidentifier@Base @SVER@ + _Py_hgversion@Base @SVER@ + _Py_isalnum__doc__@Base @SVER@ + _Py_isalpha__doc__@Base @SVER@ + _Py_isdigit__doc__@Base @SVER@ + _Py_islower__doc__@Base @SVER@ + _Py_isspace__doc__@Base @SVER@ + _Py_istitle__doc__@Base @SVER@ + _Py_isupper__doc__@Base @SVER@ + _Py_keyword@Base @SVER@ + _Py_log1p@Base @SVER@ + _Py_lower__doc__@Base @SVER@ + _Py_maketrans__doc__@Base @SVER@ + _Py_mergebitset@Base @SVER@ + _Py_meta_grammar@Base @SVER@ + _Py_newbitset@Base @SVER@ + _Py_newgrammar@Base @SVER@ + _Py_normalize_encoding@Base @SVER@ + _Py_open@Base @SVER@ + _Py_open_cloexec_works@Base @SVER@ + _Py_parse_inf_or_nan@Base @SVER@ + _Py_pgen@Base @SVER@ + _Py_samebitset@Base @SVER@ + (arch=amd64 i386 lpia)_Py_set_387controlword@Base @SVER@ + _Py_set_inheritable@Base @SVER@ + _Py_stat@Base @SVER@ + _Py_swapcase__doc__@Base @SVER@ + _Py_title__doc__@Base @SVER@ + _Py_translatelabels@Base @SVER@ + _Py_upper__doc__@Base @SVER@ + _Py_wchar2char@Base @SVER@ + _Py_wfopen@Base @SVER@ + _Py_wgetcwd@Base @SVER@ + _Py_withitem@Base @SVER@ + _Py_wreadlink@Base @SVER@ + _Py_wrealpath@Base @SVER@ + _Py_wstat@Base @SVER@ + + (optional|regex)"^_ctypes_.*@Base$" @SVER@ + (optional|regex)"^ffi_type_.*@Base$" @SVER@ + (optional|regex)"^ffi_closure_.*@Base$" @SVER@ + + (optional|regex)"^PyInit_.*@Base$" @SVER@ --- python3.4-3.4.1.orig/debian/locale-gen +++ python3.4-3.4.1/debian/locale-gen @@ -0,0 +1,31 @@ +#!/bin/sh + +LOCPATH=`pwd`/locales +export LOCPATH + +[ -d $LOCPATH ] || mkdir -p $LOCPATH + +umask 022 + +echo "Generating locales..." +while read locale charset; do + case $locale in \#*) continue;; esac + [ -n "$locale" -a -n "$charset" ] || continue + echo -n " `echo $locale | sed 's/\([^.\@]*\).*/\1/'`" + echo -n ".$charset" + echo -n `echo $locale | sed 's/\([^\@]*\)\(\@.*\)*/\2/'` + echo -n '...' + if [ -f $LOCPATH/$locale ]; then + input=$locale + else + input=`echo $locale | sed 's/\([^.]*\)[^@]*\(.*\)/\1\2/'` + fi + localedef -i $input -c -f $charset $LOCPATH/$locale #-A /etc/locale.alias + echo ' done'; \ +done < +# elif defined(__x86_64__) && defined(__ILP32__) +# include +# elif defined(__i386__) +# include +# elif defined(__aarch64__) && defined(__AARCH64EL__) +# include +# elif defined(__alpha__) +# include +# elif defined(__ARM_EABI__) && defined(__ARM_PCS_VFP) +# include +# elif defined(__ARM_EABI__) && !defined(__ARM_PCS_VFP) +# include +# elif defined(__hppa__) +# include +# elif defined(__ia64__) +# include +# elif defined(__m68k__) && !defined(__mcoldfire__) +# include +# elif defined(__mips_hard_float) && defined(_MIPSEL) +# if _MIPS_SIM == _ABIO32 +# include +# elif _MIPS_SIM == _ABIN32 +# include +# elif _MIPS_SIM == _ABI64 +# include +# else +# error unknown multiarch location for @header@ +# endif +# elif defined(__mips_hard_float) +# if _MIPS_SIM == _ABIO32 +# include +# elif _MIPS_SIM == _ABIN32 +# include +# elif _MIPS_SIM == _ABI64 +# include +# else +# error unknown multiarch location for @header@ +# endif +# elif defined(__or1k__) +# include +# elif defined(__powerpc__) && defined(__SPE__) +# include +# elif defined(__powerpc64__) +# if defined(__LITTLE_ENDIAN__) +# include +# else +# include +# endif +# elif defined(__powerpc__) +# include +# elif defined(__s390x__) +# include +# elif defined(__s390__) +# include +# elif defined(__sh__) && defined(__LITTLE_ENDIAN__) +# include +# elif defined(__sparc__) && defined(__arch64__) +# include +# elif defined(__sparc__) +# include +# else +# error unknown multiarch location for @header@ +# endif +#elif defined(__FreeBSD_kernel__) +# if defined(__LP64__) +# include +# elif defined(__i386__) +# include +# else +# error unknown multiarch location for @header@ +# endif +#elif defined(__gnu_hurd__) +# include +#else +# error unknown multiarch location for @header@ +#endif --- python3.4-3.4.1.orig/debian/patches/bdist-wininst-notfound.diff +++ python3.4-3.4.1/debian/patches/bdist-wininst-notfound.diff @@ -0,0 +1,17 @@ +# DP: suggest installation of the pythonX.Y-dev package, if bdist_wininst +# DP: cannot find the wininst-* files. + +--- a/Lib/distutils/command/bdist_wininst.py ++++ b/Lib/distutils/command/bdist_wininst.py +@@ -342,7 +342,10 @@ + sfix = '' + + filename = os.path.join(directory, "wininst-%.1f%s.exe" % (bv, sfix)) +- f = open(filename, "rb") ++ try: ++ f = open(filename, "rb") ++ except IOError as e: ++ raise DistutilsFileError(str(e) + ', %s not included in the Debian packages.' % filename) + try: + return f.read() + finally: --- python3.4-3.4.1.orig/debian/patches/ctypes-arm.diff +++ python3.4-3.4.1/debian/patches/ctypes-arm.diff @@ -0,0 +1,34 @@ +Index: b/Lib/ctypes/util.py +=================================================================== +--- a/Lib/ctypes/util.py ++++ b/Lib/ctypes/util.py +@@ -201,16 +201,27 @@ elif os.name == "posix": + + def _findSoname_ldconfig(name): + import struct ++ # XXX this code assumes that we know all unames and that a single ++ # ABI is supported per uname; instead we should find what the ++ # ABI is (e.g. check ABI of current process) or simply ask libc ++ # to load the library for us ++ uname = os.uname() ++ # ARM has a variety of unames, e.g. armv7l ++ if uname.machine.startswith("arm"): ++ machine = "arm" + if struct.calcsize('l') == 4: +- machine = os.uname().machine + '-32' ++ machine = uname.machine + '-32' + else: +- machine = os.uname().machine + '-64' ++ machine = uname.machine + '-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', ++ # this actually breaks on biarch or multiarch as the first ++ # library wins; uname doesn't tell us which ABI we're using ++ 'arm-32': 'libc6(,hard-float)?', + } + abi_type = mach_map.get(machine, 'libc6') + --- python3.4-3.4.1.orig/debian/patches/deb-locations.diff +++ python3.4-3.4.1/debian/patches/deb-locations.diff @@ -0,0 +1,30 @@ +# DP: adjust locations of directories to debian policy + +Index: b/Lib/pydoc.py +=================================================================== +--- a/Lib/pydoc.py ++++ b/Lib/pydoc.py +@@ -28,6 +28,10 @@ to a file named ".html". + + Module docs for core modules are assumed to be in + ++ /usr/share/doc/pythonX.Y/html/library ++ ++if the pythonX.Y-doc package is installed or in ++ + http://docs.python.org/X.Y/library/ + + This can be overridden by setting the PYTHONDOCS environment variable +Index: b/Misc/python.man +=================================================================== +--- a/Misc/python.man ++++ b/Misc/python.man +@@ -330,7 +330,7 @@ exception). Error messages are written + These are subject to difference depending on local installation + conventions; ${prefix} and ${exec_prefix} are installation-dependent + and should be interpreted as for GNU software; they may be the same. +-The default for both is \fI/usr/local\fP. ++On Debian GNU/{Hurd,Linux} the default for both is \fI/usr\fP. + .IP \fI${exec_prefix}/bin/python\fP + Recommended location of the interpreter. + .PP --- python3.4-3.4.1.orig/debian/patches/deb-setup.diff +++ python3.4-3.4.1/debian/patches/deb-setup.diff @@ -0,0 +1,33 @@ +# DP: Don't include /usr/local/include and /usr/local/lib as gcc search paths + +Index: b/setup.py +=================================================================== +--- a/setup.py ++++ b/setup.py +@@ -240,8 +240,10 @@ + # unfortunately, distutils doesn't let us provide separate C and C++ + # compilers + if compiler is not None: +- (ccshared,cflags) = sysconfig.get_config_vars('CCSHARED','CFLAGS') +- args['compiler_so'] = compiler + ' ' + ccshared + ' ' + cflags ++ (ccshared, cppflags, cflags) = \ ++ sysconfig.get_config_vars('CCSHARED', 'CPPFLAGS', 'CFLAGS') ++ cppflags = ' '.join([f for f in cppflags.split() if not f.startswith('-I')]) ++ args['compiler_so'] = compiler + ' ' + ccshared + ' ' + cppflags + ' ' + cflags + self.compiler.set_executables(**args) + + build_ext.build_extensions(self) +@@ -441,12 +443,7 @@ + os.unlink(tmpfile) + + def detect_modules(self): +- # Ensure that /usr/local is always used, but the local build +- # directories (i.e. '.' and 'Include') must be first. See issue +- # 10520. +- if not cross_compiling: +- add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib') +- add_dir_to_list(self.compiler.include_dirs, '/usr/local/include') ++ # On Debian /usr/local is always used, so we don't include it twice + # only change this for cross builds for 3.3, issues on Mageia + if cross_compiling: + self.add_gcc_paths() --- python3.4-3.4.1.orig/debian/patches/disable-sem-check.diff +++ python3.4-3.4.1/debian/patches/disable-sem-check.diff @@ -0,0 +1,38 @@ +# DP: Assume working semaphores, don't rely on running kernel for the check. + +Index: b/configure.ac +=================================================================== +--- a/configure.ac ++++ b/configure.ac +@@ -3930,8 +3930,13 @@ int main(void) { + AC_MSG_RESULT($ac_cv_posix_semaphores_enabled) + if test $ac_cv_posix_semaphores_enabled = no + then +- AC_DEFINE(POSIX_SEMAPHORES_NOT_ENABLED, 1, +- [Define if POSIX semaphores aren't enabled on your system]) ++ case $ac_sys_system in ++ Linux*) # assume yes, see https://launchpad.net/bugs/630511 ++ ;; ++ *) ++ AC_DEFINE(POSIX_SEMAPHORES_NOT_ENABLED, 1, ++ [Define if POSIX semaphores aren't enabled on your system]) ++ esac + fi + + # Multiprocessing check for broken sem_getvalue +@@ -3966,8 +3971,13 @@ int main(void){ + AC_MSG_RESULT($ac_cv_broken_sem_getvalue) + if test $ac_cv_broken_sem_getvalue = yes + then +- AC_DEFINE(HAVE_BROKEN_SEM_GETVALUE, 1, +- [define to 1 if your sem_getvalue is broken.]) ++ case $ac_sys_system in ++ Linux*) # assume yes, see https://launchpad.net/bugs/630511 ++ ;; ++ *) ++ AC_DEFINE(HAVE_BROKEN_SEM_GETVALUE, 1, ++ [define to 1 if your sem_getvalue is broken.]) ++ esac + fi + + # determine what size digit to use for Python's longs --- python3.4-3.4.1.orig/debian/patches/disable-some-tests.diff +++ python3.4-3.4.1/debian/patches/disable-some-tests.diff @@ -0,0 +1,14 @@ +# DP: Disable some failing tests we are not interested in + +Index: b/Lib/distutils/tests/test_build_ext.py +=================================================================== +--- a/Lib/distutils/tests/test_build_ext.py ++++ b/Lib/distutils/tests/test_build_ext.py +@@ -91,6 +91,7 @@ + build_ext.USER_BASE = self.old_user_base + super(BuildExtTestCase, self).tearDown() + ++ @unittest.skip('Skipping failing Solaris test') + def test_solaris_enable_shared(self): + dist = Distribution({'name': 'xx'}) + cmd = build_ext(dist) --- python3.4-3.4.1.orig/debian/patches/distutils-init.diff +++ python3.4-3.4.1/debian/patches/distutils-init.diff @@ -0,0 +1,60 @@ +# DP: Use _sysconfigdata.py in distutils to initialize distutils + +Index: b/Lib/distutils/sysconfig.py +=================================================================== +--- a/Lib/distutils/sysconfig.py ++++ b/Lib/distutils/sysconfig.py +@@ -453,49 +453,11 @@ _config_vars = None + + def _init_posix(): + """Initialize the module as appropriate for POSIX systems.""" +- g = {} +- # load the installed Makefile: +- try: +- filename = get_makefile_filename() +- parse_makefile(filename, g) +- except OSError as msg: +- my_msg = "invalid Python installation: unable to open %s" % filename +- if hasattr(msg, "strerror"): +- my_msg = my_msg + " (%s)" % msg.strerror +- +- raise DistutilsPlatformError(my_msg) +- +- # load the installed pyconfig.h: +- try: +- filename = get_config_h_filename() +- with open(filename) as file: +- parse_config_h(file, g) +- except OSError as msg: +- my_msg = "invalid Python installation: unable to open %s" % filename +- if hasattr(msg, "strerror"): +- my_msg = my_msg + " (%s)" % msg.strerror +- +- raise DistutilsPlatformError(my_msg) +- +- # On AIX, there are wrong paths to the linker scripts in the Makefile +- # -- these paths are relative to the Python source, but when installed +- # the scripts are in another directory. +- if python_build: +- g['LDSHARED'] = g['BLDSHARED'] +- +- elif get_python_version() < '2.1': +- # The following two branches are for 1.5.2 compatibility. +- if sys.platform == 'aix4': # what about AIX 3.x ? +- # Linker script is in the config directory, not in Modules as the +- # Makefile says. +- python_lib = get_python_lib(standard_lib=1) +- ld_so_aix = os.path.join(python_lib, 'config', 'ld_so_aix') +- python_exp = os.path.join(python_lib, 'config', 'python.exp') +- +- g['LDSHARED'] = "%s %s -bI:%s" % (ld_so_aix, g['CC'], python_exp) +- ++ # _sysconfigdata is generated at build time, see the sysconfig module ++ from _sysconfigdata import build_time_vars + global _config_vars +- _config_vars = g ++ _config_vars = {} ++ _config_vars.update(build_time_vars) + + + def _init_nt(): --- python3.4-3.4.1.orig/debian/patches/distutils-install-layout.diff +++ python3.4-3.4.1/debian/patches/distutils-install-layout.diff @@ -0,0 +1,260 @@ +# DP: distutils: Add an option --install-layout=deb, which +# DP: - installs into $prefix/dist-packages instead of $prefix/site-packages. +# DP: - doesn't encode the python version into the egg name. + +Index: b/Lib/distutils/command/install_egg_info.py +=================================================================== +--- a/Lib/distutils/command/install_egg_info.py ++++ b/Lib/distutils/command/install_egg_info.py +@@ -14,18 +14,38 @@ class install_egg_info(Command): + description = "Install package's PKG-INFO metadata as an .egg-info file" + user_options = [ + ('install-dir=', 'd', "directory to install to"), ++ ('install-layout', None, "custom installation layout"), + ] + + def initialize_options(self): + self.install_dir = None ++ self.install_layout = None ++ self.prefix_option = None + + def finalize_options(self): + self.set_undefined_options('install_lib',('install_dir','install_dir')) +- basename = "%s-%s-py%s.egg-info" % ( +- to_filename(safe_name(self.distribution.get_name())), +- to_filename(safe_version(self.distribution.get_version())), +- sys.version[:3] +- ) ++ self.set_undefined_options('install',('install_layout','install_layout')) ++ self.set_undefined_options('install',('prefix_option','prefix_option')) ++ if self.install_layout: ++ if not self.install_layout.lower() in ['deb', 'unix']: ++ raise DistutilsOptionError( ++ "unknown value for --install-layout") ++ no_pyver = (self.install_layout.lower() == 'deb') ++ elif self.prefix_option: ++ no_pyver = False ++ else: ++ no_pyver = True ++ if no_pyver: ++ basename = "%s-%s.egg-info" % ( ++ to_filename(safe_name(self.distribution.get_name())), ++ to_filename(safe_version(self.distribution.get_version())) ++ ) ++ else: ++ basename = "%s-%s-py%s.egg-info" % ( ++ to_filename(safe_name(self.distribution.get_name())), ++ to_filename(safe_version(self.distribution.get_version())), ++ sys.version[:3] ++ ) + self.target = os.path.join(self.install_dir, basename) + self.outputs = [self.target] + +Index: b/Lib/distutils/command/install.py +=================================================================== +--- a/Lib/distutils/command/install.py ++++ b/Lib/distutils/command/install.py +@@ -50,6 +50,20 @@ INSTALL_SCHEMES = { + 'scripts': '$base/bin', + 'data' : '$base', + }, ++ 'unix_local': { ++ 'purelib': '$base/local/lib/python$py_version_short/dist-packages', ++ 'platlib': '$platbase/local/lib/python$py_version_short/dist-packages', ++ 'headers': '$base/local/include/python$py_version_short/$dist_name', ++ 'scripts': '$base/local/bin', ++ 'data' : '$base/local', ++ }, ++ 'deb_system': { ++ 'purelib': '$base/lib/python3/dist-packages', ++ 'platlib': '$platbase/lib/python3/dist-packages', ++ 'headers': '$base/include/python$py_version_short/$dist_name', ++ 'scripts': '$base/bin', ++ 'data' : '$base', ++ }, + 'unix_home': { + 'purelib': '$base/lib/python', + 'platlib': '$base/lib/python', +@@ -146,6 +160,9 @@ class install(Command): + + ('record=', None, + "filename in which to record list of installed files"), ++ ++ ('install-layout=', None, ++ "installation layout to choose (known values: deb, unix)"), + ] + + boolean_options = ['compile', 'force', 'skip-build'] +@@ -166,6 +183,7 @@ class install(Command): + self.exec_prefix = None + self.home = None + self.user = 0 ++ self.prefix_option = None + + # These select only the installation base; it's up to the user to + # specify the installation scheme (currently, that means supplying +@@ -187,6 +205,9 @@ class install(Command): + self.install_userbase = USER_BASE + self.install_usersite = USER_SITE + ++ # enable custom installation, known values: deb ++ self.install_layout = None ++ + self.compile = None + self.optimize = None + +@@ -426,6 +447,7 @@ class install(Command): + self.install_base = self.install_platbase = self.home + self.select_scheme("unix_home") + else: ++ self.prefix_option = self.prefix + if self.prefix is None: + if self.exec_prefix is not None: + raise DistutilsOptionError( +@@ -440,7 +462,26 @@ class install(Command): + + self.install_base = self.prefix + self.install_platbase = self.exec_prefix +- self.select_scheme("unix_prefix") ++ if self.install_layout: ++ if self.install_layout.lower() in ['deb']: ++ self.select_scheme("deb_system") ++ elif self.install_layout.lower() in ['unix']: ++ self.select_scheme("unix_prefix") ++ else: ++ raise DistutilsOptionError( ++ "unknown value for --install-layout") ++ elif ((self.prefix_option and ++ os.path.normpath(self.prefix) != '/usr/local') ++ or sys.base_prefix != sys.prefix ++ or 'PYTHONUSERBASE' in os.environ ++ or 'VIRTUAL_ENV' in os.environ ++ or 'real_prefix' in sys.__dict__): ++ self.select_scheme("unix_prefix") ++ else: ++ if os.path.normpath(self.prefix) == '/usr/local': ++ self.prefix = self.exec_prefix = '/usr' ++ self.install_base = self.install_platbase = '/usr' ++ self.select_scheme("unix_local") + + def finalize_other(self): + """Finalizes options for non-posix platforms""" +Index: b/Lib/distutils/sysconfig.py +=================================================================== +--- a/Lib/distutils/sysconfig.py ++++ b/Lib/distutils/sysconfig.py +@@ -134,6 +134,7 @@ def get_python_lib(plat_specific=0, stan + If 'prefix' is supplied, use it instead of sys.base_prefix or + sys.base_exec_prefix -- i.e., ignore 'plat_specific'. + """ ++ is_default_prefix = not prefix or os.path.normpath(prefix) in ('/usr', '/usr/local') + if prefix is None: + if standard_lib: + prefix = plat_specific and BASE_EXEC_PREFIX or BASE_PREFIX +@@ -145,6 +146,12 @@ def get_python_lib(plat_specific=0, stan + "lib", "python" + get_python_version()) + if standard_lib: + return libpython ++ elif (is_default_prefix and ++ 'PYTHONUSERBASE' not in os.environ and ++ 'VIRTUAL_ENV' not in os.environ and ++ 'real_prefix' not in sys.__dict__ and ++ sys.prefix == sys.base_prefix): ++ return os.path.join(prefix, "lib", "python3", "dist-packages") + else: + return os.path.join(libpython, "site-packages") + elif os.name == "nt": +Index: b/Lib/site.py +=================================================================== +--- a/Lib/site.py ++++ b/Lib/site.py +@@ -288,6 +288,13 @@ def addusersitepackages(known_paths): + + if ENABLE_USER_SITE and os.path.isdir(user_site): + addsitedir(user_site, known_paths) ++ if ENABLE_USER_SITE: ++ for dist_libdir in ("lib", "local/lib"): ++ user_site = os.path.join(USER_BASE, dist_libdir, ++ "python" + sys.version[:3], ++ "dist-packages") ++ if os.path.isdir(user_site): ++ addsitedir(user_site, known_paths) + return known_paths + + def getsitepackages(prefixes=None): +Index: b/Lib/test/test_site.py +=================================================================== +--- a/Lib/test/test_site.py ++++ b/Lib/test/test_site.py +@@ -243,12 +243,20 @@ class HelperFunctionsTests(unittest.Test + self.assertEqual(dirs[2], wanted) + elif os.sep == '/': + # OS X non-framwework builds, Linux, FreeBSD, etc +- self.assertEqual(len(dirs), 2) +- wanted = os.path.join('xoxo', 'lib', 'python' + sys.version[:3], +- 'site-packages') ++ self.assertEqual(len(dirs), 4) ++ wanted = os.path.join('xoxo', 'local', 'lib', ++ 'python' + sys.version[:3], ++ 'dist-packages') + self.assertEqual(dirs[0], wanted) +- wanted = os.path.join('xoxo', 'lib', 'site-python') ++ wanted = os.path.join('xoxo', 'lib', ++ 'python3', 'dist-packages') + self.assertEqual(dirs[1], wanted) ++ wanted = os.path.join('xoxo', 'lib', ++ 'python' + sys.version[:3], ++ 'dist-packages') ++ self.assertEqual(dirs[2], wanted) ++ wanted = os.path.join('xoxo', 'lib', 'dist-python') ++ self.assertEqual(dirs[3], wanted) + else: + # other platforms + self.assertEqual(len(dirs), 2) +Index: b/Lib/distutils/tests/test_bdist_dumb.py +=================================================================== +--- a/Lib/distutils/tests/test_bdist_dumb.py ++++ b/Lib/distutils/tests/test_bdist_dumb.py +@@ -85,7 +85,7 @@ class BuildDumbTestCase(support.TempdirM + fp.close() + + contents = sorted(os.path.basename(fn) for fn in contents) +- wanted = ['foo-0.1-py%s.%s.egg-info' % sys.version_info[:2], 'foo.py'] ++ wanted = ['foo-0.1.egg-info', 'foo.py'] + if not sys.dont_write_bytecode: + wanted.append('foo.%s.pyc' % sys.implementation.cache_tag) + self.assertEqual(contents, sorted(wanted)) +Index: b/Lib/distutils/tests/test_install.py +=================================================================== +--- a/Lib/distutils/tests/test_install.py ++++ b/Lib/distutils/tests/test_install.py +@@ -194,7 +194,7 @@ class InstallTestCase(support.TempdirMan + found = [os.path.basename(line) for line in content.splitlines()] + expected = ['hello.py', 'hello.%s.pyc' % sys.implementation.cache_tag, + 'sayhi', +- 'UNKNOWN-0.0.0-py%s.%s.egg-info' % sys.version_info[:2]] ++ 'UNKNOWN-0.0.0.egg-info'] + self.assertEqual(found, expected) + + def test_record_extensions(self): +@@ -224,7 +224,7 @@ class InstallTestCase(support.TempdirMan + + found = [os.path.basename(line) for line in content.splitlines()] + expected = [_make_ext_name('xx'), +- 'UNKNOWN-0.0.0-py%s.%s.egg-info' % sys.version_info[:2]] ++ 'UNKNOWN-0.0.0.egg-info'] + self.assertEqual(found, expected) + + def test_debug_mode(self): +Index: b/Lib/pydoc.py +=================================================================== +--- a/Lib/pydoc.py ++++ b/Lib/pydoc.py +@@ -404,6 +404,7 @@ class Doc: + 'marshal', 'posix', 'signal', 'sys', + '_thread', 'zipimport') or + (file.startswith(basedir) and ++ not file.startswith(os.path.join(basedir, 'dist-packages')) and + not file.startswith(os.path.join(basedir, 'site-packages')))) and + object.__name__ not in ('xml.etree', 'test.pydoc_mod')): + if docloc.startswith("http://"): --- python3.4-3.4.1.orig/debian/patches/distutils-link.diff +++ python3.4-3.4.1/debian/patches/distutils-link.diff @@ -0,0 +1,24 @@ +# DP: Don't add standard library dirs to library_dirs and runtime_library_dirs. + +Index: b/Lib/distutils/unixccompiler.py +=================================================================== +--- a/Lib/distutils/unixccompiler.py ++++ b/Lib/distutils/unixccompiler.py +@@ -153,6 +153,17 @@ + runtime_library_dirs) + libraries, library_dirs, runtime_library_dirs = fixed_args + ++ # filter out standard library paths, which are not explicitely needed ++ # for linking ++ system_libdirs = ['/lib', '/lib64', '/usr/lib', '/usr/lib64'] ++ multiarch = sysconfig.get_config_var("MULTIARCH") ++ if multiarch: ++ system_libdirs.extend(['/lib/%s' % multiarch, '/usr/lib/%s' % multiarch]) ++ library_dirs = [dir for dir in library_dirs ++ if not dir in system_libdirs] ++ runtime_library_dirs = [dir for dir in runtime_library_dirs ++ if not dir in system_libdirs] ++ + lib_opts = gen_lib_options(self, library_dirs, runtime_library_dirs, + libraries) + if not isinstance(output_dir, (str, type(None))): --- python3.4-3.4.1.orig/debian/patches/distutils-sysconfig.diff +++ python3.4-3.4.1/debian/patches/distutils-sysconfig.diff @@ -0,0 +1,45 @@ +# DP: Get CONFIGURE_CFLAGS, CONFIGURE_CPPFLAGS, CONFIGURE_LDFLAGS from +# DP: the python build, when CFLAGS, CPPFLAGS, LDSHARED) are not set +# DP: in the environment. + +Index: b/Lib/distutils/sysconfig.py +=================================================================== +--- a/Lib/distutils/sysconfig.py ++++ b/Lib/distutils/sysconfig.py +@@ -191,9 +191,11 @@ + _osx_support.customize_compiler(_config_vars) + _config_vars['CUSTOMIZED_OSX_COMPILER'] = 'True' + +- (cc, cxx, opt, cflags, ccshared, ldshared, shlib_suffix, ar, ar_flags) = \ ++ (cc, cxx, opt, cflags, ccshared, ldshared, shlib_suffix, ar, ar_flags, ++ configure_cppflags, configure_cflags, configure_ldflags) = \ + get_config_vars('CC', 'CXX', 'OPT', 'CFLAGS', +- 'CCSHARED', 'LDSHARED', 'SHLIB_SUFFIX', 'AR', 'ARFLAGS') ++ 'CCSHARED', 'LDSHARED', 'SHLIB_SUFFIX', 'AR', 'ARFLAGS', ++ 'CONFIGURE_CPPFLAGS', 'CONFIGURE_CFLAGS', 'CONFIGURE_LDFLAGS') + + if 'CC' in os.environ: + newcc = os.environ['CC'] +@@ -214,13 +216,22 @@ + cpp = cc + " -E" # not always + if 'LDFLAGS' in os.environ: + ldshared = ldshared + ' ' + os.environ['LDFLAGS'] ++ elif configure_ldflags: ++ ldshared = ldshared + ' ' + configure_ldflags + if 'CFLAGS' in os.environ: + cflags = opt + ' ' + os.environ['CFLAGS'] + ldshared = ldshared + ' ' + os.environ['CFLAGS'] ++ elif configure_cflags: ++ cflags = opt + ' ' + configure_cflags ++ ldshared = ldshared + ' ' + configure_cflags + if 'CPPFLAGS' in os.environ: + cpp = cpp + ' ' + os.environ['CPPFLAGS'] + cflags = cflags + ' ' + os.environ['CPPFLAGS'] + ldshared = ldshared + ' ' + os.environ['CPPFLAGS'] ++ elif configure_cppflags: ++ cpp = cpp + ' ' + configure_cppflags ++ cflags = cflags + ' ' + configure_cppflags ++ ldshared = ldshared + ' ' + configure_cppflags + if 'AR' in os.environ: + ar = os.environ['AR'] + if 'ARFLAGS' in os.environ: --- python3.4-3.4.1.orig/debian/patches/doc-build.diff +++ python3.4-3.4.1/debian/patches/doc-build.diff @@ -0,0 +1,38 @@ +# DP: Allow docs to be built with Sphinx 0.5.x. + +--- a/Doc/tools/sphinxext/pyspecific.py ++++ b/Doc/tools/sphinxext/pyspecific.py +@@ -171,8 +171,15 @@ + from docutils.io import StringOutput + from docutils.utils import new_document + +-from sphinx.builders import Builder +-from sphinx.writers.text import TextWriter ++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 + + + class PydocTopicsBuilder(Builder): +--- a/Doc/tools/sphinxext/suspicious.py ++++ b/Doc/tools/sphinxext/suspicious.py +@@ -47,7 +47,12 @@ + import sys + + from docutils import nodes +-from sphinx.builders import Builder ++ ++try: ++ from sphinx.builders import Builder ++except ImportError: ++ from sphinx.builder import Builder ++ + + detect_all = re.compile(r''' + ::(?=[^=])| # two :: (but NOT ::=) --- python3.4-3.4.1.orig/debian/patches/doc-faq.dpatch +++ python3.4-3.4.1/debian/patches/doc-faq.dpatch @@ -0,0 +1,52 @@ +#! /bin/sh -e + +# DP: Mention the FAQ on the documentation index page. + +dir= +if [ $# -eq 3 -a "$2" = '-d' ]; then + pdir="-d $3" + dir="$3/" +elif [ $# -ne 1 ]; then + echo >&2 "usage: `basename $0`: -patch|-unpatch [-d ]" + exit 1 +fi +case "$1" in + -patch) + patch $pdir -f --no-backup-if-mismatch -p0 < $0 + ;; + -unpatch) + patch $pdir -f --no-backup-if-mismatch -R -p0 < $0 + ;; + *) + echo >&2 "usage: `basename $0`: -patch|-unpatch [-d ]" + exit 1 +esac +exit 0 + +--- Doc/html/index.html.in~ 2002-04-01 18:11:27.000000000 +0200 ++++ Doc/html/index.html.in 2003-04-05 13:33:35.000000000 +0200 +@@ -123,6 +123,24 @@ + + + ++ ++ ++   ++

++ ++ ++   ++ ++ ++ + + +

--- python3.4-3.4.1.orig/debian/patches/enable-fpectl.diff +++ python3.4-3.4.1/debian/patches/enable-fpectl.diff @@ -0,0 +1,16 @@ +# DP: Enable the build of the fpectl module. + +Index: b/setup.py +=================================================================== +--- a/setup.py ++++ b/setup.py +@@ -1312,6 +1312,9 @@ class PyBuildExt(build_ext): + else: + missing.append('_curses_panel') + ++ #fpectl fpectlmodule.c ... ++ exts.append( Extension('fpectl', ['fpectlmodule.c']) ) ++ + # Andrew Kuchling's zlib module. Note that some versions of zlib + # 1.1.3 have security problems. See CERT Advisory CA-2002-07: + # http://www.cert.org/advisories/CA-2002-07.html --- python3.4-3.4.1.orig/debian/patches/ensurepip-wheels.diff +++ python3.4-3.4.1/debian/patches/ensurepip-wheels.diff @@ -0,0 +1,125 @@ +--- a/Lib/ensurepip/__init__.py ++++ b/Lib/ensurepip/__init__.py +@@ -1,3 +1,4 @@ ++import glob + import os + import os.path + import pkgutil +@@ -8,13 +9,9 @@ + __all__ = ["version", "bootstrap"] + + +-_SETUPTOOLS_VERSION = "2.1" +- +-_PIP_VERSION = "1.5.6" +- + # pip currently requires ssl support, so we try to provide a nicer + # error message when that is missing (http://bugs.python.org/issue19744) +-_MISSING_SSL_MESSAGE = ("pip {} requires SSL/TLS".format(_PIP_VERSION)) ++_MISSING_SSL_MESSAGE = ("pip requires SSL/TLS") + try: + import ssl + except ImportError: +@@ -26,8 +23,8 @@ + pass + + _PROJECTS = [ +- ("setuptools", _SETUPTOOLS_VERSION), +- ("pip", _PIP_VERSION), ++ "setuptools", ++ "pip", + ] + + +@@ -45,7 +42,10 @@ + """ + Returns a string specifying the bundled version of pip. + """ +- return _PIP_VERSION ++ wheel_names = glob.glob('/usr/share/python-wheels/pip-*.whl') ++ assert len(wheel_names) == 1, wheel_names ++ return os.path.basename(wheel_names[0]).split('-')[1] ++ + + def _disable_pip_configuration_settings(): + # We deliberately ignore all pip environment variables +@@ -87,20 +87,41 @@ + # omit pip and easy_install + os.environ["ENSUREPIP_OPTIONS"] = "install" + ++ # Debian: The bundled wheels are useless to us because we must use ones ++ # crafted from source code in the archive. As we build the virtual ++ # environment, copy the wheels from the system location into the virtual ++ # environment, and place those wheels on sys.path. ++ def copy_wheels(wheels, destdir, paths): ++ for project in wheels: ++ wheel_names = glob.glob( ++ '/usr/share/python-wheels/{}-*.whl'.format(project)) ++ if len(wheel_names) == 0: ++ raise RuntimeError('missing dependency wheel %s' % project) ++ assert len(wheel_names) == 1, wheel_names ++ wheel_name = os.path.basename(wheel_names[0]) ++ path = os.path.join('/usr/share/python-wheels', wheel_name) ++ with open(path, 'rb') as fp: ++ whl = fp.read() ++ dest = os.path.join(destdir, wheel_name) ++ with open(dest, 'wb') as fp: ++ fp.write(whl) ++ paths.append(dest) ++ ++ private_wheel_dir = os.path.join(sys.prefix, 'lib', 'python-wheels') ++ os.makedirs(private_wheel_dir, exist_ok=True) ++ for project in _PROJECTS: ++ try: ++ with open('/usr/share/python-wheels/%s.dependencies' % project) as fp: ++ dependencies = [line[:-1].split()[0] for line in fp.readlines()] ++ except FileNotFoundError: ++ dependencies = [] ++ copy_wheels(dependencies, private_wheel_dir, sys.path) ++ + with tempfile.TemporaryDirectory() as tmpdir: + # Put our bundled wheels into a temporary directory and construct the + # additional paths that need added to sys.path + additional_paths = [] +- for project, version in _PROJECTS: +- wheel_name = "{}-{}-py2.py3-none-any.whl".format(project, version) +- whl = pkgutil.get_data( +- "ensurepip", +- "_bundled/{}".format(wheel_name), +- ) +- with open(os.path.join(tmpdir, wheel_name), "wb") as fp: +- fp.write(whl) +- +- additional_paths.append(os.path.join(tmpdir, wheel_name)) ++ copy_wheels(_PROJECTS, tmpdir, additional_paths) + + # Construct the arguments to be passed to the pip command + args = ["install", "--no-index", "--find-links", tmpdir] +@@ -113,7 +134,7 @@ + if verbosity: + args += ["-" + "v" * verbosity] + +- _run_pip(args + [p[0] for p in _PROJECTS], additional_paths) ++ _run_pip(args + _PROJECTS, additional_paths) + + def _uninstall_helper(*, verbosity=0): + """Helper to support a clean default uninstall process on Windows +@@ -127,7 +148,8 @@ + return + + # If the pip version doesn't match the bundled one, leave it alone +- if pip.__version__ != _PIP_VERSION: ++ # Disabled for Debian, always using the version from the python3-pip package. ++ if False and pip.__version__ != _PIP_VERSION: + msg = ("ensurepip will only uninstall a matching version " + "({!r} installed, {!r} bundled)") + print(msg.format(pip.__version__, _PIP_VERSION), file=sys.stderr) +@@ -141,7 +163,7 @@ + if verbosity: + args += ["-" + "v" * verbosity] + +- _run_pip(args + [p[0] for p in reversed(_PROJECTS)]) ++ _run_pip(args + reversed(_PROJECTS)) + + + def _main(argv=None): --- python3.4-3.4.1.orig/debian/patches/ext-no-libpython-link.diff +++ python3.4-3.4.1/debian/patches/ext-no-libpython-link.diff @@ -0,0 +1,24 @@ +# DP: Don't link extensions with the shared libpython library. + +Index: b/Lib/distutils/command/build_ext.py +=================================================================== +--- a/Lib/distutils/command/build_ext.py ++++ b/Lib/distutils/command/build_ext.py +@@ -245,7 +245,7 @@ + # For building extensions with a shared Python library, + # Python's library directory must be appended to library_dirs + # See Issues: #1600860, #4366 +- if (sysconfig.get_config_var('Py_ENABLE_SHARED')): ++ if False and (sysconfig.get_config_var('Py_ENABLE_SHARED')): + if sys.executable.startswith(os.path.join(sys.exec_prefix, "bin")): + # building third party extensions + self.library_dirs.append(sysconfig.get_config_var('LIBDIR')) +@@ -735,7 +735,7 @@ + return ext.libraries + else: + from distutils import sysconfig +- if sysconfig.get_config_var('Py_ENABLE_SHARED'): ++ if False and sysconfig.get_config_var('Py_ENABLE_SHARED'): + pythonlib = 'python{}.{}{}'.format( + sys.hexversion >> 24, (sys.hexversion >> 16) & 0xff, + sys.abiflags) --- python3.4-3.4.1.orig/debian/patches/gdbm-import.diff +++ python3.4-3.4.1/debian/patches/gdbm-import.diff @@ -0,0 +1,12 @@ +# DP: suggest installation of python3-gdbm package on failing _gdbm import + +--- a/Lib/dbm/gnu.py ++++ b/Lib/dbm/gnu.py +@@ -1,3 +1,6 @@ + """Provide the _gdbm module as a dbm submodule.""" + +-from _gdbm import * ++try: ++ from _gdbm import * ++except ImportError as msg: ++ raise ImportError(str(msg) + ', please install the python3-gdbm package') --- python3.4-3.4.1.orig/debian/patches/hg-updates.diff +++ python3.4-3.4.1/debian/patches/hg-updates.diff @@ -0,0 +1,92999 @@ +# DP: updates from the 3.4 release branch (until 2014-08-18, 92145:fbb51251eb9d). + +# hg diff -r v3.4.1 | filterdiff --exclude=.hgignore --exclude=.hgeol --exclude=.hgtags --remove-timestamps + +diff -r c0e311e010fc Doc/Makefile +--- a/Doc/Makefile ++++ b/Doc/Makefile +@@ -69,24 +69,30 @@ + @echo "The overview file is in build/changes." + + linkcheck: BUILDER = linkcheck +-linkcheck: build +- @echo "Link check complete; look for any errors in the above output" \ +- "or in build/$(BUILDER)/output.txt" ++linkcheck: ++ @$(MAKE) build BUILDER=$(BUILDER) || { \ ++ echo "Link check complete; look for any errors in the above output" \ ++ "or in build/$(BUILDER)/output.txt"; \ ++ false; } + + suspicious: BUILDER = suspicious +-suspicious: build +- @echo "Suspicious check complete; look for any errors in the above output" \ +- "or in build/$(BUILDER)/suspicious.csv. If all issues are false" \ +- "positives, append that file to tools/sphinxext/susp-ignored.csv." ++suspicious: ++ @$(MAKE) build BUILDER=$(BUILDER) || { \ ++ echo "Suspicious check complete; look for any errors in the above output" \ ++ "or in build/$(BUILDER)/suspicious.csv. If all issues are false" \ ++ "positives, append that file to tools/sphinxext/susp-ignored.csv."; \ ++ false; } + + coverage: BUILDER = coverage + coverage: build + @echo "Coverage finished; see c.txt and python.txt in build/coverage" + + doctest: BUILDER = doctest +-doctest: build +- @echo "Testing of doctests in the sources finished, look at the" \ +- "results in build/doctest/output.txt" ++doctest: ++ @$(MAKE) build BUILDER=$(BUILDER) || { \ ++ echo "Testing of doctests in the sources finished, look at the" \ ++ "results in build/doctest/output.txt"; \ ++ false; } + + pydoc-topics: BUILDER = pydoc-topics + pydoc-topics: build +diff -r c0e311e010fc Doc/c-api/buffer.rst +--- a/Doc/c-api/buffer.rst ++++ b/Doc/c-api/buffer.rst +@@ -89,6 +89,16 @@ + + .. c:type:: Py_buffer + ++ .. c:member:: void \*buf ++ ++ A pointer to the start of the logical structure described by the buffer ++ fields. This can be any location within the underlying physical memory ++ block of the exporter. For example, with negative :c:member:`~Py_buffer.strides` ++ the value may point to the end of the memory block. ++ ++ For contiguous arrays, the value points to the beginning of the memory ++ block. ++ + .. c:member:: void \*obj + + A new reference to the exporting object. The reference is owned by +@@ -101,16 +111,6 @@ + this field is *NULL*. In general, exporting objects MUST NOT + use this scheme. + +- .. c:member:: void \*buf +- +- A pointer to the start of the logical structure described by the buffer +- fields. This can be any location within the underlying physical memory +- block of the exporter. For example, with negative :c:member:`~Py_buffer.strides` +- the value may point to the end of the memory block. +- +- For contiguous arrays, the value points to the beginning of the memory +- block. +- + .. c:member:: Py_ssize_t len + + ``product(shape) * itemsize``. For contiguous arrays, this is the length +@@ -489,8 +489,8 @@ + :c:member:`view->obj` to *NULL* and return -1; + + If this function is used as part of a :ref:`getbufferproc `, +- *exporter* MUST be set to the exporting object. Otherwise, *exporter* MUST +- be NULL. ++ *exporter* MUST be set to the exporting object and *flags* must be passed ++ unmodified. Otherwise, *exporter* MUST be NULL. + + + +diff -r c0e311e010fc Doc/c-api/typeobj.rst +--- a/Doc/c-api/typeobj.rst ++++ b/Doc/c-api/typeobj.rst +@@ -597,7 +597,9 @@ + .. c:member:: richcmpfunc PyTypeObject.tp_richcompare + + An optional pointer to the rich comparison function, whose signature is +- ``PyObject *tp_richcompare(PyObject *a, PyObject *b, int op)``. ++ ``PyObject *tp_richcompare(PyObject *a, PyObject *b, int op)``. The first ++ parameter is guaranteed to be an instance of the type that is defined ++ by :c:type:`PyTypeObject`. + + The function should return the result of the comparison (usually ``Py_True`` + or ``Py_False``). If the comparison is undefined, it must return +diff -r c0e311e010fc Doc/c-api/unicode.rst +--- a/Doc/c-api/unicode.rst ++++ b/Doc/c-api/unicode.rst +@@ -1624,7 +1624,7 @@ + Compare a unicode object, *uni*, with *string* and return -1, 0, 1 for less + than, equal, and greater than, respectively. It is best to pass only + ASCII-encoded strings, but the function interprets the input string as +- ISO-8859-1 if it contains non-ASCII characters". ++ ISO-8859-1 if it contains non-ASCII characters. + + + .. c:function:: PyObject* PyUnicode_RichCompare(PyObject *left, PyObject *right, int op) +@@ -1646,7 +1646,7 @@ + .. c:function:: PyObject* PyUnicode_Format(PyObject *format, PyObject *args) + + Return a new string object from *format* and *args*; this is analogous to +- ``format % args``. The *args* argument must be a tuple. ++ ``format % args``. + + + .. c:function:: int PyUnicode_Contains(PyObject *container, PyObject *element) +diff -r c0e311e010fc Doc/distributing/index.rst +--- a/Doc/distributing/index.rst ++++ b/Doc/distributing/index.rst +@@ -48,6 +48,18 @@ + standard library, but its name lives on in other ways (such as the name + of the mailing list used to coordinate Python packaging standards + development). ++* ``setuptools`` is a (largely) drop-in replacement for ``distutils`` first ++ published in 2004. Its most notable addition over the unmodified ++ ``distutils`` tools was the ability to declare dependencies on other ++ packages. It is currently recommended as a more regularly updated ++ alternative to ``distutils`` that offers consistent support for more ++ recent packaging standards across a wide range of Python versions. ++* ``wheel`` (in this context) is a project that adds the ``bdist_wheel`` ++ command to ``distutils``/``setuptools``. This produces a cross platform ++ binary packaging format (called "wheels" or "wheel files" and defined in ++ :pep:`427`) that allows Python libraries, even those including binary ++ extensions, to be installed on a system without needing to be built ++ locally. + + + Open source licensing and collaboration +@@ -85,12 +97,16 @@ + + pip install setuptools wheel twine + ++The Python Packaging User Guide includes more details on the `currently ++recommended tools`_. ++ ++.. _currently recommended tools: https://packaging.python.org/en/latest/current.html#packaging-tool-recommendations + + Reading the guide + ================= + + The Python Packaging User Guide covers the various key steps and elements +-involved in creating a project ++involved in creating a project: + + * `Project structure`_ + * `Building and packaging the project`_ +diff -r c0e311e010fc Doc/distutils/examples.rst +--- a/Doc/distutils/examples.rst ++++ b/Doc/distutils/examples.rst +@@ -193,9 +193,6 @@ + packages=['foobar', 'foobar.subfoo'], + ) + +-(Again, the empty string in :option:`package_dir` stands for the current +-directory.) +- + + .. _single-ext: + +diff -r c0e311e010fc Doc/faq/design.rst +--- a/Doc/faq/design.rst ++++ b/Doc/faq/design.rst +@@ -664,62 +664,6 @@ + sloppy and not write test cases at all. + + +-Why are default values shared between objects? +----------------------------------------------- +- +-This type of bug commonly bites neophyte programmers. Consider this function:: +- +- def foo(mydict={}): # Danger: shared reference to one dict for all calls +- ... compute something ... +- mydict[key] = value +- return mydict +- +-The first time you call this function, ``mydict`` contains a single item. The +-second time, ``mydict`` contains two items because when ``foo()`` begins +-executing, ``mydict`` starts out with an item already in it. +- +-It is often expected that a function call creates new objects for default +-values. This is not what happens. Default values are created exactly once, when +-the function is defined. If that object is changed, like the dictionary in this +-example, subsequent calls to the function will refer to this changed object. +- +-By definition, immutable objects such as numbers, strings, tuples, and ``None``, +-are safe from change. Changes to mutable objects such as dictionaries, lists, +-and class instances can lead to confusion. +- +-Because of this feature, it is good programming practice to not use mutable +-objects as default values. Instead, use ``None`` as the default value and +-inside the function, check if the parameter is ``None`` and create a new +-list/dictionary/whatever if it is. For example, don't write:: +- +- def foo(mydict={}): +- ... +- +-but:: +- +- def foo(mydict=None): +- if mydict is None: +- mydict = {} # create a new dict for local namespace +- +-This feature can be useful. When you have a function that's time-consuming to +-compute, a common technique is to cache the parameters and the resulting value +-of each call to the function, and return the cached value if the same value is +-requested again. This is called "memoizing", and can be implemented like this:: +- +- # Callers will never provide a third parameter for this function. +- def expensive(arg1, arg2, _cache={}): +- if (arg1, arg2) in _cache: +- return _cache[(arg1, arg2)] +- +- # Calculate the value +- result = ... expensive computation ... +- _cache[(arg1, arg2)] = result # Store result in the cache +- return result +- +-You could use a global variable containing a dictionary instead of the default +-value; it's a matter of taste. +- +- + Why is there no goto? + --------------------- + +diff -r c0e311e010fc Doc/faq/programming.rst +--- a/Doc/faq/programming.rst ++++ b/Doc/faq/programming.rst +@@ -352,6 +352,62 @@ + occur when the module is initialized. + + ++Why are default values shared between objects? ++---------------------------------------------- ++ ++This type of bug commonly bites neophyte programmers. Consider this function:: ++ ++ def foo(mydict={}): # Danger: shared reference to one dict for all calls ++ ... compute something ... ++ mydict[key] = value ++ return mydict ++ ++The first time you call this function, ``mydict`` contains a single item. The ++second time, ``mydict`` contains two items because when ``foo()`` begins ++executing, ``mydict`` starts out with an item already in it. ++ ++It is often expected that a function call creates new objects for default ++values. This is not what happens. Default values are created exactly once, when ++the function is defined. If that object is changed, like the dictionary in this ++example, subsequent calls to the function will refer to this changed object. ++ ++By definition, immutable objects such as numbers, strings, tuples, and ``None``, ++are safe from change. Changes to mutable objects such as dictionaries, lists, ++and class instances can lead to confusion. ++ ++Because of this feature, it is good programming practice to not use mutable ++objects as default values. Instead, use ``None`` as the default value and ++inside the function, check if the parameter is ``None`` and create a new ++list/dictionary/whatever if it is. For example, don't write:: ++ ++ def foo(mydict={}): ++ ... ++ ++but:: ++ ++ def foo(mydict=None): ++ if mydict is None: ++ mydict = {} # create a new dict for local namespace ++ ++This feature can be useful. When you have a function that's time-consuming to ++compute, a common technique is to cache the parameters and the resulting value ++of each call to the function, and return the cached value if the same value is ++requested again. This is called "memoizing", and can be implemented like this:: ++ ++ # Callers will never provide a third parameter for this function. ++ def expensive(arg1, arg2, _cache={}): ++ if (arg1, arg2) in _cache: ++ return _cache[(arg1, arg2)] ++ ++ # Calculate the value ++ result = ... expensive computation ... ++ _cache[(arg1, arg2)] = result # Store result in the cache ++ return result ++ ++You could use a global variable containing a dictionary instead of the default ++value; it's a matter of taste. ++ ++ + How can I pass optional or keyword parameters from one function to another? + --------------------------------------------------------------------------- + +@@ -1730,19 +1786,10 @@ + __import__('x.y.z') returns ; how do I get z? + --------------------------------------------------------- + +-Try:: ++Consider using the convenience function :func:`~importlib.import_module` from ++:mod:`importlib` instead:: + +- __import__('x.y.z').y.z +- +-For more realistic situations, you may have to do something like :: +- +- m = __import__(s) +- for i in s.split(".")[1:]: +- m = getattr(m, i) +- +-See :mod:`importlib` for a convenience function called +-:func:`~importlib.import_module`. +- ++ z = importlib.import_module('x.y.z') + + + When I edit an imported module and reimport it, the changes don't show up. Why does this happen? +diff -r c0e311e010fc Doc/howto/functional.rst +--- a/Doc/howto/functional.rst ++++ b/Doc/howto/functional.rst +@@ -583,7 +583,7 @@ + + Because ``yield`` will often be returning ``None``, you should always check for + this case. Don't just use its value in expressions unless you're sure that the +-:meth:`~generator.send` method will be the only method used resume your ++:meth:`~generator.send` method will be the only method used to resume your + generator function. + + In addition to :meth:`~generator.send`, there are two other methods on +diff -r c0e311e010fc Doc/howto/logging.rst +--- a/Doc/howto/logging.rst ++++ b/Doc/howto/logging.rst +@@ -1027,6 +1027,15 @@ + so that if the logger's threshold is set above ``DEBUG``, the calls to + :func:`expensive_func1` and :func:`expensive_func2` are never made. + ++.. note:: In some cases, :meth:`~Logger.isEnabledFor` can itself be more ++ expensive than you'd like (e.g. for deeply nested loggers where an explicit ++ level is only set high up in the logger hierarchy). In such cases (or if you ++ want to avoid calling a method in tight loops), you can cache the result of a ++ call to :meth:`~Logger.isEnabledFor` in a local or instance variable, and use ++ that instead of calling the method each time. Such a cached value would only ++ need to be recomputed when the logging configuration changes dynamically ++ while the application is running (which is not all that common). ++ + There are other optimizations which can be made for specific applications which + need more precise control over what logging information is collected. Here's a + list of things you can do to avoid processing during logging which you don't +@@ -1036,6 +1045,12 @@ + | What you don't want to collect | How to avoid collecting it | + +===============================================+========================================+ + | Information about where calls were made from. | Set ``logging._srcfile`` to ``None``. | ++| | This avoids calling | ++| | :func:`sys._getframe`, which may help | ++| | to speed up your code in environments | ++| | like PyPy (which can't speed up code | ++| | that uses :func:`sys._getframe`), if | ++| | and when PyPy supports Python 3.x. | + +-----------------------------------------------+----------------------------------------+ + | Threading information. | Set ``logging.logThreads`` to ``0``. | + +-----------------------------------------------+----------------------------------------+ +diff -r c0e311e010fc Doc/howto/sockets.rst +--- a/Doc/howto/sockets.rst ++++ b/Doc/howto/sockets.rst +@@ -180,7 +180,7 @@ + Assuming you don't want to end the connection, the simplest solution is a fixed + length message:: + +- class mysocket: ++ class MySocket: + """demonstration class only + - coded for clarity, not efficiency + """ +@@ -189,8 +189,8 @@ + if sock is None: + self.sock = socket.socket( + socket.AF_INET, socket.SOCK_STREAM) +- else: +- self.sock = sock ++ else: ++ self.sock = sock + + def connect(self, host, port): + self.sock.connect((host, port)) +@@ -204,13 +204,15 @@ + totalsent = totalsent + sent + + def myreceive(self): +- msg = b'' +- while len(msg) < MSGLEN: +- chunk = self.sock.recv(MSGLEN-len(msg)) ++ chunks = [] ++ bytes_recd = 0 ++ while bytes_recd < MSGLEN: ++ chunk = self.sock.recv(min(MSGLEN - bytes_recd, 2048)) + if chunk == b'': + raise RuntimeError("socket connection broken") +- msg = msg + chunk +- return msg ++ chunks.append(chunk) ++ bytes_recd = bytes_recd + len(chunk) ++ return b''.join(chunks) + + The sending code here is usable for almost any messaging scheme - in Python you + send strings, and you can use ``len()`` to determine its length (even if it has +diff -r c0e311e010fc Doc/howto/urllib2.rst +--- a/Doc/howto/urllib2.rst ++++ b/Doc/howto/urllib2.rst +@@ -97,7 +97,7 @@ + ---- + + Sometimes you want to send data to a URL (often the URL will refer to a CGI +-(Common Gateway Interface) script [#]_ or other web application). With HTTP, ++(Common Gateway Interface) script or other web application). With HTTP, + this is often done using what's known as a **POST** request. This is often what + your browser does when you submit a HTML form that you filled in on the web. Not + all POSTs have to come from forms: you can use a POST to transmit arbitrary data +@@ -572,8 +572,6 @@ + + This document was reviewed and revised by John Lee. + +-.. [#] For an introduction to the CGI protocol see +- `Writing Web Applications in Python `_. + .. [#] Like Google for example. The *proper* way to use google from a program + is to use `PyGoogle `_ of course. See + `Voidspace Google `_ +diff -r c0e311e010fc Doc/howto/webservers.rst +--- a/Doc/howto/webservers.rst ++++ b/Doc/howto/webservers.rst +@@ -687,7 +687,7 @@ + The newest version of TurboGears, version 2.0, moves even further in direction + of WSGI support and a component-based architecture. TurboGears 2 is based on + the WSGI stack of another popular component-based web framework, `Pylons +-`_. ++`_. + + + Zope +diff -r c0e311e010fc Doc/library/2to3.rst +--- a/Doc/library/2to3.rst ++++ b/Doc/library/2to3.rst +@@ -392,7 +392,7 @@ + Replaces use of the :class:`set` constructor with set literals. This fixer + is optional. + +-.. 2to3fixer:: standard_error ++.. 2to3fixer:: standarderror + + Renames :exc:`StandardError` to :exc:`Exception`. + +diff -r c0e311e010fc Doc/library/__main__.rst +--- a/Doc/library/__main__.rst ++++ b/Doc/library/__main__.rst +@@ -12,7 +12,7 @@ + A module can discover whether or not it is running in the main scope by + checking its own ``__name__``, which allows a common idiom for conditionally + executing code in a module when it is run as a script or with ``python +--m`` but not when it is imported: ++-m`` but not when it is imported:: + + if __name__ == "__main__": + # execute only if run as a script +diff -r c0e311e010fc Doc/library/_thread.rst +--- a/Doc/library/_thread.rst ++++ b/Doc/library/_thread.rst +@@ -176,10 +176,6 @@ + * Calling :func:`sys.exit` or raising the :exc:`SystemExit` exception is + equivalent to calling :func:`_thread.exit`. + +-* Not all built-in functions that may block waiting for I/O allow other threads +- to run. (The most popular ones (:func:`time.sleep`, :meth:`io.FileIO.read`, +- :func:`select.select`) work as expected.) +- + * It is not possible to interrupt the :meth:`acquire` method on a lock --- the + :exc:`KeyboardInterrupt` exception will happen after the lock has been acquired. + +diff -r c0e311e010fc Doc/library/argparse.rst +--- a/Doc/library/argparse.rst ++++ b/Doc/library/argparse.rst +@@ -683,7 +683,7 @@ + actions can do just about anything with the command-line arguments associated with + them, though most actions simply add an attribute to the object returned by + :meth:`~ArgumentParser.parse_args`. The ``action`` keyword argument specifies +-how the command-line arguments should be handled. The supported actions are: ++how the command-line arguments should be handled. The supplied actions are: + + * ``'store'`` - This just stores the argument's value. This is the default + action. For example:: +@@ -757,28 +757,18 @@ + >>> parser.parse_args(['--version']) + PROG 2.0 + +-You can also specify an arbitrary action by passing an object that implements +-the Action API. The easiest way to do this is to extend +-:class:`argparse.Action`, supplying an appropriate ``__call__`` method. The +-``__call__`` method should accept four parameters: +- +-* ``parser`` - The ArgumentParser object which contains this action. +- +-* ``namespace`` - The :class:`Namespace` object that will be returned by +- :meth:`~ArgumentParser.parse_args`. Most actions add an attribute to this +- object. +- +-* ``values`` - The associated command-line arguments, with any type conversions +- applied. (Type conversions are specified with the type_ keyword argument to +- :meth:`~ArgumentParser.add_argument`.) +- +-* ``option_string`` - The option string that was used to invoke this action. +- The ``option_string`` argument is optional, and will be absent if the action +- is associated with a positional argument. ++You may also specify an arbitrary action by passing an Action subclass or ++other object that implements the same interface. The recommended way to do ++this is to extend :class:`Action`, overriding the ``__call__`` method ++and optionally the ``__init__`` method. + + An example of a custom action:: + + >>> class FooAction(argparse.Action): ++ ... def __init__(self, option_strings, dest, nargs=None, **kwargs): ++ ... if nargs is not None: ++ ... raise ValueError("nargs not allowed") ++ ... super(FooAction, self).__init__(option_strings, dest, **kwargs) + ... def __call__(self, parser, namespace, values, option_string=None): + ... print('%r %r %r' % (namespace, values, option_string)) + ... setattr(namespace, self.dest, values) +@@ -792,6 +782,7 @@ + >>> args + Namespace(bar='1', foo='2') + ++For more details, see :class:`Action`. + + nargs + ^^^^^ +@@ -1238,6 +1229,49 @@ + >>> parser.parse_args('--foo XXX'.split()) + Namespace(bar='XXX') + ++Action classes ++^^^^^^^^^^^^^^ ++ ++Action classes implement the Action API, a callable which returns a callable ++which processes arguments from the command-line. Any object which follows ++this API may be passed as the ``action`` parameter to ++:meth:`add_argument`. ++ ++.. class:: Action(option_strings, dest, nargs=None, const=None, default=None, ++ type=None, choices=None, required=False, help=None, ++ metavar=None) ++ ++Action objects are used by an ArgumentParser to represent the information ++needed to parse a single argument from one or more strings from the ++command line. The Action class must accept the two positional arguments ++plus any keyword arguments passed to :meth:`ArgumentParser.add_argument` ++except for the ``action`` itself. ++ ++Instances of Action (or return value of any callable to the ``action`` ++parameter) should have attributes "dest", "option_strings", "default", "type", ++"required", "help", etc. defined. The easiest way to ensure these attributes ++are defined is to call ``Action.__init__``. ++ ++Action instances should be callable, so subclasses must override the ++``__call__`` method, which should accept four parameters: ++ ++* ``parser`` - The ArgumentParser object which contains this action. ++ ++* ``namespace`` - The :class:`Namespace` object that will be returned by ++ :meth:`~ArgumentParser.parse_args`. Most actions add an attribute to this ++ object using :func:`setattr`. ++ ++* ``values`` - The associated command-line arguments, with any type conversions ++ applied. Type conversions are specified with the type_ keyword argument to ++ :meth:`~ArgumentParser.add_argument`. ++ ++* ``option_string`` - The option string that was used to invoke this action. ++ The ``option_string`` argument is optional, and will be absent if the action ++ is associated with a positional argument. ++ ++The ``__call__`` method may perform arbitrary actions, but will typically set ++attributes on the ``namespace`` based on ``dest`` and ``values``. ++ + + The parse_args() method + ----------------------- +diff -r c0e311e010fc Doc/library/asyncio-dev.rst +--- a/Doc/library/asyncio-dev.rst ++++ b/Doc/library/asyncio-dev.rst +@@ -9,6 +9,29 @@ + This page lists common traps and explains how to avoid them. + + ++.. _asyncio-debug-mode: ++ ++Debug mode of asyncio ++--------------------- ++ ++To enable the debug mode globally, set the environment variable ++:envvar:`PYTHONASYNCIODEBUG` to ``1``. Examples of effects of the debug mode: ++ ++* Log :ref:`coroutines defined but never "yielded from" ++ ` ++* :meth:`~BaseEventLoop.call_soon` and :meth:`~BaseEventLoop.call_at` methods ++ raise an exception if they are called from the wrong thread. ++* Log the execution time of the selector ++* Log callbacks taking more than 100 ms to be executed. The ++ :attr:`BaseEventLoop.slow_callback_duration` attribute is the minimum ++ duration in seconds of "slow" callbacks. ++ ++.. seealso:: ++ ++ The :meth:`BaseEventLoop.set_debug` method and the :ref:`asyncio logger ++ `. ++ ++ + .. _asyncio-multithreading: + + Concurrency and multithreading +@@ -80,20 +103,11 @@ + Detect coroutine objects never scheduled + ---------------------------------------- + +-When a coroutine function is called but not passed to :func:`async` or to the +-:class:`Task` constructor, it is not scheduled and it is probably a bug. +- +-To detect such bug, set the environment variable :envvar:`PYTHONASYNCIODEBUG` +-to ``1``. When the coroutine object is destroyed by the garbage collector, a +-log will be emitted with the traceback where the coroutine function was called. +-See the :ref:`asyncio logger `. +- +-The debug flag changes the behaviour of the :func:`coroutine` decorator. The +-debug flag value is only used when then coroutine function is defined, not when +-it is called. Coroutine functions defined before the debug flag is set to +-``True`` will not be tracked. For example, it is not possible to debug +-coroutines defined in the :mod:`asyncio` module, because the module must be +-imported before the flag value can be changed. ++When a coroutine function is called and its result is not passed to ++:func:`async` or to the :meth:`BaseEventLoop.create_task` method: the execution ++of the coroutine objet will never be scheduled and it is probably a bug. ++:ref:`Enable the debug mode of asyncio ` to :ref:`log a ++warning ` to detect it. + + Example with the bug:: + +@@ -107,20 +121,27 @@ + + Output in debug mode:: + +- Coroutine 'test' defined at test.py:4 was never yielded from ++ Coroutine test() at test.py:3 was never yielded from ++ Coroutine object created at (most recent call last): ++ File "test.py", line 7, in ++ test() + +-The fix is to call the :func:`async` function or create a :class:`Task` object +-with this coroutine object. ++The fix is to call the :func:`async` function or the ++:meth:`BaseEventLoop.create_task` method with the coroutine object. + ++.. seealso:: + +-Detect exceptions not consumed +------------------------------- ++ :ref:`Pending task destroyed `. ++ ++ ++Detect exceptions never consumed ++-------------------------------- + + Python usually calls :func:`sys.displayhook` on unhandled exceptions. If +-:meth:`Future.set_exception` is called, but the exception is not consumed, +-:func:`sys.displayhook` is not called. Instead, a log is emitted when the +-future is deleted by the garbage collector, with the traceback where the +-exception was raised. See the :ref:`asyncio logger `. ++:meth:`Future.set_exception` is called, but the exception is never consumed, ++:func:`sys.displayhook` is not called. Instead, a :ref:`a log is emitted ++` when the future is deleted by the garbage collector, with the ++traceback where the exception was raised. + + Example of unhandled exception:: + +@@ -136,16 +157,27 @@ + + Output:: + +- Future/Task exception was never retrieved: ++ Task exception was never retrieved ++ future: ++ source_traceback: Object created at (most recent call last): ++ File "test.py", line 10, in ++ asyncio.async(bug()) ++ File "asyncio/tasks.py", line 510, in async ++ task = loop.create_task(coro_or_future) + Traceback (most recent call last): +- File "/usr/lib/python3.4/asyncio/tasks.py", line 279, in _step ++ File "asyncio/tasks.py", line 244, in _step + result = next(coro) +- File "/usr/lib/python3.4/asyncio/tasks.py", line 80, in coro ++ File "coroutines.py", line 78, in __next__ ++ return next(self.gen) ++ File "asyncio/coroutines.py", line 141, in coro + res = func(*args, **kw) +- File "test.py", line 5, in bug ++ File "test.py", line 7, in bug + raise Exception("not consumed") + Exception: not consumed + ++:ref:`Enable the debug mode of asyncio ` to get the ++traceback where the task was created. ++ + There are different options to fix this issue. The first option is to chain to + coroutine in another coroutine and use classic try/except:: + +@@ -172,7 +204,7 @@ + See also the :meth:`Future.exception` method. + + +-Chain coroutines correctly ++Chain correctly coroutines + -------------------------- + + When a coroutine function calls other coroutine functions and tasks, they +@@ -223,7 +255,9 @@ + + (3) close file + (2) write into file +- Pending tasks at exit: {Task()} ++ Pending tasks at exit: {>} ++ Task was destroyed but it is pending! ++ task: > + + The loop stopped before the ``create()`` finished, ``close()`` has been called + before ``write()``, whereas coroutine functions were called in this order: +@@ -249,3 +283,29 @@ + yield from asyncio.sleep(2.0) + loop.stop() + ++ ++.. _asyncio-pending-task-destroyed: ++ ++Pending task destroyed ++---------------------- ++ ++If a pending task is destroyed, the execution of its wrapped :ref:`coroutine ++` did not complete. It is probably a bug and so a warning is logged. ++ ++Example of log:: ++ ++ Task was destroyed but it is pending! ++ source_traceback: Object created at (most recent call last): ++ File "test.py", line 17, in ++ task = asyncio.async(coro, loop=loop) ++ File "asyncio/tasks.py", line 510, in async ++ task = loop.create_task(coro_or_future) ++ task: > ++ ++:ref:`Enable the debug mode of asyncio ` to get the ++traceback where the task was created. ++ ++.. seealso:: ++ ++ :ref:`Detect coroutine objects never scheduled `. ++ +diff -r c0e311e010fc Doc/library/asyncio-eventloop.rst +--- a/Doc/library/asyncio-eventloop.rst ++++ b/Doc/library/asyncio-eventloop.rst +@@ -2,8 +2,8 @@ + + .. _asyncio-event-loop: + +-Event loops +-=========== ++Base Event Loop ++=============== + + The event loop is the central execution device provided by :mod:`asyncio`. + It provides multiple facilities, amongst which: +@@ -18,78 +18,9 @@ + + * Delegating costly function calls to a pool of threads. + +-Event loop policies and the default policy +------------------------------------------- ++.. class:: BaseEventLoop + +-Event loop management is abstracted with a *policy* pattern, to provide maximal +-flexibility for custom platforms and frameworks. Throughout the execution of a +-process, a single global policy object manages the event loops available to the +-process based on the calling context. A policy is an object implementing the +-:class:`AbstractEventLoopPolicy` interface. +- +-For most users of :mod:`asyncio`, policies never have to be dealt with +-explicitly, since the default global policy is sufficient. +- +-The default policy defines context as the current thread, and manages an event +-loop per thread that interacts with :mod:`asyncio`. The module-level functions +-:func:`get_event_loop` and :func:`set_event_loop` provide convenient access to +-event loops managed by the default policy. +- +-Event loop functions +--------------------- +- +-The following functions are convenient shortcuts to accessing the methods of the +-global policy. Note that this provides access to the default policy, unless an +-alternative policy was set by calling :func:`set_event_loop_policy` earlier in +-the execution of the process. +- +-.. function:: get_event_loop() +- +- Equivalent to calling ``get_event_loop_policy().get_event_loop()``. +- +-.. function:: set_event_loop(loop) +- +- Equivalent to calling ``get_event_loop_policy().set_event_loop(loop)``. +- +-.. function:: new_event_loop() +- +- Equivalent to calling ``get_event_loop_policy().new_event_loop()``. +- +-Event loop policy interface +---------------------------- +- +-An event loop policy must implement the following interface: +- +-.. class:: AbstractEventLoopPolicy +- +- .. method:: get_event_loop() +- +- Get the event loop for current context. Returns an event loop object +- implementing :class:`BaseEventLoop` interface, or raises an exception in case +- no event loop has been set for the current context and the current policy +- does not specify to create one. It should never return ``None``. +- +- .. method:: set_event_loop(loop) +- +- Set the event loop of the current context to *loop*. +- +- .. method:: new_event_loop() +- +- Create and return a new event loop object according to this policy's rules. +- If there's need to set this loop as the event loop of the current context, +- :meth:`set_event_loop` must be called explicitly. +- +-Access to the global loop policy +--------------------------------- +- +-.. function:: get_event_loop_policy() +- +- Get the current event loop policy. +- +-.. function:: set_event_loop_policy(policy) +- +- Set the current event loop policy. If *policy* is ``None``, the default +- policy is restored. ++ Base class of event loops. + + Run an event loop + ----------------- +@@ -102,8 +33,8 @@ + + Run until the :class:`Future` is done. + +- If the argument is a :ref:`coroutine `, it is wrapped +- in a :class:`Task`. ++ If the argument is a :ref:`coroutine object `, it is wrapped by ++ :func:`async`. + + Return the Future's result, or raise its exception. + +@@ -116,12 +47,19 @@ + Stop running the event loop. + + Every callback scheduled before :meth:`stop` is called will run. +- Callback scheduled after :meth:`stop` is called won't. However, those +- callbacks will run if :meth:`run_forever` is called again later. ++ Callbacks scheduled after :meth:`stop` is called will not run. ++ However, those callbacks will run if :meth:`run_forever` is called ++ again later. ++ ++.. method:: BaseEventLoop.is_closed() ++ ++ Returns ``True`` if the event loop was closed. ++ ++ .. versionadded:: 3.4.2 + + .. method:: BaseEventLoop.close() + +- Close the event loop. The loop should not be running. ++ Close the event loop. The loop must not be running. + + This clears the queues and shuts down the executor, but does not wait for + the executor to finish. +@@ -197,6 +135,24 @@ + The :func:`asyncio.sleep` function. + + ++Coroutines ++---------- ++ ++.. method:: BaseEventLoop.create_task(coro) ++ ++ Schedule the execution of a :ref:`coroutine object `: wrap it in ++ a future. Return a :class:`Task` object. ++ ++ Third-party event loops can use their own subclass of :class:`Task` for ++ interoperability. In this case, the result type is a subclass of ++ :class:`Task`. ++ ++ This method was added in Python 3.4.2. Use the :func:`async` function to ++ support also older Python versions. ++ ++ .. versionadded:: 3.4.2 ++ ++ + Creating connections + -------------------- + +@@ -305,11 +261,11 @@ + + .. method:: BaseEventLoop.create_server(protocol_factory, host=None, port=None, \*, family=socket.AF_UNSPEC, flags=socket.AI_PASSIVE, sock=None, backlog=100, ssl=None, reuse_address=None) + +- A :ref:`coroutine ` method which creates a TCP server bound to +- host and port. ++ Create a TCP server bound to host and port. Return a :class:`Server` object, ++ its :attr:`~Server.sockets` attribute contains created sockets. Use the ++ :meth:`Server.close` method to stop the server: close listening sockets. + +- The return value is a :class:`AbstractServer` object which can be used to stop +- the service. ++ This method is a :ref:`coroutine `. + + If *host* is an empty string or None all interfaces are assumed + and a list of multiple sockets will be returned (most likely +@@ -349,7 +305,6 @@ + Availability: UNIX. + + +- + Watch file descriptors + ---------------------- + +@@ -381,6 +336,8 @@ + representing the data received. The maximum amount of data to be received + at once is specified by *nbytes*. + ++ The socket *sock* must be non-blocking. ++ + This method is a :ref:`coroutine `. + + .. seealso:: +@@ -395,6 +352,8 @@ + an exception is raised, and there is no way to determine how much data, if + any, was successfully processed by the receiving end of the connection. + ++ The socket *sock* must be non-blocking. ++ + This method is a :ref:`coroutine `. + + .. seealso:: +@@ -411,6 +370,8 @@ + :py:data:`~socket.AF_INET` and :py:data:`~socket.AF_INET6` address families. + Use :meth:`getaddrinfo` to resolve the hostname asynchronously. + ++ The socket *sock* must be non-blocking. ++ + This method is a :ref:`coroutine `. + + .. seealso:: +@@ -428,6 +389,8 @@ + and *address* is the address bound to the socket on the other end of the + connection. + ++ The socket *sock* must be non-blocking. ++ + This method is a :ref:`coroutine `. + + .. seealso:: +@@ -455,11 +418,11 @@ + + .. method:: BaseEventLoop.connect_read_pipe(protocol_factory, pipe) + +- Register read pipe in eventloop. ++ Register read pipe in eventloop. Set the *pipe* to non-blocking mode. + + *protocol_factory* should instantiate object with :class:`Protocol` +- interface. pipe is file-like object already switched to nonblocking. +- Return pair (transport, protocol), where transport support ++ interface. *pipe* is a :term:`file-like object `. ++ Return pair ``(transport, protocol)``, where *transport* supports the + :class:`ReadTransport` interface. + + This method is a :ref:`coroutine `. +@@ -580,31 +543,55 @@ + + .. method:: BaseEventLoop.get_debug() + +- Get the debug mode (:class:`bool`) of the event loop, ``False`` by default. ++ Get the debug mode (:class:`bool`) of the event loop. ++ ++ The default value is ``True`` if the environment variable ++ :envvar:`PYTHONASYNCIODEBUG` is set to a non-empty string, ``False`` ++ otherwise. ++ ++ .. versionadded:: 3.4.2 + + .. method:: BaseEventLoop.set_debug(enabled: bool) + + Set the debug mode of the event loop. + ++ .. versionadded:: 3.4.2 ++ + .. seealso:: + +- The :ref:`Develop with asyncio ` section. +- ++ The :ref:`debug mode of asyncio `. + + Server + ------ + +-.. class:: AbstractServer ++.. class:: Server + +- Abstract server returned by :func:`BaseEventLoop.create_server`. ++ Server listening on sockets. ++ ++ Object created by the :meth:`BaseEventLoop.create_server` method and the ++ :func:`start_server` function. Don't instanciate the class directly. + + .. method:: close() + +- Stop serving. This leaves existing connections open. ++ Stop serving: close listening sockets and set the :attr:`sockets` ++ attribute to ``None``. ++ ++ The sockets that represent existing incoming client connections are ++ leaved open. ++ ++ The server is closed asynchonously, use the :meth:`wait_closed` coroutine ++ to wait until the server is closed. + + .. method:: wait_closed() + +- A :ref:`coroutine ` to wait until service is closed. ++ Wait until the :meth:`close` method completes. ++ ++ This method is a :ref:`coroutine `. ++ ++ .. attribute:: sockets ++ ++ List of :class:`socket.socket` objects the server is listening to, or ++ ``None`` if the server is closed. + + + Handle +@@ -618,7 +605,8 @@ + + .. method:: cancel() + +- Cancel the call. ++ Cancel the call. ++ + + + .. _asyncio-hello-world-callback: +@@ -636,7 +624,10 @@ + + loop = asyncio.get_event_loop() + loop.call_soon(print_and_repeat, loop) +- loop.run_forever() ++ try: ++ loop.run_forever() ++ finally: ++ loop.close() + + .. seealso:: + +@@ -664,5 +655,8 @@ + + print("Event loop running forever, press CTRL+c to interrupt.") + print("pid %s: send SIGINT or SIGTERM to exit." % os.getpid()) +- loop.run_forever() ++ try: ++ loop.run_forever() ++ finally: ++ loop.close() + +diff -r c0e311e010fc Doc/library/asyncio-eventloops.rst +--- /dev/null ++++ b/Doc/library/asyncio-eventloops.rst +@@ -0,0 +1,186 @@ ++.. currentmodule:: asyncio ++ ++Event loops ++=========== ++ ++Event loop functions ++-------------------- ++ ++The following functions are convenient shortcuts to accessing the methods of the ++global policy. Note that this provides access to the default policy, unless an ++alternative policy was set by calling :func:`set_event_loop_policy` earlier in ++the execution of the process. ++ ++.. function:: get_event_loop() ++ ++ Equivalent to calling ``get_event_loop_policy().get_event_loop()``. ++ ++.. function:: set_event_loop(loop) ++ ++ Equivalent to calling ``get_event_loop_policy().set_event_loop(loop)``. ++ ++.. function:: new_event_loop() ++ ++ Equivalent to calling ``get_event_loop_policy().new_event_loop()``. ++ ++ ++.. _asyncio-event-loops: ++ ++Available event loops ++--------------------- ++ ++asyncio currently provides two implementations of event loops: ++:class:`SelectorEventLoop` and :class:`ProactorEventLoop`. ++ ++.. class:: SelectorEventLoop ++ ++ Event loop based on the :mod:`selectors` module. Subclass of ++ :class:`BaseEventLoop`. ++ ++ Use the most efficient selector available on the platform. ++ ++.. class:: ProactorEventLoop ++ ++ Proactor event loop for Windows using "I/O Completion Ports" aka IOCP. ++ Subclass of :class:`BaseEventLoop`. ++ ++ Availability: Windows. ++ ++ .. seealso:: ++ ++ `MSDN documentation on I/O Completion Ports ++ `_. ++ ++Example to use a :class:`ProactorEventLoop` on Windows:: ++ ++ import asyncio, os ++ ++ if os.name == 'nt': ++ loop = asyncio.ProactorEventLoop() ++ asyncio.set_event_loop(loop) ++ ++.. _asyncio-platform-support: ++ ++Platform support ++---------------- ++ ++The :mod:`asyncio` module has been designed to be portable, but each platform ++still has subtle differences and may not support all :mod:`asyncio` features. ++ ++Windows ++^^^^^^^ ++ ++Common limits of Windows event loops: ++ ++- :meth:`~BaseEventLoop.create_unix_server` and ++ :meth:`~BaseEventLoop.create_unix_server` are not supported: the socket ++ family :data:`socket.AF_UNIX` is specific to UNIX ++- :meth:`~BaseEventLoop.add_signal_handler` and ++ :meth:`~BaseEventLoop.remove_signal_handler` are not supported ++- :meth:`EventLoopPolicy.set_child_watcher` is not supported. ++ :class:`ProactorEventLoop` supports subprocesses. It has only one ++ implementation to watch child processes, there is no need to configure it. ++ ++:class:`SelectorEventLoop` specific limits: ++ ++- :class:`~selectors.SelectSelector` is used but it only supports sockets, ++ see the `MSDN documentation of select ++ `_ ++- :meth:`~BaseEventLoop.add_reader` and :meth:`~BaseEventLoop.add_writer` only ++ accept file descriptors of sockets ++- Pipes are not supported ++ (ex: :meth:`~BaseEventLoop.connect_read_pipe`, ++ :meth:`~BaseEventLoop.connect_write_pipe`) ++- :ref:`Subprocesses ` are not supported ++ (ex: :meth:`~BaseEventLoop.subprocess_exec`, ++ :meth:`~BaseEventLoop.subprocess_shell`) ++ ++:class:`ProactorEventLoop` specific limits: ++ ++- SSL is not supported: :meth:`~BaseEventLoop.create_connection` and ++ :meth:`~BaseEventLoop.create_server` cannot be used with SSL for example ++- :meth:`~BaseEventLoop.create_datagram_endpoint` (UDP) is not supported ++- :meth:`~BaseEventLoop.add_reader` and :meth:`~BaseEventLoop.add_writer` are ++ not supported ++ ++The resolution of the monotonic clock on Windows is usually around 15.6 msec. ++The best resolution is 0.5 msec. The resolution depends on the hardware ++(availability of `HPET ++`_) and on the Windows ++configuration. See :ref:`asyncio delayed calls `. ++ ++ ++Mac OS X ++^^^^^^^^ ++ ++Character devices like PTY are only well supported since Mavericks (Mac OS ++10.9). They are not supported at all on Mac OS 10.5 and older. ++ ++On Mac OS 10.6, 10.7 and 10.8, the default event loop is ++:class:`SelectorEventLoop` which uses :class:`selectors.KqueueSelector`. ++:class:`selectors.KqueueSelector` does not support character devices on these ++versions. The :class:`SelectorEventLoop` can be used with ++:class:`~selectors.SelectSelector` or :class:`~selectors.PollSelector` to ++support character devices on these versions of Mac OS X. Example:: ++ ++ import asyncio ++ import selectors ++ ++ selector = selectors.SelectSelector() ++ loop = asyncio.SelectorEventLoop(selector) ++ asyncio.set_event_loop(loop) ++ ++ ++Event loop policies and the default policy ++------------------------------------------ ++ ++Event loop management is abstracted with a *policy* pattern, to provide maximal ++flexibility for custom platforms and frameworks. Throughout the execution of a ++process, a single global policy object manages the event loops available to the ++process based on the calling context. A policy is an object implementing the ++:class:`AbstractEventLoopPolicy` interface. ++ ++For most users of :mod:`asyncio`, policies never have to be dealt with ++explicitly, since the default global policy is sufficient. ++ ++The default policy defines context as the current thread, and manages an event ++loop per thread that interacts with :mod:`asyncio`. The module-level functions ++:func:`get_event_loop` and :func:`set_event_loop` provide convenient access to ++event loops managed by the default policy. ++ ++Event loop policy interface ++--------------------------- ++ ++An event loop policy must implement the following interface: ++ ++.. class:: AbstractEventLoopPolicy ++ ++ .. method:: get_event_loop() ++ ++ Get the event loop for the current context. Returns an event loop object ++ implementing the :class:`BaseEventLoop` interface, or raises an exception in case ++ no event loop has been set for the current context and the current policy ++ does not specify to create one. It should never return ``None``. ++ ++ .. method:: set_event_loop(loop) ++ ++ Set the event loop for the current context to *loop*. ++ ++ .. method:: new_event_loop() ++ ++ Create and return a new event loop object according to this policy's rules. ++ If there's need to set this loop as the event loop for the current context, ++ :meth:`set_event_loop` must be called explicitly. ++ ++Access to the global loop policy ++-------------------------------- ++ ++.. function:: get_event_loop_policy() ++ ++ Get the current event loop policy. ++ ++.. function:: set_event_loop_policy(policy) ++ ++ Set the current event loop policy. If *policy* is ``None``, the default ++ policy is restored. ++ +diff -r c0e311e010fc Doc/library/asyncio-protocol.rst +--- a/Doc/library/asyncio-protocol.rst ++++ b/Doc/library/asyncio-protocol.rst +@@ -272,8 +272,8 @@ + Connection callbacks + -------------------- + +-These callbacks may be called on :class:`Protocol` and +-:class:`SubprocessProtocol` instances: ++These callbacks may be called on :class:`Protocol`, :class:`DatagramProtocol` ++and :class:`SubprocessProtocol` instances: + + .. method:: BaseProtocol.connection_made(transport) + +@@ -291,10 +291,10 @@ + The latter means a regular EOF is received, or the connection was + aborted or closed by this side of the connection. + +-:meth:`connection_made` and :meth:`connection_lost` are called exactly once +-per successful connection. All other callbacks will be called between those +-two methods, which allows for easier resource management in your protocol +-implementation. ++:meth:`~BaseProtocol.connection_made` and :meth:`~BaseProtocol.connection_lost` ++are called exactly once per successful connection. All other callbacks will be ++called between those two methods, which allows for easier resource management ++in your protocol implementation. + + The following callbacks may be called only on :class:`SubprocessProtocol` + instances: +@@ -459,7 +459,7 @@ + example to raise an exception if the server is not listening, instead of + having to write a short coroutine to handle the exception and stop the + running loop. At :meth:`~BaseEventLoop.run_until_complete` exit, the loop is +-no more running, so there is no need to stop the loop in case of an error. ++no longer running, so there is no need to stop the loop in case of an error. + + Echo server + ----------- +diff -r c0e311e010fc Doc/library/asyncio-stream.rst +--- a/Doc/library/asyncio-stream.rst ++++ b/Doc/library/asyncio-stream.rst +@@ -34,28 +34,26 @@ + + .. function:: start_server(client_connected_cb, host=None, port=None, \*, loop=None, limit=None, **kwds) + +- Start a socket server, with a callback for each client connected. ++ Start a socket server, with a callback for each client connected. The return ++ value is the same as :meth:`~BaseEventLoop.create_server()`. + +- The first parameter, *client_connected_cb*, takes two parameters: ++ The *client_connected_cb* parameter is called with two parameters: + *client_reader*, *client_writer*. *client_reader* is a + :class:`StreamReader` object, while *client_writer* is a +- :class:`StreamWriter` object. This parameter can either be a plain callback +- function or a :ref:`coroutine function `; if it is a coroutine +- function, it will be automatically converted into a :class:`Task`. ++ :class:`StreamWriter` object. The *client_connected_cb* parameter can ++ either be a plain callback function or a :ref:`coroutine function ++ `; if it is a coroutine function, it will be automatically ++ converted into a :class:`Task`. + + The rest of the arguments are all the usual arguments to + :meth:`~BaseEventLoop.create_server()` except *protocol_factory*; most +- common are positional host and port, with various optional keyword arguments +- following. The return value is the same as +- :meth:`~BaseEventLoop.create_server()`. ++ common are positional *host* and *port*, with various optional keyword ++ arguments following. + + Additional optional keyword arguments are *loop* (to set the event loop + instance to use) and *limit* (to set the buffer limit passed to the + :class:`StreamReader`). + +- The return value is the same as :meth:`~BaseEventLoop.create_server()`, i.e. +- a :class:`AbstractServer` object which can be used to stop the service. +- + This function is a :ref:`coroutine `. + + .. function:: open_unix_connection(path=None, \*, loop=None, limit=None, **kwds) +diff -r c0e311e010fc Doc/library/asyncio-subprocess.rst +--- a/Doc/library/asyncio-subprocess.rst ++++ b/Doc/library/asyncio-subprocess.rst +@@ -1,20 +1,27 @@ + .. currentmodule:: asyncio + ++.. _asyncio-subprocess: ++ + Subprocess + ========== + +-Operating system support +------------------------- ++Windows event loop ++------------------ + +-On Windows, the default event loop uses :class:`selectors.SelectSelector` +-which only supports sockets. The :class:`ProactorEventLoop` should be used to +-support subprocesses. However, the latter does not support SSL. ++On Windows, the default event loop is :class:`SelectorEventLoop` which does not ++support subprocesses. :class:`ProactorEventLoop` should be used instead. ++Example to use it on Windows:: + +-On Mac OS X older than 10.9 (Mavericks), :class:`selectors.KqueueSelector` +-does not support character devices like PTY, whereas it is used by the +-default event loop. The :class:`SelectorEventLoop` can be used with +-:class:`SelectSelector` or :class:`PollSelector` to handle character +-devices on Mac OS X 10.6 (Snow Leopard) and later. ++ import asyncio, os ++ ++ if os.name == 'nt': ++ loop = asyncio.ProactorEventLoop() ++ asyncio.set_event_loop(loop) ++ ++.. seealso:: ++ ++ :ref:`Available event loops ` and :ref:`Platform ++ support `. + + + Create a subprocess: high-level API using Process +@@ -22,8 +29,8 @@ + + .. function:: create_subprocess_shell(cmd, stdin=None, stdout=None, stderr=None, loop=None, limit=None, \*\*kwds) + +- Run the shell command *cmd* given as a string. Return a :class:`~asyncio.subprocess.Process` +- instance. ++ Run the shell command *cmd*. See :meth:`BaseEventLoop.subprocess_shell` for ++ parameters. Return a :class:`~asyncio.subprocess.Process` instance. + + The optional *limit* parameter sets the buffer limit passed to the + :class:`StreamReader`. +@@ -32,7 +39,8 @@ + + .. function:: create_subprocess_exec(\*args, stdin=None, stdout=None, stderr=None, loop=None, limit=None, \*\*kwds) + +- Create a subprocess. Return a :class:`~asyncio.subprocess.Process` instance. ++ Create a subprocess. See :meth:`BaseEventLoop.subprocess_exec` for ++ parameters. Return a :class:`~asyncio.subprocess.Process` instance. + + The optional *limit* parameter sets the buffer limit passed to the + :class:`StreamReader`. +@@ -50,7 +58,9 @@ + + .. method:: BaseEventLoop.subprocess_exec(protocol_factory, \*args, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE, \*\*kwargs) + +- Create a subprocess from one or more string arguments, where the first string ++ Create a subprocess from one or more string arguments (character strings or ++ bytes strings encoded to the :ref:`filesystem encoding ++ `), where the first string + specifies the program to execute, and the remaining strings specify the + program's arguments. (Thus, together the string arguments form the + ``sys.argv`` value of the program, assuming it is a Python script.) This is +@@ -94,8 +104,9 @@ + + .. method:: BaseEventLoop.subprocess_shell(protocol_factory, cmd, \*, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE, \*\*kwargs) + +- Create a subprocess from *cmd*, which is a string using the platform's +- "shell" syntax. This is similar to the standard library ++ Create a subprocess from *cmd*, which is a character string or a bytes ++ string encoded to the :ref:`filesystem encoding `, ++ using the platform's "shell" syntax. This is similar to the standard library + :class:`subprocess.Popen` class called with ``shell=True``. + + See :meth:`~BaseEventLoop.subprocess_exec` for more details about +@@ -180,6 +191,10 @@ + process, or ``None``, if no data should be sent to the child. The type + of *input* must be bytes. + ++ If a :exc:`BrokenPipeError` or :exc:`ConnectionResetError` exception is ++ raised when writing *input* into stdin, the exception is ignored. It ++ occurs when the process exits before all data are written into stdin. ++ + :meth:`communicate` returns a tuple ``(stdoutdata, stderrdata)``. + + Note that if you want to send data to the process's stdin, you need to +@@ -194,6 +209,10 @@ + + This method is a :ref:`coroutine `. + ++ .. versionchanged:: 3.4.2 ++ The method now ignores :exc:`BrokenPipeError` and ++ :exc:`ConnectionResetError`. ++ + .. method:: kill() + + Kills the child. On Posix OSs the function sends :py:data:`SIGKILL` to +diff -r c0e311e010fc Doc/library/asyncio-sync.rst +--- a/Doc/library/asyncio-sync.rst ++++ b/Doc/library/asyncio-sync.rst +@@ -130,7 +130,7 @@ + Condition + ^^^^^^^^^ + +-.. class:: Condition(\*, loop=None) ++.. class:: Condition(lock=None, \*, loop=None) + + A Condition implementation, asynchronous equivalent to + :class:`threading.Condition`. +@@ -139,7 +139,9 @@ + allows one or more coroutines to wait until they are notified by another + coroutine. + +- A new :class:`Lock` object is created and used as the underlying lock. ++ If the *lock* argument is given and not ``None``, it must be a :class:`Lock` ++ object, and it is used as the underlying lock. Otherwise, ++ a new :class:`Lock` object is created and used as the underlying lock. + + .. method:: acquire() + +diff -r c0e311e010fc Doc/library/asyncio-task.rst +--- a/Doc/library/asyncio-task.rst ++++ b/Doc/library/asyncio-task.rst +@@ -51,8 +51,10 @@ + generator object, which doesn't do anything until you iterate over it. + In the case of a coroutine object, there are two basic ways to start + it running: call ``yield from coroutine`` from another coroutine +-(assuming the other coroutine is already running!), or convert it to a +-:class:`Task`. ++(assuming the other coroutine is already running!), or schedule its execution ++using the :func:`async` function or the :meth:`BaseEventLoop.create_task` ++method. ++ + + Coroutines (and tasks) can only run when the event loop is running. + +@@ -89,7 +91,10 @@ + yield from asyncio.sleep(2) + + loop = asyncio.get_event_loop() +- loop.run_until_complete(greet_every_two_seconds()) ++ try: ++ loop.run_until_complete(greet_every_two_seconds()) ++ finally: ++ loop.close() + + .. seealso:: + +@@ -142,6 +147,18 @@ + The operation is not allowed in this state. + + ++TimeoutError ++------------ ++ ++.. exception:: TimeoutError ++ ++ The operation exceeded the given deadline. ++ ++.. note:: ++ ++ This exception is different from the builtin :exc:`TimeoutError` exception! ++ ++ + Future + ------ + +@@ -241,12 +258,12 @@ + + loop = asyncio.get_event_loop() + future = asyncio.Future() +- asyncio.Task(slow_operation(future)) ++ asyncio.async(slow_operation(future)) + loop.run_until_complete(future) + print(future.result()) + loop.close() + +-The coroutine function is responsible of the computation (which takes 1 second) ++The coroutine function is responsible for the computation (which takes 1 second) + and it stores the result into the future. The + :meth:`~BaseEventLoop.run_until_complete` method waits for the completion of + the future. +@@ -277,7 +294,7 @@ + + loop = asyncio.get_event_loop() + future = asyncio.Future() +- asyncio.Task(slow_operation(future)) ++ asyncio.async(slow_operation(future)) + future.add_done_callback(got_result) + try: + loop.run_forever() +@@ -299,7 +316,33 @@ + + .. class:: Task(coro, \*, loop=None) + +- A coroutine object wrapped in a :class:`Future`. Subclass of :class:`Future`. ++ Schedule the execution of a :ref:`coroutine `: wrap it in a ++ future. A task is a subclass of :class:`Future`. ++ ++ A task is responsible to execute a coroutine object in an event loop. If ++ the wrapped coroutine yields from a future, the task suspends the execution ++ of the wrapped coroutine and waits for the completition of the future. When ++ the future is done, the execution of the wrapped coroutine restarts with the ++ result or the exception of the future. ++ ++ Event loops use cooperative scheduling: an event loop only runs one task at ++ the same time. Other tasks may run in parallel if other event loops are ++ running in different threads. While a task waits for the completion of a ++ future, the event loop executes a new task. ++ ++ The cancellation of a task is different than cancelling a future. Calling ++ :meth:`cancel` will throw a :exc:`~concurrent.futures.CancelledError` to the ++ wrapped coroutine. :meth:`~Future.cancelled` only returns ``True`` if the ++ wrapped coroutine did not catch the ++ :exc:`~concurrent.futures.CancelledError` exception, or raised a ++ :exc:`~concurrent.futures.CancelledError` exception. ++ ++ If a pending task is destroyed, the execution of its wrapped :ref:`coroutine ++ ` did not complete. It is probably a bug and a warning is ++ logged: see :ref:`Pending task destroyed `. ++ ++ Don't create directly :class:`Task` instances: use the :func:`async` ++ function or the :meth:`BaseEventLoop.create_task` method. + + .. classmethod:: all_tasks(loop=None) + +@@ -315,7 +358,27 @@ + + ``None`` is returned when called not in the context of a :class:`Task`. + +- .. method:: get_stack(self, \*, limit=None) ++ .. method:: cancel() ++ ++ Request this task to cancel itself. ++ ++ This arranges for a :exc:`~concurrent.futures.CancelledError` to be ++ thrown into the wrapped coroutine on the next cycle through the event ++ loop. The coroutine then has a chance to clean up or even deny the ++ request using try/except/finally. ++ ++ Contrary to :meth:`Future.cancel`, this does not guarantee that the task ++ will be cancelled: the exception might be caught and acted upon, delaying ++ cancellation of the task or preventing it completely. The task may also ++ return a value or raise a different exception. ++ ++ Immediately after this method is called, :meth:`~Future.cancelled` will ++ not return ``True`` (unless the task was already cancelled). A task will ++ be marked as cancelled when the wrapped coroutine terminates with a ++ :exc:`~concurrent.futures.CancelledError` exception (even if ++ :meth:`cancel` was not called). ++ ++ .. method:: get_stack(\*, limit=None) + + Return the list of stack frames for this task's coroutine. + +@@ -361,12 +424,11 @@ + f *= i + print("Task %s: factorial(%s) = %s" % (name, number, f)) + ++ loop = asyncio.get_event_loop() + tasks = [ +- asyncio.Task(factorial("A", 2)), +- asyncio.Task(factorial("B", 3)), +- asyncio.Task(factorial("C", 4))] +- +- loop = asyncio.get_event_loop() ++ asyncio.async(factorial("A", 2)), ++ asyncio.async(factorial("B", 3)), ++ asyncio.async(factorial("C", 4))] + loop.run_until_complete(asyncio.wait(tasks)) + loop.close() + +@@ -400,7 +462,8 @@ + Return an iterator whose values, when waited for, are :class:`Future` + instances. + +- Raises :exc:`TimeoutError` if the timeout occurs before all Futures are done. ++ Raises :exc:`asyncio.TimeoutError` if the timeout occurs before all Futures ++ are done. + + Example:: + +@@ -418,6 +481,10 @@ + + If the argument is a :class:`Future`, it is returned directly. + ++ .. seealso:: ++ ++ The :meth:`BaseEventLoop.create_task` method. ++ + .. function:: gather(\*coros_or_futures, loop=None, return_exceptions=False) + + Return a future aggregating results from the given coroutine objects or +@@ -488,6 +555,8 @@ + to complete. Coroutines will be wrapped in Tasks. Returns two sets of + :class:`Future`: (done, pending). + ++ The sequence *futures* must not be empty. ++ + *timeout* can be used to control the maximum number of seconds to wait before + returning. *timeout* can be an int or float. If *timeout* is not specified + or ``None``, there is no limit to the wait time. +@@ -521,25 +590,23 @@ + + .. note:: + +- This does not raise :exc:`TimeoutError`! Futures that aren't done when +- the timeout occurs are returned in the second set. ++ This does not raise :exc:`asyncio.TimeoutError`! Futures that aren't done ++ when the timeout occurs are returned in the second set. + + + .. function:: wait_for(fut, timeout, \*, loop=None) + + Wait for the single :class:`Future` or :ref:`coroutine object ` +- to complete, with timeout. If *timeout* is ``None``, block until the future ++ to complete with timeout. If *timeout* is ``None``, block until the future + completes. + + Coroutine will be wrapped in :class:`Task`. + + Returns result of the Future or coroutine. When a timeout occurs, it +- cancels the task and raises :exc:`TimeoutError`. To avoid the task ++ cancels the task and raises :exc:`asyncio.TimeoutError`. To avoid the task + cancellation, wrap it in :func:`shield`. + +- This function is a :ref:`coroutine `. ++ This function is a :ref:`coroutine `, usage:: + +- Usage:: ++ result = yield from asyncio.wait_for(fut, 60.0) + +- result = yield from asyncio.wait_for(fut, 60.0) +- +diff -r c0e311e010fc Doc/library/asyncio.rst +--- a/Doc/library/asyncio.rst ++++ b/Doc/library/asyncio.rst +@@ -39,12 +39,13 @@ + you absolutely, positively have to use a library that makes blocking + I/O calls. + +-Table of content: ++Table of contents: + + .. toctree:: + :maxdepth: 3 + + asyncio-eventloop.rst ++ asyncio-eventloops.rst + asyncio-task.rst + asyncio-protocol.rst + asyncio-stream.rst +@@ -54,6 +55,6 @@ + + .. seealso:: + +- The :mod:`asyncio` module was designed in the :PEP:`3156`. For a ++ The :mod:`asyncio` module was designed in :PEP:`3156`. For a + motivational primer on transports and protocols, see :PEP:`3153`. + +diff -r c0e311e010fc Doc/library/asyncore.rst +--- a/Doc/library/asyncore.rst ++++ b/Doc/library/asyncore.rst +@@ -216,6 +216,10 @@ + empty bytes object implies that the channel has been closed from the + other end. + ++ Note that :meth:`recv` may raise :exc:`BlockingIOError` , even though ++ :func:`select.select` or :func:`select.poll` has reported the socket ++ ready for reading. ++ + + .. method:: listen(backlog) + +diff -r c0e311e010fc Doc/library/collections.abc.rst +--- a/Doc/library/collections.abc.rst ++++ b/Doc/library/collections.abc.rst +@@ -173,7 +173,7 @@ + + (2) + To override the comparisons (presumably for speed, as the +- semantics are fixed), redefine :meth:`__le__` and ++ semantics are fixed), redefine :meth:`__le__` and :meth:`__ge__`, + then the other operations will automatically follow suit. + + (3) +diff -r c0e311e010fc Doc/library/contextlib.rst +--- a/Doc/library/contextlib.rst ++++ b/Doc/library/contextlib.rst +@@ -371,7 +371,7 @@ + with ExitStack() as stack: + for resource in resources: + stack.enter_context(resource) +- if need_special resource: ++ if need_special_resource(): + special = acquire_special_resource() + stack.callback(release_special_resource, special) + # Perform operations that use the acquired resources +diff -r c0e311e010fc Doc/library/datetime.rst +--- a/Doc/library/datetime.rst ++++ b/Doc/library/datetime.rst +@@ -1687,11 +1687,11 @@ + .. seealso:: + + `pytz `_ +- The standard library has no :class:`tzinfo` instances except for UTC, but +- there exists a third-party library which brings the *IANA timezone +- database* (also known as the Olson database) to Python: *pytz*. +- +- *pytz* contains up-to-date information and its usage is recommended. ++ The standard library has :class:`timezone` class for handling arbitrary ++ fixed offsets from UTC and :attr:`timezone.utc` as UTC timezone instance. ++ ++ *pytz* library brings the *IANA timezone database* (also known as the ++ Olson database) to Python and its usage is recommended. + + `IANA timezone database `_ + The Time Zone Database (often called tz or zoneinfo) contains code and +@@ -1728,6 +1728,8 @@ + *offset*, HH and MM are two digits of ``offset.hours`` and + ``offset.minutes`` respectively. + ++ .. versionadded:: 3.2 ++ + .. method:: timezone.utcoffset(dt) + + Return the fixed value specified when the :class:`timezone` instance is +diff -r c0e311e010fc Doc/library/dbm.rst +--- a/Doc/library/dbm.rst ++++ b/Doc/library/dbm.rst +@@ -222,6 +222,9 @@ + When the database has been opened in fast mode, this method forces any + unwritten data to be written to the disk. + ++ .. method:: gdbm.close() ++ ++ Close the ``gdbm`` database. + + :mod:`dbm.ndbm` --- Interface based on ndbm + ------------------------------------------- +@@ -253,7 +256,7 @@ + + .. function:: open(filename[, flag[, mode]]) + +- Open a dbm database and return a ``dbm`` object. The *filename* argument is the ++ Open a dbm database and return a ``ndbm`` object. The *filename* argument is the + name of the database file (without the :file:`.dir` or :file:`.pag` extensions). + + The optional *flag* argument must be one of these values: +@@ -278,6 +281,12 @@ + database has to be created. It defaults to octal ``0o666`` (and will be + modified by the prevailing umask). + ++ In addition to the dictionary-like methods, ``ndbm`` objects ++ provide the following method: ++ ++ .. method:: ndbm.close() ++ ++ Close the ``ndbm`` database. + + + :mod:`dbm.dumb` --- Portable DBM implementation +@@ -325,9 +334,14 @@ + + In addition to the methods provided by the + :class:`collections.abc.MutableMapping` class, :class:`dumbdbm` objects +- provide the following method: ++ provide the following methods: + + .. method:: dumbdbm.sync() + + Synchronize the on-disk directory and data files. This method is called + by the :meth:`Shelve.sync` method. ++ ++ .. method:: dumbdbm.close() ++ ++ Close the ``dumbdbm`` database. ++ +diff -r c0e311e010fc Doc/library/exceptions.rst +--- a/Doc/library/exceptions.rst ++++ b/Doc/library/exceptions.rst +@@ -274,9 +274,10 @@ + + Raised when the result of an arithmetic operation is too large to be + represented. This cannot occur for integers (which would rather raise +- :exc:`MemoryError` than give up). Because of the lack of standardization of +- floating point exception handling in C, most floating point operations also +- aren't checked. ++ :exc:`MemoryError` than give up). However, for historical reasons, ++ OverflowError is sometimes raised for integers that are outside a required ++ range. Because of the lack of standardization of floating point exception ++ handling in C, most floating point operations are not checked. + + + .. exception:: ReferenceError +@@ -457,10 +458,6 @@ + + .. exception:: IOError + +-.. exception:: VMSError +- +- Only available on VMS. +- + .. exception:: WindowsError + + Only available on Windows. +diff -r c0e311e010fc Doc/library/functions.rst +--- a/Doc/library/functions.rst ++++ b/Doc/library/functions.rst +@@ -410,6 +410,7 @@ + See :func:`ast.literal_eval` for a function that can safely evaluate strings + with expressions containing only literals. + ++.. index:: builtin: exec + + .. function:: exec(object[, globals[, locals]]) + +@@ -742,7 +743,8 @@ + .. function:: len(s) + + Return the length (the number of items) of an object. The argument may be a +- sequence (string, tuple or list) or a mapping (dictionary). ++ sequence (such as a string, bytes, tuple, list, or range) or a collection ++ (such as a dictionary, set, or frozen set). + + + .. _func-list: +@@ -1104,9 +1106,11 @@ + + Return a property attribute. + +- *fget* is a function for getting an attribute value, likewise *fset* is a +- function for setting, and *fdel* a function for del'ing, an attribute. Typical +- use is to define a managed attribute ``x``:: ++ *fget* is a function for getting an attribute value. *fset* is a function ++ for setting an attribute value. *fdel* is a function for deleting an attribute ++ value. And *doc* creates a docstring for the attribute. ++ ++ A typical use is to define a managed attribute ``x``:: + + class C: + def __init__(self): +@@ -1114,13 +1118,16 @@ + + def getx(self): + return self._x ++ + def setx(self, value): + self._x = value ++ + def delx(self): + del self._x ++ + x = property(getx, setx, delx, "I'm the 'x' property.") + +- If then *c* is an instance of *C*, ``c.x`` will invoke the getter, ++ If *c* is an instance of *C*, ``c.x`` will invoke the getter, + ``c.x = value`` will invoke the setter and ``del c.x`` the deleter. + + If given, *doc* will be the docstring of the property attribute. Otherwise, the +@@ -1136,8 +1143,9 @@ + """Get the current voltage.""" + return self._voltage + +- turns the :meth:`voltage` method into a "getter" for a read-only attribute +- with the same name. ++ The ``@property`` decorator turns the :meth:`voltage` method into a "getter" ++ for a read-only attribute with the same name, and it sets the docstring for ++ *voltage* to "Get the current voltage." + + A property object has :attr:`~property.getter`, :attr:`~property.setter`, + and :attr:`~property.deleter` methods usable as decorators that create a +@@ -1165,7 +1173,7 @@ + additional functions the same name as the original property (``x`` in this + case.) + +- The returned property also has the attributes ``fget``, ``fset``, and ++ The returned property object also has the attributes ``fget``, ``fset``, and + ``fdel`` corresponding to the constructor arguments. + + +diff -r c0e311e010fc Doc/library/functools.rst +--- a/Doc/library/functools.rst ++++ b/Doc/library/functools.rst +@@ -413,9 +413,10 @@ + + .. decorator:: wraps(wrapped, assigned=WRAPPER_ASSIGNMENTS, updated=WRAPPER_UPDATES) + +- This is a convenience function for invoking ``partial(update_wrapper, +- wrapped=wrapped, assigned=assigned, updated=updated)`` as a function decorator +- when defining a wrapper function. For example: ++ This is a convenience function for invoking :func:`update_wrapper` as a ++ function decorator when defining a wrapper function. It is equivalent to ++ ``partial(update_wrapper, wrapped=wrapped, assigned=assigned, updated=updated)``. ++ For example:: + + >>> from functools import wraps + >>> def my_decorator(f): +diff -r c0e311e010fc Doc/library/hashlib.rst +--- a/Doc/library/hashlib.rst ++++ b/Doc/library/hashlib.rst +@@ -180,9 +180,9 @@ + ----------------------- + + Key derivation and key stretching algorithms are designed for secure password +-hashing. Naive algorithms such as ``sha1(password)`` are not resistant +-against brute-force attacks. A good password hashing function must be tunable, +-slow and include a salt. ++hashing. Naive algorithms such as ``sha1(password)`` are not resistant against ++brute-force attacks. A good password hashing function must be tunable, slow, and ++include a `salt `_. + + + .. function:: pbkdf2_hmac(name, password, salt, rounds, dklen=None) +@@ -197,8 +197,7 @@ + a proper source, e.g. :func:`os.urandom`. + + The number of *rounds* should be chosen based on the hash algorithm and +- computing power. As of 2013 a value of at least 100,000 rounds of SHA-256 +- have been suggested. ++ computing power. As of 2013, at least 100,000 rounds of SHA-256 is suggested. + + *dklen* is the length of the derived key. If *dklen* is ``None`` then the + digest size of the hash algorithm *name* is used, e.g. 64 for SHA-512. +@@ -210,9 +209,11 @@ + + .. versionadded:: 3.4 + +- .. note:: A fast implementation of *pbkdf2_hmac* is available with OpenSSL. +- The Python implementation uses an inline version of :mod:`hmac`. It is +- about three times slower and doesn't release the GIL. ++ .. note:: ++ ++ A fast implementation of *pbkdf2_hmac* is available with OpenSSL. The ++ Python implementation uses an inline version of :mod:`hmac`. It is about ++ three times slower and doesn't release the GIL. + + + .. seealso:: +diff -r c0e311e010fc Doc/library/hmac.rst +--- a/Doc/library/hmac.rst ++++ b/Doc/library/hmac.rst +@@ -25,7 +25,7 @@ + .. versionchanged:: 3.4 + Parameter *key* can be a bytes or bytearray object. + Parameter *msg* can be of any type supported by :mod:`hashlib`. +- Paramter *digestmod* can be the name of a hash algorithm. ++ Parameter *digestmod* can be the name of a hash algorithm. + + .. deprecated:: 3.4 + MD5 as implicit default digest for *digestmod* is deprecated. +diff -r c0e311e010fc Doc/library/io.rst +--- a/Doc/library/io.rst ++++ b/Doc/library/io.rst +@@ -289,7 +289,7 @@ + most *size* bytes will be read. + + The line terminator is always ``b'\n'`` for binary files; for text files, +- the *newlines* argument to :func:`open` can be used to select the line ++ the *newline* argument to :func:`open` can be used to select the line + terminator(s) recognized. + + .. method:: readlines(hint=-1) +@@ -353,6 +353,12 @@ + is usual for each of the lines provided to have a line separator at the + end. + ++ .. method:: __del__() ++ ++ Prepare for object destruction. :class:`IOBase` provides a default ++ implementation of this method that calls the instance's ++ :meth:`~IOBase.close` method. ++ + + .. class:: RawIOBase + +diff -r c0e311e010fc Doc/library/logging.config.rst +--- a/Doc/library/logging.config.rst ++++ b/Doc/library/logging.config.rst +@@ -105,7 +105,7 @@ + + :param disable_existing_loggers: If specified as ``False``, loggers which + exist when this call is made are left +- alone. The default is ``True`` because this ++ enabled. The default is ``True`` because this + enables old behaviour in a backward- + compatible way. This behaviour is to + disable any existing loggers unless they or +diff -r c0e311e010fc Doc/library/logging.handlers.rst +--- a/Doc/library/logging.handlers.rst ++++ b/Doc/library/logging.handlers.rst +@@ -850,10 +850,27 @@ + credentials, you should also specify secure=True so that your userid and + password are not passed in cleartext across the wire. + ++ .. method:: mapLogRecord(record) ++ ++ Provides a dictionary, based on ``record``, which is to be URL-encoded ++ and sent to the web server. The default implementation just returns ++ ``record.__dict__``. This method can be overridden if e.g. only a ++ subset of :class:`~logging.LogRecord` is to be sent to the web server, or ++ if more specific customization of what's sent to the server is required. + + .. method:: emit(record) + +- Sends the record to the Web server as a percent-encoded dictionary. ++ Sends the record to the Web server as an URL-encoded dictionary. The ++ :meth:`mapLogRecord` method is used to convert the record to the ++ dictionary to be sent. ++ ++ .. note:: Since preparing a record for sending it to a Web server is not ++ the same as a generic formatting operation, using ++ :meth:`~logging.Handler.setFormatter` to specify a ++ :class:`~logging.Formatter` for a :class:`HTTPHandler` has no effect. ++ Instead of calling :meth:`~logging.Handler.format`, this handler calls ++ :meth:`mapLogRecord` and then :func:`urllib.parse.urlencode` to encode the ++ dictionary in a form suitable for sending to a Web server. + + + .. _queue-handler: +diff -r c0e311e010fc Doc/library/logging.rst +--- a/Doc/library/logging.rst ++++ b/Doc/library/logging.rst +@@ -1049,6 +1049,11 @@ + of the defined levels is passed in, the corresponding string representation is + returned. Otherwise, the string 'Level %s' % lvl is returned. + ++ .. versionchanged:: 3.4 ++ In Python versions earlier than 3.4, this function could also be passed a ++ text level, and would return the corresponding numeric value of the level. ++ This undocumented behaviour was a mistake, and has been removed in Python ++ 3.4. + + .. function:: makeLogRecord(attrdict) + +diff -r c0e311e010fc Doc/library/multiprocessing.rst +--- a/Doc/library/multiprocessing.rst ++++ b/Doc/library/multiprocessing.rst +@@ -262,8 +262,10 @@ + + def f(l, i): + l.acquire() +- print('hello world', i) +- l.release() ++ try: ++ print('hello world', i) ++ finally: ++ l.release() + + if __name__ == '__main__': + lock = Lock() +@@ -396,7 +398,7 @@ + print(res.get(timeout=1)) # prints "100" + + # make worker sleep for 10 secs +- res = pool.apply_async(sleep, 10) ++ res = pool.apply_async(sleep, [10]) + print(res.get(timeout=1)) # raises multiprocessing.TimeoutError + + # exiting the 'with'-block has stopped the pool +diff -r c0e311e010fc Doc/library/operator.rst +--- a/Doc/library/operator.rst ++++ b/Doc/library/operator.rst +@@ -228,15 +228,6 @@ + + Set the value of *a* at index *b* to *c*. + +-Example: Build a dictionary that maps the ordinals from ``0`` to ``255`` to +-their character equivalents. +- +- >>> d = {} +- >>> keys = range(256) +- >>> vals = map(chr, keys) +- >>> map(operator.setitem, [d]*len(keys), keys, vals) # doctest: +SKIP +- +-.. XXX: find a better, readable, example + + .. function:: length_hint(obj, default=0) + +diff -r c0e311e010fc Doc/library/os.path.rst +--- a/Doc/library/os.path.rst ++++ b/Doc/library/os.path.rst +@@ -188,7 +188,7 @@ + .. function:: islink(path) + + Return ``True`` if *path* refers to a directory entry that is a symbolic link. +- Always ``False`` if symbolic links are not supported. ++ Always ``False`` if symbolic links are not supported by the python runtime. + + + .. function:: ismount(path) +diff -r c0e311e010fc Doc/library/os.rst +--- a/Doc/library/os.rst ++++ b/Doc/library/os.rst +@@ -53,7 +53,7 @@ + .. data:: name + + The name of the operating system dependent module imported. The following +- names have currently been registered: ``'posix'``, ``'nt'``, ``'mac'``, ++ names have currently been registered: ``'posix'``, ``'nt'``, + ``'ce'``, ``'java'``. + + .. seealso:: +@@ -65,6 +65,7 @@ + + + .. _os-filenames: ++.. _filesystem-encoding: + + File Names, Command Line Arguments, and Environment Variables + ------------------------------------------------------------- +@@ -379,7 +380,7 @@ + + .. index:: single: user; id + +- Return the current process's user id. ++ Return the current process's real user id. + + Availability: Unix. + +@@ -764,8 +765,14 @@ + + .. function:: fstat(fd) + +- Return status for file descriptor *fd*, like :func:`~os.stat`. As of Python +- 3.3, this is equivalent to ``os.stat(fd)``. ++ Get the status of the file descriptor *fd*. Return a :class:`stat_result` ++ object. ++ ++ As of Python 3.3, this is equivalent to ``os.stat(fd)``. ++ ++ .. seealso:: ++ ++ The :func:`stat` function. + + Availability: Unix, Windows. + +@@ -1087,8 +1094,16 @@ + All platforms support sockets as *out* file descriptor, and some platforms + allow other types (e.g. regular file, pipe) as well. + ++ Cross-platform applications should not use *headers*, *trailers* and *flags* ++ arguments. ++ + Availability: Unix. + ++ .. note:: ++ ++ For a higher-level wrapper of :func:`sendfile`, see ++ :mod:`socket.socket.sendfile`. ++ + .. versionadded:: 3.3 + + +@@ -1569,17 +1584,25 @@ + Added support for specifying an open file descriptor for *path*. + + +-.. function:: lstat(path, *, dir_fd=None) ++.. function:: lstat(path, \*, dir_fd=None) + + Perform the equivalent of an :c:func:`lstat` system call on the given path. +- Similar to :func:`~os.stat`, but does not follow symbolic links. On +- platforms that do not support symbolic links, this is an alias for +- :func:`~os.stat`. As of Python 3.3, this is equivalent to ``os.stat(path, +- dir_fd=dir_fd, follow_symlinks=False)``. ++ Similar to :func:`~os.stat`, but does not follow symbolic links. Return a ++ :class:`stat_result` object. ++ ++ On platforms that do not support symbolic links, this is an alias for ++ :func:`~os.stat`. ++ ++ As of Python 3.3, this is equivalent to ``os.stat(path, dir_fd=dir_fd, ++ follow_symlinks=False)``. + + This function can also support :ref:`paths relative to directory descriptors + `. + ++ .. seealso:: ++ ++ The :func:`stat` function. ++ + .. versionchanged:: 3.2 + Added support for Windows 6.0 (Vista) symbolic links. + +@@ -1846,55 +1869,116 @@ + The *dir_fd* parameter. + + +-.. function:: stat(path, *, dir_fd=None, follow_symlinks=True) +- +- Perform the equivalent of a :c:func:`stat` system call on the given path. +- *path* may be specified as either a string or as an open file descriptor. +- (This function normally follows symlinks; to stat a symlink add the argument +- ``follow_symlinks=False``, or use :func:`lstat`.) +- +- The return value is an object whose attributes correspond roughly +- to the members of the :c:type:`stat` structure, namely: +- +- * :attr:`st_mode` - protection bits, +- * :attr:`st_ino` - inode number, +- * :attr:`st_dev` - device, +- * :attr:`st_nlink` - number of hard links, +- * :attr:`st_uid` - user id of owner, +- * :attr:`st_gid` - group id of owner, +- * :attr:`st_size` - size of file, in bytes, +- * :attr:`st_atime` - time of most recent access expressed in seconds, +- * :attr:`st_mtime` - time of most recent content modification +- expressed in seconds, +- * :attr:`st_ctime` - platform dependent; time of most recent metadata +- change on Unix, or the time of creation on Windows, expressed in seconds +- * :attr:`st_atime_ns` - time of most recent access +- expressed in nanoseconds as an integer, +- * :attr:`st_mtime_ns` - time of most recent content modification +- expressed in nanoseconds as an integer, +- * :attr:`st_ctime_ns` - platform dependent; time of most recent metadata +- change on Unix, or the time of creation on Windows, +- expressed in nanoseconds as an integer +- +- On some Unix systems (such as Linux), the following attributes may also be +- available: +- +- * :attr:`st_blocks` - number of 512-byte blocks allocated for file +- * :attr:`st_blksize` - filesystem blocksize for efficient file system I/O +- * :attr:`st_rdev` - type of device if an inode device +- * :attr:`st_flags` - user defined flags for file +- +- On other Unix systems (such as FreeBSD), the following attributes may be +- available (but may be only filled out if root tries to use them): +- +- * :attr:`st_gen` - file generation number +- * :attr:`st_birthtime` - time of file creation +- +- On Mac OS systems, the following attributes may also be available: +- +- * :attr:`st_rsize` +- * :attr:`st_creator` +- * :attr:`st_type` ++.. function:: stat(path, \*, dir_fd=None, follow_symlinks=True) ++ ++ Get the status of a file or a file descriptor. Perform the equivalent of a ++ :c:func:`stat` system call on the given path. *path* may be specified as ++ either a string or as an open file descriptor. Return a :class:`stat_result` ++ object. ++ ++ This function normally follows symlinks; to stat a symlink add the argument ++ ``follow_symlinks=False``, or use :func:`lstat`. ++ ++ This function can support :ref:`specifying a file descriptor ` and ++ :ref:`not following symlinks `. ++ ++ .. index:: module: stat ++ ++ Example:: ++ ++ >>> import os ++ >>> statinfo = os.stat('somefile.txt') ++ >>> statinfo ++ os.stat_result(st_mode=33188, st_ino=7876932, st_dev=234881026, ++ st_nlink=1, st_uid=501, st_gid=501, st_size=264, st_atime=1297230295, ++ st_mtime=1297230027, st_ctime=1297230027) ++ >>> statinfo.st_size ++ 264 ++ ++ Availability: Unix, Windows. ++ ++ .. seealso:: ++ ++ :func:`fstat` and :func:`lstat` functions. ++ ++ .. versionadded:: 3.3 ++ Added the *dir_fd* and *follow_symlinks* arguments, specifying a file ++ descriptor instead of a path. ++ ++ ++.. class:: stat_result ++ ++ Object whose attributes correspond roughly to the members of the ++ :c:type:`stat` structure. It is used for the result of :func:`os.stat`, ++ :func:`os.fstat` and :func:`os.lstat`. ++ ++ Attributes: ++ ++ .. attribute:: st_mode ++ ++ File mode: file type and file mode bits (permissions). ++ ++ .. attribute:: st_ino ++ ++ Inode number. ++ ++ .. attribute:: st_dev ++ ++ Identifier of the device on which this file resides. ++ ++ .. attribute:: st_nlink ++ ++ Number of hard links. ++ ++ .. attribute:: st_uid ++ ++ User identifier of the file owner. ++ ++ .. attribute:: st_gid ++ ++ Group identifier of the file owner. ++ ++ .. attribute:: st_size ++ ++ Size of the file in bytes, if it is a regular file or a symbolic link. ++ The size of a symbolic link is the length of the pathname it contains, ++ without a terminating null byte. ++ ++ Timestamps: ++ ++ .. attribute:: st_atime ++ ++ Time of most recent access expressed in seconds. ++ ++ .. attribute:: st_mtime ++ ++ Time of most recent content modification expressed in seconds. ++ ++ .. attribute:: st_ctime ++ ++ Platform dependent: ++ ++ * the time of most recent metadata change on Unix, ++ * the time of creation on Windows, expressed in seconds. ++ ++ .. attribute:: st_atime_ns ++ ++ Time of most recent access expressed in nanoseconds as an integer. ++ ++ .. attribute:: st_mtime_ns ++ ++ Time of most recent content modification expressed in nanoseconds as an ++ integer. ++ ++ .. attribute:: st_ctime_ns ++ ++ Platform dependent: ++ ++ * the time of most recent metadata change on Unix, ++ * the time of creation on Windows, expressed in nanoseconds as an ++ integer. ++ ++ See also the :func:`stat_float_times` function. + + .. note:: + +@@ -1904,6 +1988,7 @@ + or FAT32 file systems, :attr:`st_mtime` has 2-second resolution, and + :attr:`st_atime` has only 1-day resolution. See your operating system + documentation for details. ++ + Similarly, although :attr:`st_atime_ns`, :attr:`st_mtime_ns`, + and :attr:`st_ctime_ns` are always expressed in nanoseconds, many + systems do not provide nanosecond precision. On systems that do +@@ -1913,41 +1998,68 @@ + If you need the exact timestamps you should always use + :attr:`st_atime_ns`, :attr:`st_mtime_ns`, and :attr:`st_ctime_ns`. + +- For backward compatibility, the return value of :func:`~os.stat` is also ++ On some Unix systems (such as Linux), the following attributes may also be ++ available: ++ ++ .. attribute:: st_blocks ++ ++ Number of 512-byte blocks allocated for file. ++ This may be smaller than :attr:`st_size`/512 when the file has holes. ++ ++ .. attribute:: st_blksize ++ ++ "Preferred" blocksize for efficient file system I/O. Writing to a file in ++ smaller chunks may cause an inefficient read-modify-rewrite. ++ ++ .. attribute:: st_rdev ++ ++ Type of device if an inode device. ++ ++ .. attribute:: st_flags ++ ++ User defined flags for file. ++ ++ On other Unix systems (such as FreeBSD), the following attributes may be ++ available (but may be only filled out if root tries to use them): ++ ++ .. attribute:: st_gen ++ ++ File generation number. ++ ++ .. attribute:: st_birthtime ++ ++ Time of file creation. ++ ++ On Mac OS systems, the following attributes may also be available: ++ ++ .. attribute:: st_rsize ++ ++ Real size of the file. ++ ++ .. attribute:: st_creator ++ ++ Creator of the file. ++ ++ .. attribute:: st_type ++ ++ File type. ++ ++ The standard module :mod:`stat` defines functions and constants that are ++ useful for extracting information from a :c:type:`stat` structure. (On ++ Windows, some items are filled with dummy values.) ++ ++ For backward compatibility, a :class:`stat_result` instance is also + accessible as a tuple of at least 10 integers giving the most important (and + portable) members of the :c:type:`stat` structure, in the order + :attr:`st_mode`, :attr:`st_ino`, :attr:`st_dev`, :attr:`st_nlink`, + :attr:`st_uid`, :attr:`st_gid`, :attr:`st_size`, :attr:`st_atime`, + :attr:`st_mtime`, :attr:`st_ctime`. More items may be added at the end by +- some implementations. +- +- This function can support :ref:`specifying a file descriptor ` and +- :ref:`not following symlinks `. +- +- .. index:: module: stat +- +- The standard module :mod:`stat` defines functions and constants that are useful +- for extracting information from a :c:type:`stat` structure. (On Windows, some +- items are filled with dummy values.) +- +- Example:: +- +- >>> import os +- >>> statinfo = os.stat('somefile.txt') +- >>> statinfo +- posix.stat_result(st_mode=33188, st_ino=7876932, st_dev=234881026, +- st_nlink=1, st_uid=501, st_gid=501, st_size=264, st_atime=1297230295, +- st_mtime=1297230027, st_ctime=1297230027) +- >>> statinfo.st_size +- 264 +- +- Availability: Unix, Windows. ++ some implementations. For compatibility with older Python versions, ++ accessing :class:`stat_result` as a tuple always returns integers. + + .. versionadded:: 3.3 +- Added the *dir_fd* and *follow_symlinks* arguments, +- specifying a file descriptor instead of a path, +- and the :attr:`st_atime_ns`, :attr:`st_mtime_ns`, +- and :attr:`st_ctime_ns` members. ++ Added the :attr:`st_atime_ns`, :attr:`st_mtime_ns`, and ++ :attr:`st_ctime_ns` members. + + + .. function:: stat_float_times([newvalue]) +@@ -2228,9 +2340,11 @@ + + If optional argument *topdown* is ``True`` or not specified, the triple for a + directory is generated before the triples for any of its subdirectories +- (directories are generated top-down). If *topdown* is ``False``, the triple for a +- directory is generated after the triples for all of its subdirectories +- (directories are generated bottom-up). ++ (directories are generated top-down). If *topdown* is ``False``, the triple ++ for a directory is generated after the triples for all of its subdirectories ++ (directories are generated bottom-up). No matter the value of *topdown*, the ++ list of subdirectories is retrieved before the tuples for the directory and ++ its subdirectories are generated. + + When *topdown* is ``True``, the caller can modify the *dirnames* list in-place + (perhaps using :keyword:`del` or slice assignment), and :func:`walk` will only +@@ -2730,10 +2844,27 @@ + Availability: Unix. + + +-.. function:: popen(...) +- +- Run child processes, returning opened pipes for communications. These functions +- are described in section :ref:`os-newstreams`. ++.. function:: popen(command, mode='r', buffering=-1) ++ ++ Open a pipe to or from *command*. The return value is an open file object ++ connected to the pipe, which can be read or written depending on whether *mode* ++ is ``'r'`` (default) or ``'w'``. The *buffering* argument has the same meaning as ++ the corresponding argument to the built-in :func:`open` function. The ++ returned file object reads or writes text strings rather than bytes. ++ ++ The ``close`` method returns :const:`None` if the subprocess exited ++ successfully, or the subprocess's return code if there was an ++ error. On POSIX systems, if the return code is positive it ++ represents the return value of the process left-shifted by one ++ byte. If the return code is negative, the process was terminated ++ by the signal given by the negated value of the return code. (For ++ example, the return value might be ``- signal.SIGKILL`` if the ++ subprocess was killed.) On Windows systems, the return value ++ contains the signed integer return code from the child process. ++ ++ This is implemented using :class:`subprocess.Popen`; see that class's ++ documentation for more powerful ways to manage and communicate with ++ subprocesses. + + + .. function:: spawnl(mode, path, ...) +diff -r c0e311e010fc Doc/library/ossaudiodev.rst +--- a/Doc/library/ossaudiodev.rst ++++ b/Doc/library/ossaudiodev.rst +@@ -407,7 +407,7 @@ + (silent) to 100 (full volume). If the control is monophonic, a 2-tuple is still + returned, but both volumes are the same. + +- Raises :exc:`OSSAudioError` if an invalid control was is specified, or ++ Raises :exc:`OSSAudioError` if an invalid control is specified, or + :exc:`OSError` if an unsupported control is specified. + + +diff -r c0e311e010fc Doc/library/quopri.rst +--- a/Doc/library/quopri.rst ++++ b/Doc/library/quopri.rst +@@ -24,9 +24,8 @@ + .. function:: decode(input, output, header=False) + + Decode the contents of the *input* file and write the resulting decoded binary +- data to the *output* file. *input* and *output* must be :term:`file objects +- `. *input* will be read until ``input.readline()`` returns an +- empty string. If the optional argument *header* is present and true, underscore ++ data to the *output* file. *input* and *output* must be :term:`binary file objects ++ `. If the optional argument *header* is present and true, underscore + will be decoded as space. This is used to decode "Q"-encoded headers as + described in :rfc:`1522`: "MIME (Multipurpose Internet Mail Extensions) + Part Two: Message Header Extensions for Non-ASCII Text". +@@ -34,27 +33,28 @@ + + .. function:: encode(input, output, quotetabs, header=False) + +- Encode the contents of the *input* file and write the resulting quoted-printable +- data to the *output* file. *input* and *output* must be :term:`file objects +- `. *input* will be read until ``input.readline()`` returns an +- empty string. *quotetabs* is a flag which controls whether to encode embedded +- spaces and tabs; when true it encodes such embedded whitespace, and when +- false it leaves them unencoded. Note that spaces and tabs appearing at the +- end of lines are always encoded, as per :rfc:`1521`. *header* is a flag +- which controls if spaces are encoded as underscores as per :rfc:`1522`. ++ Encode the contents of the *input* file and write the resulting quoted- ++ printable data to the *output* file. *input* and *output* must be ++ :term:`binary file objects `. *quotetabs*, a flag which controls ++ whether to encode embedded spaces and tabs must be provideda and when true it ++ encodes such embedded whitespace, and when false it leaves them unencoded. ++ Note that spaces and tabs appearing at the end of lines are always encoded, ++ as per :rfc:`1521`. *header* is a flag which controls if spaces are encoded ++ as underscores as per :rfc:`1522`. + + + .. function:: decodestring(s, header=False) + +- Like :func:`decode`, except that it accepts a source string and returns the +- corresponding decoded string. ++ Like :func:`decode`, except that it accepts a source :class:`bytes` and ++ returns the corresponding decoded :class:`bytes`. + + + .. function:: encodestring(s, quotetabs=False, header=False) + +- Like :func:`encode`, except that it accepts a source string and returns the +- corresponding encoded string. *quotetabs* and *header* are optional +- (defaulting to ``False``), and are passed straight through to :func:`encode`. ++ Like :func:`encode`, except that it accepts a source :class:`bytes` and ++ returns the corresponding encoded :class:`bytes`. By default, it sends a ++ False value to *quotetabs* parameter of the :func:`encode` function. ++ + + + .. seealso:: +diff -r c0e311e010fc Doc/library/re.rst +--- a/Doc/library/re.rst ++++ b/Doc/library/re.rst +@@ -458,8 +458,8 @@ + .. function:: compile(pattern, flags=0) + + Compile a regular expression pattern into a regular expression object, which +- can be used for matching using its :func:`match` and :func:`search` methods, +- described below. ++ can be used for matching using its :func:`~regex.match` and ++ :func:`~regex.search` methods, described below. + + The expression's behaviour can be modified by specifying a *flags* value. + Values can be any of the following variables, combined using bitwise OR (the +@@ -563,7 +563,7 @@ + + .. function:: search(pattern, string, flags=0) + +- Scan through *string* looking for a location where the regular expression ++ Scan through *string* looking for the first location where the regular expression + *pattern* produces a match, and return a corresponding :ref:`match object + `. Return ``None`` if no position in the string matches the + pattern; note that this is different from finding a zero-length match at some +@@ -1333,36 +1333,36 @@ + + Token = collections.namedtuple('Token', ['typ', 'value', 'line', 'column']) + +- def tokenize(s): ++ def tokenize(code): + keywords = {'IF', 'THEN', 'ENDIF', 'FOR', 'NEXT', 'GOSUB', 'RETURN'} + token_specification = [ + ('NUMBER', r'\d+(\.\d*)?'), # Integer or decimal number + ('ASSIGN', r':='), # Assignment operator + ('END', r';'), # Statement terminator + ('ID', r'[A-Za-z]+'), # Identifiers +- ('OP', r'[+*\/\-]'), # Arithmetic operators ++ ('OP', r'[+\-*/]'), # Arithmetic operators + ('NEWLINE', r'\n'), # Line endings +- ('SKIP', r'[ \t]'), # Skip over spaces and tabs ++ ('SKIP', r'[ \t]+'), # Skip over spaces and tabs ++ ('MISMATCH',r'.'), # Any other character + ] + tok_regex = '|'.join('(?P<%s>%s)' % pair for pair in token_specification) +- get_token = re.compile(tok_regex).match +- line = 1 +- pos = line_start = 0 +- mo = get_token(s) +- while mo is not None: +- typ = mo.lastgroup +- if typ == 'NEWLINE': +- line_start = pos +- line += 1 +- elif typ != 'SKIP': +- val = mo.group(typ) +- if typ == 'ID' and val in keywords: +- typ = val +- yield Token(typ, val, line, mo.start()-line_start) +- pos = mo.end() +- mo = get_token(s, pos) +- if pos != len(s): +- raise RuntimeError('Unexpected character %r on line %d' %(s[pos], line)) ++ line_num = 1 ++ line_start = 0 ++ for mo in re.finditer(tok_regex, code): ++ kind = mo.lastgroup ++ value = mo.group(kind) ++ if kind == 'NEWLINE': ++ line_start = mo.end() ++ line_num += 1 ++ elif kind == 'SKIP': ++ pass ++ elif kind == 'MISMATCH': ++ raise RuntimeError('%r unexpected on line %d' % (value, line_num)) ++ else: ++ if kind == 'ID' and value in keywords: ++ kind = value ++ column = mo.start() - line_start ++ yield Token(kind, value, line_num, column) + + statements = ''' + IF quantity THEN +@@ -1376,22 +1376,22 @@ + + The tokenizer produces the following output:: + +- Token(typ='IF', value='IF', line=2, column=5) +- Token(typ='ID', value='quantity', line=2, column=8) +- Token(typ='THEN', value='THEN', line=2, column=17) +- Token(typ='ID', value='total', line=3, column=9) +- Token(typ='ASSIGN', value=':=', line=3, column=15) +- Token(typ='ID', value='total', line=3, column=18) +- Token(typ='OP', value='+', line=3, column=24) +- Token(typ='ID', value='price', line=3, column=26) +- Token(typ='OP', value='*', line=3, column=32) +- Token(typ='ID', value='quantity', line=3, column=34) +- Token(typ='END', value=';', line=3, column=42) +- Token(typ='ID', value='tax', line=4, column=9) +- Token(typ='ASSIGN', value=':=', line=4, column=13) +- Token(typ='ID', value='price', line=4, column=16) +- Token(typ='OP', value='*', line=4, column=22) +- Token(typ='NUMBER', value='0.05', line=4, column=24) +- Token(typ='END', value=';', line=4, column=28) +- Token(typ='ENDIF', value='ENDIF', line=5, column=5) +- Token(typ='END', value=';', line=5, column=10) ++ Token(typ='IF', value='IF', line=2, column=4) ++ Token(typ='ID', value='quantity', line=2, column=7) ++ Token(typ='THEN', value='THEN', line=2, column=16) ++ Token(typ='ID', value='total', line=3, column=8) ++ Token(typ='ASSIGN', value=':=', line=3, column=14) ++ Token(typ='ID', value='total', line=3, column=17) ++ Token(typ='OP', value='+', line=3, column=23) ++ Token(typ='ID', value='price', line=3, column=25) ++ Token(typ='OP', value='*', line=3, column=31) ++ Token(typ='ID', value='quantity', line=3, column=33) ++ Token(typ='END', value=';', line=3, column=41) ++ Token(typ='ID', value='tax', line=4, column=8) ++ Token(typ='ASSIGN', value=':=', line=4, column=12) ++ Token(typ='ID', value='price', line=4, column=15) ++ Token(typ='OP', value='*', line=4, column=21) ++ Token(typ='NUMBER', value='0.05', line=4, column=23) ++ Token(typ='END', value=';', line=4, column=27) ++ Token(typ='ENDIF', value='ENDIF', line=5, column=4) ++ Token(typ='END', value=';', line=5, column=9) +diff -r c0e311e010fc Doc/library/reprlib.rst +--- a/Doc/library/reprlib.rst ++++ b/Doc/library/reprlib.rst +@@ -49,8 +49,8 @@ + + >>> class MyList(list): + ... @recursive_repr() +- ... def __repr__(self): +- ... return '<' + '|'.join(map(repr, self)) + '>' ++ ... def __repr__(self): ++ ... return '<' + '|'.join(map(repr, self)) + '>' + ... + >>> m = MyList('abc') + >>> m.append(m) +diff -r c0e311e010fc Doc/library/runpy.rst +--- a/Doc/library/runpy.rst ++++ b/Doc/library/runpy.rst +@@ -28,6 +28,9 @@ + + .. function:: run_module(mod_name, init_globals=None, run_name=None, alter_sys=False) + ++ .. index:: ++ module: __main__ ++ + Execute the code of the specified module and return the resulting module + globals dictionary. The module's code is first located using the standard + import mechanism (refer to :pep:`302` for details) and then executed in a +@@ -87,6 +90,9 @@ + + .. function:: run_path(file_path, init_globals=None, run_name=None) + ++ .. index:: ++ module: __main__ ++ + Execute the code at the named filesystem location and return the resulting + module globals dictionary. As with a script name supplied to the CPython + command line, the supplied path may refer to a Python source file, a +diff -r c0e311e010fc Doc/library/smtplib.rst +--- a/Doc/library/smtplib.rst ++++ b/Doc/library/smtplib.rst +@@ -32,7 +32,8 @@ + than a success code, an :exc:`SMTPConnectError` is raised. The optional + *timeout* parameter specifies a timeout in seconds for blocking operations + like the connection attempt (if not specified, the global default timeout +- setting will be used). The optional source_address parameter allows to bind ++ setting will be used). If the timeout expires, :exc:`socket.timeout` is ++ raised. The optional source_address parameter allows to bind + to some specific source address in a machine with multiple network + interfaces, and/or to some specific source TCP port. It takes a 2-tuple + (host, port), for the socket to bind to as its source address before +diff -r c0e311e010fc Doc/library/sqlite3.rst +--- a/Doc/library/sqlite3.rst ++++ b/Doc/library/sqlite3.rst +@@ -646,7 +646,7 @@ + + .. method:: keys + +- This method returns a tuple of column names. Immediately after a query, ++ This method returns a list of column names. Immediately after a query, + it is the first member of each tuple in :attr:`Cursor.description`. + + Let's assume we initialize a table as in the example given above:: +diff -r c0e311e010fc Doc/library/ssl.rst +--- a/Doc/library/ssl.rst ++++ b/Doc/library/ssl.rst +@@ -787,7 +787,7 @@ + Perform the SSL setup handshake. + + .. versionchanged:: 3.4 +- The handshake method also performce :func:`match_hostname` when the ++ The handshake method also performs :func:`match_hostname` when the + :attr:`~SSLContext.check_hostname` attribute of the socket's + :attr:`~SSLSocket.context` is true. + +@@ -1111,7 +1111,7 @@ + returned. Other return values will result in a TLS fatal error with + :const:`ALERT_DESCRIPTION_INTERNAL_ERROR`. + +- If there is a IDNA decoding error on the server name, the TLS connection ++ If there is an IDNA decoding error on the server name, the TLS connection + will terminate with an :const:`ALERT_DESCRIPTION_INTERNAL_ERROR` fatal TLS + alert message to the client. + +@@ -1220,8 +1220,8 @@ + context.load_default_certs() + + s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) +- ssl_sock = context.wrap_socket(s, server_hostname='www.verisign.com'): +- ssl_sock.connect(('www.verisign.com', 443)) ++ ssl_sock = context.wrap_socket(s, server_hostname='www.verisign.com') ++ ssl_sock.connect(('www.verisign.com', 443)) + + .. versionadded:: 3.4 + +diff -r c0e311e010fc Doc/library/stdtypes.rst +--- a/Doc/library/stdtypes.rst ++++ b/Doc/library/stdtypes.rst +@@ -1493,7 +1493,9 @@ + .. method:: str.center(width[, fillchar]) + + Return centered in a string of length *width*. Padding is done using the +- specified *fillchar* (default is a space). ++ specified *fillchar* (default is an ASCII space). The original string is ++ returned if *width* is less than or equal to ``len(s)``. ++ + + + .. method:: str.count(sub[, start[, end]]) +@@ -1598,7 +1600,8 @@ + + .. method:: str.index(sub[, start[, end]]) + +- Like :meth:`find`, but raise :exc:`ValueError` when the substring is not found. ++ Like :meth:`~str.find`, but raise :exc:`ValueError` when the substring is ++ not found. + + + .. method:: str.isalnum() +@@ -1701,9 +1704,9 @@ + + .. method:: str.ljust(width[, fillchar]) + +- Return the string left justified in a string of length *width*. Padding is done +- using the specified *fillchar* (default is a space). The original string is +- returned if *width* is less than or equal to ``len(s)``. ++ Return the string left justified in a string of length *width*. Padding is ++ done using the specified *fillchar* (default is an ASCII space). The ++ original string is returned if *width* is less than or equal to ``len(s)``. + + + .. method:: str.lower() +@@ -1720,7 +1723,7 @@ + Return a copy of the string with leading characters removed. The *chars* + argument is a string specifying the set of characters to be removed. If omitted + or ``None``, the *chars* argument defaults to removing whitespace. The *chars* +- argument is not a prefix; rather, all combinations of its values are stripped: ++ argument is not a prefix; rather, all combinations of its values are stripped:: + + >>> ' spacious '.lstrip() + 'spacious ' +@@ -1773,9 +1776,9 @@ + + .. method:: str.rjust(width[, fillchar]) + +- Return the string right justified in a string of length *width*. Padding is done +- using the specified *fillchar* (default is a space). The original string is +- returned if *width* is less than or equal to ``len(s)``. ++ Return the string right justified in a string of length *width*. Padding is ++ done using the specified *fillchar* (default is an ASCII space). The ++ original string is returned if *width* is less than or equal to ``len(s)``. + + + .. method:: str.rpartition(sep) +@@ -1800,7 +1803,7 @@ + Return a copy of the string with trailing characters removed. The *chars* + argument is a string specifying the set of characters to be removed. If omitted + or ``None``, the *chars* argument defaults to removing whitespace. The *chars* +- argument is not a suffix; rather, all combinations of its values are stripped: ++ argument is not a suffix; rather, all combinations of its values are stripped:: + + >>> ' spacious '.rstrip() + ' spacious' +@@ -1822,6 +1825,15 @@ + (for example, ``'1<>2<>3'.split('<>')`` returns ``['1', '2', '3']``). + Splitting an empty string with a specified separator returns ``['']``. + ++ For example:: ++ ++ >>> '1,2,3'.split(',') ++ ['1', '2', '3'] ++ >>> '1,2,3'.split(',', maxsplit=1) ++ ['1', '2 3'] ++ >>> '1,2,,3,'.split(',') ++ ['1', '2', '', '3', ''] ++ + If *sep* is not specified or is ``None``, a different splitting algorithm is + applied: runs of consecutive whitespace are regarded as a single separator, + and the result will contain no empty strings at the start or end if the +@@ -1829,8 +1841,14 @@ + string or a string consisting of just whitespace with a ``None`` separator + returns ``[]``. + +- For example, ``' 1 2 3 '.split()`` returns ``['1', '2', '3']``, and +- ``' 1 2 3 '.split(None, 1)`` returns ``['1', '2 3 ']``. ++ For example:: ++ ++ >>> '1 2 3'.split() ++ ['1', '2', '3'] ++ >>> '1 2 3'.split(maxsplit=1) ++ ['1', '2 3'] ++ >>> ' 1 2 3 '.split() ++ ['1', '2', '3'] + + + .. index:: +@@ -1843,13 +1861,28 @@ + Line breaks are not included in the resulting list unless *keepends* is + given and true. + +- For example, ``'ab c\n\nde fg\rkl\r\n'.splitlines()`` returns +- ``['ab c', '', 'de fg', 'kl']``, while the same call with ``splitlines(True)`` +- returns ``['ab c\n', '\n', 'de fg\r', 'kl\r\n']``. ++ For example:: ++ ++ >>> 'ab c\n\nde fg\rkl\r\n'.splitlines() ++ ['ab c', '', 'de fg', 'kl']`` ++ >>> 'ab c\n\nde fg\rkl\r\n'.splitlines(keepends=True) ++ ['ab c\n', '\n', 'de fg\r', 'kl\r\n'] + + Unlike :meth:`~str.split` when a delimiter string *sep* is given, this + method returns an empty list for the empty string, and a terminal line +- break does not result in an extra line. ++ break does not result in an extra line:: ++ ++ >>> "".splitlines() ++ [] ++ >>> "One line\n".splitlines() ++ ['One line'] ++ ++ For comparison, ``split('\n')`` gives:: ++ ++ >>> ''.split('\n') ++ [''] ++ >>> 'Two lines\n'.split('\n') ++ ['Two lines', ''] + + + .. method:: str.startswith(prefix[, start[, end]]) +@@ -1866,7 +1899,7 @@ + The *chars* argument is a string specifying the set of characters to be removed. + If omitted or ``None``, the *chars* argument defaults to removing whitespace. + The *chars* argument is not a prefix or suffix; rather, all combinations of its +- values are stripped: ++ values are stripped:: + + >>> ' spacious '.strip() + 'spacious' +@@ -1886,6 +1919,11 @@ + Return a titlecased version of the string where words start with an uppercase + character and the remaining characters are lowercase. + ++ For example:: ++ ++ >>> 'Hello world'.title() ++ 'Hello World' ++ + The algorithm uses a simple language-independent definition of a word as + groups of consecutive letters. The definition works in many contexts but + it means that apostrophes in contractions and possessives form word +@@ -1938,9 +1976,18 @@ + + .. method:: str.zfill(width) + +- Return the numeric string left filled with zeros in a string of length +- *width*. A sign prefix is handled correctly. The original string is +- returned if *width* is less than or equal to ``len(s)``. ++ Return a copy of the string left filled with ASCII ``'0'`` digits to ++ make a string of length *width*. A leading sign prefix (``'+'``/``'-'`` ++ is handled by inserting the padding *after* the sign character rather ++ than before. The original string is returned if *width* is less than ++ or equal to ``len(s)``. ++ ++ For example:: ++ ++ >>> "42".zfill(5) ++ '00042' ++ >>> "-42".zfill(5) ++ '-0042' + + + +@@ -2198,16 +2245,28 @@ + + Also see the :ref:`bytes ` built-in. + +-Since bytes objects are sequences of integers, for a bytes object *b*, +-``b[0]`` will be an integer, while ``b[0:1]`` will be a bytes object of +-length 1. (This contrasts with text strings, where both indexing and +-slicing will produce a string of length 1) ++Since 2 hexadecimal digits correspond precisely to a single byte, hexadecimal ++numbers are a commonly used format for describing binary data. Accordingly, ++the bytes type has an additional class method to read data in that format: ++ ++.. classmethod:: bytes.fromhex(string) ++ ++ This :class:`bytes` class method returns a bytes object, decoding the ++ given string object. The string must contain two hexadecimal digits per ++ byte, with ASCII spaces being ignored. ++ ++ >>> bytes.fromhex('2Ef0 F1f2 ') ++ b'.\xf0\xf1\xf2' ++ ++Since bytes objects are sequences of integers (akin to a tuple), for a bytes ++object *b*, ``b[0]`` will be an integer, while ``b[0:1]`` will be a bytes ++object of length 1. (This contrasts with text strings, where both indexing ++and slicing will produce a string of length 1) + + The representation of bytes objects uses the literal format (``b'...'``) + since it is often more useful than e.g. ``bytes([46, 46, 46])``. You can + always convert a bytes object into a list of integers using ``list(b)``. + +- + .. note:: + For Python 2.x users: In the Python 2.x series, a variety of implicit + conversions between 8-bit strings (the closest thing 2.x offers to a +@@ -2241,6 +2300,29 @@ + + Also see the :ref:`bytearray ` built-in. + ++Since 2 hexadecimal digits correspond precisely to a single byte, hexadecimal ++numbers are a commonly used format for describing binary data. Accordingly, ++the bytearray type has an additional class method to read data in that format: ++ ++.. classmethod:: bytearray.fromhex(string) ++ ++ This :class:`bytearray` class method returns bytearray object, decoding ++ the given string object. The string must contain two hexadecimal digits ++ per byte, with ASCII spaces being ignored. ++ ++ >>> bytearray.fromhex('2Ef0 F1f2 ') ++ bytearray(b'.\xf0\xf1\xf2') ++ ++Since bytearray objects are sequences of integers (akin to a list), for a ++bytearray object *b*, ``b[0]`` will be an integer, while ``b[0:1]`` will be ++a bytearray object of length 1. (This contrasts with text strings, where ++both indexing and slicing will produce a string of length 1) ++ ++The representation of bytearray objects uses the bytes literal format ++(``bytearray(b'...')``) since it is often more useful than e.g. ++``bytearray([46, 46, 46])``. You can always convert a bytearray object into ++a list of integers using ``list(b)``. ++ + + .. _bytes-methods: + +@@ -2252,25 +2334,10 @@ + + Both bytes and bytearray objects support the :ref:`common ` + sequence operations. They interoperate not just with operands of the same +-type, but with any object that supports the +-:ref:`buffer protocol `. Due to this flexibility, they can be ++type, but with any :term:`bytes-like object`. Due to this flexibility, they can be + freely mixed in operations without causing errors. However, the return type + of the result may depend on the order of operands. + +-Due to the common use of ASCII text as the basis for binary protocols, bytes +-and bytearray objects provide almost all methods found on text strings, with +-the exceptions of: +- +-* :meth:`str.encode` (which converts text strings to bytes objects) +-* :meth:`str.format` and :meth:`str.format_map` (which are used to format +- text for display to users) +-* :meth:`str.isidentifier`, :meth:`str.isnumeric`, :meth:`str.isdecimal`, +- :meth:`str.isprintable` (which are used to check various properties of +- text strings which are not typically applicable to binary protocols). +- +-All other string methods are supported, although sometimes with slight +-differences in functionality and semantics (as described below). +- + .. note:: + + The methods on bytes and bytearray objects don't accept strings as their +@@ -2285,25 +2352,30 @@ + a = b"abc" + b = a.replace(b"a", b"f") + +-Whenever a bytes or bytearray method needs to interpret the bytes as +-characters (e.g. the :meth:`is...` methods, :meth:`split`, :meth:`strip`), +-the ASCII character set is assumed (text strings use Unicode semantics). ++Some bytes and bytearray operations assume the use of ASCII compatible ++binary formats, and hence should be avoided when working with arbitrary ++binary data. These restrictions are covered below. + + .. note:: +- Using these ASCII based methods to manipulate binary data that is not ++ Using these ASCII based operations to manipulate binary data that is not + stored in an ASCII based format may lead to data corruption. + +-The search operations (:keyword:`in`, :meth:`count`, :meth:`find`, +-:meth:`index`, :meth:`rfind` and :meth:`rindex`) all accept both integers +-in the range 0 to 255 (inclusive) as well as bytes and byte array sequences. +- +-.. versionchanged:: 3.3 +- All of the search methods also accept an integer in the range 0 to 255 +- (inclusive) as their first argument. +- +- +-Each bytes and bytearray instance provides a :meth:`~bytes.decode` convenience +-method that is the inverse of :meth:`str.encode`: ++The following methods on bytes and bytearray objects can be used with ++arbitrary binary data. ++ ++.. method:: bytes.count(sub[, start[, end]]) ++ bytearray.count(sub[, start[, end]]) ++ ++ Return the number of non-overlapping occurrences of subsequence *sub* in ++ the range [*start*, *end*]. Optional arguments *start* and *end* are ++ interpreted as in slice notation. ++ ++ The subsequence to search for may be any :term:`bytes-like object` or an ++ integer in the range 0 to 255. ++ ++ .. versionchanged:: 3.3 ++ Also accept an integer in the range 0 to 255 as the subsequence. ++ + + .. method:: bytes.decode(encoding="utf-8", errors="strict") + bytearray.decode(encoding="utf-8", errors="strict") +@@ -2316,37 +2388,175 @@ + :func:`codecs.register_error`, see section :ref:`codec-base-classes`. For a + list of possible encodings, see section :ref:`standard-encodings`. + ++ .. note:: ++ ++ Passing the *encoding* argument to :class:`str` allows decoding any ++ :term:`bytes-like object` directly, without needing to make a temporary ++ bytes or bytearray object. ++ + .. versionchanged:: 3.1 + Added support for keyword arguments. + +-Since 2 hexadecimal digits correspond precisely to a single byte, hexadecimal +-numbers are a commonly used format for describing binary data. Accordingly, +-the bytes and bytearray types have an additional class method to read data in +-that format: +- +-.. classmethod:: bytes.fromhex(string) +- bytearray.fromhex(string) +- +- This :class:`bytes` class method returns a bytes or bytearray object, +- decoding the given string object. The string must contain two hexadecimal +- digits per byte, spaces are ignored. +- +- >>> bytes.fromhex('2Ef0 F1f2 ') +- b'.\xf0\xf1\xf2' +- +- +-The maketrans and translate methods differ in semantics from the versions +-available on strings: ++ ++.. method:: bytes.endswith(suffix[, start[, end]]) ++ bytearray.endswith(suffix[, start[, end]]) ++ ++ Return ``True`` if the binary data ends with the specified *suffix*, ++ otherwise return ``False``. *suffix* can also be a tuple of suffixes to ++ look for. With optional *start*, test beginning at that position. With ++ optional *end*, stop comparing at that position. ++ ++ The suffix(es) to search for may be any :term:`bytes-like object`. ++ ++ ++.. method:: bytes.find(sub[, start[, end]]) ++ bytearray.find(sub[, start[, end]]) ++ ++ Return the lowest index in the data where the subsequence *sub* is found, ++ such that *sub* is contained in the slice ``s[start:end]``. Optional ++ arguments *start* and *end* are interpreted as in slice notation. Return ++ ``-1`` if *sub* is not found. ++ ++ The subsequence to search for may be any :term:`bytes-like object` or an ++ integer in the range 0 to 255. ++ ++ .. note:: ++ ++ The :meth:`~bytes.find` method should be used only if you need to know the ++ position of *sub*. To check if *sub* is a substring or not, use the ++ :keyword:`in` operator:: ++ ++ >>> b'Py' in b'Python' ++ True ++ ++ .. versionchanged:: 3.3 ++ Also accept an integer in the range 0 to 255 as the subsequence. ++ ++ ++.. method:: bytes.index(sub[, start[, end]]) ++ bytearray.index(sub[, start[, end]]) ++ ++ Like :meth:`~bytes.find`, but raise :exc:`ValueError` when the ++ subsequence is not found. ++ ++ The subsequence to search for may be any :term:`bytes-like object` or an ++ integer in the range 0 to 255. ++ ++ .. versionchanged:: 3.3 ++ Also accept an integer in the range 0 to 255 as the subsequence. ++ ++ ++.. method:: bytes.join(iterable) ++ bytearray.join(iterable) ++ ++ Return a bytes or bytearray object which is the concatenation of the ++ binary data sequences in the :term:`iterable` *iterable*. A ++ :exc:`TypeError` will be raised if there are any values in *iterable* ++ that are note :term:`bytes-like objects `, including ++ :class:`str` objects. The separator between elements is the contents ++ of the bytes or bytearray object providing this method. ++ ++ ++.. staticmethod:: bytes.maketrans(from, to) ++ bytearray.maketrans(from, to) ++ ++ This static method returns a translation table usable for ++ :meth:`bytes.translate` that will map each character in *from* into the ++ character at the same position in *to*; *from* and *to* must both be ++ :term:`bytes-like objects ` and have the same length. ++ ++ .. versionadded:: 3.1 ++ ++ ++.. method:: bytes.partition(sep) ++ bytearray.partition(sep) ++ ++ Split the sequence at the first occurrence of *sep*, and return a 3-tuple ++ containing the part before the separator, the separator, and the part ++ after the separator. If the separator is not found, return a 3-tuple ++ containing a copy of the original sequence, followed by two empty bytes or ++ bytearray objects. ++ ++ The separator to search for may be any :term:`bytes-like object`. ++ ++ ++.. method:: bytes.replace(old, new[, count]) ++ bytearray.replace(old, new[, count]) ++ ++ Return a copy of the sequence with all occurrences of subsequence *old* ++ replaced by *new*. If the optional argument *count* is given, only the ++ first *count* occurrences are replaced. ++ ++ The subsequence to search for and its replacement may be any ++ :term:`bytes-like object`. ++ ++ .. note:: ++ ++ The bytearray version of this method does *not* operate in place - it ++ always produces a new object, even if no changes were made. ++ ++ ++.. method:: bytes.rfind(sub[, start[, end]]) ++ bytearray.rfind(sub[, start[, end]]) ++ ++ Return the highest index in the sequence where the subsequence *sub* is ++ found, such that *sub* is contained within ``s[start:end]``. Optional ++ arguments *start* and *end* are interpreted as in slice notation. Return ++ ``-1`` on failure. ++ ++ The subsequence to search for may be any :term:`bytes-like object` or an ++ integer in the range 0 to 255. ++ ++ .. versionchanged:: 3.3 ++ Also accept an integer in the range 0 to 255 as the subsequence. ++ ++ ++.. method:: bytes.rindex(sub[, start[, end]]) ++ bytearray.rindex(sub[, start[, end]]) ++ ++ Like :meth:`~bytes.rfind` but raises :exc:`ValueError` when the ++ subsequence *sub* is not found. ++ ++ The subsequence to search for may be any :term:`bytes-like object` or an ++ integer in the range 0 to 255. ++ ++ .. versionchanged:: 3.3 ++ Also accept an integer in the range 0 to 255 as the subsequence. ++ ++ ++.. method:: bytes.rpartition(sep) ++ bytearray.rpartition(sep) ++ ++ Split the sequence at the last occurrence of *sep*, and return a 3-tuple ++ containing the part before the separator, the separator, and the part ++ after the separator. If the separator is not found, return a 3-tuple ++ containing a copy of the original sequence, followed by two empty bytes or ++ bytearray objects. ++ ++ The separator to search for may be any :term:`bytes-like object`. ++ ++ ++.. method:: bytes.startswith(prefix[, start[, end]]) ++ bytearray.startswith(prefix[, start[, end]]) ++ ++ Return ``True`` if the binary data starts with the specified *prefix*, ++ otherwise return ``False``. *prefix* can also be a tuple of prefixes to ++ look for. With optional *start*, test beginning at that position. With ++ optional *end*, stop comparing at that position. ++ ++ The prefix(es) to search for may be any :term:`bytes-like object`. ++ + + .. method:: bytes.translate(table[, delete]) + bytearray.translate(table[, delete]) + + Return a copy of the bytes or bytearray object where all bytes occurring in +- the optional argument *delete* are removed, and the remaining bytes have been +- mapped through the given translation table, which must be a bytes object of +- length 256. +- +- You can use the :func:`bytes.maketrans` method to create a translation table. ++ the optional argument *delete* are removed, and the remaining bytes have ++ been mapped through the given translation table, which must be a bytes ++ object of length 256. ++ ++ You can use the :func:`bytes.maketrans` method to create a translation ++ table. + + Set the *table* argument to ``None`` for translations that only delete + characters:: +@@ -2355,15 +2565,497 @@ + b'rd ths shrt txt' + + +-.. staticmethod:: bytes.maketrans(from, to) +- bytearray.maketrans(from, to) +- +- This static method returns a translation table usable for +- :meth:`bytes.translate` that will map each character in *from* into the +- character at the same position in *to*; *from* and *to* must be bytes objects +- and have the same length. +- +- .. versionadded:: 3.1 ++The following methods on bytes and bytearray objects have default behaviours ++that assume the use of ASCII compatible binary formats, but can still be used ++with arbitrary binary data by passing appropriate arguments. Note that all of ++the bytearray methods in this section do *not* operate in place, and instead ++produce new objects. ++ ++.. method:: bytes.center(width[, fillbyte]) ++ bytearray.center(width[, fillbyte]) ++ ++ Return a copy of the object centered in a sequence of length *width*. ++ Padding is done using the specified *fillbyte* (default is an ASCII ++ space). For :class:`bytes` objects, the original sequence is returned if ++ *width* is less than or equal to ``len(s)``. ++ ++ .. note:: ++ ++ The bytearray version of this method does *not* operate in place - ++ it always produces a new object, even if no changes were made. ++ ++ ++.. method:: bytes.ljust(width[, fillbyte]) ++ bytearray.ljust(width[, fillbyte]) ++ ++ Return a copy of the object left justified in a sequence of length *width*. ++ Padding is done using the specified *fillbyte* (default is an ASCII ++ space). For :class:`bytes` objects, the original sequence is returned if ++ *width* is less than or equal to ``len(s)``. ++ ++ .. note:: ++ ++ The bytearray version of this method does *not* operate in place - ++ it always produces a new object, even if no changes were made. ++ ++ ++.. method:: bytes.lstrip([chars]) ++ bytearray.lstrip([chars]) ++ ++ Return a copy of the sequence with specified leading bytes removed. The ++ *chars* argument is a binary sequence specifying the set of byte values to ++ be removed - the name refers to the fact this method is usually used with ++ ASCII characters. If omitted or ``None``, the *chars* argument defaults ++ to removing ASCII whitespace. The *chars* argument is not a prefix; ++ rather, all combinations of its values are stripped:: ++ ++ >>> b' spacious '.lstrip() ++ b'spacious ' ++ >>> b'www.example.com'.lstrip(b'cmowz.') ++ b'example.com' ++ ++ The binary sequence of byte values to remove may be any ++ :term:`bytes-like object`. ++ ++ .. note:: ++ ++ The bytearray version of this method does *not* operate in place - ++ it always produces a new object, even if no changes were made. ++ ++ ++.. method:: bytes.rjust(width[, fillbyte]) ++ bytearray.rjust(width[, fillbyte]) ++ ++ Return a copy of the object right justified in a sequence of length *width*. ++ Padding is done using the specified *fillbyte* (default is an ASCII ++ space). For :class:`bytes` objects, the original sequence is returned if ++ *width* is less than or equal to ``len(s)``. ++ ++ .. note:: ++ ++ The bytearray version of this method does *not* operate in place - ++ it always produces a new object, even if no changes were made. ++ ++ ++.. method:: bytes.rsplit(sep=None, maxsplit=-1) ++ bytearray.rsplit(sep=None, maxsplit=-1) ++ ++ Split the binary sequence into subsequences of the same type, using *sep* ++ as the delimiter string. If *maxsplit* is given, at most *maxsplit* splits ++ are done, the *rightmost* ones. If *sep* is not specified or ``None``, ++ any subsequence consisting solely of ASCII whitespace is a separator. ++ Except for splitting from the right, :meth:`rsplit` behaves like ++ :meth:`split` which is described in detail below. ++ ++ ++.. method:: bytes.rstrip([chars]) ++ bytearray.rstrip([chars]) ++ ++ Return a copy of the sequence with specified trailing bytes removed. The ++ *chars* argument is a binary sequence specifying the set of byte values to ++ be removed - the name refers to the fact this method is usually used with ++ ASCII characters. If omitted or ``None``, the *chars* argument defaults to ++ removing ASCII whitespace. The *chars* argument is not a suffix; rather, ++ all combinations of its values are stripped:: ++ ++ >>> b' spacious '.rstrip() ++ b' spacious' ++ >>> b'mississippi'.rstrip(b'ipz') ++ b'mississ' ++ ++ The binary sequence of byte values to remove may be any ++ :term:`bytes-like object`. ++ ++ .. note:: ++ ++ The bytearray version of this method does *not* operate in place - ++ it always produces a new object, even if no changes were made. ++ ++ ++.. method:: bytes.split(sep=None, maxsplit=-1) ++ bytearray.split(sep=None, maxsplit=-1) ++ ++ Split the binary sequence into subsequences of the same type, using *sep* ++ as the delimiter string. If *maxsplit* is given and non-negative, at most ++ *maxsplit* splits are done (thus, the list will have at most ``maxsplit+1`` ++ elements). If *maxsplit* is not specified or is ``-1``, then there is no ++ limit on the number of splits (all possible splits are made). ++ ++ If *sep* is given, consecutive delimiters are not grouped together and are ++ deemed to delimit empty subsequences (for example, ``b'1,,2'.split(b',')`` ++ returns ``[b'1', b'', b'2']``). The *sep* argument may consist of a ++ multibyte sequence (for example, ``b'1<>2<>3'.split(b'<>')`` returns ++ ``[b'1', b'2', b'3']``). Splitting an empty sequence with a specified ++ separator returns ``[b'']`` or ``[bytearray(b'')]`` depending on the type ++ of object being split. The *sep* argument may be any ++ :term:`bytes-like object`. ++ ++ For example:: ++ ++ >>> b'1,2,3'.split(b',') ++ [b'1', b'2', b'3'] ++ >>> b'1,2,3'.split(b',', maxsplit=1) ++ [b'1', b'2 3'] ++ >>> b'1,2,,3,'.split(b',') ++ [b'1', b'2', b'', b'3', b''] ++ ++ If *sep* is not specified or is ``None``, a different splitting algorithm ++ is applied: runs of consecutive ASCII whitespace are regarded as a single ++ separator, and the result will contain no empty strings at the start or ++ end if the sequence has leading or trailing whitespace. Consequently, ++ splitting an empty sequence or a sequence consisting solely of ASCII ++ whitespace without a specified separator returns ``[]``. ++ ++ For example:: ++ ++ ++ >>> b'1 2 3'.split() ++ [b'1', b'2', b'3'] ++ >>> b'1 2 3'.split(maxsplit=1) ++ [b'1', b'2 3'] ++ >>> b' 1 2 3 '.split() ++ [b'1', b'2', b'3'] ++ ++ ++.. method:: bytes.strip([chars]) ++ bytearray.strip([chars]) ++ ++ Return a copy of the sequence with specified leading and trailing bytes ++ removed. The *chars* argument is a binary sequence specifying the set of ++ byte values to be removed - the name refers to the fact this method is ++ usually used with ASCII characters. If omitted or ``None``, the *chars* ++ argument defaults to removing ASCII whitespace. The *chars* argument is ++ not a prefix or suffix; rather, all combinations of its values are ++ stripped:: ++ ++ >>> b' spacious '.strip() ++ b'spacious' ++ >>> b'www.example.com'.strip(b'cmowz.') ++ b'example' ++ ++ The binary sequence of byte values to remove may be any ++ :term:`bytes-like object`. ++ ++ .. note:: ++ ++ The bytearray version of this method does *not* operate in place - ++ it always produces a new object, even if no changes were made. ++ ++ ++The following methods on bytes and bytearray objects assume the use of ASCII ++compatible binary formats and should not be applied to arbitrary binary data. ++Note that all of the bytearray methods in this section do *not* operate in ++place, and instead produce new objects. ++ ++.. method:: bytes.capitalize() ++ bytearray.capitalize() ++ ++ Return a copy of the sequence with each byte interpreted as an ASCII ++ character, and the first byte capitalized and the rest lowercased. ++ Non-ASCII byte values are passed through unchanged. ++ ++ .. note:: ++ ++ The bytearray version of this method does *not* operate in place - it ++ always produces a new object, even if no changes were made. ++ ++ ++.. method:: bytes.expandtabs(tabsize=8) ++ bytearray.expandtabs(tabsize=8) ++ ++ Return a copy of the sequence where all ASCII tab characters are replaced ++ by one or more ASCII spaces, depending on the current column and the given ++ tab size. Tab positions occur every *tabsize* bytes (default is 8, ++ giving tab positions at columns 0, 8, 16 and so on). To expand the ++ sequence, the current column is set to zero and the sequence is examined ++ byte by byte. If the byte is an ASCII tab character (``b'\t'``), one or ++ more space characters are inserted in the result until the current column ++ is equal to the next tab position. (The tab character itself is not ++ copied.) If the current byte is an ASCII newline (``b'\n'``) or ++ carriage return (``b'\r'``), it is copied and the current column is reset ++ to zero. Any other byte value is copied unchanged and the current column ++ is incremented by one regardless of how the byte value is represented when ++ printed:: ++ ++ >>> b'01\t012\t0123\t01234'.expandtabs() ++ b'01 012 0123 01234' ++ >>> b'01\t012\t0123\t01234'.expandtabs(4) ++ b'01 012 0123 01234' ++ ++ .. note:: ++ ++ The bytearray version of this method does *not* operate in place - it ++ always produces a new object, even if no changes were made. ++ ++ ++.. method:: bytes.isalnum() ++ bytearray.isalnum() ++ ++ Return true if all bytes in the sequence are alphabetical ASCII characters ++ or ASCII decimal digits and the sequence is not empty, false otherwise. ++ Alphabetic ASCII characters are those byte values in the sequence ++ ``b'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'``. ASCII decimal ++ digits are those byte values in the sequence ``b'0123456789'``. ++ ++ For example:: ++ ++ >>> b'ABCabc1'.isalnum() ++ True ++ >>> b'ABC abc1'.isalnum() ++ False ++ ++ ++.. method:: bytes.isalpha() ++ bytearray.isalpha() ++ ++ Return true if all bytes in the sequence are alphabetic ASCII characters ++ and the sequence is not empty, false otherwise. Alphabetic ASCII ++ characters are those byte values in the sequence ++ ``b'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'``. ++ ++ For example:: ++ ++ >>> b'ABCabc'.isalpha() ++ True ++ >>> b'ABCabc1'.isalpha() ++ False ++ ++ ++.. method:: bytes.isdigit() ++ bytearray.isdigit() ++ ++ Return true if all bytes in the sequence are ASCII decimal digits ++ and the sequence is not empty, false otherwise. ASCII decimal digits are ++ those byte values in the sequence ``b'0123456789'``. ++ ++ For example:: ++ ++ >>> b'1234'.isdigit() ++ True ++ >>> b'1.23'.isdigit() ++ False ++ ++ ++.. method:: bytes.islower() ++ bytearray.islower() ++ ++ Return true if there is at least one lowercase ASCII character ++ in the sequence and no uppercase ASCII characters, false otherwise. ++ ++ For example:: ++ ++ >>> b'hello world'.islower() ++ True ++ >>> b'Hello world'.islower() ++ False ++ ++ Lowercase ASCII characters are those byte values in the sequence ++ ``b'abcdefghijklmnopqrstuvwxyz'``. Uppercase ASCII characters ++ are those byte values in the sequence ``b'ABCDEFGHIJKLMNOPQRSTUVWXYZ'``. ++ ++ ++.. method:: bytes.isspace() ++ bytearray.isspace() ++ ++ Return true if all bytes in the sequence are ASCII whitespace and the ++ sequence is not empty, false otherwise. ASCII whitespace characters are ++ those byte values in the sequence b' \t\n\r\x0b\f' (space, tab, newline, ++ carriage return, vertical tab, form feed). ++ ++ ++.. method:: bytes.istitle() ++ bytearray.istitle() ++ ++ Return true if the sequence is ASCII titlecase and the sequence is not ++ empty, false otherwise. See :meth:`bytes.title` for more details on the ++ definition of "titlecase". ++ ++ For example:: ++ ++ >>> b'Hello World'.istitle() ++ True ++ >>> b'Hello world'.istitle() ++ False ++ ++ ++.. method:: bytes.isupper() ++ bytearray.isupper() ++ ++ Return true if there is at least one lowercase alphabetic ASCII character ++ in the sequence and no uppercase ASCII characters, false otherwise. ++ ++ For example:: ++ ++ >>> b'HELLO WORLD'.isupper() ++ True ++ >>> b'Hello world'.isupper() ++ False ++ ++ Lowercase ASCII characters are those byte values in the sequence ++ ``b'abcdefghijklmnopqrstuvwxyz'``. Uppercase ASCII characters ++ are those byte values in the sequence ``b'ABCDEFGHIJKLMNOPQRSTUVWXYZ'``. ++ ++ ++.. method:: bytes.lower() ++ bytearray.lower() ++ ++ Return a copy of the sequence with all the uppercase ASCII characters ++ converted to their corresponding lowercase counterpart. ++ ++ For example:: ++ ++ >>> b'Hello World'.lower() ++ b'hello world' ++ ++ Lowercase ASCII characters are those byte values in the sequence ++ ``b'abcdefghijklmnopqrstuvwxyz'``. Uppercase ASCII characters ++ are those byte values in the sequence ``b'ABCDEFGHIJKLMNOPQRSTUVWXYZ'``. ++ ++ .. note:: ++ ++ The bytearray version of this method does *not* operate in place - it ++ always produces a new object, even if no changes were made. ++ ++ ++.. index:: ++ single: universal newlines; bytes.splitlines method ++ single: universal newlines; bytearray.splitlines method ++ ++.. method:: bytes.splitlines(keepends=False) ++ bytearray.splitlines(keepends=False) ++ ++ Return a list of the lines in the binary sequence, breaking at ASCII ++ line boundaries. This method uses the :term:`universal newlines` approach ++ to splitting lines. Line breaks are not included in the resulting list ++ unless *keepends* is given and true. ++ ++ For example:: ++ ++ >>> b'ab c\n\nde fg\rkl\r\n'.splitlines() ++ [b'ab c', b'', b'de fg', b'kl']`` ++ >>> b'ab c\n\nde fg\rkl\r\n'.splitlines(keepends=True) ++ [b'ab c\n', b'\n', b'de fg\r', b'kl\r\n'] ++ ++ Unlike :meth:`~bytes.split` when a delimiter string *sep* is given, this ++ method returns an empty list for the empty string, and a terminal line ++ break does not result in an extra line:: ++ ++ >>> b"".split(b'\n'), b"Two lines\n".split(b'\n') ++ ([b''], [b'Two lines', b'']) ++ >>> b"".splitlines(), b"One line\n".splitlines() ++ ([], [b'One line']) ++ ++ ++.. method:: bytes.swapcase() ++ bytearray.swapcase() ++ ++ Return a copy of the sequence with all the lowercase ASCII characters ++ converted to their corresponding uppercase counterpart and vice-versa. ++ ++ For example:: ++ ++ >>> b'Hello World'.swapcase() ++ b'hELLO wORLD' ++ ++ Lowercase ASCII characters are those byte values in the sequence ++ ``b'abcdefghijklmnopqrstuvwxyz'``. Uppercase ASCII characters ++ are those byte values in the sequence ``b'ABCDEFGHIJKLMNOPQRSTUVWXYZ'``. ++ ++ Unlike :func:`str.swapcase()`, it is always the case that ++ ``bin.swapcase().swapcase() == bin`` for the binary versions. Case ++ conversions are symmetrical in ASCII, even though that is not generally ++ true for arbitrary Unicode code points. ++ ++ .. note:: ++ ++ The bytearray version of this method does *not* operate in place - it ++ always produces a new object, even if no changes were made. ++ ++ ++.. method:: bytes.title() ++ bytearray.title() ++ ++ Return a titlecased version of the binary sequence where words start with ++ an uppercase ASCII character and the remaining characters are lowercase. ++ Uncased byte values are left unmodified. ++ ++ For example:: ++ ++ >>> b'Hello world'.title() ++ b'Hello World' ++ ++ Lowercase ASCII characters are those byte values in the sequence ++ ``b'abcdefghijklmnopqrstuvwxyz'``. Uppercase ASCII characters ++ are those byte values in the sequence ``b'ABCDEFGHIJKLMNOPQRSTUVWXYZ'``. ++ All other byte values are uncased. ++ ++ The algorithm uses a simple language-independent definition of a word as ++ groups of consecutive letters. The definition works in many contexts but ++ it means that apostrophes in contractions and possessives form word ++ boundaries, which may not be the desired result:: ++ ++ >>> b"they're bill's friends from the UK".title() ++ b"They'Re Bill'S Friends From The Uk" ++ ++ A workaround for apostrophes can be constructed using regular expressions:: ++ ++ >>> import re ++ >>> def titlecase(s): ++ ... return re.sub(rb"[A-Za-z]+('[A-Za-z]+)?", ++ ... lambda mo: mo.group(0)[0:1].upper() + ++ ... mo.group(0)[1:].lower(), ++ ... s) ++ ... ++ >>> titlecase(b"they're bill's friends.") ++ b"They're Bill's Friends." ++ ++ .. note:: ++ ++ The bytearray version of this method does *not* operate in place - it ++ always produces a new object, even if no changes were made. ++ ++ ++.. method:: bytes.upper() ++ bytearray.upper() ++ ++ Return a copy of the sequence with all the lowercase ASCII characters ++ converted to their corresponding uppercase counterpart. ++ ++ For example:: ++ ++ >>> b'Hello World'.upper() ++ b'HELLO WORLD' ++ ++ Lowercase ASCII characters are those byte values in the sequence ++ ``b'abcdefghijklmnopqrstuvwxyz'``. Uppercase ASCII characters ++ are those byte values in the sequence ``b'ABCDEFGHIJKLMNOPQRSTUVWXYZ'``. ++ ++ .. note:: ++ ++ The bytearray version of this method does *not* operate in place - it ++ always produces a new object, even if no changes were made. ++ ++ ++.. method:: bytes.zfill(width) ++ bytearray.zfill(width) ++ ++ Return a copy of the sequence left filled with ASCII ``b'0'`` digits to ++ make a sequence of length *width*. A leading sign prefix (``b'+'``/ ++ ``b'-'`` is handled by inserting the padding *after* the sign character ++ rather than before. For :class:`bytes` objects, the original sequence is ++ returned if *width* is less than or equal to ``len(seq)``. ++ ++ For example:: ++ ++ >>> b"42".zfill(5) ++ b'00042' ++ >>> b"-42".zfill(5) ++ b'-0042' ++ ++ .. note:: ++ ++ The bytearray version of this method does *not* operate in place - it ++ always produces a new object, even if no changes were made. + + + .. _typememoryview: +@@ -3031,8 +3723,8 @@ + If no positional argument is given, an empty dictionary is created. + If a positional argument is given and it is a mapping object, a dictionary + is created with the same key-value pairs as the mapping object. Otherwise, +- the positional argument must be an :term:`iterator` object. Each item in +- the iterable must itself be an iterator with exactly two objects. The ++ the positional argument must be an :term:`iterable` object. Each item in ++ the iterable must itself be an iterable with exactly two objects. The + first object of each item becomes a key in the new dictionary, and the + second object the corresponding value. If a key occurs more than once, the + last value for that key becomes the corresponding value in the new +diff -r c0e311e010fc Doc/library/tarfile.rst +--- a/Doc/library/tarfile.rst ++++ b/Doc/library/tarfile.rst +@@ -81,6 +81,10 @@ + If *fileobj* is specified, it is used as an alternative to a :term:`file object` + opened in binary mode for *name*. It is supposed to be at position 0. + ++ For modes ``'w:gz'``, ``'r:gz'``, ``'w:bz2'``, ``'r:bz2'``, :func:`tarfile.open` ++ accepts the keyword argument *compresslevel* to specify the compression level of ++ the file. ++ + For special purposes, there is a second format for *mode*: + ``'filemode|[compression]'``. :func:`tarfile.open` will return a :class:`TarFile` + object that processes its data as a stream of blocks. No random seeking will +@@ -292,7 +296,7 @@ + will be added as a pax global header if *format* is :const:`PAX_FORMAT`. + + +-.. method:: TarFile.open(...) ++.. classmethod:: TarFile.open(...) + + Alternative constructor. The :func:`tarfile.open` function is actually a + shortcut to this classmethod. +@@ -509,7 +513,7 @@ + :const:`AREGTYPE`, :const:`LNKTYPE`, :const:`SYMTYPE`, :const:`DIRTYPE`, + :const:`FIFOTYPE`, :const:`CONTTYPE`, :const:`CHRTYPE`, :const:`BLKTYPE`, + :const:`GNUTYPE_SPARSE`. To determine the type of a :class:`TarInfo` object +- more conveniently, use the ``is_*()`` methods below. ++ more conveniently, use the ``is*()`` methods below. + + + .. attribute:: TarInfo.linkname +diff -r c0e311e010fc Doc/library/test.rst +--- a/Doc/library/test.rst ++++ b/Doc/library/test.rst +@@ -461,7 +461,7 @@ + .. function:: make_bad_fd() + + Create an invalid file descriptor by opening and closing a temporary file, +- and returning its descripor. ++ and returning its descriptor. + + + .. function:: import_module(name, deprecated=False) +@@ -554,6 +554,21 @@ + run simultaneously, which is a problem for buildbots. + + ++.. function:: load_package_tests(pkg_dir, loader, standard_tests, pattern) ++ ++ Generic implementation of the :mod:`unittest` ``load_tests`` protocol for ++ use in test packages. *pkg_dir* is the root directory of the package; ++ *loader*, *standard_tests*, and *pattern* are the arguments expected by ++ ``load_tests``. In simple cases, the test package's ``__init__.py`` ++ can be the following:: ++ ++ import os ++ from test.support import load_package_tests ++ ++ def load_tests(*args): ++ return load_package_tests(os.path.dirname(__file__), *args) ++ ++ + The :mod:`test.support` module defines the following classes: + + .. class:: TransientResource(exc, **kwargs) +diff -r c0e311e010fc Doc/library/timeit.rst +--- a/Doc/library/timeit.rst ++++ b/Doc/library/timeit.rst +@@ -28,22 +28,23 @@ + + .. code-block:: sh + +- $ python -m timeit '"-".join(str(n) for n in range(100))' +- 10000 loops, best of 3: 40.3 usec per loop +- $ python -m timeit '"-".join([str(n) for n in range(100)])' +- 10000 loops, best of 3: 33.4 usec per loop +- $ python -m timeit '"-".join(map(str, range(100)))' +- 10000 loops, best of 3: 25.2 usec per loop ++ $ python3 -m timeit '"-".join(str(n) for n in range(100))' ++ 10000 loops, best of 3: 30.2 usec per loop ++ $ python3 -m timeit '"-".join([str(n) for n in range(100)])' ++ 10000 loops, best of 3: 27.5 usec per loop ++ $ python3 -m timeit '"-".join(map(str, range(100)))' ++ 10000 loops, best of 3: 23.2 usec per loop + + This can be achieved from the :ref:`python-interface` with:: + + >>> import timeit + >>> timeit.timeit('"-".join(str(n) for n in range(100))', number=10000) +- 0.8187260627746582 ++ 0.3018611848820001 + >>> timeit.timeit('"-".join([str(n) for n in range(100)])', number=10000) +- 0.7288308143615723 ++ 0.2727368790656328 + >>> timeit.timeit('"-".join(map(str, range(100)))', number=10000) +- 0.5858950614929199 ++ 0.23702679807320237 ++ + + Note however that :mod:`timeit` will automatically determine the number of + repetitions only when the command-line interface is used. In the +diff -r c0e311e010fc Doc/library/tokenize.rst +--- a/Doc/library/tokenize.rst ++++ b/Doc/library/tokenize.rst +@@ -131,6 +131,24 @@ + + .. versionadded:: 3.2 + ++.. exception:: TokenError ++ ++ Raised when either a docstring or expression that may be split over several ++ lines is not completed anywhere in the file, for example:: ++ ++ """Beginning of ++ docstring ++ ++ or:: ++ ++ [1, ++ 2, ++ 3 ++ ++Note that unclosed single-quoted strings do not cause an error to be ++raised. They are tokenized as ``ERRORTOKEN``, followed by the tokenization of ++their contents. ++ + + .. _tokenize-cli: + +diff -r c0e311e010fc Doc/library/turtle.rst +--- a/Doc/library/turtle.rst ++++ b/Doc/library/turtle.rst +@@ -1981,7 +1981,7 @@ + :param startx: if positive, starting position in pixels from the left + edge of the screen, if negative from the right edge, if None, + center window horizontally +- :param startx: if positive, starting position in pixels from the top ++ :param starty: if positive, starting position in pixels from the top + edge of the screen, if negative from the bottom edge, if None, + center window vertically + +diff -r c0e311e010fc Doc/library/winreg.rst +--- a/Doc/library/winreg.rst ++++ b/Doc/library/winreg.rst +@@ -322,7 +322,7 @@ + +-------+---------------------------------------------+ + | ``2`` | An integer giving when the key was last | + | | modified (if available) as 100's of | +- | | nanoseconds since Jan 1, 1600. | ++ | | nanoseconds since Jan 1, 1601. | + +-------+---------------------------------------------+ + + +diff -r c0e311e010fc Doc/make.bat +--- a/Doc/make.bat ++++ b/Doc/make.bat +@@ -76,6 +76,15 @@ + cmd /C %SPHINXBUILD% %SPHINXOPTS% -b%1 -dbuild\doctrees . %BUILDDIR%\%* + + if "%1" EQU "htmlhelp" ( ++ if not exist "%HTMLHELP%" ( ++ echo. ++ echo.The HTML Help Workshop was not found. Set the HTMLHELP variable ++ echo.to the path to hhc.exe or download and install it from ++ echo.http://msdn.microsoft.com/en-us/library/ms669985 ++ rem Set errorlevel to 1 and exit ++ cmd /C exit /b 1 ++ goto end ++ ) + cmd /C "%HTMLHELP%" build\htmlhelp\python%DISTVERSION:.=%.hhp + rem hhc.exe seems to always exit with code 1, reset to 0 for less than 2 + if not errorlevel 2 cmd /C exit /b 0 +diff -r c0e311e010fc Doc/reference/compound_stmts.rst +--- a/Doc/reference/compound_stmts.rst ++++ b/Doc/reference/compound_stmts.rst +@@ -22,14 +22,14 @@ + single: clause + single: suite + +-Compound statements consist of one or more 'clauses.' A clause consists of a ++A compound statement consists of one or more 'clauses.' A clause consists of a + header and a 'suite.' The clause headers of a particular compound statement are + all at the same indentation level. Each clause header begins with a uniquely + identifying keyword and ends with a colon. A suite is a group of statements + controlled by a clause. A suite can be one or more semicolon-separated simple + statements on the same line as the header, following the header's colon, or it + can be one or more indented statements on subsequent lines. Only the latter +-form of suite can contain nested compound statements; the following is illegal, ++form of a suite can contain nested compound statements; the following is illegal, + mostly because it wouldn't be clear to which :keyword:`if` clause a following + :keyword:`else` clause would belong:: + +@@ -156,8 +156,8 @@ + + The expression list is evaluated once; it should yield an iterable object. An + iterator is created for the result of the ``expression_list``. The suite is +-then executed once for each item provided by the iterator, in the order of +-ascending indices. Each item in turn is assigned to the target list using the ++then executed once for each item provided by the iterator, in the order returned ++by the iterator. Each item in turn is assigned to the target list using the + standard rules for assignments (see :ref:`assignment`), and then the suite is + executed. When the items are exhausted (which is immediately when the sequence + is empty or an iterator raises a :exc:`StopIteration` exception), the suite in +@@ -170,17 +170,25 @@ + A :keyword:`break` statement executed in the first suite terminates the loop + without executing the :keyword:`else` clause's suite. A :keyword:`continue` + statement executed in the first suite skips the rest of the suite and continues +-with the next item, or with the :keyword:`else` clause if there was no next ++with the next item, or with the :keyword:`else` clause if there is no next + item. + +-The suite may assign to the variable(s) in the target list; this does not affect +-the next item assigned to it. ++The for-loop makes assignments to the variables(s) in the target list. ++This overwrites all previous assignments to those variables including ++those made in the suite of the for-loop:: ++ ++ for i in range(10): ++ print(i) ++ i = 5 # this will not affect the for-loop ++ # because i will be overwritten with the next ++ # index in the range ++ + + .. index:: + builtin: range + + Names in the target list are not deleted when the loop is finished, but if the +-sequence is empty, it will not have been assigned to at all by the loop. Hint: ++sequence is empty, they will not have been assigned to at all by the loop. Hint: + the built-in function :func:`range` returns an iterator of integers suitable to + emulate the effect of Pascal's ``for i := a to b do``; e.g., ``list(range(3))`` + returns the list ``[0, 1, 2]``. +@@ -284,7 +292,7 @@ + object: traceback + + Before an except clause's suite is executed, details about the exception are +-stored in the :mod:`sys` module and can be access via :func:`sys.exc_info`. ++stored in the :mod:`sys` module and can be accessed via :func:`sys.exc_info`. + :func:`sys.exc_info` returns a 3-tuple consisting of the exception class, the + exception instance and a traceback object (see section :ref:`types`) identifying + the point in the program where the exception occurred. :func:`sys.exc_info` +@@ -461,7 +469,7 @@ + decorator: "@" `dotted_name` ["(" [`parameter_list` [","]] ")"] NEWLINE + dotted_name: `identifier` ("." `identifier`)* + parameter_list: (`defparameter` ",")* +- : ( "*" [`parameter`] ("," `defparameter`)* ["," "**" `parameter`] ++ : | "*" [`parameter`] ("," `defparameter`)* ["," "**" `parameter`] + : | "**" `parameter` + : | `defparameter` [","] ) + parameter: `identifier` [":" `expression`] +diff -r c0e311e010fc Doc/reference/datamodel.rst +--- a/Doc/reference/datamodel.rst ++++ b/Doc/reference/datamodel.rst +@@ -77,7 +77,7 @@ + module for information on controlling the collection of cyclic garbage. + Other implementations act differently and CPython may change. + Do not depend on immediate finalization of objects when they become +- unreachable (ex: always close files). ++ unreachable (so you should always close files explicitly). + + Note that the use of the implementation's tracing or debugging facilities may + keep objects alive that would normally be collectable. Also note that catching +@@ -285,16 +285,17 @@ + single: integer + single: Unicode + +- A string is a sequence of values that represent Unicode codepoints. +- All the codepoints in range ``U+0000 - U+10FFFF`` can be represented +- in a string. Python doesn't have a :c:type:`chr` type, and +- every character in the string is represented as a string object +- with length ``1``. The built-in function :func:`ord` converts a +- character to its codepoint (as an integer); :func:`chr` converts +- an integer in range ``0 - 10FFFF`` to the corresponding character. ++ A string is a sequence of values that represent Unicode code points. ++ All the code points in the range ``U+0000 - U+10FFFF`` can be ++ represented in a string. Python doesn't have a :c:type:`char` type; ++ instead, every code point in the string is represented as a string ++ object with length ``1``. The built-in function :func:`ord` ++ converts a code point from its string form to an integer in the ++ range ``0 - 10FFFF``; :func:`chr` converts an integer in the range ++ ``0 - 10FFFF`` to the corresponding length ``1`` string object. + :meth:`str.encode` can be used to convert a :class:`str` to +- :class:`bytes` using the given encoding, and :meth:`bytes.decode` can +- be used to achieve the opposite. ++ :class:`bytes` using the given text encoding, and ++ :meth:`bytes.decode` can be used to achieve the opposite. + + Tuples + .. index:: +@@ -1722,7 +1723,7 @@ + locking/synchronization. + + Here is an example of a metaclass that uses an :class:`collections.OrderedDict` +-to remember the order that class members were defined:: ++to remember the order that class variables are defined:: + + class OrderedClass(type): + +@@ -2102,9 +2103,9 @@ + + .. note:: + +- When :meth:`__index__` is defined, :meth:`__int__` should also be defined, +- and both shuld return the same value, in order to have a coherent integer +- type class. ++ In order to have a coherent integer type class, when :meth:`__index__` is ++ defined :meth:`__int__` should also be defined, and both should return ++ the same value. + + + .. _context-managers: +diff -r c0e311e010fc Doc/reference/executionmodel.rst +--- a/Doc/reference/executionmodel.rst ++++ b/Doc/reference/executionmodel.rst +@@ -31,11 +31,11 @@ + A :dfn:`block` is a piece of Python program text that is executed as a unit. + The following are blocks: a module, a function body, and a class definition. + Each command typed interactively is a block. A script file (a file given as +-standard input to the interpreter or specified on the interpreter command line +-the first argument) is a code block. A script command (a command specified on +-the interpreter command line with the '**-c**' option) is a code block. The +-string argument passed to the built-in functions :func:`eval` and :func:`exec` +-is a code block. ++standard input to the interpreter or specified as a command line argument to the ++interpreter) is a code block. A script command (a command specified on the ++interpreter command line with the '**-c**' option) is a code block. The string ++argument passed to the built-in functions :func:`eval` and :func:`exec` is a ++code block. + + .. index:: pair: execution; frame + +@@ -77,7 +77,7 @@ + single: UnboundLocalError + + When a name is not found at all, a :exc:`NameError` exception is raised. If the +-name refers to a local variable that has not been bound, a ++name refers to a local variable that has not been bound, an + :exc:`UnboundLocalError` exception is raised. :exc:`UnboundLocalError` is a + subclass of :exc:`NameError`. + +diff -r c0e311e010fc Doc/reference/expressions.rst +--- a/Doc/reference/expressions.rst ++++ b/Doc/reference/expressions.rst +@@ -29,7 +29,7 @@ + + When a description of an arithmetic operator below uses the phrase "the numeric + arguments are converted to a common type," this means that the operator +-implementation for built-in types works that way: ++implementation for built-in types works as follows: + + * If either argument is a complex number, the other is converted to complex; + +@@ -38,8 +38,9 @@ + + * otherwise, both must be integers and no conversion is necessary. + +-Some additional rules apply for certain operators (e.g., a string left argument +-to the '%' operator). Extensions must define their own conversion behavior. ++Some additional rules apply for certain operators (e.g., a string as a left ++argument to the '%' operator). Extensions must define their own conversion ++behavior. + + + .. _atoms: +@@ -183,7 +184,7 @@ + each time the innermost block is reached. + + Note that the comprehension is executed in a separate scope, so names assigned +-to in the target list don't "leak" in the enclosing scope. ++to in the target list don't "leak" into the enclosing scope. + + + .. _lists: +@@ -293,7 +294,7 @@ + brackets or curly braces. + + Variables used in the generator expression are evaluated lazily when the +-:meth:`~generator.__next__` method is called for generator object (in the same ++:meth:`~generator.__next__` method is called for the generator object (in the same + fashion as normal generators). However, the leftmost :keyword:`for` clause is + immediately evaluated, so that an error produced by it can be seen before any + other possible error in the code that handles the generator expression. +@@ -302,7 +303,7 @@ + range(10) for y in bar(x))``. + + The parentheses can be omitted on calls with only one argument. See section +-:ref:`calls` for the detail. ++:ref:`calls` for details. + + + .. _yieldexpr: +@@ -327,12 +328,12 @@ + generator. That generator then controls the execution of a generator function. + The execution starts when one of the generator's methods is called. At that + time, the execution proceeds to the first yield expression, where it is +-suspended again, returning the value of :token:`expression_list` to generator's ++suspended again, returning the value of :token:`expression_list` to the generator's + caller. By suspended, we mean that all local state is retained, including the + current bindings of local variables, the instruction pointer, and the internal + evaluation stack. When the execution is resumed by calling one of the + generator's methods, the function can proceed exactly as if the yield expression +-was just another external call. The value of the yield expression after ++were just another external call. The value of the yield expression after + resuming depends on the method which resumed the execution. If + :meth:`~generator.__next__` is used (typically via either a :keyword:`for` or + the :func:`next` builtin) then the result is :const:`None`. Otherwise, if +@@ -344,10 +345,10 @@ + All of this makes generator functions quite similar to coroutines; they yield + multiple times, they have more than one entry point and their execution can be + suspended. The only difference is that a generator function cannot control +-where should the execution continue after it yields; the control is always ++where the execution should continue after it yields; the control is always + transferred to the generator's caller. + +-yield expressions are allowed in the :keyword:`try` clause of a :keyword:`try` ++Yield expressions are allowed in the :keyword:`try` clause of a :keyword:`try` + ... :keyword:`finally` construct. If the generator is not resumed before it is + finalized (by reaching a zero reference count or by being garbage collected), + the generator-iterator's :meth:`~generator.close` method will be called, +@@ -430,7 +431,7 @@ + + .. method:: generator.throw(type[, value[, traceback]]) + +- Raises an exception of type ``type`` at the point where generator was paused, ++ Raises an exception of type ``type`` at the point where the generator was paused, + and returns the next value yielded by the generator function. If the generator + exits without yielding another value, a :exc:`StopIteration` exception is + raised. If the generator function does not catch the passed-in exception, or +@@ -520,11 +521,11 @@ + + The primary must evaluate to an object of a type that supports attribute + references, which most objects do. This object is then asked to produce the +-attribute whose name is the identifier (which can be customized by overriding +-the :meth:`__getattr__` method). If this attribute is not available, the +-exception :exc:`AttributeError` is raised. Otherwise, the type and value of the +-object produced is determined by the object. Multiple evaluations of the same +-attribute reference may yield different objects. ++attribute whose name is the identifier. This production can be customized by ++overriding the :meth:`__getattr__` method. If this attribute is not available, ++the exception :exc:`AttributeError` is raised. Otherwise, the type and value of ++the object produced is determined by the object. Multiple evaluations of the ++same attribute reference may yield different objects. + + + .. _subscriptions: +@@ -549,9 +550,9 @@ + .. productionlist:: + subscription: `primary` "[" `expression_list` "]" + +-The primary must evaluate to an object that supports subscription, e.g. a list +-or dictionary. User-defined objects can support subscription by defining a +-:meth:`__getitem__` method. ++The primary must evaluate to an object that supports subscription (lists or ++dictionaries for example). User-defined objects can support subscription by ++defining a :meth:`__getitem__` method. + + For built-in objects, there are two types of objects that support subscription: + +@@ -660,8 +661,8 @@ + keyword_arguments: `keyword_item` ("," `keyword_item`)* + keyword_item: `identifier` "=" `expression` + +-A trailing comma may be present after the positional and keyword arguments but +-does not affect the semantics. ++An optional trailing comma may be present after the positional and keyword arguments ++but does not affect the semantics. + + .. index:: + single: parameter; call semantics +@@ -943,9 +944,9 @@ + .. index:: single: addition + + The ``+`` (addition) operator yields the sum of its arguments. The arguments +-must either both be numbers or both sequences of the same type. In the former +-case, the numbers are converted to a common type and then added together. In +-the latter case, the sequences are concatenated. ++must either both be numbers or both be sequences of the same type. In the ++former case, the numbers are converted to a common type and then added together. ++In the latter case, the sequences are concatenated. + + .. index:: single: subtraction + +@@ -1106,7 +1107,7 @@ + another one is made arbitrarily but consistently within one execution of a + program. + +-Comparison of objects of the differing types depends on whether either of the ++Comparison of objects of differing types depends on whether either of the + types provide explicit support for the comparison. Most numeric types can be + compared with one another. When cross-type comparison is not supported, the + comparison method returns ``NotImplemented``. +@@ -1116,7 +1117,7 @@ + The operators :keyword:`in` and :keyword:`not in` test for membership. ``x in + s`` evaluates to true if *x* is a member of *s*, and false otherwise. ``x not + in s`` returns the negation of ``x in s``. All built-in sequences and set types +-support this as well as dictionary, for which :keyword:`in` tests whether a the ++support this as well as dictionary, for which :keyword:`in` tests whether the + dictionary has a given key. For container types such as list, tuple, set, + frozenset, dict, or collections.deque, the expression ``x in y`` is equivalent + to ``any(x is e or x == e for e in y)``. +@@ -1202,9 +1203,9 @@ + they return to ``False`` and ``True``, but rather return the last evaluated + argument. This is sometimes useful, e.g., if ``s`` is a string that should be + replaced by a default value if it is empty, the expression ``s or 'foo'`` yields +-the desired value. Because :keyword:`not` has to invent a value anyway, it does +-not bother to return a value of the same type as its argument, so e.g., ``not +-'foo'`` yields ``False``, not ``''``.) ++the desired value. Because :keyword:`not` has to create a new value, it ++returns a boolean value regardless of the type of its argument ++(for example, ``not 'foo'`` produces ``False`` rather than ``''``.) + + + Conditional expressions +@@ -1222,8 +1223,8 @@ + Conditional expressions (sometimes called a "ternary operator") have the lowest + priority of all Python operations. + +-The expression ``x if C else y`` first evaluates the condition, *C* (*not* *x*); +-if *C* is true, *x* is evaluated and its value is returned; otherwise, *y* is ++The expression ``x if C else y`` first evaluates the condition, *C* rather than *x*. ++If *C* is true, *x* is evaluated and its value is returned; otherwise, *y* is + evaluated and its value is returned. + + See :pep:`308` for more details about conditional expressions. +@@ -1244,10 +1245,9 @@ + lambda_expr: "lambda" [`parameter_list`]: `expression` + lambda_expr_nocond: "lambda" [`parameter_list`]: `expression_nocond` + +-Lambda expressions (sometimes called lambda forms) have the same syntactic position as +-expressions. They are a shorthand to create anonymous functions; the expression +-``lambda arguments: expression`` yields a function object. The unnamed object +-behaves like a function object defined with :: ++Lambda expressions (sometimes called lambda forms) are used to create anonymous ++functions. The expression ``lambda arguments: expression`` yields a function ++object. The unnamed object behaves like a function object defined with :: + + def (arguments): + return expression +@@ -1310,13 +1310,15 @@ + + .. index:: pair: operator; precedence + +-The following table summarizes the operator precedences in Python, from lowest ++The following table summarizes the operator precedence in Python, from lowest + precedence (least binding) to highest precedence (most binding). Operators in + the same box have the same precedence. Unless the syntax is explicitly given, + operators are binary. Operators in the same box group left to right (except for +-comparisons, including tests, which all have the same precedence and chain from +-left to right --- see section :ref:`comparisons` --- and exponentiation, which +-groups from right to left). ++exponentiation, which groups from right to left). ++ ++Note that comparisons, membership tests, and identity tests, all have the same ++precedence and have a left-to-right chaining feature as described in the ++:ref:`comparisons` section. + + + +-----------------------------------------------+-------------------------------------+ +diff -r c0e311e010fc Doc/reference/simple_stmts.rst +--- a/Doc/reference/simple_stmts.rst ++++ b/Doc/reference/simple_stmts.rst +@@ -7,7 +7,7 @@ + + .. index:: pair: simple; statement + +-Simple statements are comprised within a single logical line. Several simple ++A simple statement is comprised within a single logical line. Several simple + statements may occur on a single line separated by semicolons. The syntax for + simple statements is: + +@@ -91,8 +91,8 @@ + : | `slicing` + : | "*" `target` + +-(See section :ref:`primaries` for the syntax definitions for the last three +-symbols.) ++(See section :ref:`primaries` for the syntax definitions for *attributeref*, ++*subscription*, and *slicing*.) + + An assignment statement evaluates the expression list (remember that this can be + a single expression or a comma-separated list, the latter yielding a tuple) and +@@ -228,7 +228,7 @@ + inclusive. Finally, the sequence object is asked to replace the slice with + the items of the assigned sequence. The length of the slice may be different + from the length of the assigned sequence, thus changing the length of the +- target sequence, if the object allows it. ++ target sequence, if the target sequence allows it. + + .. impl-detail:: + +@@ -236,14 +236,15 @@ + as for expressions, and invalid syntax is rejected during the code generation + phase, causing less detailed error messages. + +-WARNING: Although the definition of assignment implies that overlaps between the +-left-hand side and the right-hand side are 'safe' (for example ``a, b = b, a`` +-swaps two variables), overlaps *within* the collection of assigned-to variables +-are not safe! For instance, the following program prints ``[0, 2]``:: ++Although the definition of assignment implies that overlaps between the ++left-hand side and the right-hand side are 'simultanenous' (for example ``a, b = ++b, a`` swaps two variables), overlaps *within* the collection of assigned-to ++variables occur left-to-right, sometimes resulting in confusion. For instance, ++the following program prints ``[0, 2]``:: + + x = [0, 1] + i = 0 +- i, x[i] = 1, 2 ++ i, x[i] = 1, 2 # i is updated, then x[i] is updated + print(x) + + +@@ -283,7 +284,7 @@ + augop: "+=" | "-=" | "*=" | "/=" | "//=" | "%=" | "**=" + : | ">>=" | "<<=" | "&=" | "^=" | "|=" + +-(See section :ref:`primaries` for the syntax definitions for the last three ++(See section :ref:`primaries` for the syntax definitions of the last three + symbols.) + + An augmented assignment evaluates the target (which, unlike normal assignment +@@ -297,6 +298,11 @@ + is performed *in-place*, meaning that rather than creating a new object and + assigning that to the target, the old object is modified instead. + ++Unlike normal assignments, augmented assignments evaluate the left-hand side ++*before* evaluating the right-hand side. For example, ``a[i] += f(x)`` first ++looks-up ``a[i]``, then it evaluates ``f(x)`` and performs the addition, and ++lastly, it writes the result back to ``a[i]``. ++ + With the exception of assigning to tuples and multiple targets in a single + statement, the assignment done by augmented assignment statements is handled the + same way as normal assignments. Similarly, with the exception of the possible +@@ -658,7 +664,7 @@ + as though the clauses had been separated out into individiual import + statements. + +-The details of the first step, finding and loading modules is described in ++The details of the first step, finding and loading modules are described in + greater detail in the section on the :ref:`import system `, + which also describes the various types of packages and modules that can + be imported, as well as all the hooks that can be used to customize +@@ -689,7 +695,7 @@ + + The :keyword:`from` form uses a slightly more complex process: + +-#. find the module specified in the :keyword:`from` clause loading and ++#. find the module specified in the :keyword:`from` clause, loading and + initializing it if necessary; + #. for each of the identifiers specified in the :keyword:`import` clauses: + +@@ -697,7 +703,7 @@ + #. if not, attempt to import a submodule with that name and then + check the imported module again for that attribute + #. if the attribute is not found, :exc:`ImportError` is raised. +- #. otherwise, a reference to that value is bound in the local namespace, ++ #. otherwise, a reference to that value is stored in the local namespace, + using the name in the :keyword:`as` clause if it is present, + otherwise using the attribute name + +@@ -726,9 +732,9 @@ + library modules which were imported and used within the module). + + The :keyword:`from` form with ``*`` may only occur in a module scope. The wild +-card form of import --- ``import *`` --- is only allowed at the module level. +-Attempting to use it in class or function definitions will raise a +-:exc:`SyntaxError`. ++card form of import --- ``from module import *`` --- is only allowed at the ++module level. Attempting to use it in class or function definitions will raise ++a :exc:`SyntaxError`. + + .. index:: + single: relative; import +@@ -747,7 +753,7 @@ + The specification for relative imports is contained within :pep:`328`. + + :func:`importlib.import_module` is provided to support applications that +-determine which modules need to be loaded dynamically. ++determine dynamically the modules to be loaded. + + + .. _future: +@@ -759,10 +765,12 @@ + + A :dfn:`future statement` is a directive to the compiler that a particular + module should be compiled using syntax or semantics that will be available in a +-specified future release of Python. The future statement is intended to ease +-migration to future versions of Python that introduce incompatible changes to +-the language. It allows use of the new features on a per-module basis before +-the release in which the feature becomes standard. ++specified future release of Python where the feature becomes standard. ++ ++The future statement is intended to ease migration to future versions of Python ++that introduce incompatible changes to the language. It allows use of the new ++features on a per-module basis before the release in which the feature becomes ++standard. + + .. productionlist:: * + future_statement: "from" "__future__" "import" feature ["as" name] +@@ -857,7 +865,7 @@ + + .. impl-detail:: + +- The current implementation does not enforce the latter two restrictions, but ++ The current implementation does not enforce the two restrictions, but + programs should not abuse this freedom, as future implementations may enforce + them or silently change the meaning of the program. + +@@ -890,16 +898,16 @@ + : | "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 +-first. The statement allows encapsulated code to rebind variables outside of +-the local scope besides the global (module) scope. ++previously bound variables in the nearest enclosing scope excluding globals. ++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. + + .. XXX not implemented + The :keyword:`nonlocal` statement may prepend an assignment or augmented + assignment, but not an expression. + +-Names listed in a :keyword:`nonlocal` statement, unlike to those listed in a ++Names listed in a :keyword:`nonlocal` statement, unlike those listed in a + :keyword:`global` statement, must refer to pre-existing bindings in an + enclosing scope (the scope in which a new binding should be created cannot + be determined unambiguously). +diff -r c0e311e010fc Doc/tools/sphinxext/indexsidebar.html +--- a/Doc/tools/sphinxext/indexsidebar.html ++++ b/Doc/tools/sphinxext/indexsidebar.html +@@ -1,17 +1,18 @@ +-

Download

+-

Download these documents

+-

Docs for other versions

+- ++

Download

++

Download these documents

++

Docs for other versions

++ + +-

Other resources

+- ++

Other resources

++ +diff -r c0e311e010fc Doc/tutorial/classes.rst +--- a/Doc/tutorial/classes.rst ++++ b/Doc/tutorial/classes.rst +@@ -387,6 +387,77 @@ + argument list. + + ++.. _tut-class-and-instance-variables: ++ ++Class and Instance Variables ++---------------------------- ++ ++Generally speaking, instance variables are for data unique to each instance ++and class variables are for attributes and methods shared by all instances ++of the class:: ++ ++ class Dog: ++ ++ kind = 'canine' # class variable shared by all instances ++ ++ def __init__(self, name): ++ self.name = name # instance variable unique to each instance ++ ++ >>> d = Dog('Fido') ++ >>> e = Dog('Buddy') ++ >>> d.kind # shared by all dogs ++ 'canine' ++ >>> e.kind # shared by all dogs ++ 'canine' ++ >>> d.name # unique to d ++ 'Fido' ++ >>> e.name # unique to e ++ 'Buddy' ++ ++As discussed in :ref:`tut-object`, shared data can have possibly surprising ++effects with involving :term:`mutable` objects such as lists and dictionaries. ++For example, the *tricks* list in the following code should not be used as a ++class variable because just a single list would be shared by all *Dog* ++instances:: ++ ++ class Dog: ++ ++ tricks = [] # mistaken use of a class variable ++ ++ def __init__(self, name): ++ self.name = name ++ ++ def add_trick(self, trick): ++ self.tricks.append(trick) ++ ++ >>> d = Dog('Fido') ++ >>> e = Dog('Buddy') ++ >>> d.add_trick('roll over') ++ >>> e.add_trick('play dead') ++ >>> d.tricks # unexpectedly shared by all dogs ++ ['roll over', 'play dead'] ++ ++Correct design of the class should use an instance variable instead:: ++ ++ class Dog: ++ ++ def __init__(self, name): ++ self.name = name ++ self.tricks = [] # creates a new empty list for each dog ++ ++ def add_trick(self, trick): ++ self.tricks.append(trick) ++ ++ >>> d = Dog('Fido') ++ >>> e = Dog('Buddy') ++ >>> d.add_trick('roll over') ++ >>> e.add_trick('play dead') ++ >>> d.tricks ++ ['roll over'] ++ >>> e.tricks ++ ['play dead'] ++ ++ + .. _tut-remarks: + + Random Remarks +@@ -731,7 +802,7 @@ + for char in "123": + print(char) + for line in open("myfile.txt"): +- print(line) ++ print(line, end='') + + This style of access is clear, concise, and convenient. The use of iterators + pervades and unifies Python. Behind the scenes, the :keyword:`for` statement +diff -r c0e311e010fc Doc/tutorial/datastructures.rst +--- a/Doc/tutorial/datastructures.rst ++++ b/Doc/tutorial/datastructures.rst +@@ -111,10 +111,15 @@ + >>> a.sort() + >>> a + [-1, 1, 66.25, 333, 333, 1234.5] ++ >>> a.pop() ++ 1234.5 ++ >>> a ++ [-1, 1, 66.25, 333, 333] + + You might have noticed that methods like ``insert``, ``remove`` or ``sort`` that +-modify the list have no return value printed -- they return ``None``. [1]_ This +-is a design principle for all mutable data structures in Python. ++only modify the list have no return value printed -- they return the default ++``None``. [1]_ This is a design principle for all mutable data structures in ++Python. + + + .. _tut-lists-as-stacks: +diff -r c0e311e010fc Doc/tutorial/stdlib.rst +--- a/Doc/tutorial/stdlib.rst ++++ b/Doc/tutorial/stdlib.rst +@@ -40,7 +40,9 @@ + + >>> import shutil + >>> shutil.copyfile('data.db', 'archive.db') ++ 'archive.db' + >>> shutil.move('/build/executables', 'installdir') ++ 'installdir' + + + .. _tut-file-wildcards: +diff -r c0e311e010fc Doc/using/cmdline.rst +--- a/Doc/using/cmdline.rst ++++ b/Doc/using/cmdline.rst +@@ -616,8 +616,8 @@ + + .. envvar:: PYTHONASYNCIODEBUG + +- If this environment variable is set to a non-empty string, enable the debug +- mode of the :mod:`asyncio` module. ++ If this environment variable is set to a non-empty string, enable the ++ :ref:`debug mode ` of the :mod:`asyncio` module. + + .. versionadded:: 3.4 + +diff -r c0e311e010fc Doc/whatsnew/2.7.rst +--- a/Doc/whatsnew/2.7.rst ++++ b/Doc/whatsnew/2.7.rst +@@ -7,7 +7,6 @@ + .. hyperlink all the methods & functions. + + .. T_STRING_INPLACE not described in main docs +-.. "Format String Syntax" in string.rst could use many more examples. + + .. $Id$ + Rules for maintenance: +@@ -50,17 +49,16 @@ + This saves the maintainer some effort going through the SVN logs + when researching a change. + +-This article explains the new features in Python 2.7. The final +-release of 2.7 is currently scheduled for July 2010; the detailed +-schedule is described in :pep:`373`. ++This article explains the new features in Python 2.7. Python 2.7 was released ++on July 3, 2010. + + Numeric handling has been improved in many ways, for both +-floating-point numbers and for the :class:`Decimal` class. There are +-some useful additions to the standard library, such as a greatly +-enhanced :mod:`unittest` module, the :mod:`argparse` module for +-parsing command-line options, convenient ordered-dictionary and +-:class:`Counter` classes in the :mod:`collections` module, and many +-other improvements. ++floating-point numbers and for the :class:`~decimal.Decimal` class. ++There are some useful additions to the standard library, such as a ++greatly enhanced :mod:`unittest` module, the :mod:`argparse` module ++for parsing command-line options, convenient :class:`~collections.OrderedDict` ++and :class:`~collections.Counter` classes in the :mod:`collections` module, ++and many other improvements. + + Python 2.7 is planned to be the last of the 2.x releases, so we worked + on making it a good release for the long term. To help with porting +@@ -81,45 +79,91 @@ + The Future for Python 2.x + ========================= + +-Python 2.7 is intended to be the last major release in the 2.x series. +-The Python maintainers are planning to focus their future efforts on +-the Python 3.x series. +- +-This means that 2.7 will remain in place for a long time, running +-production systems that have not been ported to Python 3.x. +-Two consequences of the long-term significance of 2.7 are: +- +-* It's very likely the 2.7 release will have a longer period of +- maintenance compared to earlier 2.x versions. Python 2.7 will +- continue to be maintained while the transition to 3.x continues, and +- the developers are planning to support Python 2.7 with bug-fix +- releases beyond the typical two years. +- +-* A policy decision was made to silence warnings only of interest to +- developers. :exc:`DeprecationWarning` and its +- descendants are now ignored unless otherwise requested, preventing +- users from seeing warnings triggered by an application. This change +- was also made in the branch that will become Python 3.2. (Discussed +- on stdlib-sig and carried out in :issue:`7319`.) +- +- In previous releases, :exc:`DeprecationWarning` messages were +- enabled by default, providing Python developers with a clear +- indication of where their code may break in a future major version +- of Python. +- +- However, there are increasingly many users of Python-based +- applications who are not directly involved in the development of +- those applications. :exc:`DeprecationWarning` messages are +- irrelevant to such users, making them worry about an application +- that's actually working correctly and burdening application developers +- with responding to these concerns. +- +- You can re-enable display of :exc:`DeprecationWarning` messages by +- running Python with the :option:`-Wdefault` (short form: +- :option:`-Wd`) switch, or by setting the :envvar:`PYTHONWARNINGS` +- environment variable to ``"default"`` (or ``"d"``) before running +- Python. Python code can also re-enable them +- by calling ``warnings.simplefilter('default')``. ++Python 2.7 is the last major release in the 2.x series, as the Python ++maintainers have shifted the focus of their new feature development efforts ++to the Python 3.x series. This means that while Python 2 continues to ++receive bug fixes, and to be updated to build correctly on new hardware and ++versions of supported operated systems, there will be no new full feature ++releases for the language or standard library. ++ ++However, while there is a large common subset between Python 2.7 and Python ++3, and many of the changes involved in migrating to that common subset, or ++directly to Python 3, can be safely automated, some other changes (notably ++those associated with Unicode handling) may require careful consideration, ++and preferably robust automated regression test suites, to migrate ++effectively. ++ ++This means that Python 2.7 will remain in place for a long time, providing a ++stable and supported base platform for production systems that have not yet ++been ported to Python 3. The full expected lifecycle of the Python 2.7 ++series is detailed in :pep:`373`. ++ ++Some key consequences of the long-term significance of 2.7 are: ++ ++* As noted above, the 2.7 release has a much longer period of maintenance ++ when compared to earlier 2.x versions. Python 2.7 is currently expected to ++ remain supported by the core development team (receiving security updates ++ and other bug fixes) until at least 2020 (10 years after its initial ++ release, compared to the more typical support period of 18-24 months). ++ ++* As the Python 2.7 standard library ages, making effective use of the ++ Python Package Index (either directly or via a redistributor) becomes ++ more important for Python 2 users. In addition to a wide variety of third ++ party packages for various tasks, the available packages include backports ++ of new modules and features from the Python 3 standard library that are ++ compatible with Python 2, as well as various tools and libraries that can ++ make it easier to migrate to Python 3. The `Python Packaging User Guide ++ `__ provides guidance on downloading and ++ installing software from the Python Package Index. ++ ++* While the preferred approach to enhancing Python 2 is now the publication ++ of new packages on the Python Package Index, this approach doesn't ++ necessarily work in all cases, especially those related to network ++ security. In exceptional cases that cannot be handled adequately by ++ publishing new or updated packages on PyPI, the Python Enhancement ++ Proposal process may be used to make the case for adding new features ++ directly to the Python 2 standard library. Any such additions, and the ++ maintenance releases where they were added, will be noted in the ++ :ref:`py27-maintenance-enhancements` section below. ++ ++For projects wishing to migrate from Python 2 to Python 3, or for library ++and framework developers wishing to support users on both Python 2 and ++Python 3, there are a variety of tools and guides available to help decide ++on a suitable approach and manage some of the technical details involved. ++The recommended starting point is the :ref:`pyporting-howto` HOWTO guide. ++ ++ ++Changes to the Handling of Deprecation Warnings ++=============================================== ++ ++For Python 2.7, a policy decision was made to silence warnings only of ++interest to developers by default. :exc:`DeprecationWarning` and its ++descendants are now ignored unless otherwise requested, preventing ++users from seeing warnings triggered by an application. This change ++was also made in the branch that became Python 3.2. (Discussed ++on stdlib-sig and carried out in :issue:`7319`.) ++ ++In previous releases, :exc:`DeprecationWarning` messages were ++enabled by default, providing Python developers with a clear ++indication of where their code may break in a future major version ++of Python. ++ ++However, there are increasingly many users of Python-based ++applications who are not directly involved in the development of ++those applications. :exc:`DeprecationWarning` messages are ++irrelevant to such users, making them worry about an application ++that's actually working correctly and burdening application developers ++with responding to these concerns. ++ ++You can re-enable display of :exc:`DeprecationWarning` messages by ++running Python with the :option:`-Wdefault <-W>` (short form: ++:option:`-Wd <-W>`) switch, or by setting the :envvar:`PYTHONWARNINGS` ++environment variable to ``"default"`` (or ``"d"``) before running ++Python. Python code can also re-enable them ++by calling ``warnings.simplefilter('default')``. ++ ++The ``unittest`` module also automatically reenables deprecation warnings ++when running tests. + + + Python 3.1 Features +@@ -133,7 +177,7 @@ + A partial list of 3.1 features that were backported to 2.7: + + * The syntax for set literals (``{1,2,3}`` is a mutable set). +-* Dictionary and set comprehensions (``{ i: i*2 for i in range(3)}``). ++* Dictionary and set comprehensions (``{i: i*2 for i in range(3)}``). + * Multiple context managers in a single :keyword:`with` statement. + * A new version of the :mod:`io` library, rewritten in C for performance. + * The ordered-dictionary type described in :ref:`pep-0372`. +@@ -155,7 +199,7 @@ + * :func:`operator.isCallable` and :func:`operator.sequenceIncludes`, + which are not supported in 3.x, now trigger warnings. + * The :option:`-3` switch now automatically +- enables the :option:`-Qwarn` switch that causes warnings ++ enables the :option:`-Qwarn <-Q>` switch that causes warnings + about using classic division with integers and long integers. + + +@@ -390,9 +434,10 @@ + + .. seealso:: + +- `argparse module documentation `__ +- +- `Upgrading optparse code to use argparse `__ ++ :mod:`argparse` documentation ++ The documentation page of the argparse module. ++ ++ :ref:`upgrading-optparse-code` + Part of the Python documentation, describing how to convert + code that uses :mod:`optparse`. + +@@ -402,8 +447,6 @@ + PEP 391: Dictionary-Based Configuration For Logging + ==================================================== + +-.. XXX not documented in library reference yet; add link here once it's added. +- + The :mod:`logging` module is very flexible; applications can define + a tree of logging subsystems, and each logger in this tree can filter + out certain messages, format them differently, and direct messages to +@@ -412,21 +455,21 @@ + All this flexibility can require a lot of configuration. You can + write Python statements to create objects and set their properties, + but a complex set-up requires verbose but boring code. +-:mod:`logging` also supports a :func:`~logging.config.fileConfig` ++:mod:`logging` also supports a :func:`~logging.fileConfig` + function that parses a file, but the file format doesn't support + configuring filters, and it's messier to generate programmatically. + +-Python 2.7 adds a :func:`~logging.config.dictConfig` function that ++Python 2.7 adds a :func:`~logging.dictConfig` function that + uses a dictionary to configure logging. There are many ways to + produce a dictionary from different sources: construct one with code; + parse a file containing JSON; or use a YAML parsing library if one is +-installed. ++installed. For more information see :ref:`logging-config-api`. + + The following example configures two loggers, the root logger and a +-logger named "network". Messages sent to the root logger will be ++logger named "network". Messages sent to the root logger will be + sent to the system log using the syslog protocol, and messages + to the "network" logger will be written to a :file:`network.log` file +-that will be rotated once the log reaches 1Mb. ++that will be rotated once the log reaches 1MB. + + :: + +@@ -445,7 +488,7 @@ + 'filename': '/logs/network.log', + 'formatter': 'standard', + 'level': 'INFO', +- 'maxBytes': 1024*1024}, ++ 'maxBytes': 1000000}, + 'syslog': {'class': 'logging.handlers.SysLogHandler', + 'formatter': 'standard', + 'level': 'ERROR'}}, +@@ -483,16 +526,19 @@ + for UDP or :const:`socket.SOCK_STREAM` for TCP. The default + protocol remains UDP. + +-* :class:`Logger` instances gained a :meth:`getChild` method that retrieves a +- descendant logger using a relative path. For example, +- once you retrieve a logger by doing ``log = getLogger('app')``, ++* :class:`~logging.Logger` instances gained a :meth:`~logging.Logger.getChild` ++ method that retrieves a descendant logger using a relative path. ++ For example, once you retrieve a logger by doing ``log = getLogger('app')``, + calling ``log.getChild('network.listen')`` is equivalent to + ``getLogger('app.network.listen')``. + +-* The :class:`LoggerAdapter` class gained a :meth:`isEnabledFor` method +- that takes a *level* and returns whether the underlying logger would ++* The :class:`~logging.LoggerAdapter` class gained a ++ :meth:`~logging.LoggerAdapter.isEnabledFor` method that takes a ++ *level* and returns whether the underlying logger would + process a message of that level of importance. + ++.. XXX: Logger objects don't have a class declaration so the link don't work ++ + .. seealso:: + + :pep:`391` - Dictionary-Based Configuration For Logging +@@ -501,14 +547,15 @@ + PEP 3106: Dictionary Views + ==================================================== + +-The dictionary methods :meth:`keys`, :meth:`values`, and :meth:`items` +-are different in Python 3.x. They return an object called a :dfn:`view` +-instead of a fully materialized list. +- +-It's not possible to change the return values of :meth:`keys`, +-:meth:`values`, and :meth:`items` in Python 2.7 because too much code +-would break. Instead the 3.x versions were added under the new names +-:meth:`viewkeys`, :meth:`viewvalues`, and :meth:`viewitems`. ++The dictionary methods :meth:`~dict.keys`, :meth:`~dict.values`, and ++:meth:`~dict.items` are different in Python 3.x. They return an object ++called a :dfn:`view` instead of a fully materialized list. ++ ++It's not possible to change the return values of :meth:`~dict.keys`, ++:meth:`~dict.values`, and :meth:`~dict.items` in Python 2.7 because ++too much code would break. Instead the 3.x versions were added ++under the new names :meth:`~dict.viewkeys`, :meth:`~dict.viewvalues`, ++and :meth:`~dict.viewitems`. + + :: + +@@ -550,8 +597,8 @@ + RuntimeError: dictionary changed size during iteration + + You can use the view methods in Python 2.x code, and the 2to3 +-converter will change them to the standard :meth:`keys`, +-:meth:`values`, and :meth:`items` methods. ++converter will change them to the standard :meth:`~dict.keys`, ++:meth:`~dict.values`, and :meth:`~dict.items` methods. + + .. seealso:: + +@@ -624,7 +671,7 @@ + ``{}`` continues to represent an empty dictionary; use + ``set()`` for an empty set. + +- >>> {1,2,3,4,5} ++ >>> {1, 2, 3, 4, 5} + set([1, 2, 3, 4, 5]) + >>> set() # empty set + set([]) +@@ -794,7 +841,7 @@ + ``None`` as its first argument. (Fixed by Georg Brandl; + :issue:`4759`.) + +- .. bytearray doesn't seem to be documented ++ .. XXX bytearray doesn't seem to be documented + + * When using ``@classmethod`` and ``@staticmethod`` to wrap + methods as class or static methods, the wrapper object now +@@ -867,12 +914,6 @@ + + Several performance enhancements have been added: + +-.. * A new :program:`configure` option, :option:`--with-computed-gotos`, +- compiles the main bytecode interpreter loop using a new dispatch +- mechanism that gives speedups of up to 20%, depending on the system +- and benchmark. The new mechanism is only supported on certain +- compilers, such as gcc, SunPro, and icc. +- + * A new opcode was added to perform the initial setup for + :keyword:`with` statements, looking up the :meth:`__enter__` and + :meth:`__exit__` methods. (Contributed by Benjamin Peterson.) +@@ -1054,7 +1095,7 @@ + :meth:`~collections.deque.count` method that returns the number of + contained elements equal to the supplied argument *x*, and a + :meth:`~collections.deque.reverse` method that reverses the elements +- of the deque in-place. :class:`deque` also exposes its maximum ++ of the deque in-place. :class:`~collections.deque` also exposes its maximum + length as the read-only :attr:`~collections.deque.maxlen` attribute. + (Both features added by Raymond Hettinger.) + +@@ -1135,15 +1176,14 @@ + ``Decimal('0.1000000000000000055511151231257827021181583404541015625')``. + (Implemented by Raymond Hettinger; :issue:`4796`.) + +- Comparing instances of :class:`Decimal` with floating-point ++ Comparing instances of :class:`~decimal.Decimal` with floating-point + numbers now produces sensible results based on the numeric values + of the operands. Previously such comparisons would fall back to + Python's default rules for comparing objects, which produced arbitrary + results based on their type. Note that you still cannot combine + :class:`Decimal` and floating-point in other operations such as addition, + since you should be explicitly choosing how to convert between float and +- :class:`Decimal`. +- (Fixed by Mark Dickinson; :issue:`2531`.) ++ :class:`~decimal.Decimal`. (Fixed by Mark Dickinson; :issue:`2531`.) + + The constructor for :class:`~decimal.Decimal` now accepts + floating-point numbers (added by Raymond Hettinger; :issue:`8257`) +@@ -1195,8 +1235,8 @@ + + Ordering comparisons (``<``, ``<=``, ``>``, ``>=``) between + fractions and complex numbers now raise a :exc:`TypeError`. +- This fixes an oversight, making the :class:`Fraction` match the other +- numeric types. ++ This fixes an oversight, making the :class:`~fractions.Fraction` ++ match the other numeric types. + + .. revision 79455 + +@@ -1210,7 +1250,7 @@ + uploads thanks to an added *rest* parameter (patch by Pablo Mouzo; + :issue:`6845`.) + +-* New class decorator: :func:`total_ordering` in the :mod:`functools` ++* New class decorator: :func:`~functools.total_ordering` in the :mod:`functools` + module takes a class that defines an :meth:`__eq__` method and one of + :meth:`__lt__`, :meth:`__le__`, :meth:`__gt__`, or :meth:`__ge__`, + and generates the missing comparison methods. Since the +@@ -1218,7 +1258,7 @@ + this decorator makes it easier to define ordered classes. + (Added by Raymond Hettinger; :issue:`5479`.) + +- New function: :func:`cmp_to_key` will take an old-style comparison ++ New function: :func:`~functools.cmp_to_key` will take an old-style comparison + function that expects two arguments and return a new callable that + can be used as the *key* parameter to functions such as + :func:`sorted`, :func:`min` and :func:`max`, etc. The primary +@@ -1345,7 +1385,7 @@ + with any object literal that decodes to a list of pairs. + (Contributed by Raymond Hettinger; :issue:`5381`.) + +-* The :mod:`mailbox` module's :class:`Maildir` class now records the ++* The :mod:`mailbox` module's :class:`~mailbox.Maildir` class now records the + timestamp on the directories it reads, and only re-reads them if the + modification time has subsequently changed. This improves + performance by avoiding unneeded directory scans. (Fixed by +@@ -1432,7 +1472,7 @@ + * The :mod:`signal` module no longer re-installs the signal handler + unless this is truly necessary, which fixes a bug that could make it + impossible to catch the EINTR signal robustly. (Fixed by +- Charles-François Natali; :issue:`8354`.) ++ Charles-Francois Natali; :issue:`8354`.) + + * New functions: in the :mod:`site` module, three new functions + return various site- and user-specific paths. +@@ -1466,10 +1506,10 @@ + defaults to False; if overridden to be True, + new request connections will have the TCP_NODELAY option set to + prevent buffering many small sends into a single TCP packet. +- The :attr:`~SocketServer.TCPServer.timeout` class attribute can hold ++ The :attr:`~SocketServer.BaseServer.timeout` class attribute can hold + a timeout in seconds that will be applied to the request socket; if +- no request is received within that time, :meth:`handle_timeout` +- will be called and :meth:`handle_request` will return. ++ no request is received within that time, :meth:`~SocketServer.BaseServer.handle_timeout` ++ will be called and :meth:`~SocketServer.BaseServer.handle_request` will return. + (Contributed by Kristján Valur Jónsson; :issue:`6192` and :issue:`6267`.) + + * Updated module: the :mod:`sqlite3` module has been updated to +@@ -1479,7 +1519,7 @@ + and then call :meth:`~sqlite3.Connection.load_extension` to load a particular shared library. + (Updated by Gerhard Häring.) + +-* The :mod:`ssl` module's :class:`ssl.SSLSocket` objects now support the ++* The :mod:`ssl` module's :class:`~ssl.SSLSocket` objects now support the + buffer API, which fixed a test suite failure (fix by Antoine Pitrou; + :issue:`7133`) and automatically set + OpenSSL's :c:macro:`SSL_MODE_AUTO_RETRY`, which will prevent an error +@@ -1535,7 +1575,7 @@ + on receiving an :const:`EINTR` signal. (Reported by several people; final + patch by Gregory P. Smith in :issue:`1068268`.) + +-* New function: :func:`~symtable.is_declared_global` in the :mod:`symtable` module ++* New function: :func:`~symtable.Symbol.is_declared_global` in the :mod:`symtable` module + returns true for variables that are explicitly declared to be global, + false for ones that are implicitly global. + (Contributed by Jeremy Hylton.) +@@ -1716,7 +1756,7 @@ + Makefile and the :file:`pyconfig.h` file. + * :func:`~sysconfig.get_config_vars` returns a dictionary containing + all of the configuration variables. +-* :func:`~sysconfig.getpath` returns the configured path for ++* :func:`~sysconfig.get_path` returns the configured path for + a particular type of module: the standard library, + site-specific modules, platform-specific modules, etc. + * :func:`~sysconfig.is_python_build` returns true if you're running a +@@ -1778,7 +1818,7 @@ + Consult the :mod:`unittest` module documentation for more details. + (Developed in :issue:`6001`.) + +-The :func:`main` function supports some other new options: ++The :func:`~unittest.main` function supports some other new options: + + * :option:`-b` or :option:`--buffer` will buffer the standard output + and standard error streams during each test. If the test passes, +@@ -1796,7 +1836,7 @@ + being tested or the tests being run have defined a signal handler of + their own, by noticing that a signal handler was already set and + calling it. If this doesn't work for you, there's a +- :func:`removeHandler` decorator that can be used to mark tests that ++ :func:`~unittest.removeHandler` decorator that can be used to mark tests that + should have the control-C handling disabled. + + * :option:`-f` or :option:`--failfast` makes +@@ -1923,7 +1963,7 @@ + + :func:`unittest.main` now takes an optional ``exit`` argument. If + False, :func:`~unittest.main` doesn't call :func:`sys.exit`, allowing +-:func:`main` to be used from the interactive interpreter. ++:func:`~unittest.main` to be used from the interactive interpreter. + (Contributed by J. Pablo Fernández; :issue:`3379`.) + + :class:`~unittest.TestResult` has new :meth:`~unittest.TestResult.startTestRun` and +@@ -2120,7 +2160,7 @@ + :c:macro:`Py_ISSPACE`, + :c:macro:`Py_ISUPPER`, + :c:macro:`Py_ISXDIGIT`, +- and :c:macro:`Py_TOLOWER`, :c:macro:`Py_TOUPPER`. ++ :c:macro:`Py_TOLOWER`, and :c:macro:`Py_TOUPPER`. + All of these functions are analogous to the C + standard macros for classifying characters, but ignore the current + locale setting, because in +@@ -2266,11 +2306,11 @@ + (Contributed by David Cournapeau; :issue:`4365`.) + + * The :mod:`_winreg` module for accessing the registry now implements +- the :func:`CreateKeyEx` and :func:`DeleteKeyEx` functions, extended +- versions of previously-supported functions that take several extra +- arguments. The :func:`DisableReflectionKey`, +- :func:`EnableReflectionKey`, and :func:`QueryReflectionKey` were also +- tested and documented. ++ the :func:`~_winreg.CreateKeyEx` and :func:`~_winreg.DeleteKeyEx` ++ functions, extended versions of previously-supported functions that ++ take several extra arguments. The :func:`~_winreg.DisableReflectionKey`, ++ :func:`~_winreg.EnableReflectionKey`, and :func:`~_winreg.QueryReflectionKey` ++ were also tested and documented. + (Implemented by Brian Curtin: :issue:`7347`.) + + * The new :c:func:`_beginthreadex` API is used to start threads, and +@@ -2329,7 +2369,7 @@ + attributes of the resulting code objects are overwritten when the + original filename is obsolete. This can happen if the file has been + renamed, moved, or is accessed through different paths. (Patch by +- Žiga Seilnacht and Jean-Paul Calderone; :issue:`1180193`.) ++ Ziga Seilnacht and Jean-Paul Calderone; :issue:`1180193`.) + + * The :file:`regrtest.py` script now takes a :option:`--randseed=` + switch that takes an integer that will be used as the random seed +@@ -2387,20 +2427,20 @@ + + In the standard library: + +-* Operations with :class:`datetime` instances that resulted in a year ++* Operations with :class:`~datetime.datetime` instances that resulted in a year + falling outside the supported range didn't always raise + :exc:`OverflowError`. Such errors are now checked more carefully + and will now raise the exception. (Reported by Mark Leander, patch + by Anand B. Pillai and Alexander Belopolsky; :issue:`7150`.) + +-* When using :class:`Decimal` instances with a string's ++* When using :class:`~decimal.Decimal` instances with a string's + :meth:`format` method, the default alignment was previously + left-alignment. This has been changed to right-alignment, which might + change the output of your programs. + (Changed by Mark Dickinson; :issue:`6857`.) + + Comparisons involving a signaling NaN value (or ``sNAN``) now signal +- :const:`InvalidOperation` instead of silently returning a true or ++ :const:`~decimal.InvalidOperation` instead of silently returning a true or + false value depending on the comparison operator. Quiet NaN values + (or ``NaN``) are now hashable. (Fixed by Mark Dickinson; + :issue:`7279`.) +@@ -2411,7 +2451,7 @@ + or comment (which looks like ``). + (Patch by Neil Muller; :issue:`2746`.) + +-* The :meth:`readline` method of :class:`StringIO` objects now does ++* The :meth:`~StringIO.StringIO.readline` method of :class:`~StringIO.StringIO` objects now does + nothing when a negative length is requested, as other file-like + objects do. (:issue:`7348`). + +@@ -2470,6 +2510,54 @@ + .. ====================================================================== + + ++.. _py27-maintenance-enhancements: ++ ++New Features Added to Python 2.7 Maintenance Releases ++===================================================== ++ ++New features may be added to Python 2.7 maintenance releases when the ++situation genuinely calls for it. Any such additions must go through ++the Python Enhancement Proposal process, and make a compelling case for why ++they can't be adequately addressed by either adding the new feature solely to ++Python 3, or else by publishing it on the Python Package Index. ++ ++In addition to the specific proposals listed below, there is a general ++exemption allowing new ``-3`` warnings to be added in any Python 2.7 ++maintenance release. ++ ++ ++PEP 434: IDLE Enhancement Exception for All Branches ++---------------------------------------------------- ++ ++:pep:`434` describes a general exemption for changes made to the IDLE ++development environment shipped along with Python. This exemption makes it ++possible for the IDLE developers to provide a more consistent user ++experience across all supported versions of Python 2 and 3. ++ ++For details of any IDLE changes, refer to the NEWS file for the specific ++release. ++ ++ ++PEP 466: Network Security Enhancements for Python 2.7 ++----------------------------------------------------- ++ ++:pep:`466` describes a number of network security enhancement proposals ++that have been approved for inclusion in Python 2.7 maintenance releases, ++with the first of those changes appearing in the Python 2.7.7 release. ++ ++:pep:`466` related features added in Python 2.7.7: ++ ++* :func:`hmac.compare_digest` was added to make a timing attack resistant ++ comparison operation broadly available to Python 2 applications ++ (backported by Alex Gaynor in :issue:`21306`) ++ ++* the version of OpenSSL linked with the prebuilt Windows installers ++ published on python.org was updated to 1.0.1g (contributed by ++ Zachary Ware in :issue:`21462`) ++ ++ ++.. ====================================================================== ++ + .. _acks27: + + Acknowledgements +diff -r c0e311e010fc Include/listobject.h +--- a/Include/listobject.h ++++ b/Include/listobject.h +@@ -46,7 +46,7 @@ + PyAPI_DATA(PyTypeObject) PySortWrapper_Type; + + #define PyList_Check(op) \ +- PyType_FastSubclass(Py_TYPE(op), Py_TPFLAGS_LIST_SUBCLASS) ++ PyType_FastSubclass(Py_TYPE(op), Py_TPFLAGS_LIST_SUBCLASS) + #define PyList_CheckExact(op) (Py_TYPE(op) == &PyList_Type) + + PyAPI_FUNC(PyObject *) PyList_New(Py_ssize_t size); +diff -r c0e311e010fc Include/patchlevel.h +--- a/Include/patchlevel.h ++++ b/Include/patchlevel.h +@@ -23,7 +23,7 @@ + #define PY_RELEASE_SERIAL 0 + + /* Version as a string */ +-#define PY_VERSION "3.4.1" ++#define PY_VERSION "3.4.1+" + /*--end constants--*/ + + /* Version as a single 4-byte hex number, e.g. 0x010502B2 == 1.5.2b2. +diff -r c0e311e010fc Include/sysmodule.h +--- a/Include/sysmodule.h ++++ b/Include/sysmodule.h +@@ -33,6 +33,10 @@ + PyAPI_FUNC(void) PySys_AddXOption(const wchar_t *); + PyAPI_FUNC(PyObject *) PySys_GetXOptions(void); + ++#ifndef Py_LIMITED_API ++PyAPI_DATA(size_t) _PySys_GetSizeOf(PyObject *); ++#endif ++ + #ifdef __cplusplus + } + #endif +diff -r c0e311e010fc Lib/_collections_abc.py +--- a/Lib/_collections_abc.py ++++ b/Lib/_collections_abc.py +@@ -183,7 +183,7 @@ + methods except for __contains__, __iter__ and __len__. + + To override the comparisons (presumably for speed, as the +- semantics are fixed), all you have to do is redefine __le__ and ++ semantics are fixed), redefine __le__ and __ge__, + then the other operations will automatically follow suit. + """ + +@@ -207,12 +207,17 @@ + def __gt__(self, other): + if not isinstance(other, Set): + return NotImplemented +- return other.__lt__(self) ++ return len(self) > len(other) and self.__ge__(other) + + def __ge__(self, other): + if not isinstance(other, Set): + return NotImplemented +- return other.__le__(self) ++ if len(self) < len(other): ++ return False ++ for elem in other: ++ if elem not in self: ++ return False ++ return True + + def __eq__(self, other): + if not isinstance(other, Set): +@@ -236,6 +241,8 @@ + return NotImplemented + return self._from_iterable(value for value in other if value in self) + ++ __rand__ = __and__ ++ + def isdisjoint(self, other): + 'Return True if two sets have a null intersection.' + for value in other: +@@ -249,6 +256,8 @@ + chain = (e for s in (self, other) for e in s) + return self._from_iterable(chain) + ++ __ror__ = __or__ ++ + def __sub__(self, other): + if not isinstance(other, Set): + if not isinstance(other, Iterable): +@@ -257,6 +266,14 @@ + return self._from_iterable(value for value in self + if value not in other) + ++ def __rsub__(self, other): ++ if not isinstance(other, Set): ++ if not isinstance(other, Iterable): ++ return NotImplemented ++ other = self._from_iterable(other) ++ return self._from_iterable(value for value in other ++ if value not in self) ++ + def __xor__(self, other): + if not isinstance(other, Set): + if not isinstance(other, Iterable): +@@ -264,6 +281,8 @@ + other = self._from_iterable(other) + return (self - other) | (other - self) + ++ __rxor__ = __xor__ ++ + def _hash(self): + """Compute the hash value of a set. + +diff -r c0e311e010fc Lib/_osx_support.py +--- a/Lib/_osx_support.py ++++ b/Lib/_osx_support.py +@@ -450,8 +450,16 @@ + # case and disallow installs. + cflags = _config_vars.get(_INITPRE+'CFLAGS', + _config_vars.get('CFLAGS', '')) +- if ((macrelease + '.') >= '10.4.' and +- '-arch' in cflags.strip()): ++ if macrelease: ++ try: ++ macrelease = tuple(int(i) for i in macrelease.split('.')[0:2]) ++ except ValueError: ++ macrelease = (10, 0) ++ else: ++ # assume no universal support ++ macrelease = (10, 0) ++ ++ if (macrelease >= (10, 4)) and '-arch' in cflags.strip(): + # The universal build will build fat binaries, but not on + # systems before 10.4 + +diff -r c0e311e010fc Lib/_pyio.py +--- a/Lib/_pyio.py ++++ b/Lib/_pyio.py +@@ -200,38 +200,45 @@ + (appending and "a" or "") + + (updating and "+" or ""), + closefd, opener=opener) +- line_buffering = False +- if buffering == 1 or buffering < 0 and raw.isatty(): +- buffering = -1 +- line_buffering = True +- if buffering < 0: +- buffering = DEFAULT_BUFFER_SIZE +- try: +- bs = os.fstat(raw.fileno()).st_blksize +- except (OSError, AttributeError): +- pass ++ result = raw ++ try: ++ line_buffering = False ++ if buffering == 1 or buffering < 0 and raw.isatty(): ++ buffering = -1 ++ line_buffering = True ++ if buffering < 0: ++ buffering = DEFAULT_BUFFER_SIZE ++ try: ++ bs = os.fstat(raw.fileno()).st_blksize ++ except (OSError, AttributeError): ++ pass ++ else: ++ if bs > 1: ++ buffering = bs ++ if buffering < 0: ++ raise ValueError("invalid buffering size") ++ if buffering == 0: ++ if binary: ++ return result ++ raise ValueError("can't have unbuffered text I/O") ++ if updating: ++ buffer = BufferedRandom(raw, buffering) ++ elif creating or writing or appending: ++ buffer = BufferedWriter(raw, buffering) ++ elif reading: ++ buffer = BufferedReader(raw, buffering) + else: +- if bs > 1: +- buffering = bs +- if buffering < 0: +- raise ValueError("invalid buffering size") +- if buffering == 0: ++ raise ValueError("unknown mode: %r" % mode) ++ result = buffer + if binary: +- return raw +- raise ValueError("can't have unbuffered text I/O") +- if updating: +- buffer = BufferedRandom(raw, buffering) +- elif creating or writing or appending: +- buffer = BufferedWriter(raw, buffering) +- elif reading: +- buffer = BufferedReader(raw, buffering) +- else: +- raise ValueError("unknown mode: %r" % mode) +- if binary: +- return buffer +- text = TextIOWrapper(buffer, encoding, errors, newline, line_buffering) +- text.mode = mode +- return text ++ return result ++ text = TextIOWrapper(buffer, encoding, errors, newline, line_buffering) ++ result = text ++ text.mode = mode ++ return result ++ except: ++ result.close() ++ raise + + + class DocDescriptor: +diff -r c0e311e010fc Lib/argparse.py +--- a/Lib/argparse.py ++++ b/Lib/argparse.py +@@ -1198,9 +1198,13 @@ + setattr(self, name, kwargs[name]) + + def __eq__(self, other): ++ if not isinstance(other, Namespace): ++ return NotImplemented + return vars(self) == vars(other) + + def __ne__(self, other): ++ if not isinstance(other, Namespace): ++ return NotImplemented + return not (self == other) + + def __contains__(self, key): +diff -r c0e311e010fc Lib/asynchat.py +--- a/Lib/asynchat.py ++++ b/Lib/asynchat.py +@@ -49,22 +49,22 @@ + from collections import deque + + +-class async_chat (asyncore.dispatcher): ++class async_chat(asyncore.dispatcher): + """This is an abstract class. You must derive from this class, and add + the two methods collect_incoming_data() and found_terminator()""" + + # these are overridable defaults + +- ac_in_buffer_size = 65536 +- ac_out_buffer_size = 65536 ++ ac_in_buffer_size = 65536 ++ ac_out_buffer_size = 65536 + + # we don't want to enable the use of encoding by default, because that is a + # sign of an application bug that we don't want to pass silently + +- use_encoding = 0 +- encoding = 'latin-1' ++ use_encoding = 0 ++ encoding = 'latin-1' + +- def __init__ (self, sock=None, map=None): ++ def __init__(self, sock=None, map=None): + # for string terminator matching + self.ac_in_buffer = b'' + +@@ -76,7 +76,7 @@ + # we toss the use of the "simple producer" and replace it with + # a pure deque, which the original fifo was a wrapping of + self.producer_fifo = deque() +- asyncore.dispatcher.__init__ (self, sock, map) ++ asyncore.dispatcher.__init__(self, sock, map) + + def collect_incoming_data(self, data): + raise NotImplementedError("must be implemented in subclass") +@@ -92,13 +92,18 @@ + def found_terminator(self): + raise NotImplementedError("must be implemented in subclass") + +- def set_terminator (self, term): +- "Set the input delimiter. Can be a fixed string of any length, an integer, or None" ++ def set_terminator(self, term): ++ """Set the input delimiter. ++ ++ Can be a fixed string of any length, an integer, or None. ++ """ + if isinstance(term, str) and self.use_encoding: + term = bytes(term, self.encoding) ++ elif isinstance(term, int) and term < 0: ++ raise ValueError('the number of received bytes must be positive') + self.terminator = term + +- def get_terminator (self): ++ def get_terminator(self): + return self.terminator + + # grab some more data from the socket, +@@ -106,10 +111,12 @@ + # check for the terminator, + # if found, transition to the next state. + +- def handle_read (self): ++ def handle_read(self): + + try: +- data = self.recv (self.ac_in_buffer_size) ++ data = self.recv(self.ac_in_buffer_size) ++ except BlockingIOError: ++ return + except OSError as why: + self.handle_error() + return +@@ -128,17 +135,17 @@ + terminator = self.get_terminator() + if not terminator: + # no terminator, collect it all +- self.collect_incoming_data (self.ac_in_buffer) ++ self.collect_incoming_data(self.ac_in_buffer) + self.ac_in_buffer = b'' + elif isinstance(terminator, int): + # numeric terminator + n = terminator + if lb < n: +- self.collect_incoming_data (self.ac_in_buffer) ++ self.collect_incoming_data(self.ac_in_buffer) + self.ac_in_buffer = b'' + self.terminator = self.terminator - lb + else: +- self.collect_incoming_data (self.ac_in_buffer[:n]) ++ self.collect_incoming_data(self.ac_in_buffer[:n]) + self.ac_in_buffer = self.ac_in_buffer[n:] + self.terminator = 0 + self.found_terminator() +@@ -155,32 +162,37 @@ + if index != -1: + # we found the terminator + if index > 0: +- # don't bother reporting the empty string (source of subtle bugs) +- self.collect_incoming_data (self.ac_in_buffer[:index]) ++ # don't bother reporting the empty string ++ # (source of subtle bugs) ++ self.collect_incoming_data(self.ac_in_buffer[:index]) + self.ac_in_buffer = self.ac_in_buffer[index+terminator_len:] +- # This does the Right Thing if the terminator is changed here. ++ # This does the Right Thing if the terminator ++ # is changed here. + self.found_terminator() + else: + # check for a prefix of the terminator +- index = find_prefix_at_end (self.ac_in_buffer, terminator) ++ index = find_prefix_at_end(self.ac_in_buffer, terminator) + if index: + if index != lb: + # we found a prefix, collect up to the prefix +- self.collect_incoming_data (self.ac_in_buffer[:-index]) ++ self.collect_incoming_data(self.ac_in_buffer[:-index]) + self.ac_in_buffer = self.ac_in_buffer[-index:] + break + else: + # no prefix, collect it all +- self.collect_incoming_data (self.ac_in_buffer) ++ self.collect_incoming_data(self.ac_in_buffer) + self.ac_in_buffer = b'' + +- def handle_write (self): ++ def handle_write(self): + self.initiate_send() + +- def handle_close (self): ++ def handle_close(self): + self.close() + +- def push (self, data): ++ def push(self, data): ++ if not isinstance(data, (bytes, bytearray, memoryview)): ++ raise TypeError('data argument must be byte-ish (%r)', ++ type(data)) + sabs = self.ac_out_buffer_size + if len(data) > sabs: + for i in range(0, len(data), sabs): +@@ -189,11 +201,11 @@ + self.producer_fifo.append(data) + self.initiate_send() + +- def push_with_producer (self, producer): ++ def push_with_producer(self, producer): + self.producer_fifo.append(producer) + self.initiate_send() + +- def readable (self): ++ def readable(self): + "predicate for inclusion in the readable for select()" + # cannot use the old predicate, it violates the claim of the + # set_terminator method. +@@ -201,11 +213,11 @@ + # return (len(self.ac_in_buffer) <= self.ac_in_buffer_size) + return 1 + +- def writable (self): ++ def writable(self): + "predicate for inclusion in the writable for select()" + return self.producer_fifo or (not self.connected) + +- def close_when_done (self): ++ def close_when_done(self): + "automatically close this channel once the outgoing queue is empty" + self.producer_fifo.append(None) + +@@ -216,10 +228,8 @@ + if not first: + del self.producer_fifo[0] + if first is None: +- ## print("first is None") + self.handle_close() + return +- ## print("first is not None") + + # handle classic producer behavior + obs = self.ac_out_buffer_size +@@ -251,20 +261,21 @@ + # we tried to send some actual data + return + +- def discard_buffers (self): ++ def discard_buffers(self): + # Emergencies only! + self.ac_in_buffer = b'' + del self.incoming[:] + self.producer_fifo.clear() + ++ + class simple_producer: + +- def __init__ (self, data, buffer_size=512): ++ def __init__(self, data, buffer_size=512): + self.data = data + self.buffer_size = buffer_size + +- def more (self): +- if len (self.data) > self.buffer_size: ++ def more(self): ++ if len(self.data) > self.buffer_size: + result = self.data[:self.buffer_size] + self.data = self.data[self.buffer_size:] + return result +@@ -273,38 +284,40 @@ + self.data = b'' + return result + ++ + class fifo: +- def __init__ (self, list=None): ++ def __init__(self, list=None): + if not list: + self.list = deque() + else: + self.list = deque(list) + +- def __len__ (self): ++ def __len__(self): + return len(self.list) + +- def is_empty (self): ++ def is_empty(self): + return not self.list + +- def first (self): ++ def first(self): + return self.list[0] + +- def push (self, data): ++ def push(self, data): + self.list.append(data) + +- def pop (self): ++ def pop(self): + if self.list: + return (1, self.list.popleft()) + else: + return (0, None) + ++ + # Given 'haystack', see if any prefix of 'needle' is at its end. This + # assumes an exact match has already been checked. Return the number of + # characters matched. + # for example: +-# f_p_a_e ("qwerty\r", "\r\n") => 1 +-# f_p_a_e ("qwertydkjf", "\r\n") => 0 +-# f_p_a_e ("qwerty\r\n", "\r\n") => ++# f_p_a_e("qwerty\r", "\r\n") => 1 ++# f_p_a_e("qwertydkjf", "\r\n") => 0 ++# f_p_a_e("qwerty\r\n", "\r\n") => + + # this could maybe be made faster with a computed regex? + # [answer: no; circa Python-2.0, Jan 2001] +@@ -313,7 +326,7 @@ + # re: 12820/s + # regex: 14035/s + +-def find_prefix_at_end (haystack, needle): ++def find_prefix_at_end(haystack, needle): + l = len(needle) - 1 + while l and not haystack.endswith(needle[:l]): + l -= 1 +diff -r c0e311e010fc Lib/asyncio/__init__.py +--- a/Lib/asyncio/__init__.py ++++ b/Lib/asyncio/__init__.py +@@ -18,6 +18,7 @@ + import _overlapped # Will also be exported. + + # This relies on each of the submodules having an __all__ variable. ++from .coroutines import * + from .events import * + from .futures import * + from .locks import * +@@ -28,13 +29,8 @@ + from .tasks import * + from .transports import * + +-if sys.platform == 'win32': # pragma: no cover +- from .windows_events import * +-else: +- from .unix_events import * # pragma: no cover +- +- +-__all__ = (events.__all__ + ++__all__ = (coroutines.__all__ + ++ events.__all__ + + futures.__all__ + + locks.__all__ + + protocols.__all__ + +@@ -43,3 +39,10 @@ + subprocess.__all__ + + tasks.__all__ + + transports.__all__) ++ ++if sys.platform == 'win32': # pragma: no cover ++ from .windows_events import * ++ __all__ += windows_events.__all__ ++else: ++ from .unix_events import * # pragma: no cover ++ __all__ += unix_events.__all__ +diff -r c0e311e010fc Lib/asyncio/base_events.py +--- a/Lib/asyncio/base_events.py ++++ b/Lib/asyncio/base_events.py +@@ -1,7 +1,7 @@ + """Base implementation of event loop. + + The event loop can be broken up into a multiplexer (the part +-responsible for notifying us of IO events) and the event loop proper, ++responsible for notifying us of I/O events) and the event loop proper, + which wraps a multiplexer with functionality for scheduling callbacks, + immediately or at a given time in the future. + +@@ -17,16 +17,20 @@ + import collections + import concurrent.futures + import heapq ++import inspect + import logging ++import os + import socket + import subprocess + import time +-import os ++import traceback + import sys + ++from . import coroutines + from . import events + from . import futures + from . import tasks ++from .coroutines import coroutine + from .log import logger + + +@@ -37,6 +41,24 @@ + _MAX_WORKERS = 5 + + ++def _format_handle(handle): ++ cb = handle._callback ++ if inspect.ismethod(cb) and isinstance(cb.__self__, tasks.Task): ++ # format the task ++ return repr(cb.__self__) ++ else: ++ return str(handle) ++ ++ ++def _format_pipe(fd): ++ if fd == subprocess.PIPE: ++ return '' ++ elif fd == subprocess.STDOUT: ++ return '' ++ else: ++ return repr(fd) ++ ++ + class _StopError(BaseException): + """Raised to stop the event loop.""" + +@@ -57,7 +79,7 @@ + type_mask |= socket.SOCK_NONBLOCK + if hasattr(socket, 'SOCK_CLOEXEC'): + type_mask |= socket.SOCK_CLOEXEC +- # Use getaddrinfo(AI_NUMERICHOST) to ensure that the address is ++ # Use getaddrinfo(flags=AI_NUMERICHOST) to ensure that the address is + # already resolved. + try: + socket.getaddrinfo(host, port, +@@ -76,49 +98,54 @@ + class Server(events.AbstractServer): + + def __init__(self, loop, sockets): +- self.loop = loop ++ self._loop = loop + self.sockets = sockets +- self.active_count = 0 +- self.waiters = [] ++ self._active_count = 0 ++ self._waiters = [] + +- def attach(self, transport): ++ def __repr__(self): ++ return '<%s sockets=%r>' % (self.__class__.__name__, self.sockets) ++ ++ def _attach(self): + assert self.sockets is not None +- self.active_count += 1 ++ self._active_count += 1 + +- def detach(self, transport): +- assert self.active_count > 0 +- self.active_count -= 1 +- if self.active_count == 0 and self.sockets is None: ++ def _detach(self): ++ assert self._active_count > 0 ++ self._active_count -= 1 ++ if self._active_count == 0 and self.sockets is None: + self._wakeup() + + def close(self): + sockets = self.sockets +- if sockets is not None: +- self.sockets = None +- for sock in sockets: +- self.loop._stop_serving(sock) +- if self.active_count == 0: +- self._wakeup() ++ if sockets is None: ++ return ++ self.sockets = None ++ for sock in sockets: ++ self._loop._stop_serving(sock) ++ if self._active_count == 0: ++ self._wakeup() + + def _wakeup(self): +- waiters = self.waiters +- self.waiters = None ++ waiters = self._waiters ++ self._waiters = None + for waiter in waiters: + if not waiter.done(): + waiter.set_result(waiter) + +- @tasks.coroutine ++ @coroutine + def wait_closed(self): +- if self.sockets is None or self.waiters is None: ++ if self.sockets is None or self._waiters is None: + return +- waiter = futures.Future(loop=self.loop) +- self.waiters.append(waiter) ++ waiter = futures.Future(loop=self._loop) ++ self._waiters.append(waiter) + yield from waiter + + + class BaseEventLoop(events.AbstractEventLoop): + + def __init__(self): ++ self._closed = False + self._ready = collections.deque() + self._scheduled = [] + self._default_executor = None +@@ -126,7 +153,26 @@ + self._running = False + self._clock_resolution = time.get_clock_info('monotonic').resolution + self._exception_handler = None +- self._debug = False ++ self._debug = (not sys.flags.ignore_environment ++ and bool(os.environ.get('PYTHONASYNCIODEBUG'))) ++ # In debug mode, if the execution of a callback or a step of a task ++ # exceed this duration in seconds, the slow callback/task is logged. ++ self.slow_callback_duration = 0.1 ++ ++ def __repr__(self): ++ return ('<%s running=%s closed=%s debug=%s>' ++ % (self.__class__.__name__, self.is_running(), ++ self.is_closed(), self.get_debug())) ++ ++ def create_task(self, coro): ++ """Schedule a coroutine object. ++ ++ Return a task object. ++ """ ++ task = tasks.Task(coro, loop=self) ++ if task._source_traceback: ++ del task._source_traceback[-1] ++ return task + + def _make_socket_transport(self, sock, protocol, waiter=None, *, + extra=None, server=None): +@@ -140,7 +186,7 @@ + raise NotImplementedError + + def _make_datagram_transport(self, sock, protocol, +- address=None, extra=None): ++ address=None, waiter=None, extra=None): + """Create datagram transport.""" + raise NotImplementedError + +@@ -154,27 +200,33 @@ + """Create write pipe transport.""" + raise NotImplementedError + +- @tasks.coroutine ++ @coroutine + def _make_subprocess_transport(self, protocol, args, shell, + stdin, stdout, stderr, bufsize, + extra=None, **kwargs): + """Create subprocess transport.""" + raise NotImplementedError + +- def _read_from_self(self): +- """XXX""" +- raise NotImplementedError ++ def _write_to_self(self): ++ """Write a byte to self-pipe, to wake up the event loop. + +- def _write_to_self(self): +- """XXX""" ++ This may be called from a different thread. ++ ++ The subclass is responsible for implementing the self-pipe. ++ """ + raise NotImplementedError + + def _process_events(self, event_list): + """Process selector events.""" + raise NotImplementedError + ++ def _check_closed(self): ++ if self._closed: ++ raise RuntimeError('Event loop is closed') ++ + def run_forever(self): + """Run until stop() is called.""" ++ self._check_closed() + if self._running: + raise RuntimeError('Event loop is running.') + self._running = True +@@ -192,13 +244,21 @@ + + If the argument is a coroutine, it is wrapped in a Task. + +- XXX TBD: It would be disastrous to call run_until_complete() ++ WARNING: It would be disastrous to call run_until_complete() + with the same coroutine twice -- it would wrap it in two + different Tasks and that can't be good. + + Return the Future's result, or raise its exception. + """ ++ self._check_closed() ++ ++ new_task = not isinstance(future, futures.Future) + future = tasks.async(future, loop=self) ++ if new_task: ++ # An exception is raised if the future didn't complete, so there ++ # is no need to log the "destroy pending task" message ++ future._log_destroy_pending = False ++ + future.add_done_callback(_raise_stop_error) + self.run_forever() + future.remove_done_callback(_raise_stop_error) +@@ -210,9 +270,9 @@ + def stop(self): + """Stop running the event loop. + +- Every callback scheduled before stop() is called will run. +- Callback scheduled after stop() is called won't. However, +- those callbacks will run if run() is called again later. ++ Every callback scheduled before stop() is called will run. Callbacks ++ scheduled after stop() is called will not run. However, those callbacks ++ will run if run_forever is called again later. + """ + self.call_soon(_raise_stop_error) + +@@ -221,7 +281,16 @@ + + This clears the queues and shuts down the executor, + but does not wait for the executor to finish. ++ ++ The event loop must not be running. + """ ++ if self._running: ++ raise RuntimeError("Cannot close a running event loop") ++ if self._closed: ++ return ++ if self._debug: ++ logger.debug("Close %r", self) ++ self._closed = True + self._ready.clear() + self._scheduled.clear() + executor = self._default_executor +@@ -229,12 +298,21 @@ + self._default_executor = None + executor.shutdown(wait=False) + ++ def is_closed(self): ++ """Returns True if the event loop was closed.""" ++ return self._closed ++ + def is_running(self): +- """Returns running status of event loop.""" ++ """Returns True if the event loop is running.""" + return self._running + + def time(self): +- """Return the time according to the event loop's clock.""" ++ """Return the time according to the event loop's clock. ++ ++ This is a float expressed in seconds since an epoch, but the ++ epoch, precision, accuracy and drift are unspecified and may ++ differ per event loop. ++ """ + return time.monotonic() + + def call_later(self, delay, callback, *args): +@@ -244,7 +322,7 @@ + can be used to cancel the call. + + The delay can be an int or float, expressed in seconds. It is +- always a relative time. ++ always relative to the current time. + + Each callback will be called exactly once. If two callbacks + are scheduled for exactly the same time, it undefined which +@@ -253,62 +331,81 @@ + Any positional arguments after the callback will be passed to + the callback when it is called. + """ +- return self.call_at(self.time() + delay, callback, *args) ++ timer = self.call_at(self.time() + delay, callback, *args) ++ if timer._source_traceback: ++ del timer._source_traceback[-1] ++ return timer + + def call_at(self, when, callback, *args): +- """Like call_later(), but uses an absolute time.""" +- if tasks.iscoroutinefunction(callback): ++ """Like call_later(), but uses an absolute time. ++ ++ Absolute time corresponds to the event loop's time() method. ++ """ ++ if coroutines.iscoroutinefunction(callback): + raise TypeError("coroutines cannot be used with call_at()") + if self._debug: + self._assert_is_current_event_loop() + timer = events.TimerHandle(when, callback, args, self) ++ if timer._source_traceback: ++ del timer._source_traceback[-1] + heapq.heappush(self._scheduled, timer) + return timer + + def call_soon(self, callback, *args): + """Arrange for a callback to be called as soon as possible. + +- This operates as a FIFO queue, callbacks are called in the ++ This operates as a FIFO queue: callbacks are called in the + order in which they are registered. Each callback will be + called exactly once. + + Any positional arguments after the callback will be passed to + the callback when it is called. + """ +- return self._call_soon(callback, args, check_loop=True) ++ handle = self._call_soon(callback, args, check_loop=True) ++ if handle._source_traceback: ++ del handle._source_traceback[-1] ++ return handle + + def _call_soon(self, callback, args, check_loop): +- if tasks.iscoroutinefunction(callback): ++ if coroutines.iscoroutinefunction(callback): + raise TypeError("coroutines cannot be used with call_soon()") + if self._debug and check_loop: + self._assert_is_current_event_loop() + handle = events.Handle(callback, args, self) ++ if handle._source_traceback: ++ del handle._source_traceback[-1] + self._ready.append(handle) + return handle + + def _assert_is_current_event_loop(self): + """Asserts that this event loop is the current event loop. + +- Non-threadsafe methods of this class make this assumption and will ++ Non-thread-safe methods of this class make this assumption and will + likely behave incorrectly when the assumption is violated. + +- Should only be called when (self._debug == True). The caller is ++ Should only be called when (self._debug == True). The caller is + responsible for checking this condition for performance reasons. + """ +- if events.get_event_loop() is not self: ++ try: ++ current = events.get_event_loop() ++ except AssertionError: ++ return ++ if current is not self: + raise RuntimeError( +- "non-threadsafe operation invoked on an event loop other " ++ "Non-thread-safe operation invoked on an event loop other " + "than the current one") + + def call_soon_threadsafe(self, callback, *args): +- """XXX""" ++ """Like call_soon(), but thread-safe.""" + handle = self._call_soon(callback, args, check_loop=False) ++ if handle._source_traceback: ++ del handle._source_traceback[-1] + self._write_to_self() + return handle + + def run_in_executor(self, executor, callback, *args): +- if tasks.iscoroutinefunction(callback): +- raise TypeError("coroutines cannot be used with run_in_executor()") ++ if coroutines.iscoroutinefunction(callback): ++ raise TypeError("Coroutines cannot be used with run_in_executor()") + if isinstance(callback, events.Handle): + assert not args + assert not isinstance(callback, events.TimerHandle) +@@ -327,19 +424,58 @@ + def set_default_executor(self, executor): + self._default_executor = executor + ++ def _getaddrinfo_debug(self, host, port, family, type, proto, flags): ++ msg = ["%s:%r" % (host, port)] ++ if family: ++ msg.append('family=%r' % family) ++ if type: ++ msg.append('type=%r' % type) ++ if proto: ++ msg.append('proto=%r' % proto) ++ if flags: ++ msg.append('flags=%r' % flags) ++ msg = ', '.join(msg) ++ logger.debug('Get address info %s', msg) ++ ++ t0 = self.time() ++ addrinfo = socket.getaddrinfo(host, port, family, type, proto, flags) ++ dt = self.time() - t0 ++ ++ msg = ('Getting address info %s took %.3f ms: %r' ++ % (msg, dt * 1e3, addrinfo)) ++ if dt >= self.slow_callback_duration: ++ logger.info(msg) ++ else: ++ logger.debug(msg) ++ return addrinfo ++ + def getaddrinfo(self, host, port, *, + family=0, type=0, proto=0, flags=0): +- return self.run_in_executor(None, socket.getaddrinfo, +- host, port, family, type, proto, flags) ++ if self._debug: ++ return self.run_in_executor(None, self._getaddrinfo_debug, ++ host, port, family, type, proto, flags) ++ else: ++ return self.run_in_executor(None, socket.getaddrinfo, ++ host, port, family, type, proto, flags) + + def getnameinfo(self, sockaddr, flags=0): + return self.run_in_executor(None, socket.getnameinfo, sockaddr, flags) + +- @tasks.coroutine ++ @coroutine + def create_connection(self, protocol_factory, host=None, port=None, *, + ssl=None, family=0, proto=0, flags=0, sock=None, + local_addr=None, server_hostname=None): +- """XXX""" ++ """Connect to a TCP server. ++ ++ Create a streaming transport connection to a given Internet host and ++ port: socket family AF_INET or socket.AF_INET6 depending on host (or ++ family if specified), socket type SOCK_STREAM. protocol_factory must be ++ a callable returning a protocol instance. ++ ++ This method is a coroutine which will try to establish the connection ++ in the background. When successful, the coroutine returns a ++ (transport, protocol) pair. ++ """ + if server_hostname is not None and not ssl: + raise ValueError('server_hostname is only meaningful with ssl') + +@@ -407,11 +543,17 @@ + sock.close() + sock = None + continue ++ if self._debug: ++ logger.debug("connect %r to %r", sock, address) + yield from self.sock_connect(sock, address) + except OSError as exc: + if sock is not None: + sock.close() + exceptions.append(exc) ++ except: ++ if sock is not None: ++ sock.close() ++ raise + else: + break + else: +@@ -435,9 +577,12 @@ + + transport, protocol = yield from self._create_connection_transport( + sock, protocol_factory, ssl, server_hostname) ++ if self._debug: ++ logger.debug("%r connected to %s:%r: (%r, %r)", ++ sock, host, port, transport, protocol) + return transport, protocol + +- @tasks.coroutine ++ @coroutine + def _create_connection_transport(self, sock, protocol_factory, ssl, + server_hostname): + protocol = protocol_factory() +@@ -453,7 +598,7 @@ + yield from waiter + return transport, protocol + +- @tasks.coroutine ++ @coroutine + def create_datagram_endpoint(self, protocol_factory, + local_addr=None, remote_addr=None, *, + family=0, proto=0, flags=0): +@@ -463,7 +608,7 @@ + raise ValueError('unexpected address family') + addr_pairs_info = (((family, proto), (None, None)),) + else: +- # join addresss by (family, protocol) ++ # join address by (family, protocol) + addr_infos = collections.OrderedDict() + for idx, addr in ((0, local_addr), (1, remote_addr)): + if addr is not None: +@@ -512,16 +657,32 @@ + if sock is not None: + sock.close() + exceptions.append(exc) ++ except: ++ if sock is not None: ++ sock.close() ++ raise + else: + break + else: + raise exceptions[0] + + protocol = protocol_factory() +- transport = self._make_datagram_transport(sock, protocol, r_addr) ++ waiter = futures.Future(loop=self) ++ transport = self._make_datagram_transport(sock, protocol, r_addr, ++ waiter) ++ if self._debug: ++ if local_addr: ++ logger.info("Datagram endpoint local_addr=%r remote_addr=%r " ++ "created: (%r, %r)", ++ local_addr, remote_addr, transport, protocol) ++ else: ++ logger.debug("Datagram endpoint remote_addr=%r created: " ++ "(%r, %r)", ++ remote_addr, transport, protocol) ++ yield from waiter + return transport, protocol + +- @tasks.coroutine ++ @coroutine + def create_server(self, protocol_factory, host=None, port=None, + *, + family=socket.AF_UNSPEC, +@@ -530,7 +691,12 @@ + backlog=100, + ssl=None, + reuse_address=None): +- """XXX""" ++ """Create a TCP server bound to host and port. ++ ++ Return a Server object which can be used to stop the service. ++ ++ This method is a coroutine. ++ """ + if isinstance(ssl, bool): + raise TypeError('ssl argument must be an SSLContext or None') + if host is not None or port is not None: +@@ -584,8 +750,7 @@ + sock.close() + else: + if sock is None: +- raise ValueError( +- 'host and port was not specified and no sock specified') ++ raise ValueError('Neither host/port nor sock were specified') + sockets = [sock] + + server = Server(self, sockets) +@@ -593,25 +758,46 @@ + sock.listen(backlog) + sock.setblocking(False) + self._start_serving(protocol_factory, sock, ssl, server) ++ if self._debug: ++ logger.info("%r is serving", server) + return server + +- @tasks.coroutine ++ @coroutine + def connect_read_pipe(self, protocol_factory, pipe): + protocol = protocol_factory() + waiter = futures.Future(loop=self) + transport = self._make_read_pipe_transport(pipe, protocol, waiter) + yield from waiter ++ if self._debug: ++ logger.debug('Read pipe %r connected: (%r, %r)', ++ pipe.fileno(), transport, protocol) + return transport, protocol + +- @tasks.coroutine ++ @coroutine + def connect_write_pipe(self, protocol_factory, pipe): + protocol = protocol_factory() + waiter = futures.Future(loop=self) + transport = self._make_write_pipe_transport(pipe, protocol, waiter) + yield from waiter ++ if self._debug: ++ logger.debug('Write pipe %r connected: (%r, %r)', ++ pipe.fileno(), transport, protocol) + return transport, protocol + +- @tasks.coroutine ++ def _log_subprocess(self, msg, stdin, stdout, stderr): ++ info = [msg] ++ if stdin is not None: ++ info.append('stdin=%s' % _format_pipe(stdin)) ++ if stdout is not None and stderr == subprocess.STDOUT: ++ info.append('stdout=stderr=%s' % _format_pipe(stdout)) ++ else: ++ if stdout is not None: ++ info.append('stdout=%s' % _format_pipe(stdout)) ++ if stderr is not None: ++ info.append('stderr=%s' % _format_pipe(stderr)) ++ logger.debug(' '.join(info)) ++ ++ @coroutine + def subprocess_shell(self, protocol_factory, cmd, *, stdin=subprocess.PIPE, + stdout=subprocess.PIPE, stderr=subprocess.PIPE, + universal_newlines=False, shell=True, bufsize=0, +@@ -625,11 +811,18 @@ + if bufsize != 0: + raise ValueError("bufsize must be 0") + protocol = protocol_factory() ++ if self._debug: ++ # don't log parameters: they may contain sensitive information ++ # (password) and may be too long ++ debug_log = 'run shell command %r' % cmd ++ self._log_subprocess(debug_log, stdin, stdout, stderr) + transport = yield from self._make_subprocess_transport( + protocol, cmd, True, stdin, stdout, stderr, bufsize, **kwargs) ++ if self._debug: ++ logger.info('%s: %r' % (debug_log, transport)) + return transport, protocol + +- @tasks.coroutine ++ @coroutine + def subprocess_exec(self, protocol_factory, program, *args, + stdin=subprocess.PIPE, stdout=subprocess.PIPE, + stderr=subprocess.PIPE, universal_newlines=False, +@@ -647,9 +840,16 @@ + "a bytes or text string, not %s" + % type(arg).__name__) + protocol = protocol_factory() ++ if self._debug: ++ # don't log parameters: they may contain sensitive information ++ # (password) and may be too long ++ debug_log = 'execute program %r' % program ++ self._log_subprocess(debug_log, stdin, stdout, stderr) + transport = yield from self._make_subprocess_transport( + protocol, popen_args, False, stdin, stdout, stderr, + bufsize, **kwargs) ++ if self._debug: ++ logger.info('%s: %r' % (debug_log, transport)) + return transport, protocol + + def set_exception_handler(self, handler): +@@ -659,7 +859,7 @@ + be set. + + If handler is a callable object, it should have a +- matching signature to '(loop, context)', where 'loop' ++ signature matching '(loop, context)', where 'loop' + will be a reference to the active event loop, 'context' + will be a dict object (see `call_exception_handler()` + documentation for details about context). +@@ -676,7 +876,7 @@ + handler is set, and can be called by a custom exception + handler that wants to defer to the default behavior. + +- context parameter has the same meaning as in ++ The context parameter has the same meaning as in + `call_exception_handler()`. + """ + message = context.get('message') +@@ -693,15 +893,22 @@ + for key in sorted(context): + if key in {'message', 'exception'}: + continue +- log_lines.append('{}: {!r}'.format(key, context[key])) ++ value = context[key] ++ if key == 'source_traceback': ++ tb = ''.join(traceback.format_list(value)) ++ value = 'Object created at (most recent call last):\n' ++ value += tb.rstrip() ++ else: ++ value = repr(value) ++ log_lines.append('{}: {}'.format(key, value)) + + logger.error('\n'.join(log_lines), exc_info=exc_info) + + def call_exception_handler(self, context): +- """Call the current event loop exception handler. ++ """Call the current event loop's exception handler. + +- context is a dict object containing the following keys +- (new keys maybe introduced later): ++ The context argument is a dict containing the following keys: ++ + - 'message': Error message; + - 'exception' (optional): Exception object; + - 'future' (optional): Future instance; +@@ -710,8 +917,10 @@ + - 'transport' (optional): Transport instance; + - 'socket' (optional): Socket instance. + +- Note: this method should not be overloaded in subclassed +- event loops. For any custom exception handling, use ++ New keys maybe introduced in the future. ++ ++ Note: do not overload this method in an event loop subclass. ++ For custom exception handling, use the + `set_exception_handler()` method. + """ + if self._exception_handler is None: +@@ -736,7 +945,7 @@ + 'context': context, + }) + except Exception: +- # Guard 'default_exception_handler' in case it's ++ # Guard 'default_exception_handler' in case it is + # overloaded. + logger.error('Exception in default exception handler ' + 'while handling an unexpected error ' +@@ -744,7 +953,7 @@ + exc_info=True) + + def _add_callback(self, handle): +- """Add a Handle to ready or scheduled.""" ++ """Add a Handle to _scheduled (TimerHandle) or _ready.""" + assert isinstance(handle, events.Handle), 'A Handle is required here' + if handle._cancelled: + return +@@ -777,20 +986,26 @@ + when = self._scheduled[0]._when + timeout = max(0, when - self.time()) + +- # TODO: Instrumentation only in debug mode? +- if logger.isEnabledFor(logging.INFO): ++ if self._debug and timeout != 0: + t0 = self.time() + event_list = self._selector.select(timeout) +- t1 = self.time() +- if t1-t0 >= 1: ++ dt = self.time() - t0 ++ if dt >= 1.0: + level = logging.INFO + else: + level = logging.DEBUG +- if timeout is not None: +- logger.log(level, 'poll %.3f took %.3f seconds', +- timeout, t1-t0) +- else: +- logger.log(level, 'poll took %.3f seconds', t1-t0) ++ nevent = len(event_list) ++ if timeout is None: ++ logger.log(level, 'poll took %.3f ms: %s events', ++ dt * 1e3, nevent) ++ elif nevent: ++ logger.log(level, ++ 'poll %.3f ms took %.3f ms: %s events', ++ timeout * 1e3, dt * 1e3, nevent) ++ elif dt >= 1.0: ++ logger.log(level, ++ 'poll %.3f ms took %.3f ms: timeout', ++ timeout * 1e3, dt * 1e3) + else: + event_list = self._selector.select(timeout) + self._process_events(event_list) +@@ -809,11 +1024,20 @@ + # Note: We run all currently scheduled callbacks, but not any + # callbacks scheduled by callbacks run this time around -- + # they will be run the next time (after another I/O poll). +- # Use an idiom that is threadsafe without using locks. ++ # Use an idiom that is thread-safe without using locks. + ntodo = len(self._ready) + for i in range(ntodo): + handle = self._ready.popleft() +- if not handle._cancelled: ++ if handle._cancelled: ++ continue ++ if self._debug: ++ t0 = self.time() ++ handle._run() ++ dt = self.time() - t0 ++ if dt >= self.slow_callback_duration: ++ logger.warning('Executing %s took %.3f seconds', ++ _format_handle(handle), dt) ++ else: + handle._run() + handle = None # Needed to break cycles when an exception occurs. + +diff -r c0e311e010fc Lib/asyncio/base_subprocess.py +--- a/Lib/asyncio/base_subprocess.py ++++ b/Lib/asyncio/base_subprocess.py +@@ -2,8 +2,9 @@ + import subprocess + + from . import protocols +-from . import tasks + from . import transports ++from .coroutines import coroutine ++from .log import logger + + + class BaseSubprocessTransport(transports.SubprocessTransport): +@@ -14,6 +15,7 @@ + super().__init__(extra) + self._protocol = protocol + self._loop = loop ++ self._pid = None + + self._pipes = {} + if stdin == subprocess.PIPE: +@@ -27,7 +29,36 @@ + self._returncode = None + self._start(args=args, shell=shell, stdin=stdin, stdout=stdout, + stderr=stderr, bufsize=bufsize, **kwargs) ++ self._pid = self._proc.pid + self._extra['subprocess'] = self._proc ++ if self._loop.get_debug(): ++ if isinstance(args, (bytes, str)): ++ program = args ++ else: ++ program = args[0] ++ logger.debug('process %r created: pid %s', ++ program, self._pid) ++ ++ def __repr__(self): ++ info = [self.__class__.__name__, 'pid=%s' % self._pid] ++ if self._returncode is not None: ++ info.append('returncode=%s' % self._returncode) ++ ++ stdin = self._pipes.get(0) ++ if stdin is not None: ++ info.append('stdin=%s' % stdin.pipe) ++ ++ stdout = self._pipes.get(1) ++ stderr = self._pipes.get(2) ++ if stdout is not None and stderr is stdout: ++ info.append('stdout=stderr=%s' % stdout.pipe) ++ else: ++ if stdout is not None: ++ info.append('stdout=%s' % stdout.pipe) ++ if stderr is not None: ++ info.append('stderr=%s' % stderr.pipe) ++ ++ return '<%s>' % ' '.join(info) + + def _start(self, args, shell, stdin, stdout, stderr, bufsize, **kwargs): + raise NotImplementedError +@@ -45,7 +76,7 @@ + self.terminate() + + def get_pid(self): +- return self._proc.pid ++ return self._pid + + def get_returncode(self): + return self._returncode +@@ -65,7 +96,7 @@ + def kill(self): + self._proc.kill() + +- @tasks.coroutine ++ @coroutine + def _post_init(self): + proc = self._proc + loop = self._loop +@@ -108,6 +139,9 @@ + def _process_exited(self, returncode): + assert returncode is not None, returncode + assert self._returncode is None, self._returncode ++ if self._loop.get_debug(): ++ logger.info('%r exited with return code %r', ++ self, returncode) + self._returncode = returncode + self._call(self._protocol.process_exited) + self._try_finish() +@@ -141,6 +175,10 @@ + def connection_made(self, transport): + self.pipe = transport + ++ def __repr__(self): ++ return ('<%s fd=%s pipe=%r>' ++ % (self.__class__.__name__, self.fd, self.pipe)) ++ + def connection_lost(self, exc): + self.disconnected = True + self.proc._pipe_connection_lost(self.fd, exc) +diff -r c0e311e010fc Lib/asyncio/coroutines.py +--- /dev/null ++++ b/Lib/asyncio/coroutines.py +@@ -0,0 +1,195 @@ ++__all__ = ['coroutine', ++ 'iscoroutinefunction', 'iscoroutine'] ++ ++import functools ++import inspect ++import opcode ++import os ++import sys ++import traceback ++import types ++ ++from . import events ++from . import futures ++from .log import logger ++ ++ ++# Opcode of "yield from" instruction ++_YIELD_FROM = opcode.opmap['YIELD_FROM'] ++ ++# If you set _DEBUG to true, @coroutine will wrap the resulting ++# generator objects in a CoroWrapper instance (defined below). That ++# instance will log a message when the generator is never iterated ++# over, which may happen when you forget to use "yield from" with a ++# coroutine call. Note that the value of the _DEBUG flag is taken ++# when the decorator is used, so to be of any use it must be set ++# before you define your coroutines. A downside of using this feature ++# is that tracebacks show entries for the CoroWrapper.__next__ method ++# when _DEBUG is true. ++_DEBUG = (not sys.flags.ignore_environment ++ and bool(os.environ.get('PYTHONASYNCIODEBUG'))) ++ ++ ++# Check for CPython issue #21209 ++def has_yield_from_bug(): ++ class MyGen: ++ def __init__(self): ++ self.send_args = None ++ def __iter__(self): ++ return self ++ def __next__(self): ++ return 42 ++ def send(self, *what): ++ self.send_args = what ++ return None ++ def yield_from_gen(gen): ++ yield from gen ++ value = (1, 2, 3) ++ gen = MyGen() ++ coro = yield_from_gen(gen) ++ next(coro) ++ coro.send(value) ++ return gen.send_args != (value,) ++_YIELD_FROM_BUG = has_yield_from_bug() ++del has_yield_from_bug ++ ++ ++class CoroWrapper: ++ # Wrapper for coroutine object in _DEBUG mode. ++ ++ def __init__(self, gen, func): ++ assert inspect.isgenerator(gen), gen ++ self.gen = gen ++ self.func = func ++ self._source_traceback = traceback.extract_stack(sys._getframe(1)) ++ # __name__, __qualname__, __doc__ attributes are set by the coroutine() ++ # decorator ++ ++ def __repr__(self): ++ coro_repr = _format_coroutine(self) ++ if self._source_traceback: ++ frame = self._source_traceback[-1] ++ coro_repr += ', created at %s:%s' % (frame[0], frame[1]) ++ return '<%s %s>' % (self.__class__.__name__, coro_repr) ++ ++ def __iter__(self): ++ return self ++ ++ def __next__(self): ++ return next(self.gen) ++ ++ if _YIELD_FROM_BUG: ++ # For for CPython issue #21209: using "yield from" and a custom ++ # generator, generator.send(tuple) unpacks the tuple instead of passing ++ # the tuple unchanged. Check if the caller is a generator using "yield ++ # from" to decide if the parameter should be unpacked or not. ++ def send(self, *value): ++ frame = sys._getframe() ++ caller = frame.f_back ++ assert caller.f_lasti >= 0 ++ if caller.f_code.co_code[caller.f_lasti] != _YIELD_FROM: ++ value = value[0] ++ return self.gen.send(value) ++ else: ++ def send(self, value): ++ return self.gen.send(value) ++ ++ def throw(self, exc): ++ return self.gen.throw(exc) ++ ++ def close(self): ++ return self.gen.close() ++ ++ @property ++ def gi_frame(self): ++ return self.gen.gi_frame ++ ++ @property ++ def gi_running(self): ++ return self.gen.gi_running ++ ++ @property ++ def gi_code(self): ++ return self.gen.gi_code ++ ++ def __del__(self): ++ # Be careful accessing self.gen.frame -- self.gen might not exist. ++ gen = getattr(self, 'gen', None) ++ frame = getattr(gen, 'gi_frame', None) ++ if frame is not None and frame.f_lasti == -1: ++ msg = '%r was never yielded from' % self ++ tb = getattr(self, '_source_traceback', ()) ++ if tb: ++ tb = ''.join(traceback.format_list(tb)) ++ msg += ('\nCoroutine object created at ' ++ '(most recent call last):\n') ++ msg += tb.rstrip() ++ logger.error(msg) ++ ++ ++def coroutine(func): ++ """Decorator to mark coroutines. ++ ++ If the coroutine is not yielded from before it is destroyed, ++ an error message is logged. ++ """ ++ if inspect.isgeneratorfunction(func): ++ coro = func ++ else: ++ @functools.wraps(func) ++ def coro(*args, **kw): ++ res = func(*args, **kw) ++ if isinstance(res, futures.Future) or inspect.isgenerator(res): ++ res = yield from res ++ return res ++ ++ if not _DEBUG: ++ wrapper = coro ++ else: ++ @functools.wraps(func) ++ def wrapper(*args, **kwds): ++ w = CoroWrapper(coro(*args, **kwds), func) ++ if w._source_traceback: ++ del w._source_traceback[-1] ++ w.__name__ = func.__name__ ++ if hasattr(func, '__qualname__'): ++ w.__qualname__ = func.__qualname__ ++ w.__doc__ = func.__doc__ ++ return w ++ ++ wrapper._is_coroutine = True # For iscoroutinefunction(). ++ return wrapper ++ ++ ++def iscoroutinefunction(func): ++ """Return True if func is a decorated coroutine function.""" ++ return getattr(func, '_is_coroutine', False) ++ ++ ++_COROUTINE_TYPES = (types.GeneratorType, CoroWrapper) ++ ++def iscoroutine(obj): ++ """Return True if obj is a coroutine object.""" ++ return isinstance(obj, _COROUTINE_TYPES) ++ ++ ++def _format_coroutine(coro): ++ assert iscoroutine(coro) ++ coro_name = getattr(coro, '__qualname__', coro.__name__) ++ ++ filename = coro.gi_code.co_filename ++ if (isinstance(coro, CoroWrapper) ++ and not inspect.isgeneratorfunction(coro.func)): ++ filename, lineno = events._get_function_source(coro.func) ++ if coro.gi_frame is None: ++ coro_repr = '%s() done, defined at %s:%s' % (coro_name, filename, lineno) ++ else: ++ coro_repr = '%s() running, defined at %s:%s' % (coro_name, filename, lineno) ++ elif coro.gi_frame is not None: ++ lineno = coro.gi_frame.f_lineno ++ coro_repr = '%s() running at %s:%s' % (coro_name, filename, lineno) ++ else: ++ lineno = coro.gi_code.co_firstlineno ++ coro_repr = '%s() done, defined at %s:%s' % (coro_name, filename, lineno) ++ ++ return coro_repr +diff -r c0e311e010fc Lib/asyncio/events.py +--- a/Lib/asyncio/events.py ++++ b/Lib/asyncio/events.py +@@ -8,15 +8,72 @@ + 'get_child_watcher', 'set_child_watcher', + ] + ++import functools ++import inspect ++import reprlib ++import socket + import subprocess ++import sys + import threading +-import socket ++import traceback ++ ++ ++_PY34 = sys.version_info >= (3, 4) ++ ++ ++def _get_function_source(func): ++ if _PY34: ++ func = inspect.unwrap(func) ++ elif hasattr(func, '__wrapped__'): ++ func = func.__wrapped__ ++ if inspect.isfunction(func): ++ code = func.__code__ ++ return (code.co_filename, code.co_firstlineno) ++ if isinstance(func, functools.partial): ++ return _get_function_source(func.func) ++ if _PY34 and isinstance(func, functools.partialmethod): ++ return _get_function_source(func.func) ++ return None ++ ++ ++def _format_args(args): ++ """Format function arguments. ++ ++ Special case for a single parameter: ('hello',) is formatted as ('hello'). ++ """ ++ # use reprlib to limit the length of the output ++ args_repr = reprlib.repr(args) ++ if len(args) == 1 and args_repr.endswith(',)'): ++ args_repr = args_repr[:-2] + ')' ++ return args_repr ++ ++ ++def _format_callback(func, args, suffix=''): ++ if isinstance(func, functools.partial): ++ if args is not None: ++ suffix = _format_args(args) + suffix ++ return _format_callback(func.func, func.args, suffix) ++ ++ func_repr = getattr(func, '__qualname__', None) ++ if not func_repr: ++ func_repr = repr(func) ++ ++ if args is not None: ++ func_repr += _format_args(args) ++ if suffix: ++ func_repr += suffix ++ ++ source = _get_function_source(func) ++ if source: ++ func_repr += ' at %s:%s' % source ++ return func_repr + + + class Handle: + """Object returned by callback registration methods.""" + +- __slots__ = ['_callback', '_args', '_cancelled', '_loop', '__weakref__'] ++ __slots__ = ('_callback', '_args', '_cancelled', '_loop', ++ '_source_traceback', '__weakref__') + + def __init__(self, callback, args, loop): + assert not isinstance(callback, Handle), 'A Handle is not a callback' +@@ -24,27 +81,41 @@ + self._callback = callback + self._args = args + self._cancelled = False ++ if self._loop.get_debug(): ++ self._source_traceback = traceback.extract_stack(sys._getframe(1)) ++ else: ++ self._source_traceback = None + + def __repr__(self): +- res = 'Handle({}, {})'.format(self._callback, self._args) ++ info = [self.__class__.__name__] + if self._cancelled: +- res += '' +- return res ++ info.append('cancelled') ++ if self._callback is not None: ++ info.append(_format_callback(self._callback, self._args)) ++ if self._source_traceback: ++ frame = self._source_traceback[-1] ++ info.append('created at %s:%s' % (frame[0], frame[1])) ++ return '<%s>' % ' '.join(info) + + def cancel(self): + self._cancelled = True ++ self._callback = None ++ self._args = None + + def _run(self): + try: + self._callback(*self._args) + except Exception as exc: +- msg = 'Exception in callback {}{!r}'.format(self._callback, +- self._args) +- self._loop.call_exception_handler({ ++ cb = _format_callback(self._callback, self._args) ++ msg = 'Exception in callback {}'.format(cb) ++ context = { + 'message': msg, + 'exception': exc, + 'handle': self, +- }) ++ } ++ if self._source_traceback: ++ context['source_traceback'] = self._source_traceback ++ self._loop.call_exception_handler(context) + self = None # Needed to break cycles when an exception occurs. + + +@@ -56,17 +127,21 @@ + def __init__(self, when, callback, args, loop): + assert when is not None + super().__init__(callback, args, loop) +- ++ if self._source_traceback: ++ del self._source_traceback[-1] + self._when = when + + def __repr__(self): +- res = 'TimerHandle({}, {}, {})'.format(self._when, +- self._callback, +- self._args) ++ info = [] + if self._cancelled: +- res += '' +- +- return res ++ info.append('cancelled') ++ info.append('when=%s' % self._when) ++ if self._callback is not None: ++ info.append(_format_callback(self._callback, self._args)) ++ if self._source_traceback: ++ frame = self._source_traceback[-1] ++ info.append('created at %s:%s' % (frame[0], frame[1])) ++ return '<%s %s>' % (self.__class__.__name__, ' '.join(info)) + + def __hash__(self): + return hash(self._when) +@@ -140,6 +215,10 @@ + """Return whether the event loop is currently running.""" + raise NotImplementedError + ++ def is_closed(self): ++ """Returns True if the event loop was closed.""" ++ raise NotImplementedError ++ + def close(self): + """Close the loop. + +@@ -165,6 +244,11 @@ + def time(self): + raise NotImplementedError + ++ # Method scheduling a coroutine object: create a task. ++ ++ def create_task(self, coro): ++ raise NotImplementedError ++ + # Methods for interacting with threads. + + def call_soon_threadsafe(self, callback, *args): +@@ -257,11 +341,11 @@ + # Pipes and subprocesses. + + def connect_read_pipe(self, protocol_factory, pipe): +- """Register read pipe in event loop. ++ """Register read pipe in event loop. Set the pipe to non-blocking mode. + + protocol_factory should instantiate object with Protocol interface. +- pipe is file-like object already switched to nonblocking. +- Return pair (transport, protocol), where transport support ++ pipe is a file-like object. ++ Return pair (transport, protocol), where transport supports the + ReadTransport interface.""" + # The reason to accept file-like object instead of just file descriptor + # is: we need to own pipe and close it at transport finishing +@@ -355,25 +439,33 @@ + """Abstract policy for accessing the event loop.""" + + def get_event_loop(self): +- """XXX""" ++ """Get the event loop for the current context. ++ ++ Returns an event loop object implementing the BaseEventLoop interface, ++ or raises an exception in case no event loop has been set for the ++ current context and the current policy does not specify to create one. ++ ++ It should never return None.""" + raise NotImplementedError + + def set_event_loop(self, loop): +- """XXX""" ++ """Set the event loop for the current context to loop.""" + raise NotImplementedError + + def new_event_loop(self): +- """XXX""" ++ """Create and return a new event loop object according to this ++ policy's rules. If there's need to set this loop as the event loop for ++ the current context, set_event_loop must be called explicitly.""" + raise NotImplementedError + + # Child processes handling (Unix only). + + def get_child_watcher(self): +- """XXX""" ++ "Get the watcher for child processes." + raise NotImplementedError + + def set_child_watcher(self, watcher): +- """XXX""" ++ """Set the watcher for child processes.""" + raise NotImplementedError + + +@@ -447,39 +539,42 @@ + + + def get_event_loop_policy(): +- """XXX""" ++ """Get the current event loop policy.""" + if _event_loop_policy is None: + _init_event_loop_policy() + return _event_loop_policy + + + def set_event_loop_policy(policy): +- """XXX""" ++ """Set the current event loop policy. ++ ++ If policy is None, the default policy is restored.""" + global _event_loop_policy + assert policy is None or isinstance(policy, AbstractEventLoopPolicy) + _event_loop_policy = policy + + + def get_event_loop(): +- """XXX""" ++ """Equivalent to calling get_event_loop_policy().get_event_loop().""" + return get_event_loop_policy().get_event_loop() + + + def set_event_loop(loop): +- """XXX""" ++ """Equivalent to calling get_event_loop_policy().set_event_loop(loop).""" + get_event_loop_policy().set_event_loop(loop) + + + def new_event_loop(): +- """XXX""" ++ """Equivalent to calling get_event_loop_policy().new_event_loop().""" + return get_event_loop_policy().new_event_loop() + + + def get_child_watcher(): +- """XXX""" ++ """Equivalent to calling get_event_loop_policy().get_child_watcher().""" + return get_event_loop_policy().get_child_watcher() + + + def set_child_watcher(watcher): +- """XXX""" ++ """Equivalent to calling ++ get_event_loop_policy().set_child_watcher(watcher).""" + return get_event_loop_policy().set_child_watcher(watcher) +diff -r c0e311e010fc Lib/asyncio/futures.py +--- a/Lib/asyncio/futures.py ++++ b/Lib/asyncio/futures.py +@@ -7,6 +7,7 @@ + + import concurrent.futures._base + import logging ++import reprlib + import sys + import traceback + +@@ -82,10 +83,11 @@ + in a discussion about closing files when they are collected. + """ + +- __slots__ = ['exc', 'tb', 'loop'] ++ __slots__ = ('loop', 'source_traceback', 'exc', 'tb') + +- def __init__(self, exc, loop): +- self.loop = loop ++ def __init__(self, future, exc): ++ self.loop = future._loop ++ self.source_traceback = future._source_traceback + self.exc = exc + self.tb = None + +@@ -102,11 +104,12 @@ + + def __del__(self): + if self.tb: +- msg = 'Future/Task exception was never retrieved:\n{tb}' +- context = { +- 'message': msg.format(tb=''.join(self.tb)), +- } +- self.loop.call_exception_handler(context) ++ msg = 'Future/Task exception was never retrieved' ++ if self.source_traceback: ++ msg += '\nFuture/Task created at (most recent call last):\n' ++ msg += ''.join(traceback.format_list(self.source_traceback)) ++ msg += ''.join(self.tb).rstrip() ++ self.loop.call_exception_handler({'message': msg}) + + + class Future: +@@ -149,26 +152,54 @@ + else: + self._loop = loop + self._callbacks = [] ++ if self._loop.get_debug(): ++ self._source_traceback = traceback.extract_stack(sys._getframe(1)) ++ else: ++ self._source_traceback = None ++ ++ def _format_callbacks(self): ++ cb = self._callbacks ++ size = len(cb) ++ if not size: ++ cb = '' ++ ++ def format_cb(callback): ++ return events._format_callback(callback, ()) ++ ++ if size == 1: ++ cb = format_cb(cb[0]) ++ elif size == 2: ++ cb = '{}, {}'.format(format_cb(cb[0]), format_cb(cb[1])) ++ elif size > 2: ++ cb = '{}, <{} more>, {}'.format(format_cb(cb[0]), ++ size-2, ++ format_cb(cb[-1])) ++ return 'cb=[%s]' % cb ++ ++ def _repr_info(self): ++ info = [self._state.lower()] ++ if self._state == _FINISHED: ++ if self._exception is not None: ++ info.append('exception={!r}'.format(self._exception)) ++ else: ++ # use reprlib to limit the length of the output, especially ++ # for very long strings ++ result = reprlib.repr(self._result) ++ info.append('result={}'.format(result)) ++ if self._callbacks: ++ info.append(self._format_callbacks()) ++ if self._source_traceback: ++ frame = self._source_traceback[-1] ++ info.append('created at %s:%s' % (frame[0], frame[1])) ++ return info + + def __repr__(self): +- res = self.__class__.__name__ +- if self._state == _FINISHED: +- if self._exception is not None: +- res += ''.format(self._exception) +- else: +- res += ''.format(self._result) +- elif self._callbacks: +- size = len(self._callbacks) +- if size > 2: +- res += '<{}, [{}, <{} more>, {}]>'.format( +- self._state, self._callbacks[0], +- size-2, self._callbacks[-1]) +- else: +- res += '<{}, {}>'.format(self._state, self._callbacks) +- else: +- res += '<{}>'.format(self._state) +- return res ++ info = self._repr_info() ++ return '<%s %s>' % (self.__class__.__name__, ' '.join(info)) + ++ # On Python 3.3 or older, objects with a destructor part of a reference ++ # cycle are never destroyed. It's not more the case on Python 3.4 thanks to ++ # the PEP 442. + if _PY34: + def __del__(self): + if not self._log_traceback: +@@ -177,10 +208,13 @@ + return + exc = self._exception + context = { +- 'message': 'Future/Task exception was never retrieved', ++ 'message': ('%s exception was never retrieved' ++ % self.__class__.__name__), + 'exception': exc, + 'future': self, + } ++ if self._source_traceback: ++ context['source_traceback'] = self._source_traceback + self._loop.call_exception_handler(context) + + def cancel(self): +@@ -288,6 +322,12 @@ + + # So-called internal methods (note: no set_running_or_notify_cancel()). + ++ def _set_result_unless_cancelled(self, result): ++ """Helper setting the result only if the future was not cancelled.""" ++ if self.cancelled(): ++ return ++ self.set_result(result) ++ + def set_result(self, result): + """Mark the future done and set its result. + +@@ -316,7 +356,7 @@ + if _PY34: + self._log_traceback = True + else: +- self._tb_logger = _TracebackLogger(exception, self._loop) ++ self._tb_logger = _TracebackLogger(self, exception) + # Arrange for the logger to be activated after all callbacks + # have had a chance to call result() or exception(). + self._loop.call_soon(self._tb_logger.activate) +diff -r c0e311e010fc Lib/asyncio/locks.py +--- a/Lib/asyncio/locks.py ++++ b/Lib/asyncio/locks.py +@@ -6,7 +6,7 @@ + + from . import events + from . import futures +-from . import tasks ++from .coroutines import coroutine + + + class _ContextManager: +@@ -112,7 +112,7 @@ + """Return True if lock is acquired.""" + return self._locked + +- @tasks.coroutine ++ @coroutine + def acquire(self): + """Acquire a lock. + +@@ -225,7 +225,7 @@ + to true again.""" + self._value = False + +- @tasks.coroutine ++ @coroutine + def wait(self): + """Block until the internal flag is true. + +@@ -255,14 +255,17 @@ + A new Lock object is created and used as the underlying lock. + """ + +- def __init__(self, *, loop=None): ++ def __init__(self, lock=None, *, loop=None): + if loop is not None: + self._loop = loop + else: + self._loop = events.get_event_loop() + +- # Lock as an attribute as in threading.Condition. +- lock = Lock(loop=self._loop) ++ if lock is None: ++ lock = Lock(loop=self._loop) ++ elif lock._loop is not self._loop: ++ raise ValueError("loop argument must agree with lock") ++ + self._lock = lock + # Export the lock's locked(), acquire() and release() methods. + self.locked = lock.locked +@@ -278,7 +281,7 @@ + extra = '{},waiters:{}'.format(extra, len(self._waiters)) + return '<{} [{}]>'.format(res[1:-1], extra) + +- @tasks.coroutine ++ @coroutine + def wait(self): + """Wait until notified. + +@@ -306,7 +309,7 @@ + finally: + yield from self.acquire() + +- @tasks.coroutine ++ @coroutine + def wait_for(self, predicate): + """Wait until a predicate becomes true. + +@@ -402,7 +405,7 @@ + """Returns True if semaphore can not be acquired immediately.""" + return self._value == 0 + +- @tasks.coroutine ++ @coroutine + def acquire(self): + """Acquire a semaphore. + +diff -r c0e311e010fc Lib/asyncio/proactor_events.py +--- a/Lib/asyncio/proactor_events.py ++++ b/Lib/asyncio/proactor_events.py +@@ -35,10 +35,24 @@ + self._closing = False # Set when close() called. + self._eof_written = False + if self._server is not None: +- self._server.attach(self) ++ self._server._attach() + self._loop.call_soon(self._protocol.connection_made, self) + if waiter is not None: +- self._loop.call_soon(waiter.set_result, None) ++ # wait until protocol.connection_made() has been called ++ self._loop.call_soon(waiter._set_result_unless_cancelled, None) ++ ++ def __repr__(self): ++ info = [self.__class__.__name__, 'fd=%s' % self._sock.fileno()] ++ if self._read_fut is not None: ++ info.append('read=%s' % self._read_fut) ++ if self._write_fut is not None: ++ info.append("write=%r" % self._write_fut) ++ if self._buffer: ++ bufsize = len(self._buffer) ++ info.append('write_bufsize=%s' % bufsize) ++ if self._eof_written: ++ info.append('EOF written') ++ return '<%s>' % ' '.join(info) + + def _set_extra(self, sock): + self._extra['pipe'] = sock +@@ -54,7 +68,10 @@ + self._read_fut.cancel() + + def _fatal_error(self, exc, message='Fatal error on pipe transport'): +- if not isinstance(exc, (BrokenPipeError, ConnectionResetError)): ++ if isinstance(exc, (BrokenPipeError, ConnectionResetError)): ++ if self._loop.get_debug(): ++ logger.debug("%r: %s", self, message, exc_info=True) ++ else: + self._loop.call_exception_handler({ + 'message': message, + 'exception': exc, +@@ -90,7 +107,7 @@ + self._sock.close() + server = self._server + if server is not None: +- server.detach(self) ++ server._detach() + self._server = None + + def get_write_buffer_size(self): +@@ -107,7 +124,6 @@ + def __init__(self, loop, sock, protocol, waiter=None, + extra=None, server=None): + super().__init__(loop, sock, protocol, waiter, extra, server) +- self._read_fut = None + self._paused = False + self._loop.call_soon(self._loop_reading) + +@@ -117,6 +133,8 @@ + if self._paused: + raise RuntimeError('Already paused') + self._paused = True ++ if self._loop.get_debug(): ++ logger.debug("%r pauses reading", self) + + def resume_reading(self): + if not self._paused: +@@ -125,6 +143,8 @@ + if self._closing: + return + self._loop.call_soon(self._loop_reading, self._read_fut) ++ if self._loop.get_debug(): ++ logger.debug("%r resumes reading", self) + + def _loop_reading(self, fut=None): + if self._paused: +@@ -165,6 +185,8 @@ + if data: + self._protocol.data_received(data) + elif data is not None: ++ if self._loop.get_debug(): ++ logger.debug("%r received EOF", self) + keep_open = self._protocol.eof_received() + if not keep_open: + self.close() +@@ -353,21 +375,28 @@ + sock, protocol, waiter, extra) + + def close(self): +- if self._proactor is not None: +- self._close_self_pipe() +- self._proactor.close() +- self._proactor = None +- self._selector = None +- super().close() +- self._accept_futures.clear() ++ if self.is_closed(): ++ return ++ super().close() ++ self._stop_accept_futures() ++ self._close_self_pipe() ++ self._proactor.close() ++ self._proactor = None ++ self._selector = None + + def sock_recv(self, sock, n): ++ if self.get_debug() and sock.gettimeout() != 0: ++ raise ValueError("the socket must be non-blocking") + return self._proactor.recv(sock, n) + + def sock_sendall(self, sock, data): ++ if self.get_debug() and sock.gettimeout() != 0: ++ raise ValueError("the socket must be non-blocking") + return self._proactor.send(sock, data) + + def sock_connect(self, sock, address): ++ if self.get_debug() and sock.gettimeout() != 0: ++ raise ValueError("the socket must be non-blocking") + try: + base_events._check_resolved_address(sock, address) + except ValueError as err: +@@ -378,6 +407,8 @@ + return self._proactor.connect(sock, address) + + def sock_accept(self, sock): ++ if self.get_debug() and sock.gettimeout() != 0: ++ raise ValueError("the socket must be non-blocking") + return self._proactor.accept(sock) + + def _socketpair(self): +@@ -399,7 +430,9 @@ + self._ssock.setblocking(False) + self._csock.setblocking(False) + self._internal_fds += 1 +- self.call_soon(self._loop_self_reading) ++ # don't check the current loop because _make_self_pipe() is called ++ # from the event loop constructor ++ self._call_soon(self._loop_self_reading, (), check_loop=False) + + def _loop_self_reading(self, f=None): + try: +@@ -414,7 +447,7 @@ + f.add_done_callback(self._loop_self_reading) + + def _write_to_self(self): +- self._csock.send(b'x') ++ self._csock.send(b'\0') + + def _start_serving(self, protocol_factory, sock, ssl=None, server=None): + if ssl: +@@ -424,10 +457,15 @@ + try: + if f is not None: + conn, addr = f.result() ++ if self._debug: ++ logger.debug("%r got a new connection from %r: %r", ++ server, addr, conn) + protocol = protocol_factory() + self._make_socket_transport( + conn, protocol, + extra={'peername': addr}, server=server) ++ if self.is_closed(): ++ return + f = self._proactor.accept(sock) + except OSError as exc: + if sock.fileno() != -1: +@@ -448,8 +486,12 @@ + def _process_events(self, event_list): + pass # XXX hard work currently done in poll + +- def _stop_serving(self, sock): ++ def _stop_accept_futures(self): + for future in self._accept_futures.values(): + future.cancel() ++ self._accept_futures.clear() ++ ++ def _stop_serving(self, sock): ++ self._stop_accept_futures() + self._proactor._stop_serving(sock) + sock.close() +diff -r c0e311e010fc Lib/asyncio/queues.py +--- a/Lib/asyncio/queues.py ++++ b/Lib/asyncio/queues.py +@@ -105,7 +105,7 @@ + if self._maxsize <= 0: + return False + else: +- return self.qsize() == self._maxsize ++ return self.qsize() >= self._maxsize + + @coroutine + def put(self, item): +@@ -126,7 +126,7 @@ + self._put(item) + getter.set_result(self._get()) + +- elif self._maxsize > 0 and self._maxsize == self.qsize(): ++ elif self._maxsize > 0 and self._maxsize <= self.qsize(): + waiter = futures.Future(loop=self._loop) + + self._putters.append((item, waiter)) +@@ -152,7 +152,7 @@ + self._put(item) + getter.set_result(self._get()) + +- elif self._maxsize > 0 and self._maxsize == self.qsize(): ++ elif self._maxsize > 0 and self._maxsize <= self.qsize(): + raise QueueFull + else: + self._put(item) +@@ -173,7 +173,7 @@ + # run, we need to defer the put for a tick to ensure that + # getters and putters alternate perfectly. See + # ChannelTest.test_wait. +- self._loop.call_soon(putter.set_result, None) ++ self._loop.call_soon(putter._set_result_unless_cancelled, None) + + return self._get() + +diff -r c0e311e010fc Lib/asyncio/selector_events.py +--- a/Lib/asyncio/selector_events.py ++++ b/Lib/asyncio/selector_events.py +@@ -23,6 +23,17 @@ + from .log import logger + + ++def _test_selector_event(selector, fd, event): ++ # Test if the selector is monitoring 'event' events ++ # for the file descriptor 'fd'. ++ try: ++ key = selector.get_key(fd) ++ except KeyError: ++ return False ++ else: ++ return bool(key.events & event) ++ ++ + class BaseSelectorEventLoop(base_events.BaseEventLoop): + """Selector event loop. + +@@ -51,15 +62,18 @@ + server_side, server_hostname, extra, server) + + def _make_datagram_transport(self, sock, protocol, +- address=None, extra=None): +- return _SelectorDatagramTransport(self, sock, protocol, address, extra) ++ address=None, waiter=None, extra=None): ++ return _SelectorDatagramTransport(self, sock, protocol, ++ address, waiter, extra) + + def close(self): ++ if self.is_closed(): ++ return ++ super().close() ++ self._close_self_pipe() + if self._selector is not None: +- self._close_self_pipe() + self._selector.close() + self._selector = None +- super().close() + + def _socketpair(self): + raise NotImplementedError +@@ -80,11 +94,20 @@ + self._internal_fds += 1 + self.add_reader(self._ssock.fileno(), self._read_from_self) + ++ def _process_self_data(self, data): ++ pass ++ + def _read_from_self(self): +- try: +- self._ssock.recv(1) +- except (BlockingIOError, InterruptedError): +- pass ++ while True: ++ try: ++ data = self._ssock.recv(4096) ++ if not data: ++ break ++ self._process_self_data(data) ++ except InterruptedError: ++ continue ++ except BlockingIOError: ++ break + + def _write_to_self(self): + # This may be called from a different thread, possibly after +@@ -95,9 +118,12 @@ + csock = self._csock + if csock is not None: + try: +- csock.send(b'x') ++ csock.send(b'\0') + except OSError: +- pass ++ if self._debug: ++ logger.debug("Fail to write a null byte into the " ++ "self-pipe socket", ++ exc_info=True) + + def _start_serving(self, protocol_factory, sock, + sslcontext=None, server=None): +@@ -108,6 +134,9 @@ + sslcontext=None, server=None): + try: + conn, addr = sock.accept() ++ if self._debug: ++ logger.debug("%r got a new connection from %r: %r", ++ server, addr, conn) + conn.setblocking(False) + except (BlockingIOError, InterruptedError, ConnectionAbortedError): + pass # False alarm. +@@ -143,8 +172,7 @@ + + def add_reader(self, fd, callback, *args): + """Add a reader callback.""" +- if self._selector is None: +- raise RuntimeError('Event loop is closed') ++ self._check_closed() + handle = events.Handle(callback, args, self) + try: + key = self._selector.get_key(fd) +@@ -160,7 +188,7 @@ + + def remove_reader(self, fd): + """Remove a reader callback.""" +- if self._selector is None: ++ if self.is_closed(): + return False + try: + key = self._selector.get_key(fd) +@@ -182,8 +210,7 @@ + + def add_writer(self, fd, callback, *args): + """Add a writer callback..""" +- if self._selector is None: +- raise RuntimeError('Event loop is closed') ++ self._check_closed() + handle = events.Handle(callback, args, self) + try: + key = self._selector.get_key(fd) +@@ -199,7 +226,7 @@ + + def remove_writer(self, fd): + """Remove a writer callback.""" +- if self._selector is None: ++ if self.is_closed(): + return False + try: + key = self._selector.get_key(fd) +@@ -221,7 +248,16 @@ + return False + + def sock_recv(self, sock, n): +- """XXX""" ++ """Receive data from the socket. ++ ++ The return value is a bytes object representing the data received. ++ The maximum amount of data to be received at once is specified by ++ nbytes. ++ ++ This method is a coroutine. ++ """ ++ if self.get_debug() and sock.gettimeout() != 0: ++ raise ValueError("the socket must be non-blocking") + fut = futures.Future(loop=self) + self._sock_recv(fut, False, sock, n) + return fut +@@ -248,7 +284,18 @@ + fut.set_result(data) + + def sock_sendall(self, sock, data): +- """XXX""" ++ """Send data to the socket. ++ ++ The socket must be connected to a remote socket. This method continues ++ to send data from data until either all data has been sent or an ++ error occurs. None is returned on success. On error, an exception is ++ raised, and there is no way to determine how much data, if any, was ++ successfully processed by the receiving end of the connection. ++ ++ This method is a coroutine. ++ """ ++ if self.get_debug() and sock.gettimeout() != 0: ++ raise ValueError("the socket must be non-blocking") + fut = futures.Future(loop=self) + if data: + self._sock_sendall(fut, False, sock, data) +@@ -280,7 +327,18 @@ + self.add_writer(fd, self._sock_sendall, fut, True, sock, data) + + def sock_connect(self, sock, address): +- """XXX""" ++ """Connect to a remote socket at address. ++ ++ The address must be already resolved to avoid the trap of hanging the ++ entire event loop when the address requires doing a DNS lookup. For ++ example, it must be an IP address, not an hostname, for AF_INET and ++ AF_INET6 address families. Use getaddrinfo() to resolve the hostname ++ asynchronously. ++ ++ This method is a coroutine. ++ """ ++ if self.get_debug() and sock.gettimeout() != 0: ++ raise ValueError("the socket must be non-blocking") + fut = futures.Future(loop=self) + try: + base_events._check_resolved_address(sock, address) +@@ -313,7 +371,17 @@ + fut.set_result(None) + + def sock_accept(self, sock): +- """XXX""" ++ """Accept a connection. ++ ++ The socket must be bound to an address and listening for connections. ++ The return value is a pair (conn, address) where conn is a new socket ++ object usable to send and receive data on the connection, and address ++ is the address bound to the socket on the other end of the connection. ++ ++ This method is a coroutine. ++ """ ++ if self.get_debug() and sock.gettimeout() != 0: ++ raise ValueError("the socket must be non-blocking") + fut = futures.Future(loop=self) + self._sock_accept(fut, False, sock) + return fut +@@ -378,7 +446,27 @@ + self._conn_lost = 0 # Set when call to connection_lost scheduled. + self._closing = False # Set when close() called. + if self._server is not None: +- self._server.attach(self) ++ self._server._attach() ++ ++ def __repr__(self): ++ info = [self.__class__.__name__, 'fd=%s' % self._sock_fd] ++ polling = _test_selector_event(self._loop._selector, ++ self._sock_fd, selectors.EVENT_READ) ++ if polling: ++ info.append('read=polling') ++ else: ++ info.append('read=idle') ++ ++ polling = _test_selector_event(self._loop._selector, ++ self._sock_fd, selectors.EVENT_WRITE) ++ if polling: ++ state = 'polling' ++ else: ++ state = 'idle' ++ ++ bufsize = self.get_write_buffer_size() ++ info.append('write=<%s, bufsize=%s>' % (state, bufsize)) ++ return '<%s>' % ' '.join(info) + + def abort(self): + self._force_close(None) +@@ -394,7 +482,10 @@ + + def _fatal_error(self, exc, message='Fatal error on transport'): + # Should be called from exception handler only. +- if not isinstance(exc, (BrokenPipeError, ConnectionResetError)): ++ if isinstance(exc, (BrokenPipeError, ConnectionResetError)): ++ if self._loop.get_debug(): ++ logger.debug("%r: %s", self, message, exc_info=True) ++ else: + self._loop.call_exception_handler({ + 'message': message, + 'exception': exc, +@@ -425,7 +516,7 @@ + self._loop = None + server = self._server + if server is not None: +- server.detach(self) ++ server._detach() + self._server = None + + def get_write_buffer_size(self): +@@ -443,7 +534,8 @@ + self._loop.add_reader(self._sock_fd, self._read_ready) + self._loop.call_soon(self._protocol.connection_made, self) + if waiter is not None: +- self._loop.call_soon(waiter.set_result, None) ++ # wait until protocol.connection_made() has been called ++ self._loop.call_soon(waiter._set_result_unless_cancelled, None) + + def pause_reading(self): + if self._closing: +@@ -452,6 +544,8 @@ + raise RuntimeError('Already paused') + self._paused = True + self._loop.remove_reader(self._sock_fd) ++ if self._loop.get_debug(): ++ logger.debug("%r pauses reading", self) + + def resume_reading(self): + if not self._paused: +@@ -460,6 +554,8 @@ + if self._closing: + return + self._loop.add_reader(self._sock_fd, self._read_ready) ++ if self._loop.get_debug(): ++ logger.debug("%r resumes reading", self) + + def _read_ready(self): + try: +@@ -472,6 +568,8 @@ + if data: + self._protocol.data_received(data) + else: ++ if self._loop.get_debug(): ++ logger.debug("%r received EOF", self) + keep_open = self._protocol.eof_received() + if keep_open: + # We're keeping the connection open so the +@@ -598,31 +696,37 @@ + # SSL-specific extra info. (peercert is set later) + self._extra.update(sslcontext=sslcontext) + +- self._on_handshake() ++ if self._loop.get_debug(): ++ logger.debug("%r starts SSL handshake", self) ++ start_time = self._loop.time() ++ else: ++ start_time = None ++ self._on_handshake(start_time) + +- def _on_handshake(self): ++ def _on_handshake(self, start_time): + try: + self._sock.do_handshake() + except ssl.SSLWantReadError: +- self._loop.add_reader(self._sock_fd, self._on_handshake) ++ self._loop.add_reader(self._sock_fd, ++ self._on_handshake, start_time) + return + except ssl.SSLWantWriteError: +- self._loop.add_writer(self._sock_fd, self._on_handshake) ++ self._loop.add_writer(self._sock_fd, ++ self._on_handshake, start_time) + return +- except Exception as exc: ++ except BaseException as exc: ++ if self._loop.get_debug(): ++ logger.warning("%r: SSL handshake failed", ++ self, exc_info=True) + self._loop.remove_reader(self._sock_fd) + self._loop.remove_writer(self._sock_fd) + self._sock.close() + if self._waiter is not None: + self._waiter.set_exception(exc) +- return +- except BaseException as exc: +- self._loop.remove_reader(self._sock_fd) +- self._loop.remove_writer(self._sock_fd) +- self._sock.close() +- if self._waiter is not None: +- self._waiter.set_exception(exc) +- raise ++ if isinstance(exc, Exception): ++ return ++ else: ++ raise + + self._loop.remove_reader(self._sock_fd) + self._loop.remove_writer(self._sock_fd) +@@ -636,6 +740,10 @@ + try: + ssl.match_hostname(peercert, self._server_hostname) + except Exception as exc: ++ if self._loop.get_debug(): ++ logger.warning("%r: SSL handshake failed " ++ "on matching the hostname", ++ self, exc_info=True) + self._sock.close() + if self._waiter is not None: + self._waiter.set_exception(exc) +@@ -652,7 +760,13 @@ + self._loop.add_reader(self._sock_fd, self._read_ready) + self._loop.call_soon(self._protocol.connection_made, self) + if self._waiter is not None: +- self._loop.call_soon(self._waiter.set_result, None) ++ # wait until protocol.connection_made() has been called ++ self._loop.call_soon(self._waiter._set_result_unless_cancelled, ++ None) ++ ++ if self._loop.get_debug(): ++ dt = self._loop.time() - start_time ++ logger.debug("%r: SSL handshake took %.1f ms", self, dt * 1e3) + + def pause_reading(self): + # XXX This is a bit icky, given the comment at the top of +@@ -667,14 +781,18 @@ + raise RuntimeError('Already paused') + self._paused = True + self._loop.remove_reader(self._sock_fd) ++ if self._loop.get_debug(): ++ logger.debug("%r pauses reading", self) + + def resume_reading(self): + if not self._paused: +- raise ('Not paused') ++ raise RuntimeError('Not paused') + self._paused = False + if self._closing: + return + self._loop.add_reader(self._sock_fd, self._read_ready) ++ if self._loop.get_debug(): ++ logger.debug("%r resumes reading", self) + + def _read_ready(self): + if self._write_wants_read: +@@ -699,6 +817,8 @@ + self._protocol.data_received(data) + else: + try: ++ if self._loop.get_debug(): ++ logger.debug("%r received EOF", self) + keep_open = self._protocol.eof_received() + if keep_open: + logger.warning('returning true from eof_received() ' +@@ -767,11 +887,15 @@ + + _buffer_factory = collections.deque + +- def __init__(self, loop, sock, protocol, address=None, extra=None): ++ def __init__(self, loop, sock, protocol, address=None, ++ waiter=None, extra=None): + super().__init__(loop, sock, protocol, extra) + self._address = address + self._loop.add_reader(self._sock_fd, self._read_ready) + self._loop.call_soon(self._protocol.connection_made, self) ++ if waiter is not None: ++ # wait until protocol.connection_made() has been called ++ self._loop.call_soon(waiter._set_result_unless_cancelled, None) + + def get_write_buffer_size(self): + return sum(len(data) for data, _ in self._buffer) +diff -r c0e311e010fc Lib/asyncio/streams.py +--- a/Lib/asyncio/streams.py ++++ b/Lib/asyncio/streams.py +@@ -10,10 +10,12 @@ + if hasattr(socket, 'AF_UNIX'): + __all__.extend(['open_unix_connection', 'start_unix_server']) + ++from . import coroutines + from . import events + from . import futures + from . import protocols +-from . import tasks ++from .coroutines import coroutine ++from .log import logger + + + _DEFAULT_LIMIT = 2**16 +@@ -33,7 +35,7 @@ + self.expected = expected + + +-@tasks.coroutine ++@coroutine + def open_connection(host=None, port=None, *, + loop=None, limit=_DEFAULT_LIMIT, **kwds): + """A wrapper for create_connection() returning a (reader, writer) pair. +@@ -63,7 +65,7 @@ + return reader, writer + + +-@tasks.coroutine ++@coroutine + def start_server(client_connected_cb, host=None, port=None, *, + loop=None, limit=_DEFAULT_LIMIT, **kwds): + """Start a socket server, call back for each client connected. +@@ -102,7 +104,7 @@ + if hasattr(socket, 'AF_UNIX'): + # UNIX Domain Sockets are supported on this platform + +- @tasks.coroutine ++ @coroutine + def open_unix_connection(path=None, *, + loop=None, limit=_DEFAULT_LIMIT, **kwds): + """Similar to `open_connection` but works with UNIX Domain Sockets.""" +@@ -116,7 +118,7 @@ + return reader, writer + + +- @tasks.coroutine ++ @coroutine + def start_unix_server(client_connected_cb, path=None, *, + loop=None, limit=_DEFAULT_LIMIT, **kwds): + """Similar to `start_server` but works with UNIX Domain Sockets.""" +@@ -139,23 +141,27 @@ + resume_reading() and connection_lost(). If the subclass overrides + these it must call the super methods. + +- StreamWriter.drain() must check for error conditions and then call +- _make_drain_waiter(), which will return either () or a Future +- depending on the paused state. ++ StreamWriter.drain() must wait for _drain_helper() coroutine. + """ + + def __init__(self, loop=None): + self._loop = loop # May be None; we may never need it. + self._paused = False + self._drain_waiter = None ++ self._connection_lost = False + + def pause_writing(self): + assert not self._paused + self._paused = True ++ if self._loop.get_debug(): ++ logger.debug("%r pauses writing", self) + + def resume_writing(self): + assert self._paused + self._paused = False ++ if self._loop.get_debug(): ++ logger.debug("%r resumes writing", self) ++ + waiter = self._drain_waiter + if waiter is not None: + self._drain_waiter = None +@@ -163,6 +169,7 @@ + waiter.set_result(None) + + def connection_lost(self, exc): ++ self._connection_lost = True + # Wake up the writer if currently paused. + if not self._paused: + return +@@ -177,14 +184,17 @@ + else: + waiter.set_exception(exc) + +- def _make_drain_waiter(self): ++ @coroutine ++ def _drain_helper(self): ++ if self._connection_lost: ++ raise ConnectionResetError('Connection lost') + if not self._paused: +- return () ++ return + waiter = self._drain_waiter + assert waiter is None or waiter.cancelled() + waiter = futures.Future(loop=self._loop) + self._drain_waiter = waiter +- return waiter ++ yield from waiter + + + class StreamReaderProtocol(FlowControlMixin, protocols.Protocol): +@@ -210,8 +220,8 @@ + self._loop) + res = self._client_connected_cb(self._stream_reader, + self._stream_writer) +- if tasks.iscoroutine(res): +- tasks.Task(res, loop=self._loop) ++ if coroutines.iscoroutine(res): ++ self._loop.create_task(res) + + def connection_lost(self, exc): + if exc is None: +@@ -240,9 +250,17 @@ + def __init__(self, transport, protocol, reader, loop): + self._transport = transport + self._protocol = protocol ++ # drain() expects that the reader has a exception() method ++ assert reader is None or isinstance(reader, StreamReader) + self._reader = reader + self._loop = loop + ++ def __repr__(self): ++ info = [self.__class__.__name__, 'transport=%r' % self._transport] ++ if self._reader is not None: ++ info.append('reader=%r' % self._reader) ++ return '<%s>' % ' '.join(info) ++ + @property + def transport(self): + return self._transport +@@ -265,26 +283,20 @@ + def get_extra_info(self, name, default=None): + return self._transport.get_extra_info(name, default) + ++ @coroutine + def drain(self): +- """This method has an unusual return value. ++ """Flush the write buffer. + + The intended use is to write + + w.write(data) + yield from w.drain() +- +- When there's nothing to wait for, drain() returns (), and the +- yield-from continues immediately. When the transport buffer +- is full (the protocol is paused), drain() creates and returns +- a Future and the yield-from will block until that Future is +- completed, which will happen when the buffer is (partially) +- drained and the protocol is resumed. + """ +- if self._reader is not None and self._reader._exception is not None: +- raise self._reader._exception +- if self._transport._conn_lost: # Uses private variable. +- raise ConnectionResetError('Connection lost') +- return self._protocol._make_drain_waiter() ++ if self._reader is not None: ++ exc = self._reader.exception() ++ if exc is not None: ++ raise exc ++ yield from self._protocol._drain_helper() + + + class StreamReader: +@@ -373,7 +385,7 @@ + 'already waiting for incoming data' % func_name) + return futures.Future(loop=self._loop) + +- @tasks.coroutine ++ @coroutine + def readline(self): + if self._exception is not None: + raise self._exception +@@ -410,7 +422,7 @@ + self._maybe_resume_transport() + return bytes(line) + +- @tasks.coroutine ++ @coroutine + def read(self, n=-1): + if self._exception is not None: + raise self._exception +@@ -449,7 +461,7 @@ + self._maybe_resume_transport() + return data + +- @tasks.coroutine ++ @coroutine + def readexactly(self, n): + if self._exception is not None: + raise self._exception +diff -r c0e311e010fc Lib/asyncio/subprocess.py +--- a/Lib/asyncio/subprocess.py ++++ b/Lib/asyncio/subprocess.py +@@ -8,6 +8,8 @@ + from . import protocols + from . import streams + from . import tasks ++from .coroutines import coroutine ++from .log import logger + + + PIPE = subprocess.PIPE +@@ -27,6 +29,16 @@ + self._waiters = collections.deque() + self._transport = None + ++ def __repr__(self): ++ info = [self.__class__.__name__] ++ if self.stdin is not None: ++ info.append('stdin=%r' % self.stdin) ++ if self.stdout is not None: ++ info.append('stdout=%r' % self.stdout) ++ if self.stderr is not None: ++ info.append('stderr=%r' % self.stderr) ++ return '<%s>' % ' '.join(info) ++ + def connection_made(self, transport): + self._transport = transport + if transport.get_pipe_transport(1): +@@ -90,11 +102,14 @@ + self.stderr = protocol.stderr + self.pid = transport.get_pid() + ++ def __repr__(self): ++ return '<%s %s>' % (self.__class__.__name__, self.pid) ++ + @property + def returncode(self): + return self._transport.get_returncode() + +- @tasks.coroutine ++ @coroutine + def wait(self): + """Wait until the process exit and return the process return code.""" + returncode = self._transport.get_returncode() +@@ -122,17 +137,29 @@ + self._check_alive() + self._transport.kill() + +- @tasks.coroutine ++ @coroutine + def _feed_stdin(self, input): ++ debug = self._loop.get_debug() + self.stdin.write(input) +- yield from self.stdin.drain() ++ if debug: ++ logger.debug('%r communicate: feed stdin (%s bytes)', ++ self, len(input)) ++ try: ++ yield from self.stdin.drain() ++ except (BrokenPipeError, ConnectionResetError) as exc: ++ # communicate() ignores BrokenPipeError and ConnectionResetError ++ if debug: ++ logger.debug('%r communicate: stdin got %r', self, exc) ++ ++ if debug: ++ logger.debug('%r communicate: close stdin', self) + self.stdin.close() + +- @tasks.coroutine ++ @coroutine + def _noop(self): + return None + +- @tasks.coroutine ++ @coroutine + def _read_stream(self, fd): + transport = self._transport.get_pipe_transport(fd) + if fd == 2: +@@ -140,11 +167,17 @@ + else: + assert fd == 1 + stream = self.stdout ++ if self._loop.get_debug(): ++ name = 'stdout' if fd == 1 else 'stderr' ++ logger.debug('%r communicate: read %s', self, name) + output = yield from stream.read() ++ if self._loop.get_debug(): ++ name = 'stdout' if fd == 1 else 'stderr' ++ logger.debug('%r communicate: close %s', self, name) + transport.close() + return output + +- @tasks.coroutine ++ @coroutine + def communicate(self, input=None): + if input: + stdin = self._feed_stdin(input) +@@ -164,7 +197,7 @@ + return (stdout, stderr) + + +-@tasks.coroutine ++@coroutine + def create_subprocess_shell(cmd, stdin=None, stdout=None, stderr=None, + loop=None, limit=streams._DEFAULT_LIMIT, **kwds): + if loop is None: +@@ -178,7 +211,7 @@ + yield from protocol.waiter + return Process(transport, protocol, loop) + +-@tasks.coroutine ++@coroutine + def create_subprocess_exec(program, *args, stdin=None, stdout=None, + stderr=None, loop=None, + limit=streams._DEFAULT_LIMIT, **kwds): +diff -r c0e311e010fc Lib/asyncio/tasks.py +--- a/Lib/asyncio/tasks.py ++++ b/Lib/asyncio/tasks.py +@@ -1,7 +1,6 @@ + """Support for tasks, coroutines and the scheduler.""" + +-__all__ = ['coroutine', 'Task', +- 'iscoroutinefunction', 'iscoroutine', ++__all__ = ['Task', + 'FIRST_COMPLETED', 'FIRST_EXCEPTION', 'ALL_COMPLETED', + 'wait', 'wait_for', 'as_completed', 'sleep', 'async', + 'gather', 'shield', +@@ -11,122 +10,16 @@ + import functools + import inspect + import linecache +-import os + import sys + import traceback + import weakref + ++from . import coroutines + from . import events + from . import futures +-from .log import logger ++from .coroutines import coroutine + +-# If you set _DEBUG to true, @coroutine will wrap the resulting +-# generator objects in a CoroWrapper instance (defined below). That +-# instance will log a message when the generator is never iterated +-# over, which may happen when you forget to use "yield from" with a +-# coroutine call. Note that the value of the _DEBUG flag is taken +-# when the decorator is used, so to be of any use it must be set +-# before you define your coroutines. A downside of using this feature +-# is that tracebacks show entries for the CoroWrapper.__next__ method +-# when _DEBUG is true. +-_DEBUG = (not sys.flags.ignore_environment +- and bool(os.environ.get('PYTHONASYNCIODEBUG'))) +- +- +-class CoroWrapper: +- # Wrapper for coroutine in _DEBUG mode. +- +- __slots__ = ['gen', 'func', '__name__', '__doc__', '__weakref__'] +- +- def __init__(self, gen, func): +- assert inspect.isgenerator(gen), gen +- self.gen = gen +- self.func = func +- +- def __iter__(self): +- return self +- +- def __next__(self): +- return next(self.gen) +- +- def send(self, *value): +- # We use `*value` because of a bug in CPythons prior +- # to 3.4.1. See issue #21209 and test_yield_from_corowrapper +- # for details. This workaround should be removed in 3.5.0. +- if len(value) == 1: +- value = value[0] +- return self.gen.send(value) +- +- def throw(self, exc): +- return self.gen.throw(exc) +- +- def close(self): +- return self.gen.close() +- +- @property +- def gi_frame(self): +- return self.gen.gi_frame +- +- @property +- def gi_running(self): +- return self.gen.gi_running +- +- @property +- def gi_code(self): +- return self.gen.gi_code +- +- def __del__(self): +- # Be careful accessing self.gen.frame -- self.gen might not exist. +- gen = getattr(self, 'gen', None) +- frame = getattr(gen, 'gi_frame', None) +- if frame is not None and frame.f_lasti == -1: +- func = self.func +- code = func.__code__ +- filename = code.co_filename +- lineno = code.co_firstlineno +- logger.error( +- 'Coroutine %r defined at %s:%s was never yielded from', +- func.__name__, filename, lineno) +- +- +-def coroutine(func): +- """Decorator to mark coroutines. +- +- If the coroutine is not yielded from before it is destroyed, +- an error message is logged. +- """ +- if inspect.isgeneratorfunction(func): +- coro = func +- else: +- @functools.wraps(func) +- def coro(*args, **kw): +- res = func(*args, **kw) +- if isinstance(res, futures.Future) or inspect.isgenerator(res): +- res = yield from res +- return res +- +- if not _DEBUG: +- wrapper = coro +- else: +- @functools.wraps(func) +- def wrapper(*args, **kwds): +- w = CoroWrapper(coro(*args, **kwds), func) +- w.__name__ = coro.__name__ +- w.__doc__ = coro.__doc__ +- return w +- +- wrapper._is_coroutine = True # For iscoroutinefunction(). +- return wrapper +- +- +-def iscoroutinefunction(func): +- """Return True if func is a decorated coroutine function.""" +- return getattr(func, '_is_coroutine', False) +- +- +-def iscoroutine(obj): +- """Return True if obj is a coroutine object.""" +- return isinstance(obj, CoroWrapper) or inspect.isgenerator(obj) ++_PY34 = (sys.version_info >= (3, 4)) + + + class Task(futures.Future): +@@ -171,25 +64,47 @@ + return {t for t in cls._all_tasks if t._loop is loop} + + def __init__(self, coro, *, loop=None): +- assert iscoroutine(coro), repr(coro) # Not a coroutine function! ++ assert coroutines.iscoroutine(coro), repr(coro) # Not a coroutine function! + super().__init__(loop=loop) ++ if self._source_traceback: ++ del self._source_traceback[-1] + self._coro = iter(coro) # Use the iterator just in case. + self._fut_waiter = None + self._must_cancel = False + self._loop.call_soon(self._step) + self.__class__._all_tasks.add(self) ++ # If False, don't log a message if the task is destroyed whereas its ++ # status is still pending ++ self._log_destroy_pending = True + +- def __repr__(self): +- res = super().__repr__() +- if (self._must_cancel and +- self._state == futures._PENDING and +- ')'.format(self._coro.__name__) + res[i:] +- return res ++ # On Python 3.3 or older, objects with a destructor part of a reference ++ # cycle are never destroyed. It's not more the case on Python 3.4 thanks to ++ # the PEP 442. ++ if _PY34: ++ def __del__(self): ++ if self._state == futures._PENDING and self._log_destroy_pending: ++ context = { ++ 'task': self, ++ 'message': 'Task was destroyed but it is pending!', ++ } ++ if self._source_traceback: ++ context['source_traceback'] = self._source_traceback ++ self._loop.call_exception_handler(context) ++ futures.Future.__del__(self) ++ ++ def _repr_info(self): ++ info = super()._repr_info() ++ ++ if self._must_cancel: ++ # replace status ++ info[0] = 'cancelling' ++ ++ coro = coroutines._format_coroutine(self._coro) ++ info.insert(1, 'coro=<%s>' % coro) ++ ++ if self._fut_waiter is not None: ++ info.insert(2, 'wait_for=%r' % self._fut_waiter) ++ return info + + def get_stack(self, *, limit=None): + """Return the list of stack frames for this task's coroutine. +@@ -269,9 +184,9 @@ + print(line, file=file, end='') + + def cancel(self): +- """Request that a task to cancel itself. ++ """Request this task to cancel itself. + +- This arranges for a CancellationError to be thrown into the ++ This arranges for a CancelledError to be thrown into the + wrapped coroutine on the next cycle through the event loop. + The coroutine then has a chance to clean up or even deny + the request using try/except/finally. +@@ -387,6 +302,8 @@ + def wait(fs, *, loop=None, timeout=None, return_when=ALL_COMPLETED): + """Wait for the Futures and coroutines given by fs to complete. + ++ The sequence futures must not be empty. ++ + Coroutines will be wrapped in Tasks. + + Returns two sets of Future: (done, pending). +@@ -398,18 +315,18 @@ + Note: This does not raise TimeoutError! Futures that aren't done + when the timeout occurs are returned in the second set. + """ +- if isinstance(fs, futures.Future) or iscoroutine(fs): ++ if isinstance(fs, futures.Future) or coroutines.iscoroutine(fs): + raise TypeError("expect a list of futures, not %s" % type(fs).__name__) + if not fs: + raise ValueError('Set of coroutines/Futures is empty.') ++ if return_when not in (FIRST_COMPLETED, FIRST_EXCEPTION, ALL_COMPLETED): ++ raise ValueError('Invalid return_when value: {}'.format(return_when)) + + if loop is None: + loop = events.get_event_loop() + + fs = {async(f, loop=loop) for f in set(fs)} + +- if return_when not in (FIRST_COMPLETED, FIRST_EXCEPTION, ALL_COMPLETED): +- raise ValueError('Invalid return_when value: {}'.format(return_when)) + return (yield from _wait(fs, timeout, return_when, loop)) + + +@@ -520,7 +437,7 @@ + + Note: The futures 'f' are not necessarily members of fs. + """ +- if isinstance(fs, futures.Future) or iscoroutine(fs): ++ if isinstance(fs, futures.Future) or coroutines.iscoroutine(fs): + raise TypeError("expect a list of futures, not %s" % type(fs).__name__) + loop = loop if loop is not None else events.get_event_loop() + todo = {async(f, loop=loop) for f in set(fs)} +@@ -562,7 +479,8 @@ + def sleep(delay, result=None, *, loop=None): + """Coroutine that completes after a given time (in seconds).""" + future = futures.Future(loop=loop) +- h = future._loop.call_later(delay, future.set_result, result) ++ h = future._loop.call_later(delay, ++ future._set_result_unless_cancelled, result) + try: + return (yield from future) + finally: +@@ -578,8 +496,13 @@ + if loop is not None and loop is not coro_or_future._loop: + raise ValueError('loop argument must agree with Future') + return coro_or_future +- elif iscoroutine(coro_or_future): +- return Task(coro_or_future, loop=loop) ++ elif coroutines.iscoroutine(coro_or_future): ++ if loop is None: ++ loop = events.get_event_loop() ++ task = loop.create_task(coro_or_future) ++ if task._source_traceback: ++ del task._source_traceback[-1] ++ return task + else: + raise TypeError('A Future or coroutine is required') + +@@ -624,21 +547,33 @@ + prevent the cancellation of one child to cause other children to + be cancelled.) + """ +- arg_to_fut = {arg: async(arg, loop=loop) for arg in set(coros_or_futures)} +- children = [arg_to_fut[arg] for arg in coros_or_futures] +- n = len(children) +- if n == 0: ++ if not coros_or_futures: + outer = futures.Future(loop=loop) + outer.set_result([]) + return outer +- if loop is None: +- loop = children[0]._loop +- for fut in children: +- if fut._loop is not loop: +- raise ValueError("futures are tied to different event loops") ++ ++ arg_to_fut = {} ++ for arg in set(coros_or_futures): ++ if not isinstance(arg, futures.Future): ++ fut = async(arg, loop=loop) ++ if loop is None: ++ loop = fut._loop ++ # The caller cannot control this future, the "destroy pending task" ++ # warning should not be emitted. ++ fut._log_destroy_pending = False ++ else: ++ fut = arg ++ if loop is None: ++ loop = fut._loop ++ elif fut._loop is not loop: ++ raise ValueError("futures are tied to different event loops") ++ arg_to_fut[arg] = fut ++ ++ children = [arg_to_fut[arg] for arg in coros_or_futures] ++ nchildren = len(children) + outer = _GatheringFuture(children, loop=loop) + nfinished = 0 +- results = [None] * n ++ results = [None] * nchildren + + def _done_callback(i, fut): + nonlocal nfinished +@@ -661,7 +596,7 @@ + res = fut._result + results[i] = res + nfinished += 1 +- if nfinished == n: ++ if nfinished == nchildren: + outer.set_result(results) + + for i, fut in enumerate(children): +diff -r c0e311e010fc Lib/asyncio/test_utils.py +--- a/Lib/asyncio/test_utils.py ++++ b/Lib/asyncio/test_utils.py +@@ -3,6 +3,7 @@ + import collections + import contextlib + import io ++import logging + import os + import re + import socket +@@ -11,6 +12,7 @@ + import tempfile + import threading + import time ++import unittest + from unittest import mock + + from http.server import HTTPServer +@@ -26,6 +28,8 @@ + from . import futures + from . import selectors + from . import tasks ++from .coroutines import coroutine ++from .log import logger + + + if sys.platform == 'win32': # pragma: no cover +@@ -42,11 +46,14 @@ + + + def run_briefly(loop): +- @tasks.coroutine ++ @coroutine + def once(): + pass + gen = once() +- t = tasks.Task(gen, loop=loop) ++ t = loop.create_task(gen) ++ # Don't log a warning if the task is not done after run_until_complete(). ++ # It occurs if the loop is stopped or if a task raises a BaseException. ++ t._log_destroy_pending = False + try: + loop.run_until_complete(t) + finally: +@@ -372,3 +379,41 @@ + """ + def __eq__(self, other): + return bool(re.search(str(self), other, re.S)) ++ ++ ++def get_function_source(func): ++ source = events._get_function_source(func) ++ if source is None: ++ raise ValueError("unable to get the source of %r" % (func,)) ++ return source ++ ++ ++class TestCase(unittest.TestCase): ++ def set_event_loop(self, loop, *, cleanup=True): ++ assert loop is not None ++ # ensure that the event loop is passed explicitly in asyncio ++ events.set_event_loop(None) ++ if cleanup: ++ self.addCleanup(loop.close) ++ ++ def new_test_loop(self, gen=None): ++ loop = TestLoop(gen) ++ self.set_event_loop(loop) ++ return loop ++ ++ def tearDown(self): ++ events.set_event_loop(None) ++ ++ ++@contextlib.contextmanager ++def disable_logger(): ++ """Context manager to disable asyncio logger. ++ ++ For example, it can be used to ignore warnings in debug mode. ++ """ ++ old_level = logger.level ++ try: ++ logger.setLevel(logging.CRITICAL+1) ++ yield ++ finally: ++ logger.setLevel(old_level) +diff -r c0e311e010fc Lib/asyncio/unix_events.py +--- a/Lib/asyncio/unix_events.py ++++ b/Lib/asyncio/unix_events.py +@@ -16,8 +16,9 @@ + from . import constants + from . import events + from . import selector_events +-from . import tasks ++from . import selectors + from . import transports ++from .coroutines import coroutine + from .log import logger + + +@@ -30,6 +31,11 @@ + raise ImportError('Signals are not really supported on Windows') + + ++def _sighandler_noop(signum, frame): ++ """Dummy signal handler.""" ++ pass ++ ++ + class _UnixSelectorEventLoop(selector_events.BaseSelectorEventLoop): + """Unix event loop. + +@@ -44,9 +50,16 @@ + return socket.socketpair() + + def close(self): ++ super().close() + for sig in list(self._signal_handlers): + self.remove_signal_handler(sig) +- super().close() ++ ++ def _process_self_data(self, data): ++ for signum in data: ++ if not signum: ++ # ignore null bytes written by _write_to_self() ++ continue ++ self._handle_signal(signum) + + def add_signal_handler(self, sig, callback, *args): + """Add a handler for a signal. UNIX only. +@@ -61,14 +74,18 @@ + # event loop running in another thread cannot add a signal + # handler. + signal.set_wakeup_fd(self._csock.fileno()) +- except ValueError as exc: ++ except (ValueError, OSError) as exc: + raise RuntimeError(str(exc)) + + handle = events.Handle(callback, args, self) + self._signal_handlers[sig] = handle + + try: +- signal.signal(sig, self._handle_signal) ++ # Register a dummy signal handler to ask Python to write the signal ++ # number in the wakup file descriptor. _process_self_data() will ++ # read signal numbers from this file descriptor to handle signals. ++ signal.signal(sig, _sighandler_noop) ++ + # Set SA_RESTART to limit EINTR occurrences. + signal.siginterrupt(sig, False) + except OSError as exc: +@@ -76,7 +93,7 @@ + if not self._signal_handlers: + try: + signal.set_wakeup_fd(-1) +- except ValueError as nexc: ++ except (ValueError, OSError) as nexc: + logger.info('set_wakeup_fd(-1) failed: %s', nexc) + + if exc.errno == errno.EINVAL: +@@ -84,7 +101,7 @@ + else: + raise + +- def _handle_signal(self, sig, arg): ++ def _handle_signal(self, sig): + """Internal helper that is the actual signal handler.""" + handle = self._signal_handlers.get(sig) + if handle is None: +@@ -121,7 +138,7 @@ + if not self._signal_handlers: + try: + signal.set_wakeup_fd(-1) +- except ValueError as exc: ++ except (ValueError, OSError) as exc: + logger.info('set_wakeup_fd(-1) failed: %s', exc) + + return True +@@ -147,7 +164,7 @@ + extra=None): + return _UnixWritePipeTransport(self, pipe, protocol, waiter, extra) + +- @tasks.coroutine ++ @coroutine + def _make_subprocess_transport(self, protocol, args, shell, + stdin, stdout, stderr, bufsize, + extra=None, **kwargs): +@@ -164,7 +181,7 @@ + def _child_watcher_callback(self, pid, returncode, transp): + self.call_soon_threadsafe(transp._process_exited, returncode) + +- @tasks.coroutine ++ @coroutine + def create_unix_connection(self, protocol_factory, path, *, + ssl=None, sock=None, + server_hostname=None): +@@ -199,7 +216,7 @@ + sock, protocol_factory, ssl, server_hostname) + return transport, protocol + +- @tasks.coroutine ++ @coroutine + def create_unix_server(self, protocol_factory, path=None, *, + sock=None, backlog=100, ssl=None): + if isinstance(ssl, bool): +@@ -223,6 +240,9 @@ + raise OSError(errno.EADDRINUSE, msg) from None + else: + raise ++ except: ++ sock.close() ++ raise + else: + if sock is None: + raise ValueError( +@@ -239,10 +259,14 @@ + return server + + +-def _set_nonblocking(fd): +- flags = fcntl.fcntl(fd, fcntl.F_GETFL) +- flags = flags | os.O_NONBLOCK +- fcntl.fcntl(fd, fcntl.F_SETFL, flags) ++if hasattr(os, 'set_blocking'): ++ def _set_nonblocking(fd): ++ os.set_blocking(fd, False) ++else: ++ def _set_nonblocking(fd): ++ flags = fcntl.fcntl(fd, fcntl.F_GETFL) ++ flags = flags | os.O_NONBLOCK ++ fcntl.fcntl(fd, fcntl.F_SETFL, flags) + + + class _UnixReadPipeTransport(transports.ReadTransport): +@@ -266,7 +290,22 @@ + self._loop.add_reader(self._fileno, self._read_ready) + self._loop.call_soon(self._protocol.connection_made, self) + if waiter is not None: +- self._loop.call_soon(waiter.set_result, None) ++ # wait until protocol.connection_made() has been called ++ self._loop.call_soon(waiter._set_result_unless_cancelled, None) ++ ++ def __repr__(self): ++ info = [self.__class__.__name__, 'fd=%s' % self._fileno] ++ if self._pipe is not None: ++ polling = selector_events._test_selector_event( ++ self._loop._selector, ++ self._fileno, selectors.EVENT_READ) ++ if polling: ++ info.append('polling') ++ else: ++ info.append('idle') ++ else: ++ info.append('closed') ++ return '<%s>' % ' '.join(info) + + def _read_ready(self): + try: +@@ -279,6 +318,8 @@ + if data: + self._protocol.data_received(data) + else: ++ if self._loop.get_debug(): ++ logger.info("%r was closed by peer", self) + self._closing = True + self._loop.remove_reader(self._fileno) + self._loop.call_soon(self._protocol.eof_received) +@@ -350,13 +391,33 @@ + + self._loop.call_soon(self._protocol.connection_made, self) + if waiter is not None: +- self._loop.call_soon(waiter.set_result, None) ++ # wait until protocol.connection_made() has been called ++ self._loop.call_soon(waiter._set_result_unless_cancelled, None) ++ ++ def __repr__(self): ++ info = [self.__class__.__name__, 'fd=%s' % self._fileno] ++ if self._pipe is not None: ++ polling = selector_events._test_selector_event( ++ self._loop._selector, ++ self._fileno, selectors.EVENT_WRITE) ++ if polling: ++ info.append('polling') ++ else: ++ info.append('idle') ++ ++ bufsize = self.get_write_buffer_size() ++ info.append('bufsize=%s' % bufsize) ++ else: ++ info.append('closed') ++ return '<%s>' % ' '.join(info) + + def get_write_buffer_size(self): + return sum(len(data) for data in self._buffer) + + def _read_ready(self): + # Pipe was closed by peer. ++ if self._loop.get_debug(): ++ logger.info("%r was closed by peer", self) + if self._buffer: + self._close(BrokenPipeError()) + else: +@@ -491,7 +552,7 @@ + universal_newlines=False, bufsize=bufsize, **kwargs) + if stdin_w is not None: + stdin.close() +- self._proc.stdin = open(stdin_w.detach(), 'rb', buffering=bufsize) ++ self._proc.stdin = open(stdin_w.detach(), 'wb', buffering=bufsize) + + + class AbstractChildWatcher: +@@ -524,7 +585,7 @@ + process 'pid' terminates. Specifying another callback for the same + process replaces the previous handler. + +- Note: callback() must be thread-safe ++ Note: callback() must be thread-safe. + """ + raise NotImplementedError() + +@@ -680,6 +741,9 @@ + return + + returncode = self._compute_returncode(status) ++ if self._loop.get_debug(): ++ logger.debug('process %s exited with returncode %s', ++ expected_pid, returncode) + + try: + callback, args = self._callbacks.pop(pid) +@@ -777,8 +841,16 @@ + if self._forks: + # It may not be registered yet. + self._zombies[pid] = returncode ++ if self._loop.get_debug(): ++ logger.debug('unknown process %s exited ' ++ 'with returncode %s', ++ pid, returncode) + continue + callback = None ++ else: ++ if self._loop.get_debug(): ++ logger.debug('process %s exited with returncode %s', ++ pid, returncode) + + if callback is None: + logger.warning( +@@ -819,7 +891,7 @@ + self._watcher.attach_loop(loop) + + def get_child_watcher(self): +- """Get the child watcher ++ """Get the watcher for child processes. + + If not yet set, a SafeChildWatcher object is automatically created. + """ +@@ -829,7 +901,7 @@ + return self._watcher + + def set_child_watcher(self, watcher): +- """Set the child watcher""" ++ """Set the watcher for child processes.""" + + assert watcher is None or isinstance(watcher, AbstractChildWatcher) + +diff -r c0e311e010fc Lib/asyncio/windows_events.py +--- a/Lib/asyncio/windows_events.py ++++ b/Lib/asyncio/windows_events.py +@@ -14,8 +14,9 @@ + from . import selector_events + from . import tasks + from . import windows_utils ++from . import _overlapped ++from .coroutines import coroutine + from .log import logger +-from . import _overlapped + + + __all__ = ['SelectorEventLoop', 'ProactorEventLoop', 'IocpProactor', +@@ -37,30 +38,103 @@ + + def __init__(self, ov, *, loop=None): + super().__init__(loop=loop) +- self.ov = ov ++ if self._source_traceback: ++ del self._source_traceback[-1] ++ self._ov = ov ++ ++ def _repr_info(self): ++ info = super()._repr_info() ++ if self._ov is not None: ++ state = 'pending' if self._ov.pending else 'completed' ++ info.insert(1, 'overlapped=<%s, %#x>' % (state, self._ov.address)) ++ return info ++ ++ def _cancel_overlapped(self): ++ if self._ov is None: ++ return ++ try: ++ self._ov.cancel() ++ except OSError as exc: ++ context = { ++ 'message': 'Cancelling an overlapped future failed', ++ 'exception': exc, ++ 'future': self, ++ } ++ if self._source_traceback: ++ context['source_traceback'] = self._source_traceback ++ self._loop.call_exception_handler(context) ++ self._ov = None + + def cancel(self): +- try: +- self.ov.cancel() +- except OSError: +- pass ++ self._cancel_overlapped() + return super().cancel() + ++ def set_exception(self, exception): ++ super().set_exception(exception) ++ self._cancel_overlapped() ++ ++ def set_result(self, result): ++ super().set_result(result) ++ self._ov = None ++ + + class _WaitHandleFuture(futures.Future): + """Subclass of Future which represents a wait handle.""" + +- def __init__(self, wait_handle, *, loop=None): ++ def __init__(self, iocp, ov, handle, wait_handle, *, loop=None): + super().__init__(loop=loop) ++ if self._source_traceback: ++ del self._source_traceback[-1] ++ # iocp and ov are only used by cancel() to notify IocpProactor ++ # that the wait was cancelled ++ self._iocp = iocp ++ self._ov = ov ++ self._handle = handle + self._wait_handle = wait_handle + +- def cancel(self): +- super().cancel() ++ def _poll(self): ++ # non-blocking wait: use a timeout of 0 millisecond ++ return (_winapi.WaitForSingleObject(self._handle, 0) == ++ _winapi.WAIT_OBJECT_0) ++ ++ def _repr_info(self): ++ info = super()._repr_info() ++ info.insert(1, 'handle=%#x' % self._handle) ++ if self._wait_handle: ++ state = 'signaled' if self._poll() else 'waiting' ++ info.insert(1, 'wait_handle=<%s, %#x>' ++ % (state, self._wait_handle)) ++ return info ++ ++ def _unregister_wait(self): ++ if self._wait_handle is None: ++ return + try: + _overlapped.UnregisterWait(self._wait_handle) + except OSError as e: + if e.winerror != _overlapped.ERROR_IO_PENDING: + raise ++ # ERROR_IO_PENDING is not an error, the wait was unregistered ++ self._wait_handle = None ++ self._iocp = None ++ self._ov = None ++ ++ def cancel(self): ++ result = super().cancel() ++ if self._ov is not None: ++ # signal the cancellation to the overlapped object ++ _overlapped.PostQueuedCompletionStatus(self._iocp, True, ++ 0, self._ov.address) ++ self._unregister_wait() ++ return result ++ ++ def set_exception(self, exception): ++ super().set_exception(exception) ++ self._unregister_wait() ++ ++ def set_result(self, result): ++ super().set_result(result) ++ self._unregister_wait() + + + class PipeServer(object): +@@ -129,7 +203,7 @@ + def _socketpair(self): + return windows_utils.socketpair() + +- @tasks.coroutine ++ @coroutine + def create_pipe_connection(self, protocol_factory, address): + f = self._proactor.connect_pipe(address) + pipe = yield from f +@@ -138,7 +212,7 @@ + extra={'addr': address}) + return trans, protocol + +- @tasks.coroutine ++ @coroutine + def start_serving_pipe(self, protocol_factory, address): + server = PipeServer(address) + +@@ -172,7 +246,7 @@ + self.call_soon(loop) + return [server] + +- @tasks.coroutine ++ @coroutine + def _make_subprocess_transport(self, protocol, args, shell, + stdin, stdout, stderr, bufsize, + extra=None, **kwargs): +@@ -195,6 +269,11 @@ + self._registered = weakref.WeakSet() + self._stopped_serving = weakref.WeakSet() + ++ def __repr__(self): ++ return ('<%s overlapped#=%s result#=%s>' ++ % (self.__class__.__name__, len(self._cache), ++ len(self._results))) ++ + def set_loop(self, loop): + self._loop = loop + +@@ -258,7 +337,7 @@ + conn.settimeout(listener.gettimeout()) + return conn, conn.getpeername() + +- @tasks.coroutine ++ @coroutine + def accept_coro(future, conn): + # Coroutine closing the accept socket if the future is cancelled + try: +@@ -304,7 +383,10 @@ + ov.getresult() + return pipe + +- return self._register(ov, pipe, finish_accept_pipe) ++ # FIXME: Tulip issue 196: why to we neeed register=False? ++ # See also the comment in the _register() method ++ return self._register(ov, pipe, finish_accept_pipe, ++ register=False) + + def connect_pipe(self, address): + ov = _overlapped.Overlapped(NULL) +@@ -337,25 +419,28 @@ + ov = _overlapped.Overlapped(NULL) + wh = _overlapped.RegisterWaitWithQueue( + handle, self._iocp, ov.address, ms) +- f = _WaitHandleFuture(wh, loop=self._loop) ++ f = _WaitHandleFuture(self._iocp, ov, handle, wh, loop=self._loop) ++ if f._source_traceback: ++ del f._source_traceback[-1] + + def finish_wait_for_handle(trans, key, ov): +- if not f.cancelled(): +- try: +- _overlapped.UnregisterWait(wh) +- except OSError as e: +- if e.winerror != _overlapped.ERROR_IO_PENDING: +- raise + # Note that this second wait means that we should only use + # this with handles types where a successful wait has no + # effect. So events or processes are all right, but locks + # or semaphores are not. Also note if the handle is + # signalled and then quickly reset, then we may return + # False even though we have not timed out. +- return (_winapi.WaitForSingleObject(handle, 0) == +- _winapi.WAIT_OBJECT_0) ++ return f._poll() + +- self._cache[ov.address] = (f, ov, None, finish_wait_for_handle) ++ if f._poll(): ++ try: ++ result = f._poll() ++ except OSError as exc: ++ f.set_exception(exc) ++ else: ++ f.set_result(result) ++ ++ self._cache[ov.address] = (f, ov, 0, finish_wait_for_handle) + return f + + def _register_with_iocp(self, obj): +@@ -368,17 +453,15 @@ + # to avoid sending notifications to completion port of ops + # that succeed immediately. + +- def _register(self, ov, obj, callback, wait_for_post=False): ++ def _register(self, ov, obj, callback, ++ wait_for_post=False, register=True): + # Return a future which will be set with the result of the + # operation when it completes. The future's value is actually + # the value returned by callback(). + f = _OverlappedFuture(ov, loop=self._loop) +- if ov.pending or wait_for_post: +- # Register the overlapped operation for later. Note that +- # we only store obj to prevent it from being garbage +- # collected too early. +- self._cache[ov.address] = (f, ov, obj, callback) +- else: ++ if f._source_traceback: ++ del f._source_traceback[-1] ++ if not ov.pending and not wait_for_post: + # The operation has completed, so no need to postpone the + # work. We cannot take this short cut if we need the + # NumberOfBytes, CompletionKey values returned by +@@ -389,6 +472,23 @@ + f.set_exception(e) + else: + f.set_result(value) ++ # Even if GetOverlappedResult() was called, we have to wait for the ++ # notification of the completion in GetQueuedCompletionStatus(). ++ # Register the overlapped operation to keep a reference to the ++ # OVERLAPPED object, otherwise the memory is freed and Windows may ++ # read uninitialized memory. ++ # ++ # For an unknown reason, ConnectNamedPipe() behaves differently: ++ # the completion is not notified by GetOverlappedResult() if we ++ # already called GetOverlappedResult(). For this specific case, we ++ # don't expect notification (register is set to False). ++ else: ++ register = True ++ if register: ++ # Register the overlapped operation for later. Note that ++ # we only store obj to prevent it from being garbage ++ # collected too early. ++ self._cache[ov.address] = (f, ov, obj, callback) + return f + + def _get_accept_socket(self, family): +@@ -407,23 +507,36 @@ + ms = math.ceil(timeout * 1e3) + if ms >= INFINITE: + raise ValueError("timeout too big") ++ + while True: + status = _overlapped.GetQueuedCompletionStatus(self._iocp, ms) + if status is None: + return ++ ms = 0 ++ + err, transferred, key, address = status + try: + f, ov, obj, callback = self._cache.pop(address) + except KeyError: ++ if self._loop.get_debug(): ++ self._loop.call_exception_handler({ ++ 'message': ('GetQueuedCompletionStatus() returned an ' ++ 'unexpected event'), ++ 'status': ('err=%s transferred=%s key=%#x address=%#x' ++ % (err, transferred, key, address)), ++ }) ++ + # key is either zero, or it is used to return a pipe + # handle which should be closed to avoid a leak. + if key not in (0, _overlapped.INVALID_HANDLE_VALUE): + _winapi.CloseHandle(key) +- ms = 0 + continue ++ + if obj in self._stopped_serving: + f.cancel() +- elif not f.cancelled(): ++ # Don't call the callback if _register() already read the result or ++ # if the overlapped has been cancelled ++ elif not f.done(): + try: + value = callback(transferred, key, ov) + except OSError as e: +@@ -432,7 +545,6 @@ + else: + f.set_result(value) + self._results.append(f) +- ms = 0 + + def _stop_serving(self, obj): + # obj is a socket or pipe handle. It will be closed in +@@ -442,17 +554,28 @@ + + def close(self): + # Cancel remaining registered operations. +- for address, (f, ov, obj, callback) in list(self._cache.items()): ++ for address, (fut, ov, obj, callback) in list(self._cache.items()): + if obj is None: + # The operation was started with connect_pipe() which + # queues a task to Windows' thread pool. This cannot + # be cancelled, so just forget it. + del self._cache[address] ++ # FIXME: Tulip issue 196: remove this case, it should not happen ++ elif fut.done() and not fut.cancelled(): ++ del self._cache[address] + else: + try: +- ov.cancel() +- except OSError: +- pass ++ fut.cancel() ++ except OSError as exc: ++ if self._loop is not None: ++ context = { ++ 'message': 'Cancelling a future failed', ++ 'exception': exc, ++ 'future': fut, ++ } ++ if fut._source_traceback: ++ context['source_traceback'] = fut._source_traceback ++ self._loop.call_exception_handler(context) + + while self._cache: + if not self._poll(1): +@@ -463,6 +586,9 @@ + _winapi.CloseHandle(self._iocp) + self._iocp = None + ++ def __del__(self): ++ self.close() ++ + + class _WindowsSubprocessTransport(base_subprocess.BaseSubprocessTransport): + +diff -r c0e311e010fc Lib/asyncio/windows_utils.py +--- a/Lib/asyncio/windows_utils.py ++++ b/Lib/asyncio/windows_utils.py +@@ -51,23 +51,25 @@ + # We create a connected TCP socket. Note the trick with setblocking(0) + # that prevents us from having to create a thread. + lsock = socket.socket(family, type, proto) +- lsock.bind((host, 0)) +- lsock.listen(1) +- # On IPv6, ignore flow_info and scope_id +- addr, port = lsock.getsockname()[:2] +- csock = socket.socket(family, type, proto) +- csock.setblocking(False) + try: +- csock.connect((addr, port)) +- except (BlockingIOError, InterruptedError): +- pass +- except Exception: ++ lsock.bind((host, 0)) ++ lsock.listen(1) ++ # On IPv6, ignore flow_info and scope_id ++ addr, port = lsock.getsockname()[:2] ++ csock = socket.socket(family, type, proto) ++ try: ++ csock.setblocking(False) ++ try: ++ csock.connect((addr, port)) ++ except (BlockingIOError, InterruptedError): ++ pass ++ ssock, _ = lsock.accept() ++ csock.setblocking(True) ++ except: ++ csock.close() ++ raise ++ finally: + lsock.close() +- csock.close() +- raise +- ssock, _ = lsock.accept() +- csock.setblocking(True) +- lsock.close() + return (ssock, csock) + + +diff -r c0e311e010fc Lib/asyncore.py +--- a/Lib/asyncore.py ++++ b/Lib/asyncore.py +@@ -614,6 +614,11 @@ + def __init__(self, fd): + self.fd = os.dup(fd) + ++ def __del__(self): ++ if self.fd >= 0: ++ warnings.warn("unclosed file %r" % self, ResourceWarning) ++ self.close() ++ + def recv(self, *args): + return os.read(self.fd, *args) + +@@ -632,7 +637,10 @@ + write = send + + def close(self): ++ if self.fd < 0: ++ return + os.close(self.fd) ++ self.fd = -1 + + def fileno(self): + return self.fd +diff -r c0e311e010fc Lib/collections/__init__.py +--- a/Lib/collections/__init__.py ++++ b/Lib/collections/__init__.py +@@ -323,6 +323,7 @@ + if isinstance(field_names, str): + field_names = field_names.replace(',', ' ').split() + field_names = list(map(str, field_names)) ++ typename = str(typename) + if rename: + seen = set() + for index, name in enumerate(field_names): +@@ -333,6 +334,8 @@ + field_names[index] = '_%d' % index + seen.add(name) + for name in [typename] + field_names: ++ if type(name) != str: ++ raise TypeError('Type names and field names must be strings') + if not name.isidentifier(): + raise ValueError('Type names and field names must be valid ' + 'identifiers: %r' % name) +diff -r c0e311e010fc Lib/ctypes/__init__.py +--- a/Lib/ctypes/__init__.py ++++ b/Lib/ctypes/__init__.py +@@ -49,7 +49,7 @@ + create_string_buffer(anInteger) -> character array + create_string_buffer(aString, anInteger) -> character array + """ +- if isinstance(init, (str, bytes)): ++ if isinstance(init, bytes): + if size is None: + size = len(init)+1 + buftype = c_char * size +@@ -284,7 +284,7 @@ + create_unicode_buffer(anInteger) -> character array + create_unicode_buffer(aString, anInteger) -> character array + """ +- if isinstance(init, (str, bytes)): ++ if isinstance(init, str): + if size is None: + size = len(init)+1 + buftype = c_wchar * size +diff -r c0e311e010fc Lib/ctypes/test/__init__.py +--- a/Lib/ctypes/test/__init__.py ++++ b/Lib/ctypes/test/__init__.py +@@ -1,208 +1,14 @@ +-import os, sys, unittest, getopt, time ++import os ++import unittest ++from test import support + +-use_resources = [] ++# skip tests if _ctypes was not built ++ctypes = support.import_module('ctypes') ++ctypes_symbols = dir(ctypes) + +-class ResourceDenied(Exception): +- """Test skipped because it requested a disallowed resource. ++def need_symbol(name): ++ return unittest.skipUnless(name in ctypes_symbols, ++ '{!r} is required'.format(name)) + +- This is raised when a test calls requires() for a resource that +- has not be enabled. Resources are defined by test modules. +- """ +- +-def is_resource_enabled(resource): +- """Test whether a resource is enabled. +- +- If the caller's module is __main__ then automatically return True.""" +- if sys._getframe().f_back.f_globals.get("__name__") == "__main__": +- return True +- result = use_resources is not None and \ +- (resource in use_resources or "*" in use_resources) +- if not result: +- _unavail[resource] = None +- return result +- +-_unavail = {} +-def requires(resource, msg=None): +- """Raise ResourceDenied if the specified resource is not available. +- +- If the caller's module is __main__ then automatically return True.""" +- # see if the caller's module is __main__ - if so, treat as if +- # the resource was set +- if sys._getframe().f_back.f_globals.get("__name__") == "__main__": +- return +- if not is_resource_enabled(resource): +- if msg is None: +- msg = "Use of the `%s' resource not enabled" % resource +- raise ResourceDenied(msg) +- +-def find_package_modules(package, mask): +- import fnmatch +- if (package.__loader__ is not None and +- hasattr(package.__loader__, '_files')): +- path = package.__name__.replace(".", os.path.sep) +- mask = os.path.join(path, mask) +- for fnm in package.__loader__._files.keys(): +- if fnmatch.fnmatchcase(fnm, mask): +- yield os.path.splitext(fnm)[0].replace(os.path.sep, ".") +- else: +- path = package.__path__[0] +- for fnm in os.listdir(path): +- if fnmatch.fnmatchcase(fnm, mask): +- yield "%s.%s" % (package.__name__, os.path.splitext(fnm)[0]) +- +-def get_tests(package, mask, verbosity, exclude=()): +- """Return a list of skipped test modules, and a list of test cases.""" +- tests = [] +- skipped = [] +- for modname in find_package_modules(package, mask): +- if modname.split(".")[-1] in exclude: +- skipped.append(modname) +- if verbosity > 1: +- print("Skipped %s: excluded" % modname, file=sys.stderr) +- continue +- try: +- mod = __import__(modname, globals(), locals(), ['*']) +- except (ResourceDenied, unittest.SkipTest) as detail: +- skipped.append(modname) +- if verbosity > 1: +- print("Skipped %s: %s" % (modname, detail), file=sys.stderr) +- continue +- for name in dir(mod): +- if name.startswith("_"): +- continue +- o = getattr(mod, name) +- if type(o) is type(unittest.TestCase) and issubclass(o, unittest.TestCase): +- tests.append(o) +- return skipped, tests +- +-def usage(): +- print(__doc__) +- return 1 +- +-def test_with_refcounts(runner, verbosity, testcase): +- """Run testcase several times, tracking reference counts.""" +- import gc +- import ctypes +- ptc = ctypes._pointer_type_cache.copy() +- cfc = ctypes._c_functype_cache.copy() +- wfc = ctypes._win_functype_cache.copy() +- +- # when searching for refcount leaks, we have to manually reset any +- # caches that ctypes has. +- def cleanup(): +- ctypes._pointer_type_cache = ptc.copy() +- ctypes._c_functype_cache = cfc.copy() +- ctypes._win_functype_cache = wfc.copy() +- gc.collect() +- +- test = unittest.makeSuite(testcase) +- for i in range(5): +- rc = sys.gettotalrefcount() +- runner.run(test) +- cleanup() +- COUNT = 5 +- refcounts = [None] * COUNT +- for i in range(COUNT): +- rc = sys.gettotalrefcount() +- runner.run(test) +- cleanup() +- refcounts[i] = sys.gettotalrefcount() - rc +- if filter(None, refcounts): +- print("%s leaks:\n\t" % testcase, refcounts) +- elif verbosity: +- print("%s: ok." % testcase) +- +-class TestRunner(unittest.TextTestRunner): +- def run(self, test, skipped): +- "Run the given test case or test suite." +- # Same as unittest.TextTestRunner.run, except that it reports +- # skipped tests. +- result = self._makeResult() +- startTime = time.time() +- test(result) +- stopTime = time.time() +- timeTaken = stopTime - startTime +- result.printErrors() +- self.stream.writeln(result.separator2) +- run = result.testsRun +- if _unavail: #skipped: +- requested = list(_unavail.keys()) +- requested.sort() +- self.stream.writeln("Ran %d test%s in %.3fs (%s module%s skipped)" % +- (run, run != 1 and "s" or "", timeTaken, +- len(skipped), +- len(skipped) != 1 and "s" or "")) +- self.stream.writeln("Unavailable resources: %s" % ", ".join(requested)) +- else: +- self.stream.writeln("Ran %d test%s in %.3fs" % +- (run, run != 1 and "s" or "", timeTaken)) +- self.stream.writeln() +- if not result.wasSuccessful(): +- self.stream.write("FAILED (") +- failed, errored = map(len, (result.failures, result.errors)) +- if failed: +- self.stream.write("failures=%d" % failed) +- if errored: +- if failed: self.stream.write(", ") +- self.stream.write("errors=%d" % errored) +- self.stream.writeln(")") +- else: +- self.stream.writeln("OK") +- return result +- +- +-def main(*packages): +- try: +- opts, args = getopt.getopt(sys.argv[1:], "rqvu:x:") +- except getopt.error: +- return usage() +- +- verbosity = 1 +- search_leaks = False +- exclude = [] +- for flag, value in opts: +- if flag == "-q": +- verbosity -= 1 +- elif flag == "-v": +- verbosity += 1 +- elif flag == "-r": +- try: +- sys.gettotalrefcount +- except AttributeError: +- print("-r flag requires Python debug build", file=sys.stderr) +- return -1 +- search_leaks = True +- elif flag == "-u": +- use_resources.extend(value.split(",")) +- elif flag == "-x": +- exclude.extend(value.split(",")) +- +- mask = "test_*.py" +- if args: +- mask = args[0] +- +- for package in packages: +- run_tests(package, mask, verbosity, search_leaks, exclude) +- +- +-def run_tests(package, mask, verbosity, search_leaks, exclude): +- skipped, testcases = get_tests(package, mask, verbosity, exclude) +- runner = TestRunner(verbosity=verbosity) +- +- suites = [unittest.makeSuite(o) for o in testcases] +- suite = unittest.TestSuite(suites) +- result = runner.run(suite, skipped) +- +- if search_leaks: +- # hunt for refcount leaks +- runner = BasicTestRunner() +- for t in testcases: +- test_with_refcounts(runner, verbosity, t) +- +- return bool(result.errors) +- +-class BasicTestRunner: +- def run(self, test): +- result = unittest.TestResult() +- test(result) +- return result ++def load_tests(*args): ++ return support.load_package_tests(os.path.dirname(__file__), *args) +diff -r c0e311e010fc Lib/ctypes/test/__main__.py +--- /dev/null ++++ b/Lib/ctypes/test/__main__.py +@@ -0,0 +1,4 @@ ++from ctypes.test import load_tests ++import unittest ++ ++unittest.main() +diff -r c0e311e010fc Lib/ctypes/test/runtests.py +--- a/Lib/ctypes/test/runtests.py ++++ /dev/null +@@ -1,19 +0,0 @@ +-"""Usage: runtests.py [-q] [-r] [-v] [-u resources] [mask] +- +-Run all tests found in this directory, and print a summary of the results. +-Command line flags: +- -q quiet mode: don't print anything while the tests are running +- -r run tests repeatedly, look for refcount leaks +- -u +- Add resources to the lits of allowed resources. '*' allows all +- resources. +- -v verbose mode: print the test currently executed +- -x +- Exclude specified tests. +- mask mask to select filenames containing testcases, wildcards allowed +-""" +-import sys +-import ctypes.test +- +-if __name__ == "__main__": +- sys.exit(ctypes.test.main(ctypes.test)) +diff -r c0e311e010fc Lib/ctypes/test/test_arrays.py +--- a/Lib/ctypes/test/test_arrays.py ++++ b/Lib/ctypes/test/test_arrays.py +@@ -1,6 +1,8 @@ + import unittest + from ctypes import * + ++from ctypes.test import need_symbol ++ + formats = "bBhHiIlLqQfd" + + formats = c_byte, c_ubyte, c_short, c_ushort, c_int, c_uint, \ +@@ -98,20 +100,16 @@ + self.assertEqual(sz[1:4:2], b"o") + self.assertEqual(sz.value, b"foo") + +- try: +- create_unicode_buffer +- except NameError: +- pass +- else: +- def test_from_addressW(self): +- p = create_unicode_buffer("foo") +- sz = (c_wchar * 3).from_address(addressof(p)) +- self.assertEqual(sz[:], "foo") +- self.assertEqual(sz[::], "foo") +- self.assertEqual(sz[::-1], "oof") +- self.assertEqual(sz[::3], "f") +- self.assertEqual(sz[1:4:2], "o") +- self.assertEqual(sz.value, "foo") ++ @need_symbol('create_unicode_buffer') ++ def test_from_addressW(self): ++ p = create_unicode_buffer("foo") ++ sz = (c_wchar * 3).from_address(addressof(p)) ++ self.assertEqual(sz[:], "foo") ++ self.assertEqual(sz[::], "foo") ++ self.assertEqual(sz[::-1], "oof") ++ self.assertEqual(sz[::3], "f") ++ self.assertEqual(sz[1:4:2], "o") ++ self.assertEqual(sz.value, "foo") + + def test_cache(self): + # Array types are cached internally in the _ctypes extension, +diff -r c0e311e010fc Lib/ctypes/test/test_as_parameter.py +--- a/Lib/ctypes/test/test_as_parameter.py ++++ b/Lib/ctypes/test/test_as_parameter.py +@@ -1,5 +1,6 @@ + import unittest + from ctypes import * ++from ctypes.test import need_symbol + import _ctypes_test + + dll = CDLL(_ctypes_test.__file__) +@@ -17,11 +18,8 @@ + def wrap(self, param): + return param + ++ @need_symbol('c_wchar') + def test_wchar_parm(self): +- try: +- c_wchar +- except NameError: +- return + f = dll._testfunc_i_bhilfd + f.argtypes = [c_byte, c_wchar, c_int, c_long, c_float, c_double] + result = f(self.wrap(1), self.wrap("x"), self.wrap(3), self.wrap(4), self.wrap(5.0), self.wrap(6.0)) +diff -r c0e311e010fc Lib/ctypes/test/test_bitfields.py +--- a/Lib/ctypes/test/test_bitfields.py ++++ b/Lib/ctypes/test/test_bitfields.py +@@ -1,4 +1,5 @@ + from ctypes import * ++from ctypes.test import need_symbol + import unittest + import os + +@@ -127,20 +128,18 @@ + result = self.fail_fields(("a", c_char, 1)) + self.assertEqual(result, (TypeError, 'bit fields not allowed for type c_char')) + +- try: +- c_wchar +- except NameError: +- pass +- else: +- result = self.fail_fields(("a", c_wchar, 1)) +- self.assertEqual(result, (TypeError, 'bit fields not allowed for type c_wchar')) +- + class Dummy(Structure): + _fields_ = [] + + result = self.fail_fields(("a", Dummy, 1)) + self.assertEqual(result, (TypeError, 'bit fields not allowed for type Dummy')) + ++ @need_symbol('c_wchar') ++ def test_c_wchar(self): ++ result = self.fail_fields(("a", c_wchar, 1)) ++ self.assertEqual(result, ++ (TypeError, 'bit fields not allowed for type c_wchar')) ++ + def test_single_bitfield_size(self): + for c_typ in int_types: + result = self.fail_fields(("a", c_typ, -1)) +@@ -240,7 +239,7 @@ + _anonymous_ = ["_"] + _fields_ = [("_", X)] + +- @unittest.skipUnless(hasattr(ctypes, "c_uint32"), "c_int32 is required") ++ @need_symbol('c_uint32') + def test_uint32(self): + class X(Structure): + _fields_ = [("a", c_uint32, 32)] +@@ -250,7 +249,7 @@ + x.a = 0xFDCBA987 + self.assertEqual(x.a, 0xFDCBA987) + +- @unittest.skipUnless(hasattr(ctypes, "c_uint64"), "c_int64 is required") ++ @need_symbol('c_uint64') + def test_uint64(self): + class X(Structure): + _fields_ = [("a", c_uint64, 64)] +diff -r c0e311e010fc Lib/ctypes/test/test_buffers.py +--- a/Lib/ctypes/test/test_buffers.py ++++ b/Lib/ctypes/test/test_buffers.py +@@ -1,4 +1,5 @@ + from ctypes import * ++from ctypes.test import need_symbol + import unittest + + class StringBufferTestCase(unittest.TestCase): +@@ -20,43 +21,44 @@ + self.assertEqual(b[::2], b"ac") + self.assertEqual(b[::5], b"a") + ++ self.assertRaises(TypeError, create_string_buffer, "abc") ++ + def test_buffer_interface(self): + self.assertEqual(len(bytearray(create_string_buffer(0))), 0) + self.assertEqual(len(bytearray(create_string_buffer(1))), 1) + +- try: +- c_wchar +- except NameError: +- pass +- else: +- def test_unicode_buffer(self): +- b = create_unicode_buffer(32) +- self.assertEqual(len(b), 32) +- self.assertEqual(sizeof(b), 32 * sizeof(c_wchar)) +- self.assertIs(type(b[0]), str) ++ @need_symbol('c_wchar') ++ def test_unicode_buffer(self): ++ b = create_unicode_buffer(32) ++ self.assertEqual(len(b), 32) ++ self.assertEqual(sizeof(b), 32 * sizeof(c_wchar)) ++ self.assertIs(type(b[0]), str) + +- b = create_unicode_buffer("abc") +- self.assertEqual(len(b), 4) # trailing nul char +- self.assertEqual(sizeof(b), 4 * sizeof(c_wchar)) +- self.assertIs(type(b[0]), str) +- self.assertEqual(b[0], "a") +- self.assertEqual(b[:], "abc\0") +- self.assertEqual(b[::], "abc\0") +- self.assertEqual(b[::-1], "\0cba") +- self.assertEqual(b[::2], "ac") +- self.assertEqual(b[::5], "a") ++ b = create_unicode_buffer("abc") ++ self.assertEqual(len(b), 4) # trailing nul char ++ self.assertEqual(sizeof(b), 4 * sizeof(c_wchar)) ++ self.assertIs(type(b[0]), str) ++ self.assertEqual(b[0], "a") ++ self.assertEqual(b[:], "abc\0") ++ self.assertEqual(b[::], "abc\0") ++ self.assertEqual(b[::-1], "\0cba") ++ self.assertEqual(b[::2], "ac") ++ self.assertEqual(b[::5], "a") + +- def test_unicode_conversion(self): +- b = create_unicode_buffer("abc") +- self.assertEqual(len(b), 4) # trailing nul char +- self.assertEqual(sizeof(b), 4 * sizeof(c_wchar)) +- self.assertIs(type(b[0]), str) +- self.assertEqual(b[0], "a") +- self.assertEqual(b[:], "abc\0") +- self.assertEqual(b[::], "abc\0") +- self.assertEqual(b[::-1], "\0cba") +- self.assertEqual(b[::2], "ac") +- self.assertEqual(b[::5], "a") ++ self.assertRaises(TypeError, create_unicode_buffer, b"abc") ++ ++ @need_symbol('c_wchar') ++ def test_unicode_conversion(self): ++ b = create_unicode_buffer("abc") ++ self.assertEqual(len(b), 4) # trailing nul char ++ self.assertEqual(sizeof(b), 4 * sizeof(c_wchar)) ++ self.assertIs(type(b[0]), str) ++ self.assertEqual(b[0], "a") ++ self.assertEqual(b[:], "abc\0") ++ self.assertEqual(b[::], "abc\0") ++ self.assertEqual(b[::-1], "\0cba") ++ self.assertEqual(b[::2], "ac") ++ self.assertEqual(b[::5], "a") + + if __name__ == "__main__": + unittest.main() +diff -r c0e311e010fc Lib/ctypes/test/test_bytes.py +--- a/Lib/ctypes/test/test_bytes.py ++++ b/Lib/ctypes/test/test_bytes.py +@@ -6,27 +6,40 @@ + class BytesTest(unittest.TestCase): + def test_c_char(self): + x = c_char(b"x") ++ self.assertRaises(TypeError, c_char, "x") + x.value = b"y" ++ with self.assertRaises(TypeError): ++ x.value = "y" + c_char.from_param(b"x") ++ self.assertRaises(TypeError, c_char.from_param, "x") + (c_char * 3)(b"a", b"b", b"c") ++ self.assertRaises(TypeError, c_char * 3, "a", "b", "c") + + def test_c_wchar(self): + x = c_wchar("x") ++ self.assertRaises(TypeError, c_wchar, b"x") + x.value = "y" ++ with self.assertRaises(TypeError): ++ x.value = b"y" + c_wchar.from_param("x") ++ self.assertRaises(TypeError, c_wchar.from_param, b"x") + (c_wchar * 3)("a", "b", "c") ++ self.assertRaises(TypeError, c_wchar * 3, b"a", b"b", b"c") + + def test_c_char_p(self): + c_char_p(b"foo bar") ++ self.assertRaises(TypeError, c_char_p, "foo bar") + + def test_c_wchar_p(self): + c_wchar_p("foo bar") ++ self.assertRaises(TypeError, c_wchar_p, b"foo bar") + + def test_struct(self): + class X(Structure): + _fields_ = [("a", c_char * 3)] + + x = X(b"abc") ++ self.assertRaises(TypeError, X, "abc") + self.assertEqual(x.a, b"abc") + self.assertEqual(type(x.a), bytes) + +@@ -35,16 +48,18 @@ + _fields_ = [("a", c_wchar * 3)] + + x = X("abc") ++ self.assertRaises(TypeError, X, b"abc") + self.assertEqual(x.a, "abc") + self.assertEqual(type(x.a), str) + +- if sys.platform == "win32": +- def test_BSTR(self): +- from _ctypes import _SimpleCData +- class BSTR(_SimpleCData): +- _type_ = "X" ++ @unittest.skipUnless(sys.platform == "win32", 'Windows-specific test') ++ def test_BSTR(self): ++ from _ctypes import _SimpleCData ++ class BSTR(_SimpleCData): ++ _type_ = "X" + +- BSTR("abc") ++ BSTR("abc") ++ + + if __name__ == '__main__': + unittest.main() +diff -r c0e311e010fc Lib/ctypes/test/test_byteswap.py +--- a/Lib/ctypes/test/test_byteswap.py ++++ b/Lib/ctypes/test/test_byteswap.py +@@ -14,7 +14,8 @@ + # For Structures and Unions, these types are created on demand. + + class Test(unittest.TestCase): +- def X_test(self): ++ @unittest.skip('test disabled') ++ def test_X(self): + print(sys.byteorder, file=sys.stderr) + for i in range(32): + bits = BITS() +diff -r c0e311e010fc Lib/ctypes/test/test_callbacks.py +--- a/Lib/ctypes/test/test_callbacks.py ++++ b/Lib/ctypes/test/test_callbacks.py +@@ -1,5 +1,6 @@ + import unittest + from ctypes import * ++from ctypes.test import need_symbol + import _ctypes_test + + class Callbacks(unittest.TestCase): +@@ -88,9 +89,10 @@ + # disabled: would now (correctly) raise a RuntimeWarning about + # a memory leak. A callback function cannot return a non-integral + # C type without causing a memory leak. +-## def test_char_p(self): +-## self.check_type(c_char_p, "abc") +-## self.check_type(c_char_p, "def") ++ @unittest.skip('test disabled') ++ def test_char_p(self): ++ self.check_type(c_char_p, "abc") ++ self.check_type(c_char_p, "def") + + def test_pyobject(self): + o = () +@@ -142,13 +144,12 @@ + CFUNCTYPE(None)(lambda x=Nasty(): None) + + +-try: +- WINFUNCTYPE +-except NameError: +- pass +-else: +- class StdcallCallbacks(Callbacks): ++@need_symbol('WINFUNCTYPE') ++class StdcallCallbacks(Callbacks): ++ try: + functype = WINFUNCTYPE ++ except NameError: ++ pass + + ################################################################ + +@@ -178,7 +179,7 @@ + from ctypes.util import find_library + libc_path = find_library("c") + if not libc_path: +- return # cannot test ++ self.skipTest('could not find libc') + libc = CDLL(libc_path) + + @CFUNCTYPE(c_int, POINTER(c_int), POINTER(c_int)) +@@ -190,23 +191,19 @@ + libc.qsort(array, len(array), sizeof(c_int), cmp_func) + self.assertEqual(array[:], [1, 5, 7, 33, 99]) + +- try: +- WINFUNCTYPE +- except NameError: +- pass +- else: +- def test_issue_8959_b(self): +- from ctypes.wintypes import BOOL, HWND, LPARAM ++ @need_symbol('WINFUNCTYPE') ++ def test_issue_8959_b(self): ++ from ctypes.wintypes import BOOL, HWND, LPARAM ++ global windowCount ++ windowCount = 0 ++ ++ @WINFUNCTYPE(BOOL, HWND, LPARAM) ++ def EnumWindowsCallbackFunc(hwnd, lParam): + global windowCount +- windowCount = 0 ++ windowCount += 1 ++ return True #Allow windows to keep enumerating + +- @WINFUNCTYPE(BOOL, HWND, LPARAM) +- def EnumWindowsCallbackFunc(hwnd, lParam): +- global windowCount +- windowCount += 1 +- return True #Allow windows to keep enumerating +- +- windll.user32.EnumWindows(EnumWindowsCallbackFunc, 0) ++ windll.user32.EnumWindows(EnumWindowsCallbackFunc, 0) + + def test_callback_register_int(self): + # Issue #8275: buggy handling of callback args under Win64 +diff -r c0e311e010fc Lib/ctypes/test/test_cast.py +--- a/Lib/ctypes/test/test_cast.py ++++ b/Lib/ctypes/test/test_cast.py +@@ -1,4 +1,5 @@ + from ctypes import * ++from ctypes.test import need_symbol + import unittest + import sys + +@@ -75,15 +76,11 @@ + self.assertEqual(cast(cast(s, c_void_p), c_char_p).value, + b"hiho") + +- try: +- c_wchar_p +- except NameError: +- pass +- else: +- def test_wchar_p(self): +- s = c_wchar_p("hiho") +- self.assertEqual(cast(cast(s, c_void_p), c_wchar_p).value, +- "hiho") ++ @need_symbol('c_wchar_p') ++ def test_wchar_p(self): ++ s = c_wchar_p("hiho") ++ self.assertEqual(cast(cast(s, c_void_p), c_wchar_p).value, ++ "hiho") + + if __name__ == "__main__": + unittest.main() +diff -r c0e311e010fc Lib/ctypes/test/test_cfuncs.py +--- a/Lib/ctypes/test/test_cfuncs.py ++++ b/Lib/ctypes/test/test_cfuncs.py +@@ -3,6 +3,7 @@ + + import unittest + from ctypes import * ++from ctypes.test import need_symbol + + import _ctypes_test + +@@ -193,7 +194,7 @@ + try: + WinDLL + except NameError: +- pass ++ def stdcall_dll(*_): pass + else: + class stdcall_dll(WinDLL): + def __getattr__(self, name): +@@ -203,9 +204,9 @@ + setattr(self, name, func) + return func + +- class stdcallCFunctions(CFunctions): +- _dll = stdcall_dll(_ctypes_test.__file__) +- pass ++@need_symbol('WinDLL') ++class stdcallCFunctions(CFunctions): ++ _dll = stdcall_dll(_ctypes_test.__file__) + + if __name__ == '__main__': + unittest.main() +diff -r c0e311e010fc Lib/ctypes/test/test_checkretval.py +--- a/Lib/ctypes/test/test_checkretval.py ++++ b/Lib/ctypes/test/test_checkretval.py +@@ -1,6 +1,7 @@ + import unittest + + from ctypes import * ++from ctypes.test import need_symbol + + class CHECKED(c_int): + def _check_retval_(value): +@@ -25,15 +26,11 @@ + del dll._testfunc_p_p.restype + self.assertEqual(42, dll._testfunc_p_p(42)) + +- try: +- oledll +- except NameError: +- pass +- else: +- def test_oledll(self): +- self.assertRaises(OSError, +- oledll.oleaut32.CreateTypeLib2, +- 0, None, None) ++ @need_symbol('oledll') ++ def test_oledll(self): ++ self.assertRaises(OSError, ++ oledll.oleaut32.CreateTypeLib2, ++ 0, None, None) + + if __name__ == "__main__": + unittest.main() +diff -r c0e311e010fc Lib/ctypes/test/test_errcheck.py +--- a/Lib/ctypes/test/test_errcheck.py ++++ /dev/null +@@ -1,19 +0,0 @@ +-import sys +-from ctypes import * +- +-##class HMODULE(Structure): +-## _fields_ = [("value", c_void_p)] +- +-## def __repr__(self): +-## return "" % self.value +- +-##windll.kernel32.GetModuleHandleA.restype = HMODULE +- +-##print windll.kernel32.GetModuleHandleA("python23.dll") +-##print hex(sys.dllhandle) +- +-##def nonzero(handle): +-## return (GetLastError(), handle) +- +-##windll.kernel32.GetModuleHandleA.errcheck = nonzero +-##print windll.kernel32.GetModuleHandleA("spam") +diff -r c0e311e010fc Lib/ctypes/test/test_find.py +--- a/Lib/ctypes/test/test_find.py ++++ b/Lib/ctypes/test/test_find.py +@@ -1,82 +1,81 @@ + import unittest ++import os + import sys ++import test.support + from ctypes import * + from ctypes.util import find_library +-from ctypes.test import is_resource_enabled +- +-if sys.platform == "win32": +- lib_gl = find_library("OpenGL32") +- lib_glu = find_library("Glu32") +- lib_gle = None +-elif sys.platform == "darwin": +- lib_gl = lib_glu = find_library("OpenGL") +- lib_gle = None +-else: +- lib_gl = find_library("GL") +- lib_glu = find_library("GLU") +- lib_gle = find_library("gle") +- +-## print, for debugging +-if is_resource_enabled("printing"): +- if lib_gl or lib_glu or lib_gle: +- print("OpenGL libraries:") +- for item in (("GL", lib_gl), +- ("GLU", lib_glu), +- ("gle", lib_gle)): +- print("\t", item) +- + + # On some systems, loading the OpenGL libraries needs the RTLD_GLOBAL mode. + class Test_OpenGL_libs(unittest.TestCase): +- def setUp(self): +- self.gl = self.glu = self.gle = None ++ @classmethod ++ def setUpClass(cls): ++ lib_gl = lib_glu = lib_gle = None ++ if sys.platform == "win32": ++ lib_gl = find_library("OpenGL32") ++ lib_glu = find_library("Glu32") ++ elif sys.platform == "darwin": ++ lib_gl = lib_glu = find_library("OpenGL") ++ else: ++ lib_gl = find_library("GL") ++ lib_glu = find_library("GLU") ++ lib_gle = find_library("gle") ++ ++ ## print, for debugging ++ if test.support.verbose: ++ print("OpenGL libraries:") ++ for item in (("GL", lib_gl), ++ ("GLU", lib_glu), ++ ("gle", lib_gle)): ++ print("\t", item) ++ ++ cls.gl = cls.glu = cls.gle = None + if lib_gl: +- self.gl = CDLL(lib_gl, mode=RTLD_GLOBAL) ++ cls.gl = CDLL(lib_gl, mode=RTLD_GLOBAL) + if lib_glu: +- self.glu = CDLL(lib_glu, RTLD_GLOBAL) ++ cls.glu = CDLL(lib_glu, RTLD_GLOBAL) + if lib_gle: + try: +- self.gle = CDLL(lib_gle) ++ cls.gle = CDLL(lib_gle) + except OSError: + pass + +- if lib_gl: +- def test_gl(self): +- if self.gl: +- self.gl.glClearIndex ++ def test_gl(self): ++ if self.gl is None: ++ self.skipTest('lib_gl not available') ++ self.gl.glClearIndex + +- if lib_glu: +- def test_glu(self): +- if self.glu: +- self.glu.gluBeginCurve ++ def test_glu(self): ++ if self.glu is None: ++ self.skipTest('lib_glu not available') ++ self.glu.gluBeginCurve + +- if lib_gle: +- def test_gle(self): +- if self.gle: +- self.gle.gleGetJoinStyle ++ def test_gle(self): ++ if self.gle is None: ++ self.skipTest('lib_gle not available') ++ self.gle.gleGetJoinStyle + +-##if os.name == "posix" and sys.platform != "darwin": +- +-## # On platforms where the default shared library suffix is '.so', +-## # at least some libraries can be loaded as attributes of the cdll +-## # object, since ctypes now tries loading the lib again +-## # with '.so' appended of the first try fails. +-## # +-## # Won't work for libc, unfortunately. OTOH, it isn't +-## # needed for libc since this is already mapped into the current +-## # process (?) +-## # +-## # On MAC OSX, it won't work either, because dlopen() needs a full path, +-## # and the default suffix is either none or '.dylib'. +- +-## class LoadLibs(unittest.TestCase): +-## def test_libm(self): +-## import math +-## libm = cdll.libm +-## sqrt = libm.sqrt +-## sqrt.argtypes = (c_double,) +-## sqrt.restype = c_double +-## self.assertEqual(sqrt(2), math.sqrt(2)) ++# On platforms where the default shared library suffix is '.so', ++# at least some libraries can be loaded as attributes of the cdll ++# object, since ctypes now tries loading the lib again ++# with '.so' appended of the first try fails. ++# ++# Won't work for libc, unfortunately. OTOH, it isn't ++# needed for libc since this is already mapped into the current ++# process (?) ++# ++# On MAC OSX, it won't work either, because dlopen() needs a full path, ++# and the default suffix is either none or '.dylib'. ++@unittest.skip('test disabled') ++@unittest.skipUnless(os.name=="posix" and sys.platform != "darwin", ++ 'test not suitable for this platform') ++class LoadLibs(unittest.TestCase): ++ def test_libm(self): ++ import math ++ libm = cdll.libm ++ sqrt = libm.sqrt ++ sqrt.argtypes = (c_double,) ++ sqrt.restype = c_double ++ self.assertEqual(sqrt(2), math.sqrt(2)) + + if __name__ == "__main__": + unittest.main() +diff -r c0e311e010fc Lib/ctypes/test/test_functions.py +--- a/Lib/ctypes/test/test_functions.py ++++ b/Lib/ctypes/test/test_functions.py +@@ -6,6 +6,7 @@ + """ + + from ctypes import * ++from ctypes.test import need_symbol + import sys, unittest + + try: +@@ -63,22 +64,16 @@ + pass + + ++ @need_symbol('c_wchar') + def test_wchar_parm(self): +- try: +- c_wchar +- except NameError: +- return + f = dll._testfunc_i_bhilfd + f.argtypes = [c_byte, c_wchar, c_int, c_long, c_float, c_double] + result = f(1, "x", 3, 4, 5.0, 6.0) + self.assertEqual(result, 139) + self.assertEqual(type(result), int) + ++ @need_symbol('c_wchar') + def test_wchar_result(self): +- try: +- c_wchar +- except NameError: +- return + f = dll._testfunc_i_bhilfd + f.argtypes = [c_byte, c_short, c_int, c_long, c_float, c_double] + f.restype = c_wchar +@@ -155,11 +150,8 @@ + self.assertEqual(result, -21) + self.assertEqual(type(result), float) + ++ @need_symbol('c_longlong') + def test_longlongresult(self): +- try: +- c_longlong +- except NameError: +- return + f = dll._testfunc_q_bhilfd + f.restype = c_longlong + f.argtypes = [c_byte, c_short, c_int, c_long, c_float, c_double] +@@ -296,6 +288,7 @@ + result = f(-10, cb) + self.assertEqual(result, -18) + ++ @need_symbol('c_longlong') + def test_longlong_callbacks(self): + + f = dll._testfunc_callback_q_qf +@@ -348,16 +341,16 @@ + s2h = dll.ret_2h_func(inp) + self.assertEqual((s2h.x, s2h.y), (99*2, 88*3)) + +- if sys.platform == "win32": +- def test_struct_return_2H_stdcall(self): +- class S2H(Structure): +- _fields_ = [("x", c_short), +- ("y", c_short)] ++ @unittest.skipUnless(sys.platform == "win32", 'Windows-specific test') ++ def test_struct_return_2H_stdcall(self): ++ class S2H(Structure): ++ _fields_ = [("x", c_short), ++ ("y", c_short)] + +- windll.s_ret_2h_func.restype = S2H +- windll.s_ret_2h_func.argtypes = [S2H] +- s2h = windll.s_ret_2h_func(S2H(99, 88)) +- self.assertEqual((s2h.x, s2h.y), (99*2, 88*3)) ++ windll.s_ret_2h_func.restype = S2H ++ windll.s_ret_2h_func.argtypes = [S2H] ++ s2h = windll.s_ret_2h_func(S2H(99, 88)) ++ self.assertEqual((s2h.x, s2h.y), (99*2, 88*3)) + + def test_struct_return_8H(self): + class S8I(Structure): +@@ -376,23 +369,24 @@ + self.assertEqual((s8i.a, s8i.b, s8i.c, s8i.d, s8i.e, s8i.f, s8i.g, s8i.h), + (9*2, 8*3, 7*4, 6*5, 5*6, 4*7, 3*8, 2*9)) + +- if sys.platform == "win32": +- def test_struct_return_8H_stdcall(self): +- class S8I(Structure): +- _fields_ = [("a", c_int), +- ("b", c_int), +- ("c", c_int), +- ("d", c_int), +- ("e", c_int), +- ("f", c_int), +- ("g", c_int), +- ("h", c_int)] +- windll.s_ret_8i_func.restype = S8I +- windll.s_ret_8i_func.argtypes = [S8I] +- inp = S8I(9, 8, 7, 6, 5, 4, 3, 2) +- s8i = windll.s_ret_8i_func(inp) +- self.assertEqual((s8i.a, s8i.b, s8i.c, s8i.d, s8i.e, s8i.f, s8i.g, s8i.h), +- (9*2, 8*3, 7*4, 6*5, 5*6, 4*7, 3*8, 2*9)) ++ @unittest.skipUnless(sys.platform == "win32", 'Windows-specific test') ++ def test_struct_return_8H_stdcall(self): ++ class S8I(Structure): ++ _fields_ = [("a", c_int), ++ ("b", c_int), ++ ("c", c_int), ++ ("d", c_int), ++ ("e", c_int), ++ ("f", c_int), ++ ("g", c_int), ++ ("h", c_int)] ++ windll.s_ret_8i_func.restype = S8I ++ windll.s_ret_8i_func.argtypes = [S8I] ++ inp = S8I(9, 8, 7, 6, 5, 4, 3, 2) ++ s8i = windll.s_ret_8i_func(inp) ++ self.assertEqual( ++ (s8i.a, s8i.b, s8i.c, s8i.d, s8i.e, s8i.f, s8i.g, s8i.h), ++ (9*2, 8*3, 7*4, 6*5, 5*6, 4*7, 3*8, 2*9)) + + def test_sf1651235(self): + # see http://www.python.org/sf/1651235 +diff -r c0e311e010fc Lib/ctypes/test/test_integers.py +--- a/Lib/ctypes/test/test_integers.py ++++ /dev/null +@@ -1,5 +0,0 @@ +-# superseded by test_numbers.py +-import unittest +- +-if __name__ == '__main__': +- unittest.main() +diff -r c0e311e010fc Lib/ctypes/test/test_keeprefs.py +--- a/Lib/ctypes/test/test_keeprefs.py ++++ b/Lib/ctypes/test/test_keeprefs.py +@@ -94,7 +94,8 @@ + self.assertEqual(x._objects, {'1': i}) + + class DeletePointerTestCase(unittest.TestCase): +- def X_test(self): ++ @unittest.skip('test disabled') ++ def test_X(self): + class X(Structure): + _fields_ = [("p", POINTER(c_char_p))] + x = X() +diff -r c0e311e010fc Lib/ctypes/test/test_loading.py +--- a/Lib/ctypes/test/test_loading.py ++++ b/Lib/ctypes/test/test_loading.py +@@ -1,38 +1,46 @@ + from ctypes import * +-import sys, unittest + import os ++import sys ++import unittest ++import test.support + from ctypes.util import find_library +-from ctypes.test import is_resource_enabled + + libc_name = None +-if os.name == "nt": +- libc_name = find_library("c") +-elif os.name == "ce": +- libc_name = "coredll" +-elif sys.platform == "cygwin": +- libc_name = "cygwin1.dll" +-else: +- libc_name = find_library("c") + +-if is_resource_enabled("printing"): +- print("libc_name is", libc_name) ++def setUpModule(): ++ global libc_name ++ if os.name == "nt": ++ libc_name = find_library("c") ++ elif os.name == "ce": ++ libc_name = "coredll" ++ elif sys.platform == "cygwin": ++ libc_name = "cygwin1.dll" ++ else: ++ libc_name = find_library("c") ++ ++ if test.support.verbose: ++ print("libc_name is", libc_name) + + class LoaderTest(unittest.TestCase): + + unknowndll = "xxrandomnamexx" + +- if libc_name is not None: +- def test_load(self): +- CDLL(libc_name) +- CDLL(os.path.basename(libc_name)) +- self.assertRaises(OSError, CDLL, self.unknowndll) ++ def test_load(self): ++ if libc_name is None: ++ self.skipTest('could not find libc') ++ CDLL(libc_name) ++ CDLL(os.path.basename(libc_name)) ++ self.assertRaises(OSError, CDLL, self.unknowndll) + +- if libc_name is not None and os.path.basename(libc_name) == "libc.so.6": +- def test_load_version(self): +- cdll.LoadLibrary("libc.so.6") +- # linux uses version, libc 9 should not exist +- self.assertRaises(OSError, cdll.LoadLibrary, "libc.so.9") +- self.assertRaises(OSError, cdll.LoadLibrary, self.unknowndll) ++ def test_load_version(self): ++ if libc_name is None: ++ self.skipTest('could not find libc') ++ if os.path.basename(libc_name) != 'libc.so.6': ++ self.skipTest('wrong libc path for test') ++ cdll.LoadLibrary("libc.so.6") ++ # linux uses version, libc 9 should not exist ++ self.assertRaises(OSError, cdll.LoadLibrary, "libc.so.9") ++ self.assertRaises(OSError, cdll.LoadLibrary, self.unknowndll) + + def test_find(self): + for name in ("c", "m"): +@@ -41,66 +49,71 @@ + cdll.LoadLibrary(lib) + CDLL(lib) + +- if os.name in ("nt", "ce"): +- def test_load_library(self): +- self.assertIsNotNone(libc_name) +- if is_resource_enabled("printing"): +- print(find_library("kernel32")) +- print(find_library("user32")) ++ @unittest.skipUnless(os.name in ("nt", "ce"), ++ 'test specific to Windows (NT/CE)') ++ def test_load_library(self): ++ self.assertIsNotNone(libc_name) ++ if test.support.verbose: ++ print(find_library("kernel32")) ++ print(find_library("user32")) + +- if os.name == "nt": +- windll.kernel32.GetModuleHandleW +- windll["kernel32"].GetModuleHandleW +- windll.LoadLibrary("kernel32").GetModuleHandleW +- WinDLL("kernel32").GetModuleHandleW +- elif os.name == "ce": +- windll.coredll.GetModuleHandleW +- windll["coredll"].GetModuleHandleW +- windll.LoadLibrary("coredll").GetModuleHandleW +- WinDLL("coredll").GetModuleHandleW ++ if os.name == "nt": ++ windll.kernel32.GetModuleHandleW ++ windll["kernel32"].GetModuleHandleW ++ windll.LoadLibrary("kernel32").GetModuleHandleW ++ WinDLL("kernel32").GetModuleHandleW ++ elif os.name == "ce": ++ windll.coredll.GetModuleHandleW ++ windll["coredll"].GetModuleHandleW ++ windll.LoadLibrary("coredll").GetModuleHandleW ++ WinDLL("coredll").GetModuleHandleW + +- def test_load_ordinal_functions(self): +- import _ctypes_test +- dll = WinDLL(_ctypes_test.__file__) +- # We load the same function both via ordinal and name +- func_ord = dll[2] +- func_name = dll.GetString +- # addressof gets the address where the function pointer is stored +- a_ord = addressof(func_ord) +- a_name = addressof(func_name) +- f_ord_addr = c_void_p.from_address(a_ord).value +- f_name_addr = c_void_p.from_address(a_name).value +- self.assertEqual(hex(f_ord_addr), hex(f_name_addr)) ++ @unittest.skipUnless(os.name in ("nt", "ce"), ++ 'test specific to Windows (NT/CE)') ++ def test_load_ordinal_functions(self): ++ import _ctypes_test ++ dll = WinDLL(_ctypes_test.__file__) ++ # We load the same function both via ordinal and name ++ func_ord = dll[2] ++ func_name = dll.GetString ++ # addressof gets the address where the function pointer is stored ++ a_ord = addressof(func_ord) ++ a_name = addressof(func_name) ++ f_ord_addr = c_void_p.from_address(a_ord).value ++ f_name_addr = c_void_p.from_address(a_name).value ++ self.assertEqual(hex(f_ord_addr), hex(f_name_addr)) + +- self.assertRaises(AttributeError, dll.__getitem__, 1234) ++ self.assertRaises(AttributeError, dll.__getitem__, 1234) + +- if os.name == "nt": +- def test_1703286_A(self): +- from _ctypes import LoadLibrary, FreeLibrary +- # On winXP 64-bit, advapi32 loads at an address that does +- # NOT fit into a 32-bit integer. FreeLibrary must be able +- # to accept this address. ++ @unittest.skipUnless(os.name == "nt", 'Windows-specific test') ++ def test_1703286_A(self): ++ from _ctypes import LoadLibrary, FreeLibrary ++ # On winXP 64-bit, advapi32 loads at an address that does ++ # NOT fit into a 32-bit integer. FreeLibrary must be able ++ # to accept this address. + +- # These are tests for http://www.python.org/sf/1703286 +- handle = LoadLibrary("advapi32") +- FreeLibrary(handle) ++ # These are tests for http://www.python.org/sf/1703286 ++ handle = LoadLibrary("advapi32") ++ FreeLibrary(handle) + +- def test_1703286_B(self): +- # Since on winXP 64-bit advapi32 loads like described +- # above, the (arbitrarily selected) CloseEventLog function +- # also has a high address. 'call_function' should accept +- # addresses so large. +- from _ctypes import call_function +- advapi32 = windll.advapi32 +- # Calling CloseEventLog with a NULL argument should fail, +- # but the call should not segfault or so. +- self.assertEqual(0, advapi32.CloseEventLog(None)) +- windll.kernel32.GetProcAddress.argtypes = c_void_p, c_char_p +- windll.kernel32.GetProcAddress.restype = c_void_p +- proc = windll.kernel32.GetProcAddress(advapi32._handle, b"CloseEventLog") +- self.assertTrue(proc) +- # This is the real test: call the function via 'call_function' +- self.assertEqual(0, call_function(proc, (None,))) ++ @unittest.skipUnless(os.name == "nt", 'Windows-specific test') ++ def test_1703286_B(self): ++ # Since on winXP 64-bit advapi32 loads like described ++ # above, the (arbitrarily selected) CloseEventLog function ++ # also has a high address. 'call_function' should accept ++ # addresses so large. ++ from _ctypes import call_function ++ advapi32 = windll.advapi32 ++ # Calling CloseEventLog with a NULL argument should fail, ++ # but the call should not segfault or so. ++ self.assertEqual(0, advapi32.CloseEventLog(None)) ++ windll.kernel32.GetProcAddress.argtypes = c_void_p, c_char_p ++ windll.kernel32.GetProcAddress.restype = c_void_p ++ proc = windll.kernel32.GetProcAddress(advapi32._handle, ++ b"CloseEventLog") ++ self.assertTrue(proc) ++ # This is the real test: call the function via 'call_function' ++ self.assertEqual(0, call_function(proc, (None,))) + + if __name__ == "__main__": + unittest.main() +diff -r c0e311e010fc Lib/ctypes/test/test_macholib.py +--- a/Lib/ctypes/test/test_macholib.py ++++ b/Lib/ctypes/test/test_macholib.py +@@ -43,21 +43,21 @@ + raise ValueError("%s not found" % (name,)) + + class MachOTest(unittest.TestCase): +- if sys.platform == "darwin": +- def test_find(self): ++ @unittest.skipUnless(sys.platform == "darwin", 'OSX-specific test') ++ def test_find(self): + +- self.assertEqual(find_lib('pthread'), +- '/usr/lib/libSystem.B.dylib') ++ self.assertEqual(find_lib('pthread'), ++ '/usr/lib/libSystem.B.dylib') + +- result = find_lib('z') +- # Issue #21093: dyld default search path includes $HOME/lib and +- # /usr/local/lib before /usr/lib, which caused test failures if +- # a local copy of libz exists in one of them. Now ignore the head +- # of the path. +- self.assertRegex(result, r".*/lib/libz\..*.*\.dylib") ++ result = find_lib('z') ++ # Issue #21093: dyld default search path includes $HOME/lib and ++ # /usr/local/lib before /usr/lib, which caused test failures if ++ # a local copy of libz exists in one of them. Now ignore the head ++ # of the path. ++ self.assertRegex(result, r".*/lib/libz\..*.*\.dylib") + +- self.assertEqual(find_lib('IOKit'), +- '/System/Library/Frameworks/IOKit.framework/Versions/A/IOKit') ++ self.assertEqual(find_lib('IOKit'), ++ '/System/Library/Frameworks/IOKit.framework/Versions/A/IOKit') + + if __name__ == "__main__": + unittest.main() +diff -r c0e311e010fc Lib/ctypes/test/test_memfunctions.py +--- a/Lib/ctypes/test/test_memfunctions.py ++++ b/Lib/ctypes/test/test_memfunctions.py +@@ -2,17 +2,19 @@ + from test import support + import unittest + from ctypes import * ++from ctypes.test import need_symbol + + class MemFunctionsTest(unittest.TestCase): +-## def test_overflow(self): +-## # string_at and wstring_at must use the Python calling +-## # convention (which acquires the GIL and checks the Python +-## # error flag). Provoke an error and catch it; see also issue +-## # #3554: +-## self.assertRaises((OverflowError, MemoryError, SystemError), +-## lambda: wstring_at(u"foo", sys.maxint - 1)) +-## self.assertRaises((OverflowError, MemoryError, SystemError), +-## lambda: string_at("foo", sys.maxint - 1)) ++ @unittest.skip('test disabled') ++ def test_overflow(self): ++ # string_at and wstring_at must use the Python calling ++ # convention (which acquires the GIL and checks the Python ++ # error flag). Provoke an error and catch it; see also issue ++ # #3554: ++ self.assertRaises((OverflowError, MemoryError, SystemError), ++ lambda: wstring_at(u"foo", sys.maxint - 1)) ++ self.assertRaises((OverflowError, MemoryError, SystemError), ++ lambda: string_at("foo", sys.maxint - 1)) + + def test_memmove(self): + # large buffers apparently increase the chance that the memory +@@ -61,21 +63,17 @@ + self.assertEqual(string_at(b"foo bar", 7), b"foo bar") + self.assertEqual(string_at(b"foo bar", 3), b"foo") + +- try: +- create_unicode_buffer +- except NameError: +- pass +- else: +- def test_wstring_at(self): +- p = create_unicode_buffer("Hello, World") +- a = create_unicode_buffer(1000000) +- result = memmove(a, p, len(p) * sizeof(c_wchar)) +- self.assertEqual(a.value, "Hello, World") ++ @need_symbol('create_unicode_buffer') ++ def test_wstring_at(self): ++ p = create_unicode_buffer("Hello, World") ++ a = create_unicode_buffer(1000000) ++ result = memmove(a, p, len(p) * sizeof(c_wchar)) ++ self.assertEqual(a.value, "Hello, World") + +- self.assertEqual(wstring_at(a), "Hello, World") +- self.assertEqual(wstring_at(a, 5), "Hello") +- self.assertEqual(wstring_at(a, 16), "Hello, World\0\0\0\0") +- self.assertEqual(wstring_at(a, 0), "") ++ self.assertEqual(wstring_at(a), "Hello, World") ++ self.assertEqual(wstring_at(a, 5), "Hello") ++ self.assertEqual(wstring_at(a, 16), "Hello, World\0\0\0\0") ++ self.assertEqual(wstring_at(a, 0), "") + + if __name__ == "__main__": + unittest.main() +diff -r c0e311e010fc Lib/ctypes/test/test_numbers.py +--- a/Lib/ctypes/test/test_numbers.py ++++ b/Lib/ctypes/test/test_numbers.py +@@ -82,12 +82,13 @@ + self.assertRaises(TypeError, t, "") + self.assertRaises(TypeError, t, None) + +-## def test_valid_ranges(self): +-## # invalid values of the correct type +-## # raise ValueError (not OverflowError) +-## for t, (l, h) in zip(unsigned_types, unsigned_ranges): +-## self.assertRaises(ValueError, t, l-1) +-## self.assertRaises(ValueError, t, h+1) ++ @unittest.skip('test disabled') ++ def test_valid_ranges(self): ++ # invalid values of the correct type ++ # raise ValueError (not OverflowError) ++ for t, (l, h) in zip(unsigned_types, unsigned_ranges): ++ self.assertRaises(ValueError, t, l-1) ++ self.assertRaises(ValueError, t, h+1) + + def test_from_param(self): + # the from_param class method attribute always +@@ -200,16 +201,17 @@ + self.assertEqual(v.value, b'?') + + # array does not support c_bool / 't' +- # def test_bool_from_address(self): +- # from ctypes import c_bool +- # from array import array +- # a = array(c_bool._type_, [True]) +- # v = t.from_address(a.buffer_info()[0]) +- # self.assertEqual(v.value, a[0]) +- # self.assertEqual(type(v) is t) +- # a[0] = False +- # self.assertEqual(v.value, a[0]) +- # self.assertEqual(type(v) is t) ++ @unittest.skip('test disabled') ++ def test_bool_from_address(self): ++ from ctypes import c_bool ++ from array import array ++ a = array(c_bool._type_, [True]) ++ v = t.from_address(a.buffer_info()[0]) ++ self.assertEqual(v.value, a[0]) ++ self.assertEqual(type(v) is t) ++ a[0] = False ++ self.assertEqual(v.value, a[0]) ++ self.assertEqual(type(v) is t) + + def test_init(self): + # c_int() can be initialized from Python's int, and c_int. +@@ -227,8 +229,9 @@ + if (hasattr(t, "__ctype_le__")): + self.assertRaises(OverflowError, t.__ctype_le__, big_int) + +-## def test_perf(self): +-## check_perf() ++ @unittest.skip('test disabled') ++ def test_perf(self): ++ check_perf() + + from ctypes import _SimpleCData + class c_int_S(_SimpleCData): +diff -r c0e311e010fc Lib/ctypes/test/test_objects.py +--- a/Lib/ctypes/test/test_objects.py ++++ b/Lib/ctypes/test/test_objects.py +@@ -59,12 +59,9 @@ + import ctypes.test.test_objects + + class TestCase(unittest.TestCase): +- if sys.hexversion > 0x02040000: +- # Python 2.3 has no ELLIPSIS flag, so we don't test with this +- # version: +- def test(self): +- doctest.testmod(ctypes.test.test_objects) ++ def test(self): ++ failures, tests = doctest.testmod(ctypes.test.test_objects) ++ self.assertFalse(failures, 'doctests failed, see output above') + + if __name__ == '__main__': +- if sys.hexversion > 0x02040000: +- doctest.testmod(ctypes.test.test_objects) ++ doctest.testmod(ctypes.test.test_objects) +diff -r c0e311e010fc Lib/ctypes/test/test_parameters.py +--- a/Lib/ctypes/test/test_parameters.py ++++ b/Lib/ctypes/test/test_parameters.py +@@ -1,4 +1,5 @@ + import unittest, sys ++from ctypes.test import need_symbol + + class SimpleTypesTestCase(unittest.TestCase): + +@@ -35,10 +36,9 @@ + self.assertEqual(CVOIDP.from_param("abc"), "abcabc") + self.assertEqual(CCHARP.from_param("abc"), "abcabcabcabc") + +- try: +- from ctypes import c_wchar_p +- except ImportError: +- return ++ @need_symbol('c_wchar_p') ++ def test_subclasses_c_wchar_p(self): ++ from ctypes import c_wchar_p + + class CWCHARP(c_wchar_p): + def from_param(cls, value): +@@ -66,13 +66,9 @@ + a = c_char_p(b"123") + self.assertIs(c_char_p.from_param(a), a) + ++ @need_symbol('c_wchar_p') + def test_cw_strings(self): +- from ctypes import byref +- try: +- from ctypes import c_wchar_p +- except ImportError: +-## print "(No c_wchar_p)" +- return ++ from ctypes import byref, c_wchar_p + + c_wchar_p.from_param("123") + +@@ -139,9 +135,6 @@ + self.assertRaises(TypeError, LPINT.from_param, c_long*3) + self.assertRaises(TypeError, LPINT.from_param, c_uint*3) + +-## def test_performance(self): +-## check_perf() +- + def test_noctypes_argtype(self): + import _ctypes_test + from ctypes import CDLL, c_void_p, ArgumentError +diff -r c0e311e010fc Lib/ctypes/test/test_prototypes.py +--- a/Lib/ctypes/test/test_prototypes.py ++++ b/Lib/ctypes/test/test_prototypes.py +@@ -1,4 +1,5 @@ + from ctypes import * ++from ctypes.test import need_symbol + import unittest + + # IMPORTANT INFO: +@@ -135,13 +136,14 @@ + func(pointer(c_int())) + func((c_int * 3)()) + +- try: +- func.restype = c_wchar_p +- except NameError: +- pass +- else: +- self.assertEqual(None, func(c_wchar_p(None))) +- self.assertEqual("123", func(c_wchar_p("123"))) ++ @need_symbol('c_wchar_p') ++ def test_c_void_p_arg_with_c_wchar_p(self): ++ func = testdll._testfunc_p_p ++ func.restype = c_wchar_p ++ func.argtypes = c_void_p, ++ ++ self.assertEqual(None, func(c_wchar_p(None))) ++ self.assertEqual("123", func(c_wchar_p("123"))) + + def test_instance(self): + func = testdll._testfunc_p_p +@@ -156,51 +158,47 @@ + func.argtypes = None + self.assertEqual(None, func(X())) + +-try: +- c_wchar +-except NameError: +- pass +-else: +- class WCharPointersTestCase(unittest.TestCase): ++@need_symbol('c_wchar') ++class WCharPointersTestCase(unittest.TestCase): + +- def setUp(self): +- func = testdll._testfunc_p_p +- func.restype = c_int +- func.argtypes = None ++ def setUp(self): ++ func = testdll._testfunc_p_p ++ func.restype = c_int ++ func.argtypes = None + + +- def test_POINTER_c_wchar_arg(self): +- func = testdll._testfunc_p_p +- func.restype = c_wchar_p +- func.argtypes = POINTER(c_wchar), ++ def test_POINTER_c_wchar_arg(self): ++ func = testdll._testfunc_p_p ++ func.restype = c_wchar_p ++ func.argtypes = POINTER(c_wchar), + +- self.assertEqual(None, func(None)) +- self.assertEqual("123", func("123")) +- self.assertEqual(None, func(c_wchar_p(None))) +- self.assertEqual("123", func(c_wchar_p("123"))) ++ self.assertEqual(None, func(None)) ++ self.assertEqual("123", func("123")) ++ self.assertEqual(None, func(c_wchar_p(None))) ++ self.assertEqual("123", func(c_wchar_p("123"))) + +- self.assertEqual("123", func(c_wbuffer("123"))) +- ca = c_wchar("a") +- self.assertEqual("a", func(pointer(ca))[0]) +- self.assertEqual("a", func(byref(ca))[0]) ++ self.assertEqual("123", func(c_wbuffer("123"))) ++ ca = c_wchar("a") ++ self.assertEqual("a", func(pointer(ca))[0]) ++ self.assertEqual("a", func(byref(ca))[0]) + +- def test_c_wchar_p_arg(self): +- func = testdll._testfunc_p_p +- func.restype = c_wchar_p +- func.argtypes = c_wchar_p, ++ def test_c_wchar_p_arg(self): ++ func = testdll._testfunc_p_p ++ func.restype = c_wchar_p ++ func.argtypes = c_wchar_p, + +- c_wchar_p.from_param("123") ++ c_wchar_p.from_param("123") + +- self.assertEqual(None, func(None)) +- self.assertEqual("123", func("123")) +- self.assertEqual(None, func(c_wchar_p(None))) +- self.assertEqual("123", func(c_wchar_p("123"))) ++ self.assertEqual(None, func(None)) ++ self.assertEqual("123", func("123")) ++ self.assertEqual(None, func(c_wchar_p(None))) ++ self.assertEqual("123", func(c_wchar_p("123"))) + +- # XXX Currently, these raise TypeErrors, although they shouldn't: +- self.assertEqual("123", func(c_wbuffer("123"))) +- ca = c_wchar("a") +- self.assertEqual("a", func(pointer(ca))[0]) +- self.assertEqual("a", func(byref(ca))[0]) ++ # XXX Currently, these raise TypeErrors, although they shouldn't: ++ self.assertEqual("123", func(c_wbuffer("123"))) ++ ca = c_wchar("a") ++ self.assertEqual("a", func(pointer(ca))[0]) ++ self.assertEqual("a", func(byref(ca))[0]) + + class ArrayTest(unittest.TestCase): + def test(self): +diff -r c0e311e010fc Lib/ctypes/test/test_python_api.py +--- a/Lib/ctypes/test/test_python_api.py ++++ b/Lib/ctypes/test/test_python_api.py +@@ -1,7 +1,6 @@ + from ctypes import * + import unittest, sys + from test import support +-from ctypes.test import is_resource_enabled + + ################################################################ + # This section should be moved into ctypes\__init__.py, when it's ready. +@@ -39,24 +38,21 @@ + del pyob + self.assertEqual(grc(s), refcnt) + +- if is_resource_enabled("refcount"): +- # This test is unreliable, because it is possible that code in +- # unittest changes the refcount of the '42' integer. So, it +- # is disabled by default. +- def test_PyLong_Long(self): +- ref42 = grc(42) +- pythonapi.PyLong_FromLong.restype = py_object +- self.assertEqual(pythonapi.PyLong_FromLong(42), 42) ++ @support.refcount_test ++ def test_PyLong_Long(self): ++ ref42 = grc(42) ++ pythonapi.PyLong_FromLong.restype = py_object ++ self.assertEqual(pythonapi.PyLong_FromLong(42), 42) + +- self.assertEqual(grc(42), ref42) ++ self.assertEqual(grc(42), ref42) + +- pythonapi.PyLong_AsLong.argtypes = (py_object,) +- pythonapi.PyLong_AsLong.restype = c_long ++ pythonapi.PyLong_AsLong.argtypes = (py_object,) ++ pythonapi.PyLong_AsLong.restype = c_long + +- res = pythonapi.PyLong_AsLong(42) +- self.assertEqual(grc(res), ref42 + 1) +- del res +- self.assertEqual(grc(42), ref42) ++ res = pythonapi.PyLong_AsLong(42) ++ self.assertEqual(grc(res), ref42 + 1) ++ del res ++ self.assertEqual(grc(42), ref42) + + @support.refcount_test + def test_PyObj_FromPtr(self): +diff -r c0e311e010fc Lib/ctypes/test/test_random_things.py +--- a/Lib/ctypes/test/test_random_things.py ++++ b/Lib/ctypes/test/test_random_things.py +@@ -5,23 +5,22 @@ + 42 / arg + raise ValueError(arg) + +-if sys.platform == "win32": ++@unittest.skipUnless(sys.platform == "win32", 'Windows-specific test') ++class call_function_TestCase(unittest.TestCase): ++ # _ctypes.call_function is deprecated and private, but used by ++ # Gary Bishp's readline module. If we have it, we must test it as well. + +- class call_function_TestCase(unittest.TestCase): +- # _ctypes.call_function is deprecated and private, but used by +- # Gary Bishp's readline module. If we have it, we must test it as well. ++ def test(self): ++ from _ctypes import call_function ++ windll.kernel32.LoadLibraryA.restype = c_void_p ++ windll.kernel32.GetProcAddress.argtypes = c_void_p, c_char_p ++ windll.kernel32.GetProcAddress.restype = c_void_p + +- def test(self): +- from _ctypes import call_function +- windll.kernel32.LoadLibraryA.restype = c_void_p +- windll.kernel32.GetProcAddress.argtypes = c_void_p, c_char_p +- windll.kernel32.GetProcAddress.restype = c_void_p ++ hdll = windll.kernel32.LoadLibraryA(b"kernel32") ++ funcaddr = windll.kernel32.GetProcAddress(hdll, b"GetModuleHandleA") + +- hdll = windll.kernel32.LoadLibraryA(b"kernel32") +- funcaddr = windll.kernel32.GetProcAddress(hdll, b"GetModuleHandleA") +- +- self.assertEqual(call_function(funcaddr, (None,)), +- windll.kernel32.GetModuleHandleA(None)) ++ self.assertEqual(call_function(funcaddr, (None,)), ++ windll.kernel32.GetModuleHandleA(None)) + + class CallbackTracbackTestCase(unittest.TestCase): + # When an exception is raised in a ctypes callback function, the C +diff -r c0e311e010fc Lib/ctypes/test/test_slicing.py +--- a/Lib/ctypes/test/test_slicing.py ++++ b/Lib/ctypes/test/test_slicing.py +@@ -1,5 +1,6 @@ + import unittest + from ctypes import * ++from ctypes.test import need_symbol + + import _ctypes_test + +@@ -125,44 +126,40 @@ + self.assertEqual(p[2:5:-3], s[2:5:-3]) + + +- try: +- c_wchar +- except NameError: +- pass +- else: +- def test_wchar_ptr(self): +- s = "abcdefghijklmnopqrstuvwxyz\0" ++ @need_symbol('c_wchar') ++ def test_wchar_ptr(self): ++ s = "abcdefghijklmnopqrstuvwxyz\0" + +- dll = CDLL(_ctypes_test.__file__) +- dll.my_wcsdup.restype = POINTER(c_wchar) +- dll.my_wcsdup.argtypes = POINTER(c_wchar), +- dll.my_free.restype = None +- res = dll.my_wcsdup(s) +- self.assertEqual(res[:len(s)], s) +- self.assertEqual(res[:len(s):], s) +- self.assertEqual(res[len(s)-1:-1:-1], s[::-1]) +- self.assertEqual(res[len(s)-1:5:-7], s[:5:-7]) ++ dll = CDLL(_ctypes_test.__file__) ++ dll.my_wcsdup.restype = POINTER(c_wchar) ++ dll.my_wcsdup.argtypes = POINTER(c_wchar), ++ dll.my_free.restype = None ++ res = dll.my_wcsdup(s) ++ self.assertEqual(res[:len(s)], s) ++ self.assertEqual(res[:len(s):], s) ++ self.assertEqual(res[len(s)-1:-1:-1], s[::-1]) ++ self.assertEqual(res[len(s)-1:5:-7], s[:5:-7]) + +- import operator +- self.assertRaises(TypeError, operator.setitem, +- res, slice(0, 5), "abcde") +- dll.my_free(res) ++ import operator ++ self.assertRaises(TypeError, operator.setitem, ++ res, slice(0, 5), "abcde") ++ dll.my_free(res) + +- if sizeof(c_wchar) == sizeof(c_short): +- dll.my_wcsdup.restype = POINTER(c_short) +- elif sizeof(c_wchar) == sizeof(c_int): +- dll.my_wcsdup.restype = POINTER(c_int) +- elif sizeof(c_wchar) == sizeof(c_long): +- dll.my_wcsdup.restype = POINTER(c_long) +- else: +- return +- res = dll.my_wcsdup(s) +- tmpl = list(range(ord("a"), ord("z")+1)) +- self.assertEqual(res[:len(s)-1], tmpl) +- self.assertEqual(res[:len(s)-1:], tmpl) +- self.assertEqual(res[len(s)-2:-1:-1], tmpl[::-1]) +- self.assertEqual(res[len(s)-2:5:-7], tmpl[:5:-7]) +- dll.my_free(res) ++ if sizeof(c_wchar) == sizeof(c_short): ++ dll.my_wcsdup.restype = POINTER(c_short) ++ elif sizeof(c_wchar) == sizeof(c_int): ++ dll.my_wcsdup.restype = POINTER(c_int) ++ elif sizeof(c_wchar) == sizeof(c_long): ++ dll.my_wcsdup.restype = POINTER(c_long) ++ else: ++ self.skipTest('Pointers to c_wchar are not supported') ++ res = dll.my_wcsdup(s) ++ tmpl = list(range(ord("a"), ord("z")+1)) ++ self.assertEqual(res[:len(s)-1], tmpl) ++ self.assertEqual(res[:len(s)-1:], tmpl) ++ self.assertEqual(res[len(s)-2:-1:-1], tmpl[::-1]) ++ self.assertEqual(res[len(s)-2:5:-7], tmpl[:5:-7]) ++ dll.my_free(res) + + ################################################################ + +diff -r c0e311e010fc Lib/ctypes/test/test_strings.py +--- a/Lib/ctypes/test/test_strings.py ++++ b/Lib/ctypes/test/test_strings.py +@@ -1,5 +1,6 @@ + import unittest + from ctypes import * ++from ctypes.test import need_symbol + + class StringArrayTestCase(unittest.TestCase): + def test(self): +@@ -53,36 +54,33 @@ + ## print BUF.from_param(c_char_p("python")) + ## print BUF.from_param(BUF(*"pyth")) + +-try: +- c_wchar +-except NameError: +- pass +-else: +- class WStringArrayTestCase(unittest.TestCase): +- def test(self): +- BUF = c_wchar * 4 ++@need_symbol('c_wchar') ++class WStringArrayTestCase(unittest.TestCase): ++ def test(self): ++ BUF = c_wchar * 4 + +- buf = BUF("a", "b", "c") +- self.assertEqual(buf.value, "abc") ++ buf = BUF("a", "b", "c") ++ self.assertEqual(buf.value, "abc") + +- buf.value = "ABCD" +- self.assertEqual(buf.value, "ABCD") ++ buf.value = "ABCD" ++ self.assertEqual(buf.value, "ABCD") + +- buf.value = "x" +- self.assertEqual(buf.value, "x") ++ buf.value = "x" ++ self.assertEqual(buf.value, "x") + +- buf[1] = "Z" +- self.assertEqual(buf.value, "xZCD") ++ buf[1] = "Z" ++ self.assertEqual(buf.value, "xZCD") + +- @unittest.skipIf(sizeof(c_wchar) < 4, +- "sizeof(wchar_t) is smaller than 4 bytes") +- def test_nonbmp(self): +- u = chr(0x10ffff) +- w = c_wchar(u) +- self.assertEqual(w.value, u) ++ @unittest.skipIf(sizeof(c_wchar) < 4, ++ "sizeof(wchar_t) is smaller than 4 bytes") ++ def test_nonbmp(self): ++ u = chr(0x10ffff) ++ w = c_wchar(u) ++ self.assertEqual(w.value, u) + + class StringTestCase(unittest.TestCase): +- def XX_test_basic_strings(self): ++ @unittest.skip('test disabled') ++ def test_basic_strings(self): + cs = c_string("abcdef") + + # Cannot call len on a c_string any longer +@@ -108,7 +106,8 @@ + + self.assertRaises(TypeError, c_string, "123") + +- def XX_test_sized_strings(self): ++ @unittest.skip('test disabled') ++ def test_sized_strings(self): + + # New in releases later than 0.4.0: + self.assertRaises(TypeError, c_string, None) +@@ -125,7 +124,8 @@ + self.assertEqual(c_string(2).raw[-1], "\000") + self.assertEqual(len(c_string(2).raw), 2) + +- def XX_test_initialized_strings(self): ++ @unittest.skip('test disabled') ++ def test_initialized_strings(self): + + self.assertEqual(c_string("ab", 4).raw[:2], "ab") + self.assertEqual(c_string("ab", 4).raw[:2:], "ab") +@@ -134,7 +134,8 @@ + self.assertEqual(c_string("ab", 4).raw[-1], "\000") + self.assertEqual(c_string("ab", 2).raw, "a\000") + +- def XX_test_toolong(self): ++ @unittest.skip('test disabled') ++ def test_toolong(self): + cs = c_string("abcdef") + # Much too long string: + self.assertRaises(ValueError, setattr, cs, "value", "123456789012345") +@@ -142,54 +143,53 @@ + # One char too long values: + self.assertRaises(ValueError, setattr, cs, "value", "1234567") + +-## def test_perf(self): +-## check_perf() ++ @unittest.skip('test disabled') ++ def test_perf(self): ++ check_perf() + +-try: +- c_wchar +-except NameError: +- pass +-else: +- class WStringTestCase(unittest.TestCase): +- def test_wchar(self): +- c_wchar("x") +- repr(byref(c_wchar("x"))) +- c_wchar("x") ++@need_symbol('c_wchar') ++class WStringTestCase(unittest.TestCase): ++ def test_wchar(self): ++ c_wchar("x") ++ repr(byref(c_wchar("x"))) ++ c_wchar("x") + + +- def X_test_basic_wstrings(self): +- cs = c_wstring("abcdef") ++ @unittest.skip('test disabled') ++ def test_basic_wstrings(self): ++ cs = c_wstring("abcdef") + +- # XXX This behaviour is about to change: +- # len returns the size of the internal buffer in bytes. +- # This includes the terminating NUL character. +- self.assertEqual(sizeof(cs), 14) ++ # XXX This behaviour is about to change: ++ # len returns the size of the internal buffer in bytes. ++ # This includes the terminating NUL character. ++ self.assertEqual(sizeof(cs), 14) + +- # The value property is the string up to the first terminating NUL. +- self.assertEqual(cs.value, "abcdef") +- self.assertEqual(c_wstring("abc\000def").value, "abc") ++ # The value property is the string up to the first terminating NUL. ++ self.assertEqual(cs.value, "abcdef") ++ self.assertEqual(c_wstring("abc\000def").value, "abc") + +- self.assertEqual(c_wstring("abc\000def").value, "abc") ++ self.assertEqual(c_wstring("abc\000def").value, "abc") + +- # The raw property is the total buffer contents: +- self.assertEqual(cs.raw, "abcdef\000") +- self.assertEqual(c_wstring("abc\000def").raw, "abc\000def\000") ++ # The raw property is the total buffer contents: ++ self.assertEqual(cs.raw, "abcdef\000") ++ self.assertEqual(c_wstring("abc\000def").raw, "abc\000def\000") + +- # We can change the value: +- cs.value = "ab" +- self.assertEqual(cs.value, "ab") +- self.assertEqual(cs.raw, "ab\000\000\000\000\000") ++ # We can change the value: ++ cs.value = "ab" ++ self.assertEqual(cs.value, "ab") ++ self.assertEqual(cs.raw, "ab\000\000\000\000\000") + +- self.assertRaises(TypeError, c_wstring, "123") +- self.assertRaises(ValueError, c_wstring, 0) ++ self.assertRaises(TypeError, c_wstring, "123") ++ self.assertRaises(ValueError, c_wstring, 0) + +- def X_test_toolong(self): +- cs = c_wstring("abcdef") +- # Much too long string: +- self.assertRaises(ValueError, setattr, cs, "value", "123456789012345") ++ @unittest.skip('test disabled') ++ def test_toolong(self): ++ cs = c_wstring("abcdef") ++ # Much too long string: ++ self.assertRaises(ValueError, setattr, cs, "value", "123456789012345") + +- # One char too long values: +- self.assertRaises(ValueError, setattr, cs, "value", "1234567") ++ # One char too long values: ++ self.assertRaises(ValueError, setattr, cs, "value", "1234567") + + + def run_test(rep, msg, func, arg): +diff -r c0e311e010fc Lib/ctypes/test/test_structures.py +--- a/Lib/ctypes/test/test_structures.py ++++ b/Lib/ctypes/test/test_structures.py +@@ -1,5 +1,6 @@ + import unittest + from ctypes import * ++from ctypes.test import need_symbol + from struct import calcsize + import _testcapi + +@@ -291,12 +292,8 @@ + self.assertEqual(p.phone.number, b"5678") + self.assertEqual(p.age, 5) + ++ @need_symbol('c_wchar') + def test_structures_with_wchar(self): +- try: +- c_wchar +- except NameError: +- return # no unicode +- + class PersonW(Structure): + _fields_ = [("name", c_wchar * 12), + ("age", c_int)] +@@ -325,7 +322,7 @@ + self.assertEqual(cls, RuntimeError) + self.assertEqual(msg, + "(Phone) : " +- "expected string, int found") ++ "expected bytes, int found") + + cls, msg = self.get_except(Person, b"Someone", (b"a", b"b", b"c")) + self.assertEqual(cls, RuntimeError) +@@ -354,14 +351,14 @@ + except Exception as detail: + return detail.__class__, str(detail) + +- +-## def test_subclass_creation(self): +-## meta = type(Structure) +-## # same as 'class X(Structure): pass' +-## # fails, since we need either a _fields_ or a _abstract_ attribute +-## cls, msg = self.get_except(meta, "X", (Structure,), {}) +-## self.assertEqual((cls, msg), +-## (AttributeError, "class must define a '_fields_' attribute")) ++ @unittest.skip('test disabled') ++ def test_subclass_creation(self): ++ meta = type(Structure) ++ # same as 'class X(Structure): pass' ++ # fails, since we need either a _fields_ or a _abstract_ attribute ++ cls, msg = self.get_except(meta, "X", (Structure,), {}) ++ self.assertEqual((cls, msg), ++ (AttributeError, "class must define a '_fields_' attribute")) + + def test_abstract_class(self): + class X(Structure): +diff -r c0e311e010fc Lib/ctypes/test/test_unicode.py +--- a/Lib/ctypes/test/test_unicode.py ++++ b/Lib/ctypes/test/test_unicode.py +@@ -1,58 +1,55 @@ + import unittest + import ctypes ++from ctypes.test import need_symbol + +-try: +- ctypes.c_wchar +-except AttributeError: +- pass +-else: +- import _ctypes_test ++import _ctypes_test + +- class UnicodeTestCase(unittest.TestCase): +- def test_wcslen(self): +- dll = ctypes.CDLL(_ctypes_test.__file__) +- wcslen = dll.my_wcslen +- wcslen.argtypes = [ctypes.c_wchar_p] ++@need_symbol('c_wchar') ++class UnicodeTestCase(unittest.TestCase): ++ def test_wcslen(self): ++ dll = ctypes.CDLL(_ctypes_test.__file__) ++ wcslen = dll.my_wcslen ++ wcslen.argtypes = [ctypes.c_wchar_p] + +- self.assertEqual(wcslen("abc"), 3) +- self.assertEqual(wcslen("ab\u2070"), 3) +- self.assertRaises(ctypes.ArgumentError, wcslen, b"ab\xe4") ++ self.assertEqual(wcslen("abc"), 3) ++ self.assertEqual(wcslen("ab\u2070"), 3) ++ self.assertRaises(ctypes.ArgumentError, wcslen, b"ab\xe4") + +- def test_buffers(self): +- buf = ctypes.create_unicode_buffer("abc") +- self.assertEqual(len(buf), 3+1) ++ def test_buffers(self): ++ buf = ctypes.create_unicode_buffer("abc") ++ self.assertEqual(len(buf), 3+1) + +- buf = ctypes.create_unicode_buffer("ab\xe4\xf6\xfc") +- self.assertEqual(buf[:], "ab\xe4\xf6\xfc\0") +- self.assertEqual(buf[::], "ab\xe4\xf6\xfc\0") +- self.assertEqual(buf[::-1], '\x00\xfc\xf6\xe4ba') +- self.assertEqual(buf[::2], 'a\xe4\xfc') +- self.assertEqual(buf[6:5:-1], "") ++ buf = ctypes.create_unicode_buffer("ab\xe4\xf6\xfc") ++ self.assertEqual(buf[:], "ab\xe4\xf6\xfc\0") ++ self.assertEqual(buf[::], "ab\xe4\xf6\xfc\0") ++ self.assertEqual(buf[::-1], '\x00\xfc\xf6\xe4ba') ++ self.assertEqual(buf[::2], 'a\xe4\xfc') ++ self.assertEqual(buf[6:5:-1], "") + +- func = ctypes.CDLL(_ctypes_test.__file__)._testfunc_p_p ++func = ctypes.CDLL(_ctypes_test.__file__)._testfunc_p_p + +- class StringTestCase(UnicodeTestCase): +- def setUp(self): +- func.argtypes = [ctypes.c_char_p] +- func.restype = ctypes.c_char_p ++class StringTestCase(UnicodeTestCase): ++ def setUp(self): ++ func.argtypes = [ctypes.c_char_p] ++ func.restype = ctypes.c_char_p + +- def tearDown(self): +- func.argtypes = None +- func.restype = ctypes.c_int ++ def tearDown(self): ++ func.argtypes = None ++ func.restype = ctypes.c_int + +- def test_func(self): +- self.assertEqual(func(b"abc\xe4"), b"abc\xe4") ++ def test_func(self): ++ self.assertEqual(func(b"abc\xe4"), b"abc\xe4") + +- def test_buffers(self): +- buf = ctypes.create_string_buffer(b"abc") +- self.assertEqual(len(buf), 3+1) ++ def test_buffers(self): ++ buf = ctypes.create_string_buffer(b"abc") ++ self.assertEqual(len(buf), 3+1) + +- buf = ctypes.create_string_buffer(b"ab\xe4\xf6\xfc") +- self.assertEqual(buf[:], b"ab\xe4\xf6\xfc\0") +- self.assertEqual(buf[::], b"ab\xe4\xf6\xfc\0") +- self.assertEqual(buf[::-1], b'\x00\xfc\xf6\xe4ba') +- self.assertEqual(buf[::2], b'a\xe4\xfc') +- self.assertEqual(buf[6:5:-1], b"") ++ buf = ctypes.create_string_buffer(b"ab\xe4\xf6\xfc") ++ self.assertEqual(buf[:], b"ab\xe4\xf6\xfc\0") ++ self.assertEqual(buf[::], b"ab\xe4\xf6\xfc\0") ++ self.assertEqual(buf[::-1], b'\x00\xfc\xf6\xe4ba') ++ self.assertEqual(buf[::2], b'a\xe4\xfc') ++ self.assertEqual(buf[6:5:-1], b"") + + + if __name__ == '__main__': +diff -r c0e311e010fc Lib/ctypes/test/test_values.py +--- a/Lib/ctypes/test/test_values.py ++++ b/Lib/ctypes/test/test_values.py +@@ -3,6 +3,7 @@ + """ + + import unittest ++import sys + from ctypes import * + + import _ctypes_test +@@ -27,62 +28,68 @@ + ctdll = CDLL(_ctypes_test.__file__) + self.assertRaises(ValueError, c_int.in_dll, ctdll, "Undefined_Symbol") + +- class Win_ValuesTestCase(unittest.TestCase): +- """This test only works when python itself is a dll/shared library""" ++@unittest.skipUnless(sys.platform == 'win32', 'Windows-specific test') ++class Win_ValuesTestCase(unittest.TestCase): ++ """This test only works when python itself is a dll/shared library""" + +- def test_optimizeflag(self): +- # This test accesses the Py_OptimizeFlag intger, which is +- # exported by the Python dll. ++ def test_optimizeflag(self): ++ # This test accesses the Py_OptimizeFlag integer, which is ++ # exported by the Python dll and should match the sys.flags value + +- # It's value is set depending on the -O and -OO flags: +- # if not given, it is 0 and __debug__ is 1. +- # If -O is given, the flag is 1, for -OO it is 2. +- # docstrings are also removed in the latter case. +- opt = c_int.in_dll(pydll, "Py_OptimizeFlag").value +- if __debug__: +- self.assertEqual(opt, 0) +- elif ValuesTestCase.__doc__ is not None: +- self.assertEqual(opt, 1) +- else: +- self.assertEqual(opt, 2) ++ opt = c_int.in_dll(pythonapi, "Py_OptimizeFlag").value ++ self.assertEqual(opt, sys.flags.optimize) + +- def test_frozentable(self): +- # Python exports a PyImport_FrozenModules symbol. This is a +- # pointer to an array of struct _frozen entries. The end of the +- # array is marked by an entry containing a NULL name and zero +- # size. ++ def test_frozentable(self): ++ # Python exports a PyImport_FrozenModules symbol. This is a ++ # pointer to an array of struct _frozen entries. The end of the ++ # array is marked by an entry containing a NULL name and zero ++ # size. + +- # In standard Python, this table contains a __hello__ +- # module, and a __phello__ package containing a spam +- # module. +- class struct_frozen(Structure): +- _fields_ = [("name", c_char_p), +- ("code", POINTER(c_ubyte)), +- ("size", c_int)] +- FrozenTable = POINTER(struct_frozen) ++ # In standard Python, this table contains a __hello__ ++ # module, and a __phello__ package containing a spam ++ # module. ++ class struct_frozen(Structure): ++ _fields_ = [("name", c_char_p), ++ ("code", POINTER(c_ubyte)), ++ ("size", c_int)] ++ FrozenTable = POINTER(struct_frozen) + +- ft = FrozenTable.in_dll(pydll, "PyImport_FrozenModules") +- # ft is a pointer to the struct_frozen entries: +- items = [] +- for entry in ft: +- # This is dangerous. We *can* iterate over a pointer, but +- # the loop will not terminate (maybe with an access +- # violation;-) because the pointer instance has no size. +- if entry.name is None: +- break +- items.append((entry.name, entry.size)) +- import sys +- if sys.version_info[:2] >= (2, 3): +- expected = [("__hello__", 104), ("__phello__", -104), ("__phello__.spam", 104)] +- else: +- expected = [("__hello__", 100), ("__phello__", -100), ("__phello__.spam", 100)] +- self.assertEqual(items, expected) ++ ft = FrozenTable.in_dll(pythonapi, "PyImport_FrozenModules") ++ # ft is a pointer to the struct_frozen entries: ++ items = [] ++ # _frozen_importlib changes size whenever importlib._bootstrap ++ # changes, so it gets a special case. We should make sure it's ++ # found, but don't worry about its size too much. ++ _fzn_implib_seen = False ++ for entry in ft: ++ # This is dangerous. We *can* iterate over a pointer, but ++ # the loop will not terminate (maybe with an access ++ # violation;-) because the pointer instance has no size. ++ if entry.name is None: ++ break + +- from ctypes import _pointer_type_cache +- del _pointer_type_cache[struct_frozen] ++ if entry.name == b'_frozen_importlib': ++ _fzn_implib_seen = True ++ self.assertTrue(entry.size, ++ "_frozen_importlib was reported as having no size") ++ continue ++ items.append((entry.name, entry.size)) + +- def test_undefined(self): +- self.assertRaises(ValueError, c_int.in_dll, pydll, "Undefined_Symbol") ++ expected = [(b"__hello__", 161), ++ (b"__phello__", -161), ++ (b"__phello__.spam", 161), ++ ] ++ self.assertEqual(items, expected) ++ ++ self.assertTrue(_fzn_implib_seen, ++ "_frozen_importlib wasn't found in PyImport_FrozenModules") ++ ++ from ctypes import _pointer_type_cache ++ del _pointer_type_cache[struct_frozen] ++ ++ def test_undefined(self): ++ self.assertRaises(ValueError, c_int.in_dll, pythonapi, ++ "Undefined_Symbol") + + if __name__ == '__main__': + unittest.main() +diff -r c0e311e010fc Lib/ctypes/test/test_win32.py +--- a/Lib/ctypes/test/test_win32.py ++++ b/Lib/ctypes/test/test_win32.py +@@ -1,99 +1,103 @@ + # Windows specific tests + + from ctypes import * +-from ctypes.test import is_resource_enabled + import unittest, sys + from test import support + + import _ctypes_test + +-if sys.platform == "win32" and sizeof(c_void_p) == sizeof(c_int): +- # Only windows 32-bit has different calling conventions. ++# Only windows 32-bit has different calling conventions. ++@unittest.skipUnless(sys.platform == "win32", 'Windows-specific test') ++@unittest.skipUnless(sizeof(c_void_p) == sizeof(c_int), ++ "sizeof c_void_p and c_int differ") ++class WindowsTestCase(unittest.TestCase): ++ def test_callconv_1(self): ++ # Testing stdcall function + +- class WindowsTestCase(unittest.TestCase): +- def test_callconv_1(self): +- # Testing stdcall function ++ IsWindow = windll.user32.IsWindow ++ # ValueError: Procedure probably called with not enough arguments ++ # (4 bytes missing) ++ self.assertRaises(ValueError, IsWindow) + +- IsWindow = windll.user32.IsWindow +- # ValueError: Procedure probably called with not enough arguments (4 bytes missing) +- self.assertRaises(ValueError, IsWindow) ++ # This one should succeed... ++ self.assertEqual(0, IsWindow(0)) + +- # This one should succeed... +- self.assertEqual(0, IsWindow(0)) ++ # ValueError: Procedure probably called with too many arguments ++ # (8 bytes in excess) ++ self.assertRaises(ValueError, IsWindow, 0, 0, 0) + +- # ValueError: Procedure probably called with too many arguments (8 bytes in excess) +- self.assertRaises(ValueError, IsWindow, 0, 0, 0) ++ def test_callconv_2(self): ++ # Calling stdcall function as cdecl + +- def test_callconv_2(self): +- # Calling stdcall function as cdecl ++ IsWindow = cdll.user32.IsWindow + +- IsWindow = cdll.user32.IsWindow ++ # ValueError: Procedure called with not enough arguments ++ # (4 bytes missing) or wrong calling convention ++ self.assertRaises(ValueError, IsWindow, None) + +- # ValueError: Procedure called with not enough arguments (4 bytes missing) +- # or wrong calling convention +- self.assertRaises(ValueError, IsWindow, None) ++@unittest.skipUnless(sys.platform == "win32", 'Windows-specific test') ++class FunctionCallTestCase(unittest.TestCase): ++ @unittest.skipUnless('MSC' in sys.version, "SEH only supported by MSC") ++ @unittest.skipIf(sys.executable.endswith('_d.exe'), ++ "SEH not enabled in debug builds") ++ def test_SEH(self): ++ # Call functions with invalid arguments, and make sure ++ # that access violations are trapped and raise an ++ # exception. ++ self.assertRaises(OSError, windll.kernel32.GetModuleHandleA, 32) + +-if sys.platform == "win32": +- class FunctionCallTestCase(unittest.TestCase): ++ def test_noargs(self): ++ # This is a special case on win32 x64 ++ windll.user32.GetDesktopWindow() + +- if is_resource_enabled("SEH"): +- def test_SEH(self): +- # Call functions with invalid arguments, and make sure +- # that access violations are trapped and raise an +- # exception. +- self.assertRaises(OSError, windll.kernel32.GetModuleHandleA, 32) ++@unittest.skipUnless(sys.platform == "win32", 'Windows-specific test') ++class TestWintypes(unittest.TestCase): ++ def test_HWND(self): ++ from ctypes import wintypes ++ self.assertEqual(sizeof(wintypes.HWND), sizeof(c_void_p)) + +- def test_noargs(self): +- # This is a special case on win32 x64 +- windll.user32.GetDesktopWindow() ++ def test_PARAM(self): ++ from ctypes import wintypes ++ self.assertEqual(sizeof(wintypes.WPARAM), ++ sizeof(c_void_p)) ++ self.assertEqual(sizeof(wintypes.LPARAM), ++ sizeof(c_void_p)) + +- class TestWintypes(unittest.TestCase): +- def test_HWND(self): +- from ctypes import wintypes +- self.assertEqual(sizeof(wintypes.HWND), sizeof(c_void_p)) ++ def test_COMError(self): ++ from _ctypes import COMError ++ if support.HAVE_DOCSTRINGS: ++ self.assertEqual(COMError.__doc__, ++ "Raised when a COM method call failed.") + +- def test_PARAM(self): +- from ctypes import wintypes +- self.assertEqual(sizeof(wintypes.WPARAM), +- sizeof(c_void_p)) +- self.assertEqual(sizeof(wintypes.LPARAM), +- sizeof(c_void_p)) ++ ex = COMError(-1, "text", ("details",)) ++ self.assertEqual(ex.hresult, -1) ++ self.assertEqual(ex.text, "text") ++ self.assertEqual(ex.details, ("details",)) + +- def test_COMError(self): +- from _ctypes import COMError +- if support.HAVE_DOCSTRINGS: +- self.assertEqual(COMError.__doc__, +- "Raised when a COM method call failed.") ++@unittest.skipUnless(sys.platform == "win32", 'Windows-specific test') ++class TestWinError(unittest.TestCase): ++ def test_winerror(self): ++ # see Issue 16169 ++ import errno ++ ERROR_INVALID_PARAMETER = 87 ++ msg = FormatError(ERROR_INVALID_PARAMETER).strip() ++ args = (errno.EINVAL, msg, None, ERROR_INVALID_PARAMETER) + +- ex = COMError(-1, "text", ("details",)) +- self.assertEqual(ex.hresult, -1) +- self.assertEqual(ex.text, "text") +- self.assertEqual(ex.details, ("details",)) ++ e = WinError(ERROR_INVALID_PARAMETER) ++ self.assertEqual(e.args, args) ++ self.assertEqual(e.errno, errno.EINVAL) ++ self.assertEqual(e.winerror, ERROR_INVALID_PARAMETER) + +- class TestWinError(unittest.TestCase): +- def test_winerror(self): +- # see Issue 16169 +- import errno +- ERROR_INVALID_PARAMETER = 87 +- msg = FormatError(ERROR_INVALID_PARAMETER).strip() +- args = (errno.EINVAL, msg, None, ERROR_INVALID_PARAMETER) +- +- e = WinError(ERROR_INVALID_PARAMETER) +- self.assertEqual(e.args, args) +- self.assertEqual(e.errno, errno.EINVAL) +- self.assertEqual(e.winerror, ERROR_INVALID_PARAMETER) +- +- windll.kernel32.SetLastError(ERROR_INVALID_PARAMETER) +- try: +- raise WinError() +- except OSError as exc: +- e = exc +- self.assertEqual(e.args, args) +- self.assertEqual(e.errno, errno.EINVAL) +- self.assertEqual(e.winerror, ERROR_INVALID_PARAMETER) ++ windll.kernel32.SetLastError(ERROR_INVALID_PARAMETER) ++ try: ++ raise WinError() ++ except OSError as exc: ++ e = exc ++ self.assertEqual(e.args, args) ++ self.assertEqual(e.errno, errno.EINVAL) ++ self.assertEqual(e.winerror, ERROR_INVALID_PARAMETER) + + class Structures(unittest.TestCase): +- + def test_struct_by_value(self): + class POINT(Structure): + _fields_ = [("x", c_long), +diff -r c0e311e010fc Lib/ctypes/test/test_wintypes.py +--- a/Lib/ctypes/test/test_wintypes.py ++++ b/Lib/ctypes/test/test_wintypes.py +@@ -1,14 +1,12 @@ + import sys + import unittest + +-if not sys.platform.startswith('win'): +- raise unittest.SkipTest('Windows-only test') ++from ctypes import * + +-from ctypes import * +-from ctypes import wintypes +- ++@unittest.skipUnless(sys.platform.startswith('win'), 'Windows-only test') + class WinTypesTest(unittest.TestCase): + def test_variant_bool(self): ++ from ctypes import wintypes + # reads 16-bits from memory, anything non-zero is True + for true_value in (1, 32767, 32768, 65535, 65537): + true = POINTER(c_int16)(c_int16(true_value)) +diff -r c0e311e010fc Lib/dbm/dumb.py +--- a/Lib/dbm/dumb.py ++++ b/Lib/dbm/dumb.py +@@ -68,9 +68,10 @@ + try: + f = _io.open(self._datfile, 'r', encoding="Latin-1") + except OSError: +- f = _io.open(self._datfile, 'w', encoding="Latin-1") +- self._chmod(self._datfile) +- f.close() ++ with _io.open(self._datfile, 'w', encoding="Latin-1") as f: ++ self._chmod(self._datfile) ++ else: ++ f.close() + self._update() + + # Read directory file into the in-memory index dict. +@@ -81,12 +82,12 @@ + except OSError: + pass + else: +- for line in f: +- line = line.rstrip() +- key, pos_and_siz_pair = eval(line) +- key = key.encode('Latin-1') +- self._index[key] = pos_and_siz_pair +- f.close() ++ with f: ++ for line in f: ++ line = line.rstrip() ++ key, pos_and_siz_pair = eval(line) ++ key = key.encode('Latin-1') ++ self._index[key] = pos_and_siz_pair + + # Write the index dict to the directory file. The original directory + # file (if any) is renamed with a .bak extension first. If a .bak +@@ -108,13 +109,13 @@ + except OSError: + pass + +- f = self._io.open(self._dirfile, 'w', encoding="Latin-1") +- self._chmod(self._dirfile) +- for key, pos_and_siz_pair in self._index.items(): +- # Use Latin-1 since it has no qualms with any value in any +- # position; UTF-8, though, does care sometimes. +- f.write("%r, %r\n" % (key.decode('Latin-1'), pos_and_siz_pair)) +- f.close() ++ with self._io.open(self._dirfile, 'w', encoding="Latin-1") as f: ++ self._chmod(self._dirfile) ++ for key, pos_and_siz_pair in self._index.items(): ++ # Use Latin-1 since it has no qualms with any value in any ++ # position; UTF-8, though, does care sometimes. ++ entry = "%r, %r\n" % (key.decode('Latin-1'), pos_and_siz_pair) ++ f.write(entry) + + sync = _commit + +@@ -127,10 +128,9 @@ + key = key.encode('utf-8') + self._verify_open() + pos, siz = self._index[key] # may raise KeyError +- f = _io.open(self._datfile, 'rb') +- f.seek(pos) +- dat = f.read(siz) +- f.close() ++ with _io.open(self._datfile, 'rb') as f: ++ f.seek(pos) ++ dat = f.read(siz) + return dat + + # Append val to the data file, starting at a _BLOCKSIZE-aligned +@@ -138,14 +138,13 @@ + # to get to an aligned offset. Return pair + # (starting offset of val, len(val)) + def _addval(self, val): +- f = _io.open(self._datfile, 'rb+') +- f.seek(0, 2) +- pos = int(f.tell()) +- npos = ((pos + _BLOCKSIZE - 1) // _BLOCKSIZE) * _BLOCKSIZE +- f.write(b'\0'*(npos-pos)) +- pos = npos +- f.write(val) +- f.close() ++ with _io.open(self._datfile, 'rb+') as f: ++ f.seek(0, 2) ++ pos = int(f.tell()) ++ npos = ((pos + _BLOCKSIZE - 1) // _BLOCKSIZE) * _BLOCKSIZE ++ f.write(b'\0'*(npos-pos)) ++ pos = npos ++ f.write(val) + return (pos, len(val)) + + # Write val to the data file, starting at offset pos. The caller +@@ -153,10 +152,9 @@ + # pos to hold val, without overwriting some other value. Return + # pair (pos, len(val)). + def _setval(self, pos, val): +- f = _io.open(self._datfile, 'rb+') +- f.seek(pos) +- f.write(val) +- f.close() ++ with _io.open(self._datfile, 'rb+') as f: ++ f.seek(pos) ++ f.write(val) + return (pos, len(val)) + + # key is a new key whose associated value starts in the data file +@@ -164,10 +162,9 @@ + # the in-memory index dict, and append one to the directory file. + def _addkey(self, key, pos_and_siz_pair): + self._index[key] = pos_and_siz_pair +- f = _io.open(self._dirfile, 'a', encoding="Latin-1") +- self._chmod(self._dirfile) +- f.write("%r, %r\n" % (key.decode("Latin-1"), pos_and_siz_pair)) +- f.close() ++ with _io.open(self._dirfile, 'a', encoding="Latin-1") as f: ++ self._chmod(self._dirfile) ++ f.write("%r, %r\n" % (key.decode("Latin-1"), pos_and_siz_pair)) + + def __setitem__(self, key, val): + if isinstance(key, str): +@@ -216,8 +213,10 @@ + self._commit() + + def keys(self): +- self._verify_open() +- return list(self._index.keys()) ++ try: ++ return list(self._index) ++ except TypeError: ++ raise error('DBM object has already been closed') from None + + def items(self): + self._verify_open() +@@ -226,17 +225,26 @@ + def __contains__(self, key): + if isinstance(key, str): + key = key.encode('utf-8') +- self._verify_open() +- return key in self._index ++ try: ++ return key in self._index ++ except TypeError: ++ if self._index is None: ++ raise error('DBM object has already been closed') from None ++ else: ++ raise + + def iterkeys(self): +- self._verify_open() +- return iter(self._index.keys()) ++ try: ++ return iter(self._index) ++ except TypeError: ++ raise error('DBM object has already been closed') from None + __iter__ = iterkeys + + def __len__(self): +- self._verify_open() +- return len(self._index) ++ try: ++ return len(self._index) ++ except TypeError: ++ raise error('DBM object has already been closed') from None + + def close(self): + self._commit() +diff -r c0e311e010fc Lib/difflib.py +--- a/Lib/difflib.py ++++ b/Lib/difflib.py +@@ -511,8 +511,8 @@ + non_adjacent.append((i1, j1, k1)) + + non_adjacent.append( (la, lb, 0) ) +- self.matching_blocks = non_adjacent +- return map(Match._make, self.matching_blocks) ++ self.matching_blocks = list(map(Match._make, non_adjacent)) ++ return self.matching_blocks + + def get_opcodes(self): + """Return list of 5-tuples describing how to turn a into b. +diff -r c0e311e010fc Lib/distutils/command/install.py +--- a/Lib/distutils/command/install.py ++++ b/Lib/distutils/command/install.py +@@ -15,32 +15,17 @@ + from distutils.util import get_platform + from distutils.errors import DistutilsOptionError + +-# this keeps compatibility from 2.3 to 2.5 +-if sys.version < "2.6": +- USER_BASE = None +- USER_SITE = None +- HAS_USER_SITE = False +-else: +- from site import USER_BASE +- from site import USER_SITE +- HAS_USER_SITE = True ++from site import USER_BASE ++from site import USER_SITE ++HAS_USER_SITE = True + +-if sys.version < "2.2": +- WINDOWS_SCHEME = { +- 'purelib': '$base', +- 'platlib': '$base', +- 'headers': '$base/Include/$dist_name', +- 'scripts': '$base/Scripts', +- 'data' : '$base', +- } +-else: +- WINDOWS_SCHEME = { +- 'purelib': '$base/Lib/site-packages', +- 'platlib': '$base/Lib/site-packages', +- 'headers': '$base/Include/$dist_name', +- 'scripts': '$base/Scripts', +- 'data' : '$base', +- } ++WINDOWS_SCHEME = { ++ 'purelib': '$base/Lib/site-packages', ++ 'platlib': '$base/Lib/site-packages', ++ 'headers': '$base/Include/$dist_name', ++ 'scripts': '$base/Scripts', ++ 'data' : '$base', ++} + + INSTALL_SCHEMES = { + 'unix_prefix': { +diff -r c0e311e010fc Lib/distutils/command/upload.py +--- a/Lib/distutils/command/upload.py ++++ b/Lib/distutils/command/upload.py +@@ -2,10 +2,6 @@ + + Implements the Distutils 'upload' subcommand (upload package to PyPI).""" + +-from distutils.errors import * +-from distutils.core import PyPIRCCommand +-from distutils.spawn import spawn +-from distutils import log + import sys + import os, io + import socket +@@ -13,6 +9,10 @@ + from base64 import standard_b64encode + from urllib.request import urlopen, Request, HTTPError + from urllib.parse import urlparse ++from distutils.errors import DistutilsError, DistutilsOptionError ++from distutils.core import PyPIRCCommand ++from distutils.spawn import spawn ++from distutils import log + + # this keeps compatibility for 2.3 and 2.4 + if sys.version < "2.5": +@@ -184,7 +184,7 @@ + reason = result.msg + except OSError as e: + self.announce(str(e), log.ERROR) +- return ++ raise + except HTTPError as e: + status = e.code + reason = e.msg +@@ -193,8 +193,9 @@ + self.announce('Server response (%s): %s' % (status, reason), + log.INFO) + else: +- self.announce('Upload failed (%s): %s' % (status, reason), +- log.ERROR) ++ msg = 'Upload failed (%s): %s' % (status, reason) ++ self.announce(msg, log.ERROR) ++ raise DistutilsError(msg) + if self.show_response: + text = self._read_pypi_response(result) + msg = '\n'.join(('-' * 75, text, '-' * 75)) +diff -r c0e311e010fc Lib/distutils/sysconfig.py +--- a/Lib/distutils/sysconfig.py ++++ b/Lib/distutils/sysconfig.py +@@ -179,7 +179,8 @@ + # version and build tools may not support the same set + # of CPU architectures for universal builds. + global _config_vars +- if not _config_vars.get('CUSTOMIZED_OSX_COMPILER', ''): ++ # Use get_config_var() to ensure _config_vars is initialized. ++ if not get_config_var('CUSTOMIZED_OSX_COMPILER'): + import _osx_support + _osx_support.customize_compiler(_config_vars) + _config_vars['CUSTOMIZED_OSX_COMPILER'] = 'True' +diff -r c0e311e010fc Lib/distutils/tests/test_build_ext.py +--- a/Lib/distutils/tests/test_build_ext.py ++++ b/Lib/distutils/tests/test_build_ext.py +@@ -444,8 +444,16 @@ + + # get the deployment target that the interpreter was built with + target = sysconfig.get_config_var('MACOSX_DEPLOYMENT_TARGET') +- target = tuple(map(int, target.split('.'))) +- target = '%02d%01d0' % target ++ target = tuple(map(int, target.split('.')[0:2])) ++ # format the target value as defined in the Apple ++ # Availability Macros. We can't use the macro names since ++ # at least one value we test with will not exist yet. ++ if target[1] < 10: ++ # for 10.1 through 10.9.x -> "10n0" ++ target = '%02d%01d0' % target ++ else: ++ # for 10.10 and beyond -> "10nn00" ++ target = '%02d%02d00' % target + deptarget_ext = Extension( + 'deptarget', + [deptarget_c], +diff -r c0e311e010fc Lib/distutils/tests/test_sysconfig.py +--- a/Lib/distutils/tests/test_sysconfig.py ++++ b/Lib/distutils/tests/test_sysconfig.py +@@ -1,6 +1,9 @@ + """Tests for distutils.sysconfig.""" + import os + import shutil ++import subprocess ++import sys ++import textwrap + import unittest + + from distutils import sysconfig +@@ -174,6 +177,25 @@ + self.assertIsNotNone(vars['SO']) + self.assertEqual(vars['SO'], vars['EXT_SUFFIX']) + ++ def test_customize_compiler_before_get_config_vars(self): ++ # Issue #21923: test that a Distribution compiler ++ # instance can be called without an explicit call to ++ # get_config_vars(). ++ with open(TESTFN, 'w') as f: ++ f.writelines(textwrap.dedent('''\ ++ from distutils.core import Distribution ++ config = Distribution().get_command_obj('config') ++ # try_compile may pass or it may fail if no compiler ++ # is found but it should not raise an exception. ++ rc = config.try_compile('int x;') ++ ''')) ++ p = subprocess.Popen([str(sys.executable), TESTFN], ++ stdout=subprocess.PIPE, ++ stderr=subprocess.STDOUT, ++ universal_newlines=True) ++ outs, errs = p.communicate() ++ self.assertEqual(0, p.returncode, "Subprocess failed: " + outs) ++ + + def test_suite(): + suite = unittest.TestSuite() +diff -r c0e311e010fc Lib/distutils/tests/test_upload.py +--- a/Lib/distutils/tests/test_upload.py ++++ b/Lib/distutils/tests/test_upload.py +@@ -6,6 +6,7 @@ + from distutils.command import upload as upload_mod + from distutils.command.upload import upload + from distutils.core import Distribution ++from distutils.errors import DistutilsError + from distutils.log import INFO + + from distutils.tests.test_config import PYPIRC, PyPIRCCommandTestCase +@@ -41,13 +42,14 @@ + + class FakeOpen(object): + +- def __init__(self, url): ++ def __init__(self, url, msg=None, code=None): + self.url = url + if not isinstance(url, str): + self.req = url + else: + self.req = None +- self.msg = 'OK' ++ self.msg = msg or 'OK' ++ self.code = code or 200 + + def getheader(self, name, default=None): + return { +@@ -58,7 +60,7 @@ + return b'xyzzy' + + def getcode(self): +- return 200 ++ return self.code + + + class uploadTestCase(PyPIRCCommandTestCase): +@@ -68,13 +70,15 @@ + self.old_open = upload_mod.urlopen + upload_mod.urlopen = self._urlopen + self.last_open = None ++ self.next_msg = None ++ self.next_code = None + + def tearDown(self): + upload_mod.urlopen = self.old_open + super(uploadTestCase, self).tearDown() + + def _urlopen(self, url): +- self.last_open = FakeOpen(url) ++ self.last_open = FakeOpen(url, msg=self.next_msg, code=self.next_code) + return self.last_open + + def test_finalize_options(self): +@@ -135,6 +139,10 @@ + results = self.get_logs(INFO) + self.assertIn('xyzzy\n', results[-1]) + ++ def test_upload_fails(self): ++ self.next_msg = "Not Found" ++ self.next_code = 404 ++ self.assertRaises(DistutilsError, self.test_upload) + + def test_suite(): + return unittest.makeSuite(uploadTestCase) +diff -r c0e311e010fc Lib/email/_header_value_parser.py +--- a/Lib/email/_header_value_parser.py ++++ b/Lib/email/_header_value_parser.py +@@ -2897,7 +2897,7 @@ + try: + token, value = get_token(value) + except errors.HeaderParseError: +- ctype.defects.append(errors.InvalidHeaderDefect( ++ disp_header.defects.append(errors.InvalidHeaderDefect( + "Expected content disposition but found {!r}".format(value))) + _find_mime_parameters(disp_header, value) + return disp_header +@@ -2928,8 +2928,8 @@ + try: + token, value = get_token(value) + except errors.HeaderParseError: +- ctype.defects.append(errors.InvalidHeaderDefect( +- "Expected content trnasfer encoding but found {!r}".format(value))) ++ cte_header.defects.append(errors.InvalidHeaderDefect( ++ "Expected content transfer encoding but found {!r}".format(value))) + else: + cte_header.append(token) + cte_header.cte = token.value.strip().lower() +diff -r c0e311e010fc Lib/email/feedparser.py +--- a/Lib/email/feedparser.py ++++ b/Lib/email/feedparser.py +@@ -50,8 +50,8 @@ + simple abstraction -- it parses until EOF closes the current message. + """ + def __init__(self): +- # The last partial line pushed into this object. +- self._partial = '' ++ # Chunks of the last partial line pushed into this object. ++ self._partial = [] + # The list of full, pushed lines, in reverse order + self._lines = [] + # The stack of false-EOF checking predicates. +@@ -67,8 +67,8 @@ + + def close(self): + # Don't forget any trailing partial line. +- self._lines.append(self._partial) +- self._partial = '' ++ self.pushlines(''.join(self._partial).splitlines(True)) ++ self._partial = [] + self._closed = True + + def readline(self): +@@ -96,16 +96,26 @@ + + def push(self, data): + """Push some new data into this object.""" +- # Handle any previous leftovers +- data, self._partial = self._partial + data, '' + # Crack into lines, but preserve the linesep characters on the end of each + parts = data.splitlines(True) ++ ++ if not parts or not parts[0].endswith(('\n', '\r')): ++ # No new complete lines, so just accumulate partials ++ self._partial += parts ++ return ++ ++ if self._partial: ++ # If there are previous leftovers, complete them now ++ self._partial.append(parts[0]) ++ parts[0:1] = ''.join(self._partial).splitlines(True) ++ del self._partial[:] ++ + # If the last element of the list does not end in a newline, then treat + # it as a partial line. We only check for '\n' here because a line + # ending with '\r' might be a line that was split in the middle of a + # '\r\n' sequence (see bugs 1555570 and 1721862). +- if parts and not parts[-1].endswith('\n'): +- self._partial = parts.pop() ++ if not parts[-1].endswith('\n'): ++ self._partial = [parts.pop()] + self.pushlines(parts) + + def pushlines(self, lines): +diff -r c0e311e010fc Lib/email/parser.py +--- a/Lib/email/parser.py ++++ b/Lib/email/parser.py +@@ -106,8 +106,10 @@ + meaning it parses the entire contents of the file. + """ + fp = TextIOWrapper(fp, encoding='ascii', errors='surrogateescape') +- with fp: ++ try: + return self.parser.parse(fp, headersonly) ++ finally: ++ fp.detach() + + + def parsebytes(self, text, headersonly=False): +diff -r c0e311e010fc Lib/functools.py +--- a/Lib/functools.py ++++ b/Lib/functools.py +@@ -392,6 +392,12 @@ + # The internals of the lru_cache are encapsulated for thread safety and + # to allow the implementation to change (including a possible C version). + ++ # Early detection of an erroneous call to @lru_cache without any arguments ++ # resulting in the inner function being passed to maxsize instead of an ++ # integer or None. ++ if maxsize is not None and not isinstance(maxsize, int): ++ raise TypeError('Expected maxsize to be an integer or None') ++ + # Constants shared by all lru cache instances: + sentinel = object() # unique object used to signal cache misses + make_key = _make_key # build a key from the function arguments +diff -r c0e311e010fc Lib/glob.py +--- a/Lib/glob.py ++++ b/Lib/glob.py +@@ -26,11 +26,16 @@ + patterns. + + """ ++ dirname, basename = os.path.split(pathname) + if not has_magic(pathname): +- if os.path.lexists(pathname): +- yield pathname ++ if basename: ++ if os.path.lexists(pathname): ++ yield pathname ++ else: ++ # Patterns ending with a slash should match only directories ++ if os.path.isdir(dirname): ++ yield pathname + return +- dirname, basename = os.path.split(pathname) + if not dirname: + yield from glob1(None, basename) + return +diff -r c0e311e010fc Lib/http/cookiejar.py +--- a/Lib/http/cookiejar.py ++++ b/Lib/http/cookiejar.py +@@ -1722,12 +1722,12 @@ + def __repr__(self): + r = [] + for cookie in self: r.append(repr(cookie)) +- return "<%s[%s]>" % (self.__class__, ", ".join(r)) ++ return "<%s[%s]>" % (self.__class__.__name__, ", ".join(r)) + + def __str__(self): + r = [] + for cookie in self: r.append(str(cookie)) +- return "<%s[%s]>" % (self.__class__, ", ".join(r)) ++ return "<%s[%s]>" % (self.__class__.__name__, ", ".join(r)) + + + # derives from OSError for backwards-compatibility with Python 2.4.0 +diff -r c0e311e010fc Lib/http/server.py +--- a/Lib/http/server.py ++++ b/Lib/http/server.py +@@ -747,7 +747,12 @@ + return None + list.sort(key=lambda a: a.lower()) + r = [] +- displaypath = html.escape(urllib.parse.unquote(self.path)) ++ try: ++ displaypath = urllib.parse.unquote(self.path, ++ errors='surrogatepass') ++ except UnicodeDecodeError: ++ displaypath = urllib.parse.unquote(path) ++ displaypath = html.escape(displaypath) + enc = sys.getfilesystemencoding() + title = 'Directory listing for %s' % displaypath + r.append('%s' +- % (urllib.parse.quote(linkname), html.escape(displayname))) ++ % (urllib.parse.quote(linkname, ++ errors='surrogatepass'), ++ html.escape(displayname))) + r.append('\n
\n\n\n') +- encoded = '\n'.join(r).encode(enc) ++ encoded = '\n'.join(r).encode(enc, 'surrogateescape') + f = io.BytesIO() + f.write(encoded) + f.seek(0) +@@ -794,7 +801,11 @@ + path = path.split('#',1)[0] + # Don't forget explicit trailing slash when normalizing. Issue17324 + trailing_slash = path.rstrip().endswith('/') +- path = posixpath.normpath(urllib.parse.unquote(path)) ++ try: ++ path = urllib.parse.unquote(path, errors='surrogatepass') ++ except UnicodeDecodeError: ++ path = urllib.parse.unquote(path) ++ path = posixpath.normpath(path) + words = path.split('/') + words = filter(None, words) + path = os.getcwd() +@@ -977,7 +988,7 @@ + (and the next character is a '/' or the end of the string). + + """ +- collapsed_path = _url_collapse_path(self.path) ++ collapsed_path = _url_collapse_path(urllib.parse.unquote(self.path)) + dir_sep = collapsed_path.find('/', 1) + head, tail = collapsed_path[:dir_sep], collapsed_path[dir_sep+1:] + if head in self.cgi_directories: +@@ -1000,16 +1011,16 @@ + def run_cgi(self): + """Execute a CGI script.""" + dir, rest = self.cgi_info +- +- i = rest.find('/') ++ path = dir + '/' + rest ++ i = path.find('/', len(dir)+1) + while i >= 0: +- nextdir = rest[:i] +- nextrest = rest[i+1:] ++ nextdir = path[:i] ++ nextrest = path[i+1:] + + scriptdir = self.translate_path(nextdir) + if os.path.isdir(scriptdir): + dir, rest = nextdir, nextrest +- i = rest.find('/') ++ i = path.find('/', len(dir)+1) + else: + break + +diff -r c0e311e010fc Lib/idlelib/AutoComplete.py +--- a/Lib/idlelib/AutoComplete.py ++++ b/Lib/idlelib/AutoComplete.py +@@ -226,3 +226,8 @@ + namespace = sys.modules.copy() + namespace.update(__main__.__dict__) + return eval(name, namespace) ++ ++ ++if __name__ == '__main__': ++ from unittest import main ++ main('idlelib.idle_test.test_autocomplete', verbosity=2) +diff -r c0e311e010fc Lib/idlelib/AutoExpand.py +--- a/Lib/idlelib/AutoExpand.py ++++ b/Lib/idlelib/AutoExpand.py +@@ -1,3 +1,17 @@ ++'''Complete the current word before the cursor with words in the editor. ++ ++Each menu selection or shortcut key selection replaces the word with a ++different word with the same prefix. The search for matches begins ++before the target and moves toward the top of the editor. It then starts ++after the cursor and moves down. It then returns to the original word and ++the cycle starts again. ++ ++Changing the current text line or leaving the cursor in a different ++place before requesting the next selection causes AutoExpand to reset ++its state. ++ ++This is an extension file and there is only one instance of AutoExpand. ++''' + import string + import re + +@@ -20,6 +34,7 @@ + self.state = None + + def expand_word_event(self, event): ++ "Replace the current word with the next expansion." + curinsert = self.text.index("insert") + curline = self.text.get("insert linestart", "insert lineend") + if not self.state: +@@ -46,6 +61,7 @@ + return "break" + + def getwords(self): ++ "Return a list of words that match the prefix before the cursor." + word = self.getprevword() + if not word: + return [] +@@ -76,8 +92,13 @@ + return words + + def getprevword(self): ++ "Return the word prefix before the cursor." + line = self.text.get("insert linestart", "insert") + i = len(line) + while i > 0 and line[i-1] in self.wordchars: + i = i-1 + return line[i:] ++ ++if __name__ == '__main__': ++ import unittest ++ unittest.main('idlelib.idle_test.test_autoexpand', verbosity=2) +diff -r c0e311e010fc Lib/idlelib/Bindings.py +--- a/Lib/idlelib/Bindings.py ++++ b/Lib/idlelib/Bindings.py +@@ -8,6 +8,8 @@ + windows. + + """ ++from importlib.util import find_spec ++ + from idlelib.configHandler import idleConf + + # Warning: menudefs is altered in macosxSupport.overrideRootMenu() +@@ -86,4 +88,7 @@ + ]), + ] + ++if find_spec('turtledemo'): ++ menudefs[-1][1].append(('Turtle Demo', '<>')) ++ + default_keydefs = idleConf.GetCurrentKeySet() +diff -r c0e311e010fc Lib/idlelib/CallTipWindow.py +--- a/Lib/idlelib/CallTipWindow.py ++++ b/Lib/idlelib/CallTipWindow.py +@@ -2,9 +2,8 @@ + + After ToolTip.py, which uses ideas gleaned from PySol + Used by the CallTips IDLE extension. +- + """ +-from tkinter import * ++from tkinter import Toplevel, Label, LEFT, SOLID, TclError + + HIDE_VIRTUAL_EVENT_NAME = "<>" + HIDE_SEQUENCES = ("", "") +@@ -133,37 +132,39 @@ + return bool(self.tipwindow) + + ++def _calltip_window(parent): # htest # ++ import re ++ from tkinter import Tk, Text, LEFT, BOTH + +-############################### +-# +-# Test Code +-# +-class container: # Conceptually an editor_window +- def __init__(self): +- root = Tk() +- text = self.text = Text(root) +- text.pack(side=LEFT, fill=BOTH, expand=1) +- text.insert("insert", "string.split") +- root.update() +- self.calltip = CallTip(text) ++ root = Tk() ++ root.title("Test calltips") ++ width, height, x, y = list(map(int, re.split('[x+]', parent.geometry()))) ++ root.geometry("+%d+%d"%(x, y + 150)) + +- text.event_add("<>", "(") +- text.event_add("<>", ")") +- text.bind("<>", self.calltip_show) +- text.bind("<>", self.calltip_hide) ++ class MyEditWin: # conceptually an editor_window ++ def __init__(self): ++ text = self.text = Text(root) ++ text.pack(side=LEFT, fill=BOTH, expand=1) ++ text.insert("insert", "string.split") ++ root.update() ++ self.calltip = CallTip(text) + +- text.focus_set() +- root.mainloop() ++ text.event_add("<>", "(") ++ text.event_add("<>", ")") ++ text.bind("<>", self.calltip_show) ++ text.bind("<>", self.calltip_hide) + +- def calltip_show(self, event): +- self.calltip.showtip("Hello world") ++ text.focus_set() ++ root.mainloop() + +- def calltip_hide(self, event): +- self.calltip.hidetip() ++ def calltip_show(self, event): ++ self.calltip.showtip("Hello world", "insert", "end") + +-def main(): +- # Test code +- c=container() ++ def calltip_hide(self, event): ++ self.calltip.hidetip() ++ ++ MyEditWin() + + if __name__=='__main__': +- main() ++ from idlelib.idle_test.htest import run ++ run(_calltip_window) +diff -r c0e311e010fc Lib/idlelib/ClassBrowser.py +--- a/Lib/idlelib/ClassBrowser.py ++++ b/Lib/idlelib/ClassBrowser.py +@@ -21,11 +21,15 @@ + + class ClassBrowser: + +- def __init__(self, flist, name, path): ++ def __init__(self, flist, name, path, _htest=False): + # XXX This API should change, if the file doesn't end in ".py" + # XXX the code here is bogus! ++ """ ++ _htest - bool, change box when location running htest. ++ """ + self.name = name + self.file = os.path.join(path[0], self.name + ".py") ++ self._htest = _htest + self.init(flist) + + def close(self, event=None): +@@ -40,6 +44,9 @@ + self.top = top = ListedToplevel(flist.root) + top.protocol("WM_DELETE_WINDOW", self.close) + top.bind("", self.close) ++ if self._htest: # place dialog below parent if running htest ++ top.geometry("+%d+%d" % ++ (flist.root.winfo_rootx(), flist.root.winfo_rooty() + 200)) + self.settitle() + top.focus_set() + # create scrolled canvas +@@ -94,7 +101,7 @@ + return [] + try: + dict = pyclbr.readmodule_ex(name, [dir] + sys.path) +- except ImportError as msg: ++ except ImportError: + return [] + items = [] + self.classes = {} +@@ -202,7 +209,7 @@ + edit = PyShell.flist.open(self.file) + edit.gotoline(self.cl.methods[self.name]) + +-def main(): ++def _class_browser(parent): #Wrapper for htest + try: + file = __file__ + except NameError: +@@ -213,9 +220,10 @@ + file = sys.argv[0] + dir, file = os.path.split(file) + name = os.path.splitext(file)[0] +- ClassBrowser(PyShell.flist, name, [dir]) +- if sys.stdin is sys.__stdin__: +- mainloop() ++ flist = PyShell.PyShellFileList(parent) ++ ClassBrowser(flist, name, [dir], _htest=True) ++ parent.mainloop() + + if __name__ == "__main__": +- main() ++ from idlelib.idle_test.htest import run ++ run(_class_browser) +diff -r c0e311e010fc Lib/idlelib/ColorDelegator.py +--- a/Lib/idlelib/ColorDelegator.py ++++ b/Lib/idlelib/ColorDelegator.py +@@ -72,7 +72,6 @@ + "DEFINITION": idleConf.GetHighlight(theme, "definition"), + "SYNC": {'background':None,'foreground':None}, + "TODO": {'background':None,'foreground':None}, +- "BREAK": idleConf.GetHighlight(theme, "break"), + "ERROR": idleConf.GetHighlight(theme, "error"), + # The following is used by ReplaceDialog: + "hit": idleConf.GetHighlight(theme, "hit"), +@@ -253,17 +252,21 @@ + for tag in self.tagdefs: + self.tag_remove(tag, "1.0", "end") + +-def main(): ++def _color_delegator(parent): + from idlelib.Percolator import Percolator + root = Tk() +- root.wm_protocol("WM_DELETE_WINDOW", root.quit) +- text = Text(background="white") ++ root.title("Test ColorDelegator") ++ width, height, x, y = list(map(int, re.split('[x+]', parent.geometry()))) ++ root.geometry("+%d+%d"%(x, y + 150)) ++ source = "if somename: x = 'abc' # comment\nprint" ++ text = Text(root, background="white") ++ text.insert("insert", source) + text.pack(expand=1, fill="both") +- text.focus_set() + p = Percolator(text) + d = ColorDelegator() + p.insertfilter(d) + root.mainloop() + + if __name__ == "__main__": +- main() ++ from idlelib.idle_test.htest import run ++ run(_color_delegator) +diff -r c0e311e010fc Lib/idlelib/Debugger.py +--- a/Lib/idlelib/Debugger.py ++++ b/Lib/idlelib/Debugger.py +@@ -1,6 +1,5 @@ + import os + import bdb +-import types + from tkinter import * + from idlelib.WindowList import ListedToplevel + from idlelib.ScrolledList import ScrolledList +diff -r c0e311e010fc Lib/idlelib/EditorWindow.py +--- a/Lib/idlelib/EditorWindow.py ++++ b/Lib/idlelib/EditorWindow.py +@@ -2,7 +2,7 @@ + import importlib.abc + import importlib.util + import os +-from platform import python_version ++import platform + import re + import string + import sys +@@ -26,6 +26,8 @@ + # The default tab setting for a Text widget, in average-width characters. + TK_TABWIDTH_DEFAULT = 8 + ++_py_version = ' (%s)' % platform.python_version() ++ + def _sphinx_version(): + "Format sys.version_info to produce the Sphinx version string used to install the chm docs" + major, minor, micro, level, serial = sys.version_info +@@ -79,7 +81,7 @@ + self.parent = None + + helpDialog = HelpDialog() # singleton instance +-def _Help_dialog(parent): # wrapper for htest ++def _help_dialog(parent): # wrapper for htest + helpDialog.show_dialog(parent) + + +@@ -222,6 +224,7 @@ + text.bind("<>", self.flist.close_all_callback) + text.bind("<>", self.open_class_browser) + text.bind("<>", self.open_path_browser) ++ text.bind("<>", self.open_turtle_demo) + + self.set_status_bar() + vbar['command'] = text.yview +@@ -705,6 +708,14 @@ + from idlelib import PathBrowser + PathBrowser.PathBrowser(self.flist) + ++ def open_turtle_demo(self, event = None): ++ import subprocess ++ ++ cmd = [sys.executable, ++ '-c', ++ 'from turtledemo.__main__ import main; main()'] ++ p = subprocess.Popen(cmd, shell=False) ++ + def gotoline(self, lineno): + if lineno is not None and lineno > 0: + self.text.mark_set("insert", "%d.0" % lineno) +@@ -935,7 +946,7 @@ + short = self.short_title() + long = self.long_title() + if short and long: +- title = short + " - " + long ++ title = short + " - " + long + _py_version + elif short: + title = short + elif long: +@@ -959,14 +970,13 @@ + self.undo.reset_undo() + + def short_title(self): +- pyversion = "Python " + python_version() + ": " + filename = self.io.filename + if filename: + filename = os.path.basename(filename) + else: + filename = "Untitled" + # return unicode string to display non-ASCII chars correctly +- return pyversion + self._filename_to_unicode(filename) ++ return self._filename_to_unicode(filename) + + def long_title(self): + # return unicode string to display non-ASCII chars correctly +@@ -1702,21 +1712,18 @@ + tk.call('set', 'tcl_nonwordchars', '[^a-zA-Z0-9_]') + + +-def _Editor_window(parent): ++def _editor_window(parent): + root = parent + fixwordbreaks(root) +- root.withdraw() + if sys.argv[1:]: + filename = sys.argv[1] + else: + filename = None + macosxSupport.setupApp(root, None) + edit = EditorWindow(root=root, filename=filename) +- edit.set_close_hook(root.quit) + edit.text.bind("<>", edit.close_event) ++ parent.mainloop() + + if __name__ == '__main__': + from idlelib.idle_test.htest import run +- if len(sys.argv) <= 1: +- run(_Help_dialog) +- run(_Editor_window) ++ run(_help_dialog, _editor_window) +diff -r c0e311e010fc Lib/idlelib/FormatParagraph.py +--- a/Lib/idlelib/FormatParagraph.py ++++ b/Lib/idlelib/FormatParagraph.py +@@ -188,7 +188,6 @@ + return m.group(1) + + if __name__ == "__main__": +- from test import support; support.use_resources = ['gui'] + import unittest + unittest.main('idlelib.idle_test.test_formatparagraph', + verbosity=2, exit=False) +diff -r c0e311e010fc Lib/idlelib/GrepDialog.py +--- a/Lib/idlelib/GrepDialog.py ++++ b/Lib/idlelib/GrepDialog.py +@@ -1,9 +1,14 @@ + import os + import fnmatch ++import re # for htest + import sys +-from tkinter import * ++from tkinter import StringVar, BooleanVar, Checkbutton # for GrepDialog ++from tkinter import Tk, Text, Button, SEL, END # for htest + from idlelib import SearchEngine ++import itertools + from idlelib.SearchDialogBase import SearchDialogBase ++# Importing OutputWindow fails due to import loop ++# EditorWindow -> GrepDialop -> OutputWindow -> EditorWindow + + def grep(text, io=None, flist=None): + root = text._root() +@@ -40,10 +45,10 @@ + + def create_entries(self): + SearchDialogBase.create_entries(self) +- self.globent = self.make_entry("In files:", self.globvar) ++ self.globent = self.make_entry("In files:", self.globvar)[0] + + def create_other_buttons(self): +- f = self.make_frame() ++ f = self.make_frame()[0] + + btn = Checkbutton(f, anchor="w", + variable=self.recvar, +@@ -63,7 +68,7 @@ + if not path: + self.top.bell() + return +- from idlelib.OutputWindow import OutputWindow ++ from idlelib.OutputWindow import OutputWindow # leave here! + save = sys.stdout + try: + sys.stdout = OutputWindow(self.flist) +@@ -79,21 +84,26 @@ + pat = self.engine.getpat() + print("Searching %r in %s ..." % (pat, path)) + hits = 0 +- for fn in list: +- try: +- with open(fn, errors='replace') as f: +- for lineno, line in enumerate(f, 1): +- if line[-1:] == '\n': +- line = line[:-1] +- if prog.search(line): +- sys.stdout.write("%s: %s: %s\n" % +- (fn, lineno, line)) +- hits += 1 +- except OSError as msg: +- print(msg) +- print(("Hits found: %s\n" +- "(Hint: right-click to open locations.)" +- % hits) if hits else "No hits.") ++ try: ++ for fn in list: ++ try: ++ with open(fn, errors='replace') as f: ++ for lineno, line in enumerate(f, 1): ++ if line[-1:] == '\n': ++ line = line[:-1] ++ if prog.search(line): ++ sys.stdout.write("%s: %s: %s\n" % ++ (fn, lineno, line)) ++ hits += 1 ++ except OSError as msg: ++ print(msg) ++ print(("Hits found: %s\n" ++ "(Hint: right-click to open locations.)" ++ % hits) if hits else "No hits.") ++ except AttributeError: ++ # Tk window has been closed, OutputWindow.text = None, ++ # so in OW.write, OW.text.insert fails. ++ pass + + def findfiles(self, dir, base, rec): + try: +@@ -120,8 +130,30 @@ + self.top.grab_release() + self.top.withdraw() + ++ ++def _grep_dialog(parent): # for htest ++ from idlelib.PyShell import PyShellFileList ++ root = Tk() ++ root.title("Test GrepDialog") ++ width, height, x, y = list(map(int, re.split('[x+]', parent.geometry()))) ++ root.geometry("+%d+%d"%(x, y + 150)) ++ ++ flist = PyShellFileList(root) ++ text = Text(root, height=5) ++ text.pack() ++ ++ def show_grep_dialog(): ++ text.tag_add(SEL, "1.0", END) ++ grep(text, flist=flist) ++ text.tag_remove(SEL, "1.0", END) ++ ++ button = Button(root, text="Show GrepDialog", command=show_grep_dialog) ++ button.pack() ++ root.mainloop() ++ + if __name__ == "__main__": +- # A human test is a bit tricky since EditorWindow() imports this module. +- # Hence Idle must be restarted after editing this file for a live test. + import unittest + unittest.main('idlelib.idle_test.test_grep', verbosity=2, exit=False) ++ ++ from idlelib.idle_test.htest import run ++ run(_grep_dialog) +diff -r c0e311e010fc Lib/idlelib/HyperParser.py +--- a/Lib/idlelib/HyperParser.py ++++ b/Lib/idlelib/HyperParser.py +@@ -1,23 +1,31 @@ +-""" +-HyperParser +-=========== +-This module defines the HyperParser class, which provides advanced parsing +-abilities for the ParenMatch and other extensions. +-The HyperParser uses PyParser. PyParser is intended mostly to give information +-on the proper indentation of code. HyperParser gives some information on the +-structure of code, used by extensions to help the user. ++"""Provide advanced parsing abilities for ParenMatch and other extensions. ++ ++HyperParser uses PyParser. PyParser mostly gives information on the ++proper indentation of code. HyperParser gives additional information on ++the structure of code. + """ + + import string +-import keyword ++from keyword import iskeyword + from idlelib import PyParse + ++ ++# all ASCII chars that may be in an identifier ++_ASCII_ID_CHARS = frozenset(string.ascii_letters + string.digits + "_") ++# all ASCII chars that may be the first char of an identifier ++_ASCII_ID_FIRST_CHARS = frozenset(string.ascii_letters + "_") ++ ++# lookup table for whether 7-bit ASCII chars are valid in a Python identifier ++_IS_ASCII_ID_CHAR = [(chr(x) in _ASCII_ID_CHARS) for x in range(128)] ++# lookup table for whether 7-bit ASCII chars are valid as the first ++# char in a Python identifier ++_IS_ASCII_ID_FIRST_CHAR = \ ++ [(chr(x) in _ASCII_ID_FIRST_CHARS) for x in range(128)] ++ ++ + class HyperParser: +- + def __init__(self, editwin, index): +- """Initialize the HyperParser to analyze the surroundings of the given +- index. +- """ ++ "To initialize, analyze the surroundings of the given index." + + self.editwin = editwin + self.text = text = editwin.text +@@ -33,9 +41,10 @@ + startat = max(lno - context, 1) + startatindex = repr(startat) + ".0" + stopatindex = "%d.end" % lno +- # We add the newline because PyParse requires a newline at end. +- # We add a space so that index won't be at end of line, so that +- # its status will be the same as the char before it, if should. ++ # We add the newline because PyParse requires a newline ++ # at end. We add a space so that index won't be at end ++ # of line, so that its status will be the same as the ++ # char before it, if should. + parser.set_str(text.get(startatindex, stopatindex)+' \n') + bod = parser.find_good_parse_start( + editwin._build_char_in_string_func(startatindex)) +@@ -49,122 +58,175 @@ + else: + startatindex = "1.0" + stopatindex = "%d.end" % lno +- # We add the newline because PyParse requires a newline at end. +- # We add a space so that index won't be at end of line, so that +- # its status will be the same as the char before it, if should. ++ # We add the newline because PyParse requires it. We add a ++ # space so that index won't be at end of line, so that its ++ # status will be the same as the char before it, if should. + parser.set_str(text.get(startatindex, stopatindex)+' \n') + parser.set_lo(0) + +- # We want what the parser has, except for the last newline and space. ++ # We want what the parser has, minus the last newline and space. + self.rawtext = parser.str[:-2] +- # As far as I can see, parser.str preserves the statement we are in, +- # so that stopatindex can be used to synchronize the string with the +- # text box indices. ++ # Parser.str apparently preserves the statement we are in, so ++ # that stopatindex can be used to synchronize the string with ++ # the text box indices. + self.stopatindex = stopatindex + self.bracketing = parser.get_last_stmt_bracketing() +- # find which pairs of bracketing are openers. These always correspond +- # to a character of rawtext. +- self.isopener = [i>0 and self.bracketing[i][1] > self.bracketing[i-1][1] ++ # find which pairs of bracketing are openers. These always ++ # correspond to a character of rawtext. ++ self.isopener = [i>0 and self.bracketing[i][1] > ++ self.bracketing[i-1][1] + for i in range(len(self.bracketing))] + + self.set_index(index) + + def set_index(self, index): +- """Set the index to which the functions relate. Note that it must be +- in the same statement. ++ """Set the index to which the functions relate. ++ ++ The index must be in the same statement. + """ +- indexinrawtext = \ +- len(self.rawtext) - len(self.text.get(index, self.stopatindex)) ++ indexinrawtext = (len(self.rawtext) - ++ len(self.text.get(index, self.stopatindex))) + if indexinrawtext < 0: +- raise ValueError("The index given is before the analyzed statement") ++ raise ValueError("Index %s precedes the analyzed statement" ++ % index) + self.indexinrawtext = indexinrawtext + # find the rightmost bracket to which index belongs + self.indexbracket = 0 +- while self.indexbracket < len(self.bracketing)-1 and \ +- self.bracketing[self.indexbracket+1][0] < self.indexinrawtext: ++ while (self.indexbracket < len(self.bracketing)-1 and ++ self.bracketing[self.indexbracket+1][0] < self.indexinrawtext): + self.indexbracket += 1 +- if self.indexbracket < len(self.bracketing)-1 and \ +- self.bracketing[self.indexbracket+1][0] == self.indexinrawtext and \ +- not self.isopener[self.indexbracket+1]: ++ if (self.indexbracket < len(self.bracketing)-1 and ++ self.bracketing[self.indexbracket+1][0] == self.indexinrawtext and ++ not self.isopener[self.indexbracket+1]): + self.indexbracket += 1 + + def is_in_string(self): +- """Is the index given to the HyperParser is in a string?""" ++ """Is the index given to the HyperParser in a string?""" + # The bracket to which we belong should be an opener. + # If it's an opener, it has to have a character. +- return self.isopener[self.indexbracket] and \ +- self.rawtext[self.bracketing[self.indexbracket][0]] in ('"', "'") ++ return (self.isopener[self.indexbracket] and ++ self.rawtext[self.bracketing[self.indexbracket][0]] ++ in ('"', "'")) + + def is_in_code(self): +- """Is the index given to the HyperParser is in a normal code?""" +- return not self.isopener[self.indexbracket] or \ +- self.rawtext[self.bracketing[self.indexbracket][0]] not in \ +- ('#', '"', "'") ++ """Is the index given to the HyperParser in normal code?""" ++ return (not self.isopener[self.indexbracket] or ++ self.rawtext[self.bracketing[self.indexbracket][0]] ++ not in ('#', '"', "'")) + + def get_surrounding_brackets(self, openers='([{', mustclose=False): +- """If the index given to the HyperParser is surrounded by a bracket +- defined in openers (or at least has one before it), return the +- indices of the opening bracket and the closing bracket (or the +- end of line, whichever comes first). +- If it is not surrounded by brackets, or the end of line comes before +- the closing bracket and mustclose is True, returns None. ++ """Return bracket indexes or None. ++ ++ If the index given to the HyperParser is surrounded by a ++ bracket defined in openers (or at least has one before it), ++ return the indices of the opening bracket and the closing ++ bracket (or the end of line, whichever comes first). ++ ++ If it is not surrounded by brackets, or the end of line comes ++ before the closing bracket and mustclose is True, returns None. + """ ++ + bracketinglevel = self.bracketing[self.indexbracket][1] + before = self.indexbracket +- while not self.isopener[before] or \ +- self.rawtext[self.bracketing[before][0]] not in openers or \ +- self.bracketing[before][1] > bracketinglevel: ++ while (not self.isopener[before] or ++ self.rawtext[self.bracketing[before][0]] not in openers or ++ self.bracketing[before][1] > bracketinglevel): + before -= 1 + if before < 0: + return None + bracketinglevel = min(bracketinglevel, self.bracketing[before][1]) + after = self.indexbracket + 1 +- while after < len(self.bracketing) and \ +- self.bracketing[after][1] >= bracketinglevel: ++ while (after < len(self.bracketing) and ++ self.bracketing[after][1] >= bracketinglevel): + after += 1 + + beforeindex = self.text.index("%s-%dc" % + (self.stopatindex, len(self.rawtext)-self.bracketing[before][0])) +- if after >= len(self.bracketing) or \ +- self.bracketing[after][0] > len(self.rawtext): ++ if (after >= len(self.bracketing) or ++ self.bracketing[after][0] > len(self.rawtext)): + if mustclose: + return None + afterindex = self.stopatindex + else: +- # We are after a real char, so it is a ')' and we give the index +- # before it. +- afterindex = self.text.index("%s-%dc" % +- (self.stopatindex, ++ # We are after a real char, so it is a ')' and we give the ++ # index before it. ++ afterindex = self.text.index( ++ "%s-%dc" % (self.stopatindex, + len(self.rawtext)-(self.bracketing[after][0]-1))) + + return beforeindex, afterindex + ++ # the set of built-in identifiers which are also keywords, ++ # i.e. keyword.iskeyword() returns True for them ++ _ID_KEYWORDS = frozenset({"True", "False", "None"}) ++ ++ @classmethod ++ def _eat_identifier(cls, str, limit, pos): ++ """Given a string and pos, return the number of chars in the ++ identifier which ends at pos, or 0 if there is no such one. ++ ++ This ignores non-identifier eywords are not identifiers. ++ """ ++ is_ascii_id_char = _IS_ASCII_ID_CHAR ++ ++ # Start at the end (pos) and work backwards. ++ i = pos ++ ++ # Go backwards as long as the characters are valid ASCII ++ # identifier characters. This is an optimization, since it ++ # is faster in the common case where most of the characters ++ # are ASCII. ++ while i > limit and ( ++ ord(str[i - 1]) < 128 and ++ is_ascii_id_char[ord(str[i - 1])] ++ ): ++ i -= 1 ++ ++ # If the above loop ended due to reaching a non-ASCII ++ # character, continue going backwards using the most generic ++ # test for whether a string contains only valid identifier ++ # characters. ++ if i > limit and ord(str[i - 1]) >= 128: ++ while i - 4 >= limit and ('a' + str[i - 4:pos]).isidentifier(): ++ i -= 4 ++ if i - 2 >= limit and ('a' + str[i - 2:pos]).isidentifier(): ++ i -= 2 ++ if i - 1 >= limit and ('a' + str[i - 1:pos]).isidentifier(): ++ i -= 1 ++ ++ # The identifier candidate starts here. If it isn't a valid ++ # identifier, don't eat anything. At this point that is only ++ # possible if the first character isn't a valid first ++ # character for an identifier. ++ if not str[i:pos].isidentifier(): ++ return 0 ++ elif i < pos: ++ # All characters in str[i:pos] are valid ASCII identifier ++ # characters, so it is enough to check that the first is ++ # valid as the first character of an identifier. ++ if not _IS_ASCII_ID_FIRST_CHAR[ord(str[i])]: ++ return 0 ++ ++ # All keywords are valid identifiers, but should not be ++ # considered identifiers here, except for True, False and None. ++ if i < pos and ( ++ iskeyword(str[i:pos]) and ++ str[i:pos] not in cls._ID_KEYWORDS ++ ): ++ return 0 ++ ++ return pos - i ++ + # This string includes all chars that may be in a white space + _whitespace_chars = " \t\n\\" +- # This string includes all chars that may be in an identifier +- _id_chars = string.ascii_letters + string.digits + "_" +- # This string includes all chars that may be the first char of an identifier +- _id_first_chars = string.ascii_letters + "_" +- +- # Given a string and pos, return the number of chars in the identifier +- # which ends at pos, or 0 if there is no such one. Saved words are not +- # identifiers. +- def _eat_identifier(self, str, limit, pos): +- i = pos +- while i > limit and str[i-1] in self._id_chars: +- i -= 1 +- if i < pos and (str[i] not in self._id_first_chars or \ +- keyword.iskeyword(str[i:pos])): +- i = pos +- return pos - i + + def get_expression(self): +- """Return a string with the Python expression which ends at the given +- index, which is empty if there is no real one. ++ """Return a string with the Python expression which ends at the ++ given index, which is empty if there is no real one. + """ + if not self.is_in_code(): +- raise ValueError("get_expression should only be called if index "\ +- "is inside a code.") ++ raise ValueError("get_expression should only be called" ++ "if index is inside a code.") + + rawtext = self.rawtext + bracketing = self.bracketing +@@ -177,20 +239,20 @@ + postdot_phase = True + + while 1: +- # Eat whitespaces, comments, and if postdot_phase is False - one dot ++ # Eat whitespaces, comments, and if postdot_phase is False - a dot + while 1: + if pos>brck_limit and rawtext[pos-1] in self._whitespace_chars: + # Eat a whitespace + pos -= 1 +- elif not postdot_phase and \ +- pos > brck_limit and rawtext[pos-1] == '.': ++ elif (not postdot_phase and ++ pos > brck_limit and rawtext[pos-1] == '.'): + # Eat a dot + pos -= 1 + postdot_phase = True +- # The next line will fail if we are *inside* a comment, but we +- # shouldn't be. +- elif pos == brck_limit and brck_index > 0 and \ +- rawtext[bracketing[brck_index-1][0]] == '#': ++ # The next line will fail if we are *inside* a comment, ++ # but we shouldn't be. ++ elif (pos == brck_limit and brck_index > 0 and ++ rawtext[bracketing[brck_index-1][0]] == '#'): + # Eat a comment + brck_index -= 2 + brck_limit = bracketing[brck_index][0] +@@ -200,8 +262,8 @@ + break + + if not postdot_phase: +- # We didn't find a dot, so the expression end at the last +- # identifier pos. ++ # We didn't find a dot, so the expression end at the ++ # last identifier pos. + break + + ret = self._eat_identifier(rawtext, brck_limit, pos) +@@ -209,13 +271,13 @@ + # There is an identifier to eat + pos = pos - ret + last_identifier_pos = pos +- # Now, in order to continue the search, we must find a dot. ++ # Now, to continue the search, we must find a dot. + postdot_phase = False + # (the loop continues now) + + elif pos == brck_limit: +- # We are at a bracketing limit. If it is a closing bracket, +- # eat the bracket, otherwise, stop the search. ++ # We are at a bracketing limit. If it is a closing ++ # bracket, eat the bracket, otherwise, stop the search. + level = bracketing[brck_index][1] + while brck_index > 0 and bracketing[brck_index-1][1] > level: + brck_index -= 1 +@@ -244,3 +306,8 @@ + break + + return rawtext[last_identifier_pos:self.indexinrawtext] ++ ++ ++if __name__ == '__main__': ++ import unittest ++ unittest.main('idlelib.idle_test.test_hyperparser', verbosity=2) +diff -r c0e311e010fc Lib/idlelib/IOBinding.py +--- a/Lib/idlelib/IOBinding.py ++++ b/Lib/idlelib/IOBinding.py +@@ -525,16 +525,17 @@ + if self.editwin.flist: + self.editwin.update_recent_files_list(filename) + +-def test(): ++def _io_binding(parent): + root = Tk() ++ root.title("Test IOBinding") ++ width, height, x, y = list(map(int, re.split('[x+]', parent.geometry()))) ++ root.geometry("+%d+%d"%(x, y + 150)) + class MyEditWin: + def __init__(self, text): + self.text = text + self.flist = None + self.text.bind("", self.open) + self.text.bind("", self.save) +- self.text.bind("", self.save_as) +- self.text.bind("", self.save_a_copy) + def get_saved(self): return 0 + def set_saved(self, flag): pass + def reset_undo(self): pass +@@ -542,16 +543,13 @@ + self.text.event_generate("<>") + def save(self, event): + self.text.event_generate("<>") +- def save_as(self, event): +- self.text.event_generate("<>") +- def save_a_copy(self, event): +- self.text.event_generate("<>") ++ + text = Text(root) + text.pack() + text.focus_set() + editwin = MyEditWin(text) + io = IOBinding(editwin) +- root.mainloop() + + if __name__ == "__main__": +- test() ++ from idlelib.idle_test.htest import run ++ run(_io_binding) +diff -r c0e311e010fc Lib/idlelib/IdleHistory.py +--- a/Lib/idlelib/IdleHistory.py ++++ b/Lib/idlelib/IdleHistory.py +@@ -100,7 +100,5 @@ + self.prefix = None + + if __name__ == "__main__": +- from test import support +- support.use_resources = ['gui'] + from unittest import main + main('idlelib.idle_test.test_idlehistory', verbosity=2, exit=False) +diff -r c0e311e010fc Lib/idlelib/MultiCall.py +--- a/Lib/idlelib/MultiCall.py ++++ b/Lib/idlelib/MultiCall.py +@@ -420,9 +420,12 @@ + _multicall_dict[widget] = MultiCall + return MultiCall + +-if __name__ == "__main__": +- # Test ++ ++def _multi_call(parent): + root = tkinter.Tk() ++ root.title("Test MultiCall") ++ width, height, x, y = list(map(int, re.split('[x+]', parent.geometry()))) ++ root.geometry("+%d+%d"%(x, y + 150)) + text = MultiCallCreator(tkinter.Text)(root) + text.pack() + def bindseq(seq, n=[0]): +@@ -438,8 +441,13 @@ + bindseq("") + bindseq("") + bindseq("") ++ bindseq("") + bindseq("") + bindseq("") + bindseq("") + bindseq("") + root.mainloop() ++ ++if __name__ == "__main__": ++ from idlelib.idle_test.htest import run ++ run(_multi_call) +diff -r c0e311e010fc Lib/idlelib/MultiStatusBar.py +--- a/Lib/idlelib/MultiStatusBar.py ++++ b/Lib/idlelib/MultiStatusBar.py +@@ -17,16 +17,29 @@ + label = self.labels[name] + label.config(text=text) + +-def _test(): +- b = Frame() +- c = Text(b) +- c.pack(side=TOP) +- a = MultiStatusBar(b) +- a.set_label("one", "hello") +- a.set_label("two", "world") +- a.pack(side=BOTTOM, fill=X) +- b.pack() +- b.mainloop() ++def _multistatus_bar(parent): ++ root = Tk() ++ width, height, x, y = list(map(int, re.split('[x+]', parent.geometry()))) ++ root.geometry("+%d+%d" %(x, y + 150)) ++ root.title("Test multistatus bar") ++ frame = Frame(root) ++ text = Text(frame) ++ text.pack() ++ msb = MultiStatusBar(frame) ++ msb.set_label("one", "hello") ++ msb.set_label("two", "world") ++ msb.pack(side=BOTTOM, fill=X) ++ ++ def change(): ++ msb.set_label("one", "foo") ++ msb.set_label("two", "bar") ++ ++ button = Button(root, text="Update status", command=change) ++ button.pack(side=BOTTOM) ++ frame.pack() ++ frame.mainloop() ++ root.mainloop() + + if __name__ == '__main__': +- _test() ++ from idlelib.idle_test.htest import run ++ run(_multistatus_bar) +diff -r c0e311e010fc Lib/idlelib/ObjectBrowser.py +--- a/Lib/idlelib/ObjectBrowser.py ++++ b/Lib/idlelib/ObjectBrowser.py +@@ -9,6 +9,8 @@ + # XXX TO DO: + # - for classes/modules, add "open source" to object browser + ++import re ++ + from idlelib.TreeWidget import TreeItem, TreeNode, ScrolledCanvas + + from reprlib import Repr +@@ -119,12 +121,14 @@ + c = ObjectTreeItem + return c(labeltext, object, setfunction) + +-# Test script + +-def _test(): ++def _object_browser(parent): + import sys + from tkinter import Tk + root = Tk() ++ root.title("Test ObjectBrowser") ++ width, height, x, y = list(map(int, re.split('[x+]', parent.geometry()))) ++ root.geometry("+%d+%d"%(x, y + 150)) + root.configure(bd=0, bg="yellow") + root.focus_set() + sc = ScrolledCanvas(root, bg="white", highlightthickness=0, takefocus=1) +@@ -135,4 +139,5 @@ + root.mainloop() + + if __name__ == '__main__': +- _test() ++ from idlelib.idle_test.htest import run ++ run(_object_browser) +diff -r c0e311e010fc Lib/idlelib/ParenMatch.py +--- a/Lib/idlelib/ParenMatch.py ++++ b/Lib/idlelib/ParenMatch.py +@@ -90,7 +90,8 @@ + self.set_timeout = self.set_timeout_none + + def flash_paren_event(self, event): +- indices = HyperParser(self.editwin, "insert").get_surrounding_brackets() ++ indices = (HyperParser(self.editwin, "insert") ++ .get_surrounding_brackets()) + if indices is None: + self.warn_mismatched() + return +@@ -167,6 +168,11 @@ + # associate a counter with an event; only disable the "paren" + # tag if the event is for the most recent timer. + self.counter += 1 +- self.editwin.text_frame.after(self.FLASH_DELAY, +- lambda self=self, c=self.counter: \ +- self.handle_restore_timer(c)) ++ self.editwin.text_frame.after( ++ self.FLASH_DELAY, ++ lambda self=self, c=self.counter: self.handle_restore_timer(c)) ++ ++ ++if __name__ == '__main__': ++ import unittest ++ unittest.main('idlelib.idle_test.test_parenmatch', verbosity=2) +diff -r c0e311e010fc Lib/idlelib/PathBrowser.py +--- a/Lib/idlelib/PathBrowser.py ++++ b/Lib/idlelib/PathBrowser.py +@@ -4,10 +4,16 @@ + + from idlelib.TreeWidget import TreeItem + from idlelib.ClassBrowser import ClassBrowser, ModuleBrowserTreeItem ++from idlelib.PyShell import PyShellFileList ++ + + class PathBrowser(ClassBrowser): + +- def __init__(self, flist): ++ def __init__(self, flist, _htest=False): ++ """ ++ _htest - bool, change box location when running htest ++ """ ++ self._htest = _htest + self.init(flist) + + def settitle(self): +@@ -87,12 +93,14 @@ + sorted.sort() + return sorted + +-def main(): +- from idlelib import PyShell +- PathBrowser(PyShell.flist) +- if sys.stdin is sys.__stdin__: +- mainloop() ++def _path_browser(parent): ++ flist = PyShellFileList(parent) ++ PathBrowser(flist, _htest=True) ++ parent.mainloop() + + if __name__ == "__main__": + from unittest import main + main('idlelib.idle_test.test_pathbrowser', verbosity=2, exit=False) ++ ++ from idlelib.idle_test.htest import run ++ run(_path_browser) +diff -r c0e311e010fc Lib/idlelib/Percolator.py +--- a/Lib/idlelib/Percolator.py ++++ b/Lib/idlelib/Percolator.py +@@ -51,8 +51,9 @@ + f.setdelegate(filter.delegate) + filter.setdelegate(None) + +-def main(): +- import tkinter as Tk ++def _percolator(parent): ++ import tkinter as tk ++ import re + class Tracer(Delegator): + def __init__(self, name): + self.name = name +@@ -63,22 +64,41 @@ + def delete(self, *args): + print(self.name, ": delete", args) + self.delegate.delete(*args) +- root = Tk.Tk() +- root.wm_protocol("WM_DELETE_WINDOW", root.quit) +- text = Tk.Text() +- text.pack() +- text.focus_set() ++ root = tk.Tk() ++ root.title("Test Percolator") ++ width, height, x, y = list(map(int, re.split('[x+]', parent.geometry()))) ++ root.geometry("+%d+%d"%(x, y + 150)) ++ text = tk.Text(root) + p = Percolator(text) + t1 = Tracer("t1") + t2 = Tracer("t2") +- p.insertfilter(t1) +- p.insertfilter(t2) +- root.mainloop() # click close widget to continue... +- p.removefilter(t2) +- root.mainloop() +- p.insertfilter(t2) +- p.removefilter(t1) ++ ++ def toggle1(): ++ if var1.get() == 0: ++ var1.set(1) ++ p.insertfilter(t1) ++ elif var1.get() == 1: ++ var1.set(0) ++ p.removefilter(t1) ++ ++ def toggle2(): ++ if var2.get() == 0: ++ var2.set(1) ++ p.insertfilter(t2) ++ elif var2.get() == 1: ++ var2.set(0) ++ p.removefilter(t2) ++ ++ text.pack() ++ var1 = tk.IntVar() ++ cb1 = tk.Checkbutton(root, text="Tracer1", command=toggle1, variable=var1) ++ cb1.pack() ++ var2 = tk.IntVar() ++ cb2 = tk.Checkbutton(root, text="Tracer2", command=toggle2, variable=var2) ++ cb2.pack() ++ + root.mainloop() + + if __name__ == "__main__": +- main() ++ from idlelib.idle_test.htest import run ++ run(_percolator) +diff -r c0e311e010fc Lib/idlelib/PyParse.py +--- a/Lib/idlelib/PyParse.py ++++ b/Lib/idlelib/PyParse.py +@@ -1,5 +1,7 @@ + import re + import sys ++from collections import Mapping ++from functools import partial + + # Reason last stmt is continued (or C_NONE if it's not). + (C_NONE, C_BACKSLASH, C_STRING_FIRST_LINE, +@@ -91,19 +93,48 @@ + [^[\](){}#'"\\]+ + """, re.VERBOSE).match + +-# Build translation table to map uninteresting chars to "x", open +-# brackets to "(", and close brackets to ")". + +-_tran = {} +-for i in range(256): +- _tran[i] = 'x' +-for ch in "({[": +- _tran[ord(ch)] = '(' +-for ch in ")}]": +- _tran[ord(ch)] = ')' +-for ch in "\"'\\\n#": +- _tran[ord(ch)] = ch +-del i, ch ++class StringTranslatePseudoMapping(Mapping): ++ r"""Utility class to be used with str.translate() ++ ++ This Mapping class wraps a given dict. When a value for a key is ++ requested via __getitem__() or get(), the key is looked up in the ++ given dict. If found there, the value from the dict is returned. ++ Otherwise, the default value given upon initialization is returned. ++ ++ This allows using str.translate() to make some replacements, and to ++ replace all characters for which no replacement was specified with ++ a given character instead of leaving them as-is. ++ ++ For example, to replace everything except whitespace with 'x': ++ ++ >>> whitespace_chars = ' \t\n\r' ++ >>> preserve_dict = {ord(c): ord(c) for c in whitespace_chars} ++ >>> mapping = StringTranslatePseudoMapping(preserve_dict, ord('x')) ++ >>> text = "a + b\tc\nd" ++ >>> text.translate(mapping) ++ 'x x x\tx\nx' ++ """ ++ def __init__(self, non_defaults, default_value): ++ self._non_defaults = non_defaults ++ self._default_value = default_value ++ ++ def _get(key, _get=non_defaults.get, _default=default_value): ++ return _get(key, _default) ++ self._get = _get ++ ++ def __getitem__(self, item): ++ return self._get(item) ++ ++ def __len__(self): ++ return len(self._non_defaults) ++ ++ def __iter__(self): ++ return iter(self._non_defaults) ++ ++ def get(self, key, default=None): ++ return self._get(key) ++ + + class Parser: + +@@ -113,19 +144,6 @@ + + def set_str(self, s): + assert len(s) == 0 or s[-1] == '\n' +- if isinstance(s, str): +- # The parse functions have no idea what to do with Unicode, so +- # replace all Unicode characters with "x". This is "safe" +- # so long as the only characters germane to parsing the structure +- # of Python are 7-bit ASCII. It's *necessary* because Unicode +- # strings don't have a .translate() method that supports +- # deletechars. +- uniphooey = s +- s = [] +- push = s.append +- for raw in map(ord, uniphooey): +- push(raw < 127 and chr(raw) or "x") +- s = "".join(s) + self.str = s + self.study_level = 0 + +@@ -197,6 +215,16 @@ + if lo > 0: + self.str = self.str[lo:] + ++ # Build a translation table to map uninteresting chars to 'x', open ++ # brackets to '(', close brackets to ')' while preserving quotes, ++ # backslashes, newlines and hashes. This is to be passed to ++ # str.translate() in _study1(). ++ _tran = {} ++ _tran.update((ord(c), ord('(')) for c in "({[") ++ _tran.update((ord(c), ord(')')) for c in ")}]") ++ _tran.update((ord(c), ord(c)) for c in "\"'\\\n#") ++ _tran = StringTranslatePseudoMapping(_tran, default_value=ord('x')) ++ + # As quickly as humanly possible , find the line numbers (0- + # based) of the non-continuation lines. + # Creates self.{goodlines, continuation}. +@@ -211,7 +239,7 @@ + # uninteresting characters. This can cut the number of chars + # by a factor of 10-40, and so greatly speed the following loop. + str = self.str +- str = str.translate(_tran) ++ str = str.translate(self._tran) + str = str.replace('xxxxxxxx', 'x') + str = str.replace('xxxx', 'x') + str = str.replace('xx', 'x') +diff -r c0e311e010fc Lib/idlelib/PyShell.py +--- a/Lib/idlelib/PyShell.py ++++ b/Lib/idlelib/PyShell.py +@@ -138,6 +138,7 @@ + self.io.set_filename_change_hook(filename_changed_hook) + if self.io.filename: + self.restore_file_breaks() ++ self.color_breakpoint_text() + + rmenu_specs = [ + ("Cut", "<>", "rmenu_check_cut"), +@@ -148,6 +149,15 @@ + ("Clear Breakpoint", "<>", None) + ] + ++ def color_breakpoint_text(self, color=True): ++ "Turn colorizing of breakpoint text on or off" ++ if color: ++ theme = idleConf.GetOption('main','Theme','name') ++ cfg = idleConf.GetHighlight(theme, "break") ++ else: ++ cfg = {'foreground': '', 'background': ''} ++ self.text.tag_config('BREAK', cfg) ++ + def set_breakpoint(self, lineno): + text = self.text + filename = self.io.filename +diff -r c0e311e010fc Lib/idlelib/ReplaceDialog.py +--- a/Lib/idlelib/ReplaceDialog.py ++++ b/Lib/idlelib/ReplaceDialog.py +@@ -40,7 +40,7 @@ + + def create_entries(self): + SearchDialogBase.create_entries(self) +- self.replent = self.make_entry("Replace with:", self.replvar) ++ self.replent = self.make_entry("Replace with:", self.replvar)[0] + + def create_command_buttons(self): + SearchDialogBase.create_command_buttons(self) +@@ -188,3 +188,34 @@ + def close(self, event=None): + SearchDialogBase.close(self, event) + self.text.tag_remove("hit", "1.0", "end") ++ ++def _replace_dialog(parent): ++ root = Tk() ++ root.title("Test ReplaceDialog") ++ width, height, x, y = list(map(int, re.split('[x+]', parent.geometry()))) ++ root.geometry("+%d+%d"%(x, y + 150)) ++ ++ # mock undo delegator methods ++ def undo_block_start(): ++ pass ++ ++ def undo_block_stop(): ++ pass ++ ++ text = Text(root) ++ text.undo_block_start = undo_block_start ++ text.undo_block_stop = undo_block_stop ++ text.pack() ++ text.insert("insert","This is a sample string.\n"*10) ++ ++ def show_replace(): ++ text.tag_add(SEL, "1.0", END) ++ replace(text) ++ text.tag_remove(SEL, "1.0", END) ++ ++ button = Button(root, text="Replace", command=show_replace) ++ button.pack() ++ ++if __name__ == '__main__': ++ from idlelib.idle_test.htest import run ++ run(_replace_dialog) +diff -r c0e311e010fc Lib/idlelib/ScrolledList.py +--- a/Lib/idlelib/ScrolledList.py ++++ b/Lib/idlelib/ScrolledList.py +@@ -119,21 +119,22 @@ + pass + + +-def test(): ++def _scrolled_list(parent): + root = Tk() +- root.protocol("WM_DELETE_WINDOW", root.destroy) ++ root.title("Test ScrolledList") ++ width, height, x, y = list(map(int, re.split('[x+]', parent.geometry()))) ++ root.geometry("+%d+%d"%(x, y + 150)) + class MyScrolledList(ScrolledList): +- def fill_menu(self): self.menu.add_command(label="pass") ++ def fill_menu(self): self.menu.add_command(label="right click") + def on_select(self, index): print("select", self.get(index)) + def on_double(self, index): print("double", self.get(index)) +- s = MyScrolledList(root) ++ ++ scrolled_list = MyScrolledList(root) + for i in range(30): +- s.append("item %02d" % i) +- return root ++ scrolled_list.append("Item %02d" % i) + +-def main(): +- root = test() + root.mainloop() + + if __name__ == '__main__': +- main() ++ from idlelib.idle_test.htest import run ++ run(_scrolled_list) +diff -r c0e311e010fc Lib/idlelib/SearchDialog.py +--- a/Lib/idlelib/SearchDialog.py ++++ b/Lib/idlelib/SearchDialog.py +@@ -65,3 +65,25 @@ + if pat: + self.engine.setcookedpat(pat) + return self.find_again(text) ++ ++def _search_dialog(parent): ++ root = Tk() ++ root.title("Test SearchDialog") ++ width, height, x, y = list(map(int, re.split('[x+]', parent.geometry()))) ++ root.geometry("+%d+%d"%(x, y + 150)) ++ text = Text(root) ++ text.pack() ++ text.insert("insert","This is a sample string.\n"*10) ++ ++ def show_find(): ++ text.tag_add(SEL, "1.0", END) ++ s = _setup(text) ++ s.open(text) ++ text.tag_remove(SEL, "1.0", END) ++ ++ button = Button(root, text="Search", command=show_find) ++ button.pack() ++ ++if __name__ == '__main__': ++ from idlelib.idle_test.htest import run ++ run(_search_dialog) +diff -r c0e311e010fc Lib/idlelib/SearchDialogBase.py +--- a/Lib/idlelib/SearchDialogBase.py ++++ b/Lib/idlelib/SearchDialogBase.py +@@ -1,34 +1,51 @@ + '''Define SearchDialogBase used by Search, Replace, and Grep dialogs.''' +-from tkinter import * ++ ++from tkinter import (Toplevel, Frame, Entry, Label, Button, ++ Checkbutton, Radiobutton) + + class SearchDialogBase: +- '''Create most of a modal search dialog (make_frame, create_widgets). ++ '''Create most of a 3 or 4 row, 3 column search dialog. + +- The wide left column contains: +- 1 or 2 text entry lines (create_entries, make_entry); +- a row of standard radiobuttons (create_option_buttons); +- a row of dialog specific radiobuttons (create_other_buttons). ++ The left and wide middle column contain: ++ 1 or 2 labeled text entry lines (make_entry, create_entries); ++ a row of standard Checkbuttons (make_frame, create_option_buttons), ++ each of which corresponds to a search engine Variable; ++ a row of dialog-specific Check/Radiobuttons (create_other_buttons). + + The narrow right column contains command buttons +- (create_command_buttons, make_button). ++ (make_button, create_command_buttons). + These are bound to functions that execute the command. + +- Except for command buttons, this base class is not limited to +- items common to all three subclasses. Rather, it is the Find dialog +- minus the "Find Next" command and its execution function. +- The other dialogs override methods to replace and add widgets. ++ Except for command buttons, this base class is not limited to items ++ common to all three subclasses. Rather, it is the Find dialog minus ++ the "Find Next" command, its execution function, and the ++ default_command attribute needed in create_widgets. The other ++ dialogs override attributes and methods, the latter to replace and ++ add widgets. + ''' + +- title = "Search Dialog" ++ title = "Search Dialog" # replace in subclasses + icon = "Search" +- needwrapbutton = 1 ++ needwrapbutton = 1 # not in Find in Files + + def __init__(self, root, engine): ++ '''Initialize root, engine, and top attributes. ++ ++ top (level widget): set in create_widgets() called from open(). ++ text (Text searched): set in open(), only used in subclasses(). ++ ent (ry): created in make_entry() called from create_entry(). ++ row (of grid): 0 in create_widgets(), +1 in make_entry/frame(). ++ default_command: set in subclasses, used in create_widgers(). ++ ++ title (of dialog): class attribute, override in subclasses. ++ icon (of dialog): ditto, use unclear if cannot minimize dialog. ++ ''' + self.root = root + self.engine = engine + self.top = None + + def open(self, text, searchphrase=None): ++ "Make dialog visible on top of others and ready to use." + self.text = text + if not self.top: + self.create_widgets() +@@ -44,11 +61,17 @@ + self.top.grab_set() + + def close(self, event=None): ++ "Put dialog away for later use." + if self.top: + self.top.grab_release() + self.top.withdraw() + + def create_widgets(self): ++ '''Create basic 3 row x 3 col search (find) dialog. ++ ++ Other dialogs override subsidiary create_x methods as needed. ++ Replace and Find-in-Files add another entry row. ++ ''' + top = Toplevel(self.root) + top.bind("", self.default_command) + top.bind("", self.close) +@@ -61,29 +84,84 @@ + self.top.grid_columnconfigure(0, pad=2, weight=0) + self.top.grid_columnconfigure(1, pad=2, minsize=100, weight=100) + +- self.create_entries() +- self.create_option_buttons() +- self.create_other_buttons() +- return self.create_command_buttons() ++ self.create_entries() # row 0 (and maybe 1), cols 0, 1 ++ self.create_option_buttons() # next row, cols 0, 1 ++ self.create_other_buttons() # next row, cols 0, 1 ++ self.create_command_buttons() # col 2, all rows + +- def make_entry(self, label, var): +- l = Label(self.top, text=label) +- l.grid(row=self.row, column=0, sticky="nw") +- e = Entry(self.top, textvariable=var, exportselection=0) +- e.grid(row=self.row, column=1, sticky="nwe") ++ def make_entry(self, label_text, var): ++ '''Return (entry, label), . ++ ++ entry - gridded labeled Entry for text entry. ++ label - Label widget, returned for testing. ++ ''' ++ label = Label(self.top, text=label_text) ++ label.grid(row=self.row, column=0, sticky="nw") ++ entry = Entry(self.top, textvariable=var, exportselection=0) ++ entry.grid(row=self.row, column=1, sticky="nwe") + self.row = self.row + 1 +- return e ++ return entry, label ++ ++ def create_entries(self): ++ "Create one or more entry lines with make_entry." ++ self.ent = self.make_entry("Find:", self.engine.patvar)[0] + + def make_frame(self,labeltext=None): ++ '''Return (frame, label). ++ ++ frame - gridded labeled Frame for option or other buttons. ++ label - Label widget, returned for testing. ++ ''' + if labeltext: +- l = Label(self.top, text=labeltext) +- l.grid(row=self.row, column=0, sticky="nw") +- f = Frame(self.top) +- f.grid(row=self.row, column=1, columnspan=1, sticky="nwe") ++ label = Label(self.top, text=labeltext) ++ label.grid(row=self.row, column=0, sticky="nw") ++ else: ++ label = '' ++ frame = Frame(self.top) ++ frame.grid(row=self.row, column=1, columnspan=1, sticky="nwe") + self.row = self.row + 1 +- return f ++ return frame, label ++ ++ def create_option_buttons(self): ++ '''Return (filled frame, options) for testing. ++ ++ Options is a list of SearchEngine booleanvar, label pairs. ++ A gridded frame from make_frame is filled with a Checkbutton ++ for each pair, bound to the var, with the corresponding label. ++ ''' ++ frame = self.make_frame("Options")[0] ++ engine = self.engine ++ options = [(engine.revar, "Regular expression"), ++ (engine.casevar, "Match case"), ++ (engine.wordvar, "Whole word")] ++ if self.needwrapbutton: ++ options.append((engine.wrapvar, "Wrap around")) ++ for var, label in options: ++ btn = Checkbutton(frame, anchor="w", variable=var, text=label) ++ btn.pack(side="left", fill="both") ++ if var.get(): ++ btn.select() ++ return frame, options ++ ++ def create_other_buttons(self): ++ '''Return (frame, others) for testing. ++ ++ Others is a list of value, label pairs. ++ A gridded frame from make_frame is filled with radio buttons. ++ ''' ++ frame = self.make_frame("Direction")[0] ++ var = self.engine.backvar ++ others = [(1, 'Up'), (0, 'Down')] ++ for val, label in others: ++ btn = Radiobutton(frame, anchor="w", ++ variable=var, value=val, text=label) ++ btn.pack(side="left", fill="both") ++ if var.get() == val: ++ btn.select() ++ return frame, others + + def make_button(self, label, command, isdef=0): ++ "Return command button gridded in command frame." + b = Button(self.buttonframe, + text=label, command=command, + default=isdef and "active" or "normal") +@@ -92,66 +170,15 @@ + self.buttonframe.grid(rowspan=rows+1) + return b + +- def create_entries(self): +- self.ent = self.make_entry("Find:", self.engine.patvar) +- +- def create_option_buttons(self): +- f = self.make_frame("Options") +- +- btn = Checkbutton(f, anchor="w", +- variable=self.engine.revar, +- text="Regular expression") +- btn.pack(side="left", fill="both") +- if self.engine.isre(): +- btn.select() +- +- btn = Checkbutton(f, anchor="w", +- variable=self.engine.casevar, +- text="Match case") +- btn.pack(side="left", fill="both") +- if self.engine.iscase(): +- btn.select() +- +- btn = Checkbutton(f, anchor="w", +- variable=self.engine.wordvar, +- text="Whole word") +- btn.pack(side="left", fill="both") +- if self.engine.isword(): +- btn.select() +- +- if self.needwrapbutton: +- btn = Checkbutton(f, anchor="w", +- variable=self.engine.wrapvar, +- text="Wrap around") +- btn.pack(side="left", fill="both") +- if self.engine.iswrap(): +- btn.select() +- +- def create_other_buttons(self): +- f = self.make_frame("Direction") +- +- #lbl = Label(f, text="Direction: ") +- #lbl.pack(side="left") +- +- btn = Radiobutton(f, anchor="w", +- variable=self.engine.backvar, value=1, +- text="Up") +- btn.pack(side="left", fill="both") +- if self.engine.isback(): +- btn.select() +- +- btn = Radiobutton(f, anchor="w", +- variable=self.engine.backvar, value=0, +- text="Down") +- btn.pack(side="left", fill="both") +- if not self.engine.isback(): +- btn.select() +- + def create_command_buttons(self): +- # +- # place button frame on the right ++ "Place buttons in vertical command frame gridded on right." + f = self.buttonframe = Frame(self.top) + f.grid(row=0,column=2,padx=2,pady=2,ipadx=2,ipady=2) + + b = self.make_button("close", self.close) + b.lower() ++ ++if __name__ == '__main__': ++ import unittest ++ unittest.main( ++ 'idlelib.idle_test.test_searchdialogbase', verbosity=2) +diff -r c0e311e010fc Lib/idlelib/SearchEngine.py +--- a/Lib/idlelib/SearchEngine.py ++++ b/Lib/idlelib/SearchEngine.py +@@ -85,7 +85,7 @@ + except re.error as what: + args = what.args + msg = args[0] +- col = arg[1] if len(args) >= 2 else -1 ++ col = args[1] if len(args) >= 2 else -1 + self.report_error(pat, msg, col) + return None + return prog +@@ -229,6 +229,5 @@ + return line, col + + if __name__ == "__main__": +- from test import support; support.use_resources = ['gui'] + import unittest + unittest.main('idlelib.idle_test.test_searchengine', verbosity=2, exit=False) +diff -r c0e311e010fc Lib/idlelib/StackViewer.py +--- a/Lib/idlelib/StackViewer.py ++++ b/Lib/idlelib/StackViewer.py +@@ -1,9 +1,12 @@ + import os + import sys + import linecache ++import re ++import tkinter as tk + + from idlelib.TreeWidget import TreeNode, TreeItem, ScrolledCanvas + from idlelib.ObjectBrowser import ObjectTreeItem, make_objecttreeitem ++from idlelib.PyShell import PyShellFileList + + def StackBrowser(root, flist=None, tb=None, top=None): + if top is None: +@@ -120,3 +123,30 @@ + item = make_objecttreeitem(key + " =", value, setfunction) + sublist.append(item) + return sublist ++ ++def _stack_viewer(parent): ++ root = tk.Tk() ++ root.title("Test StackViewer") ++ width, height, x, y = list(map(int, re.split('[x+]', parent.geometry()))) ++ root.geometry("+%d+%d"%(x, y + 150)) ++ flist = PyShellFileList(root) ++ try: # to obtain a traceback object ++ intentional_name_error ++ except NameError: ++ exc_type, exc_value, exc_tb = sys.exc_info() ++ ++ # inject stack trace to sys ++ sys.last_type = exc_type ++ sys.last_value = exc_value ++ sys.last_traceback = exc_tb ++ ++ StackBrowser(root, flist=flist, top=root, tb=exc_tb) ++ ++ # restore sys to original state ++ del sys.last_type ++ del sys.last_value ++ del sys.last_traceback ++ ++if __name__ == '__main__': ++ from idlelib.idle_test.htest import run ++ run(_stack_viewer) +diff -r c0e311e010fc Lib/idlelib/ToolTip.py +--- a/Lib/idlelib/ToolTip.py ++++ b/Lib/idlelib/ToolTip.py +@@ -76,14 +76,22 @@ + for item in self.items: + listbox.insert(END, item) + +-def main(): +- # Test code ++def _tooltip(parent): + root = Tk() +- b = Button(root, text="Hello", command=root.destroy) +- b.pack() +- root.update() +- tip = ListboxToolTip(b, ["Hello", "world"]) ++ root.title("Test tooltip") ++ width, height, x, y = list(map(int, re.split('[x+]', parent.geometry()))) ++ root.geometry("+%d+%d"%(x, y + 150)) ++ label = Label(root, text="Place your mouse over buttons") ++ label.pack() ++ button1 = Button(root, text="Button 1") ++ button2 = Button(root, text="Button 2") ++ button1.pack() ++ button2.pack() ++ ToolTip(button1, "This is tooltip text for button1.") ++ ListboxToolTip(button2, ["This is","multiple line", ++ "tooltip text","for button2"]) + root.mainloop() + + if __name__ == '__main__': +- main() ++ from idlelib.idle_test.htest import run ++ run(_tooltip) +diff -r c0e311e010fc Lib/idlelib/TreeWidget.py +--- a/Lib/idlelib/TreeWidget.py ++++ b/Lib/idlelib/TreeWidget.py +@@ -448,29 +448,18 @@ + return "break" + + +-# Testing functions +- +-def test(): +- from idlelib import PyShell +- root = Toplevel(PyShell.root) +- root.configure(bd=0, bg="yellow") +- root.focus_set() ++def _tree_widget(parent): ++ root = Tk() ++ root.title("Test TreeWidget") ++ width, height, x, y = list(map(int, re.split('[x+]', parent.geometry()))) ++ root.geometry("+%d+%d"%(x, y + 150)) + sc = ScrolledCanvas(root, bg="white", highlightthickness=0, takefocus=1) +- sc.frame.pack(expand=1, fill="both") +- item = FileTreeItem("C:/windows/desktop") ++ sc.frame.pack(expand=1, fill="both", side=LEFT) ++ item = FileTreeItem(os.getcwd()) + node = TreeNode(sc.canvas, None, item) + node.expand() +- +-def test2(): +- # test w/o scrolling canvas +- root = Tk() +- root.configure(bd=0) +- canvas = Canvas(root, bg="white", highlightthickness=0) +- canvas.pack(expand=1, fill="both") +- item = FileTreeItem(os.curdir) +- node = TreeNode(canvas, None, item) +- node.update() +- canvas.focus_set() ++ root.mainloop() + + if __name__ == '__main__': +- test() ++ from idlelib.idle_test.htest import run ++ run(_tree_widget) +diff -r c0e311e010fc Lib/idlelib/UndoDelegator.py +--- a/Lib/idlelib/UndoDelegator.py ++++ b/Lib/idlelib/UndoDelegator.py +@@ -336,17 +336,30 @@ + self.depth = self.depth + incr + return self.depth + +-def main(): ++def _undo_delegator(parent): + from idlelib.Percolator import Percolator + root = Tk() +- root.wm_protocol("WM_DELETE_WINDOW", root.quit) +- text = Text() ++ root.title("Test UndoDelegator") ++ width, height, x, y = list(map(int, re.split('[x+]', parent.geometry()))) ++ root.geometry("+%d+%d"%(x, y + 150)) ++ ++ text = Text(root) ++ text.config(height=10) + text.pack() + text.focus_set() + p = Percolator(text) + d = UndoDelegator() + p.insertfilter(d) ++ ++ undo = Button(root, text="Undo", command=lambda:d.undo_event(None)) ++ undo.pack(side='left') ++ redo = Button(root, text="Redo", command=lambda:d.redo_event(None)) ++ redo.pack(side='left') ++ dump = Button(root, text="Dump", command=lambda:d.dump_event(None)) ++ dump.pack(side='left') ++ + root.mainloop() + + if __name__ == "__main__": +- main() ++ from idlelib.idle_test.htest import run ++ run(_undo_delegator) +diff -r c0e311e010fc Lib/idlelib/WidgetRedirector.py +--- a/Lib/idlelib/WidgetRedirector.py ++++ b/Lib/idlelib/WidgetRedirector.py +@@ -1,29 +1,40 @@ +-from tkinter import * ++from tkinter import TclError + + class WidgetRedirector: +- + """Support for redirecting arbitrary widget subcommands. + +- Some Tk operations don't normally pass through Tkinter. For example, if a ++ Some Tk operations don't normally pass through tkinter. For example, if a + character is inserted into a Text widget by pressing a key, a default Tk + binding to the widget's 'insert' operation is activated, and the Tk library +- processes the insert without calling back into Tkinter. ++ processes the insert without calling back into tkinter. + +- Although a binding to could be made via Tkinter, what we really want +- to do is to hook the Tk 'insert' operation itself. ++ Although a binding to could be made via tkinter, what we really want ++ to do is to hook the Tk 'insert' operation itself. For one thing, we want ++ a text.insert call in idle code to have the same effect as a key press. + + When a widget is instantiated, a Tcl command is created whose name is the + same as the pathname widget._w. This command is used to invoke the various + widget operations, e.g. insert (for a Text widget). We are going to hook + this command and provide a facility ('register') to intercept the widget +- operation. ++ operation. We will also intercept method calls on the tkinter class ++ instance that represents the tk widget. + +- In IDLE, the function being registered provides access to the top of a +- Percolator chain. At the bottom of the chain is a call to the original +- Tk widget operation. +- ++ In IDLE, WidgetRedirector is used in Percolator to intercept Text ++ commands. The function being registered provides access to the top ++ of a Percolator chain. At the bottom of the chain is a call to the ++ original Tk widget operation. + """ + def __init__(self, widget): ++ '''Initialize attributes and setup redirection. ++ ++ _operations: dict mapping operation name to new function. ++ widget: the widget whose tcl command is to be intercepted. ++ tk: widget.tk, a convenience attribute, probably not needed. ++ orig: new name of the original tcl command. ++ ++ Since renaming to orig fails with TclError when orig already ++ exists, only one WidgetDirector can exist for a given widget. ++ ''' + self._operations = {} + self.widget = widget # widget instance + self.tk = tk = widget.tk # widget's root +@@ -40,27 +51,45 @@ + self.widget._w) + + def close(self): ++ "Unregister operations and revert redirection created by .__init__." + for operation in list(self._operations): + self.unregister(operation) +- widget = self.widget; del self.widget +- orig = self.orig; del self.orig ++ widget = self.widget + tk = widget.tk + w = widget._w ++ # Restore the original widget Tcl command. + tk.deletecommand(w) +- # restore the original widget Tcl command: +- tk.call("rename", orig, w) ++ tk.call("rename", self.orig, w) ++ del self.widget, self.tk # Should not be needed ++ # if instance is deleted after close, as in Percolator. + + def register(self, operation, function): ++ '''Return OriginalCommand(operation) after registering function. ++ ++ Registration adds an operation: function pair to ._operations. ++ It also adds an widget function attribute that masks the tkinter ++ class instance method. Method masking operates independently ++ from command dispatch. ++ ++ If a second function is registered for the same operation, the ++ first function is replaced in both places. ++ ''' + self._operations[operation] = function + setattr(self.widget, operation, function) + return OriginalCommand(self, operation) + + def unregister(self, operation): ++ '''Return the function for the operation, or None. ++ ++ Deleting the instance attribute unmasks the class attribute. ++ ''' + if operation in self._operations: + function = self._operations[operation] + del self._operations[operation] +- if hasattr(self.widget, operation): ++ try: + delattr(self.widget, operation) ++ except AttributeError: ++ pass + return function + else: + return None +@@ -88,14 +117,29 @@ + + + class OriginalCommand: ++ '''Callable for original tk command that has been redirected. ++ ++ Returned by .register; can be used in the function registered. ++ redir = WidgetRedirector(text) ++ def my_insert(*args): ++ print("insert", args) ++ original_insert(*args) ++ original_insert = redir.register("insert", my_insert) ++ ''' + + def __init__(self, redir, operation): ++ '''Create .tk_call and .orig_and_operation for .__call__ method. ++ ++ .redir and .operation store the input args for __repr__. ++ .tk and .orig copy attributes of .redir (probably not needed). ++ ''' + self.redir = redir + self.operation = operation +- self.tk = redir.tk +- self.orig = redir.orig +- self.tk_call = self.tk.call +- self.orig_and_operation = (self.orig, self.operation) ++ self.tk = redir.tk # redundant with self.redir ++ self.orig = redir.orig # redundant with self.redir ++ # These two could be deleted after checking recipient code. ++ self.tk_call = redir.tk.call ++ self.orig_and_operation = (redir.orig, operation) + + def __repr__(self): + return "OriginalCommand(%r, %r)" % (self.redir, self.operation) +@@ -104,23 +148,27 @@ + return self.tk_call(self.orig_and_operation + args) + + +-def main(): ++def _widget_redirector(parent): # htest # ++ from tkinter import Tk, Text ++ import re ++ + root = Tk() +- root.wm_protocol("WM_DELETE_WINDOW", root.quit) +- text = Text() ++ root.title("Test WidgetRedirector") ++ width, height, x, y = list(map(int, re.split('[x+]', parent.geometry()))) ++ root.geometry("+%d+%d"%(x, y + 150)) ++ text = Text(root) + text.pack() + text.focus_set() + redir = WidgetRedirector(text) +- global previous_tcl_fcn + def my_insert(*args): + print("insert", args) +- previous_tcl_fcn(*args) +- previous_tcl_fcn = redir.register("insert", my_insert) ++ original_insert(*args) ++ original_insert = redir.register("insert", my_insert) + root.mainloop() +- redir.unregister("insert") # runs after first 'close window' +- redir.close() +- root.mainloop() +- root.destroy() + + if __name__ == "__main__": +- main() ++ import unittest ++ unittest.main('idlelib.idle_test.test_widgetredir', ++ verbosity=2, exit=False) ++ from idlelib.idle_test.htest import run ++ run(_widget_redirector) +diff -r c0e311e010fc Lib/idlelib/aboutDialog.py +--- a/Lib/idlelib/aboutDialog.py ++++ b/Lib/idlelib/aboutDialog.py +@@ -12,11 +12,16 @@ + """Modal about dialog for idle + + """ +- def __init__(self, parent, title): ++ def __init__(self, parent, title, _htest=False): ++ """ ++ _htest - bool, change box location when running htest ++ """ + Toplevel.__init__(self, parent) + self.configure(borderwidth=5) +- self.geometry("+%d+%d" % (parent.winfo_rootx()+30, +- parent.winfo_rooty()+30)) ++ # place dialog below parent if running htest ++ self.geometry("+%d+%d" % ( ++ parent.winfo_rootx()+30, ++ parent.winfo_rooty()+(30 if not _htest else 100))) + self.bg = "#707070" + self.fg = "#ffffff" + self.CreateWidgets() +diff -r c0e311e010fc Lib/idlelib/config-keys.def +--- a/Lib/idlelib/config-keys.def ++++ b/Lib/idlelib/config-keys.def +@@ -13,37 +13,37 @@ + paste= + beginning-of-line= + center-insert= +-close-all-windows= ++close-all-windows= + close-window= + do-nothing= + end-of-file= + python-docs= + python-context-help= +-history-next= +-history-previous= ++history-next= ++history-previous= + interrupt-execution= + view-restart= + restart-shell= +-open-class-browser= +-open-module= ++open-class-browser= ++open-module= + open-new-window= + open-window-from-file= + plain-newline-and-indent= + print-window= +-redo= ++redo= + remove-selection= +-save-copy-of-window-as-file= +-save-window-as-file= +-save-window= +-select-all= ++save-copy-of-window-as-file= ++save-window-as-file= ++save-window= ++select-all= + toggle-auto-coloring= + undo= + find= +-find-again= ++find-again= + find-in-files= + find-selection= + replace= +-goto-line= ++goto-line= + smart-backspace= + newline-and-indent= + smart-indent= +@@ -53,8 +53,8 @@ + uncomment-region= + tabify-region= + untabify-region= +-toggle-tabs= +-change-indentwidth= ++toggle-tabs= ++change-indentwidth= + del-word-left= + del-word-right= + +diff -r c0e311e010fc Lib/idlelib/configDialog.py +--- a/Lib/idlelib/configDialog.py ++++ b/Lib/idlelib/configDialog.py +@@ -13,7 +13,6 @@ + import tkinter.messagebox as tkMessageBox + import tkinter.colorchooser as tkColorChooser + import tkinter.font as tkFont +-import copy + + from idlelib.configHandler import idleConf + from idlelib.dynOptionMenuWidget import DynOptionMenu +@@ -25,522 +24,571 @@ + + class ConfigDialog(Toplevel): + +- def __init__(self,parent,title): ++ def __init__(self, parent, title, _htest=False, _utest=False): ++ """ ++ _htest - bool, change box location when running htest ++ _utest - bool, don't wait_window when running unittest ++ """ + Toplevel.__init__(self, parent) ++ self.parent = parent ++ if _htest: ++ parent.instance_dict = {} + self.wm_withdraw() + + self.configure(borderwidth=5) + self.title('IDLE Preferences') +- self.geometry("+%d+%d" % (parent.winfo_rootx()+20, +- parent.winfo_rooty()+30)) ++ self.geometry( ++ "+%d+%d" % (parent.winfo_rootx() + 20, ++ parent.winfo_rooty() + (30 if not _htest else 150))) + #Theme Elements. Each theme element key is its display name. + #The first value of the tuple is the sample area tag name. + #The second value is the display name list sort index. +- self.themeElements={'Normal Text':('normal','00'), +- 'Python Keywords':('keyword','01'), +- 'Python Definitions':('definition','02'), ++ self.themeElements={ ++ 'Normal Text':('normal', '00'), ++ 'Python Keywords':('keyword', '01'), ++ 'Python Definitions':('definition', '02'), + 'Python Builtins':('builtin', '03'), +- 'Python Comments':('comment','04'), +- 'Python Strings':('string','05'), +- 'Selected Text':('hilite','06'), +- 'Found Text':('hit','07'), +- 'Cursor':('cursor','08'), +- 'Error Text':('error','09'), +- 'Shell Normal Text':('console','10'), +- 'Shell Stdout Text':('stdout','11'), +- 'Shell Stderr Text':('stderr','12'), ++ 'Python Comments':('comment', '04'), ++ 'Python Strings':('string', '05'), ++ 'Selected Text':('hilite', '06'), ++ 'Found Text':('hit', '07'), ++ 'Cursor':('cursor', '08'), ++ 'Error Text':('error', '09'), ++ 'Shell Normal Text':('console', '10'), ++ 'Shell Stdout Text':('stdout', '11'), ++ 'Shell Stderr Text':('stderr', '12'), + } + self.ResetChangedItems() #load initial values in changed items dict + self.CreateWidgets() +- self.resizable(height=FALSE,width=FALSE) ++ self.resizable(height=FALSE, width=FALSE) + self.transient(parent) + self.grab_set() + self.protocol("WM_DELETE_WINDOW", self.Cancel) +- self.parent = parent + self.tabPages.focus_set() + #key bindings for this dialog +- #self.bind('',self.Cancel) #dismiss dialog, no save +- #self.bind('',self.Apply) #apply changes, save +- #self.bind('',self.Help) #context help ++ #self.bind('', self.Cancel) #dismiss dialog, no save ++ #self.bind('', self.Apply) #apply changes, save ++ #self.bind('', self.Help) #context help + self.LoadConfigs() + self.AttachVarCallbacks() #avoid callbacks during LoadConfigs + +- self.wm_deiconify() +- self.wait_window() ++ if not _utest: ++ self.wm_deiconify() ++ self.wait_window() + + def CreateWidgets(self): + self.tabPages = TabbedPageSet(self, +- page_names=['Fonts/Tabs','Highlighting','Keys','General']) +- frameActionButtons = Frame(self,pady=2) ++ page_names=['Fonts/Tabs', 'Highlighting', 'Keys', 'General']) ++ frameActionButtons = Frame(self, pady=2) + #action buttons +- + if macosxSupport.isAquaTk(): +- # Surpress the padx and pady arguments when +- # running as IDLE.app, otherwise the text +- # on these buttons will not be readable. +- extraKwds={} ++ # Changing the default padding on OSX results in unreadable ++ # text in the buttons ++ paddingArgs = {} + else: +- extraKwds=dict(padx=6, pady=3) ++ paddingArgs = {'padx':6, 'pady':3} + + # Comment out button creation and packing until implement self.Help +-## self.buttonHelp = Button(frameActionButtons,text='Help', +-## command=self.Help,takefocus=FALSE, +-## **extraKwds) +- self.buttonOk = Button(frameActionButtons,text='Ok', +- command=self.Ok,takefocus=FALSE, +- **extraKwds) +- self.buttonApply = Button(frameActionButtons,text='Apply', +- command=self.Apply,takefocus=FALSE, +- **extraKwds) +- self.buttonCancel = Button(frameActionButtons,text='Cancel', +- command=self.Cancel,takefocus=FALSE, +- **extraKwds) ++## self.buttonHelp = Button(frameActionButtons, text='Help', ++## command=self.Help, takefocus=FALSE, ++## **paddingArgs) ++ self.buttonOk = Button( ++ frameActionButtons, text='Ok', ++ command=self.Ok, takefocus=FALSE, **paddingArgs) ++ self.buttonApply = Button( ++ frameActionButtons, text='Apply', ++ command=self.Apply, takefocus=FALSE, **paddingArgs) ++ self.buttonCancel = Button( ++ frameActionButtons, text='Cancel', ++ command=self.Cancel, takefocus=FALSE, **paddingArgs) + self.CreatePageFontTab() + self.CreatePageHighlight() + self.CreatePageKeys() + self.CreatePageGeneral() +-## self.buttonHelp.pack(side=RIGHT,padx=5) +- self.buttonOk.pack(side=LEFT,padx=5) +- self.buttonApply.pack(side=LEFT,padx=5) +- self.buttonCancel.pack(side=LEFT,padx=5) ++## self.buttonHelp.pack(side=RIGHT, padx=5) ++ self.buttonOk.pack(side=LEFT, padx=5) ++ self.buttonApply.pack(side=LEFT, padx=5) ++ self.buttonCancel.pack(side=LEFT, padx=5) + frameActionButtons.pack(side=BOTTOM) + Frame(self, height=2, borderwidth=0).pack(side=BOTTOM) +- self.tabPages.pack(side=TOP,expand=TRUE,fill=BOTH) ++ self.tabPages.pack(side=TOP, expand=TRUE, fill=BOTH) + + def CreatePageFontTab(self): +- #tkVars +- self.fontSize=StringVar(self) +- self.fontBold=BooleanVar(self) +- self.fontName=StringVar(self) +- self.spaceNum=IntVar(self) +- self.editFont=tkFont.Font(self,('courier',10,'normal')) ++ parent = self.parent ++ self.fontSize = StringVar(parent) ++ self.fontBold = BooleanVar(parent) ++ self.fontName = StringVar(parent) ++ self.spaceNum = IntVar(parent) ++ self.editFont = tkFont.Font(parent, ('courier', 10, 'normal')) ++ + ##widget creation + #body frame +- frame=self.tabPages.pages['Fonts/Tabs'].frame ++ frame = self.tabPages.pages['Fonts/Tabs'].frame + #body section frames +- frameFont=LabelFrame(frame,borderwidth=2,relief=GROOVE, +- text=' Base Editor Font ') +- frameIndent=LabelFrame(frame,borderwidth=2,relief=GROOVE, +- text=' Indentation Width ') ++ frameFont = LabelFrame( ++ frame, borderwidth=2, relief=GROOVE, text=' Base Editor Font ') ++ frameIndent = LabelFrame( ++ frame, borderwidth=2, relief=GROOVE, text=' Indentation Width ') + #frameFont +- frameFontName=Frame(frameFont) +- frameFontParam=Frame(frameFont) +- labelFontNameTitle=Label(frameFontName,justify=LEFT, +- text='Font Face :') +- self.listFontName=Listbox(frameFontName,height=5,takefocus=FALSE, +- exportselection=FALSE) +- self.listFontName.bind('',self.OnListFontButtonRelease) +- scrollFont=Scrollbar(frameFontName) ++ frameFontName = Frame(frameFont) ++ frameFontParam = Frame(frameFont) ++ labelFontNameTitle = Label( ++ frameFontName, justify=LEFT, text='Font Face :') ++ self.listFontName = Listbox( ++ frameFontName, height=5, takefocus=FALSE, exportselection=FALSE) ++ self.listFontName.bind( ++ '', self.OnListFontButtonRelease) ++ scrollFont = Scrollbar(frameFontName) + scrollFont.config(command=self.listFontName.yview) + self.listFontName.config(yscrollcommand=scrollFont.set) +- labelFontSizeTitle=Label(frameFontParam,text='Size :') +- self.optMenuFontSize=DynOptionMenu(frameFontParam,self.fontSize,None, +- command=self.SetFontSample) +- checkFontBold=Checkbutton(frameFontParam,variable=self.fontBold, +- onvalue=1,offvalue=0,text='Bold',command=self.SetFontSample) +- frameFontSample=Frame(frameFont,relief=SOLID,borderwidth=1) +- self.labelFontSample=Label(frameFontSample, +- text='AaBbCcDdEe\nFfGgHhIiJjK\n1234567890\n#:+=(){}[]', +- justify=LEFT,font=self.editFont) ++ labelFontSizeTitle = Label(frameFontParam, text='Size :') ++ self.optMenuFontSize = DynOptionMenu( ++ frameFontParam, self.fontSize, None, command=self.SetFontSample) ++ checkFontBold = Checkbutton( ++ frameFontParam, variable=self.fontBold, onvalue=1, ++ offvalue=0, text='Bold', command=self.SetFontSample) ++ frameFontSample = Frame(frameFont, relief=SOLID, borderwidth=1) ++ self.labelFontSample = Label( ++ frameFontSample, justify=LEFT, font=self.editFont, ++ text='AaBbCcDdEe\nFfGgHhIiJjK\n1234567890\n#:+=(){}[]') + #frameIndent +- frameIndentSize=Frame(frameIndent) +- labelSpaceNumTitle=Label(frameIndentSize, justify=LEFT, +- text='Python Standard: 4 Spaces!') +- self.scaleSpaceNum=Scale(frameIndentSize, variable=self.spaceNum, +- orient='horizontal', +- tickinterval=2, from_=2, to=16) ++ frameIndentSize = Frame(frameIndent) ++ labelSpaceNumTitle = Label( ++ frameIndentSize, justify=LEFT, ++ text='Python Standard: 4 Spaces!') ++ self.scaleSpaceNum = Scale( ++ frameIndentSize, variable=self.spaceNum, ++ orient='horizontal', tickinterval=2, from_=2, to=16) ++ + #widget packing + #body +- frameFont.pack(side=LEFT,padx=5,pady=5,expand=TRUE,fill=BOTH) +- frameIndent.pack(side=LEFT,padx=5,pady=5,fill=Y) ++ frameFont.pack(side=LEFT, padx=5, pady=5, expand=TRUE, fill=BOTH) ++ frameIndent.pack(side=LEFT, padx=5, pady=5, fill=Y) + #frameFont +- frameFontName.pack(side=TOP,padx=5,pady=5,fill=X) +- frameFontParam.pack(side=TOP,padx=5,pady=5,fill=X) +- labelFontNameTitle.pack(side=TOP,anchor=W) +- self.listFontName.pack(side=LEFT,expand=TRUE,fill=X) +- scrollFont.pack(side=LEFT,fill=Y) +- labelFontSizeTitle.pack(side=LEFT,anchor=W) +- self.optMenuFontSize.pack(side=LEFT,anchor=W) +- checkFontBold.pack(side=LEFT,anchor=W,padx=20) +- frameFontSample.pack(side=TOP,padx=5,pady=5,expand=TRUE,fill=BOTH) +- self.labelFontSample.pack(expand=TRUE,fill=BOTH) ++ frameFontName.pack(side=TOP, padx=5, pady=5, fill=X) ++ frameFontParam.pack(side=TOP, padx=5, pady=5, fill=X) ++ labelFontNameTitle.pack(side=TOP, anchor=W) ++ self.listFontName.pack(side=LEFT, expand=TRUE, fill=X) ++ scrollFont.pack(side=LEFT, fill=Y) ++ labelFontSizeTitle.pack(side=LEFT, anchor=W) ++ self.optMenuFontSize.pack(side=LEFT, anchor=W) ++ checkFontBold.pack(side=LEFT, anchor=W, padx=20) ++ frameFontSample.pack(side=TOP, padx=5, pady=5, expand=TRUE, fill=BOTH) ++ self.labelFontSample.pack(expand=TRUE, fill=BOTH) + #frameIndent +- frameIndentSize.pack(side=TOP,fill=X) +- labelSpaceNumTitle.pack(side=TOP,anchor=W,padx=5) +- self.scaleSpaceNum.pack(side=TOP,padx=5,fill=X) ++ frameIndentSize.pack(side=TOP, fill=X) ++ labelSpaceNumTitle.pack(side=TOP, anchor=W, padx=5) ++ self.scaleSpaceNum.pack(side=TOP, padx=5, fill=X) + return frame + + def CreatePageHighlight(self): +- self.builtinTheme=StringVar(self) +- self.customTheme=StringVar(self) +- self.fgHilite=BooleanVar(self) +- self.colour=StringVar(self) +- self.fontName=StringVar(self) +- self.themeIsBuiltin=BooleanVar(self) +- self.highlightTarget=StringVar(self) ++ parent = self.parent ++ self.builtinTheme = StringVar(parent) ++ self.customTheme = StringVar(parent) ++ self.fgHilite = BooleanVar(parent) ++ self.colour = StringVar(parent) ++ self.fontName = StringVar(parent) ++ self.themeIsBuiltin = BooleanVar(parent) ++ self.highlightTarget = StringVar(parent) ++ + ##widget creation + #body frame +- frame=self.tabPages.pages['Highlighting'].frame ++ frame = self.tabPages.pages['Highlighting'].frame + #body section frames +- frameCustom=LabelFrame(frame,borderwidth=2,relief=GROOVE, +- text=' Custom Highlighting ') +- frameTheme=LabelFrame(frame,borderwidth=2,relief=GROOVE, +- text=' Highlighting Theme ') ++ frameCustom = LabelFrame(frame, borderwidth=2, relief=GROOVE, ++ text=' Custom Highlighting ') ++ frameTheme = LabelFrame(frame, borderwidth=2, relief=GROOVE, ++ text=' Highlighting Theme ') + #frameCustom +- self.textHighlightSample=Text(frameCustom,relief=SOLID,borderwidth=1, +- font=('courier',12,''),cursor='hand2',width=21,height=11, +- takefocus=FALSE,highlightthickness=0,wrap=NONE) ++ self.textHighlightSample=Text( ++ frameCustom, relief=SOLID, borderwidth=1, ++ font=('courier', 12, ''), cursor='hand2', width=21, height=11, ++ takefocus=FALSE, highlightthickness=0, wrap=NONE) + text=self.textHighlightSample +- text.bind('',lambda e: 'break') +- text.bind('',lambda e: 'break') +- textAndTags=(('#you can click here','comment'),('\n','normal'), +- ('#to choose items','comment'),('\n','normal'),('def','keyword'), +- (' ','normal'),('func','definition'),('(param):','normal'), +- ('\n ','normal'),('"""string"""','string'),('\n var0 = ','normal'), +- ("'string'",'string'),('\n var1 = ','normal'),("'selected'",'hilite'), +- ('\n var2 = ','normal'),("'found'",'hit'), +- ('\n var3 = ','normal'),('list', 'builtin'), ('(','normal'), +- ('None', 'keyword'),(')\n\n','normal'), +- (' error ','error'),(' ','normal'),('cursor |','cursor'), +- ('\n ','normal'),('shell','console'),(' ','normal'),('stdout','stdout'), +- (' ','normal'),('stderr','stderr'),('\n','normal')) ++ text.bind('', lambda e: 'break') ++ text.bind('', lambda e: 'break') ++ textAndTags=( ++ ('#you can click here', 'comment'), ('\n', 'normal'), ++ ('#to choose items', 'comment'), ('\n', 'normal'), ++ ('def', 'keyword'), (' ', 'normal'), ++ ('func', 'definition'), ('(param):\n ', 'normal'), ++ ('"""string"""', 'string'), ('\n var0 = ', 'normal'), ++ ("'string'", 'string'), ('\n var1 = ', 'normal'), ++ ("'selected'", 'hilite'), ('\n var2 = ', 'normal'), ++ ("'found'", 'hit'), ('\n var3 = ', 'normal'), ++ ('list', 'builtin'), ('(', 'normal'), ++ ('None', 'keyword'), (')\n\n', 'normal'), ++ (' error ', 'error'), (' ', 'normal'), ++ ('cursor |', 'cursor'), ('\n ', 'normal'), ++ ('shell', 'console'), (' ', 'normal'), ++ ('stdout', 'stdout'), (' ', 'normal'), ++ ('stderr', 'stderr'), ('\n', 'normal')) + for txTa in textAndTags: +- text.insert(END,txTa[0],txTa[1]) ++ text.insert(END, txTa[0], txTa[1]) + for element in self.themeElements: +- text.tag_bind(self.themeElements[element][0],'', +- lambda event,elem=element: event.widget.winfo_toplevel() +- .highlightTarget.set(elem)) ++ def tem(event, elem=element): ++ event.widget.winfo_toplevel().highlightTarget.set(elem) ++ text.tag_bind( ++ self.themeElements[element][0], '', tem) + text.config(state=DISABLED) +- self.frameColourSet=Frame(frameCustom,relief=SOLID,borderwidth=1) +- frameFgBg=Frame(frameCustom) +- buttonSetColour=Button(self.frameColourSet,text='Choose Colour for :', +- command=self.GetColour,highlightthickness=0) +- self.optMenuHighlightTarget=DynOptionMenu(self.frameColourSet, +- self.highlightTarget,None,highlightthickness=0)#,command=self.SetHighlightTargetBinding +- self.radioFg=Radiobutton(frameFgBg,variable=self.fgHilite, +- value=1,text='Foreground',command=self.SetColourSampleBinding) +- self.radioBg=Radiobutton(frameFgBg,variable=self.fgHilite, +- value=0,text='Background',command=self.SetColourSampleBinding) ++ self.frameColourSet = Frame(frameCustom, relief=SOLID, borderwidth=1) ++ frameFgBg = Frame(frameCustom) ++ buttonSetColour = Button( ++ self.frameColourSet, text='Choose Colour for :', ++ command=self.GetColour, highlightthickness=0) ++ self.optMenuHighlightTarget = DynOptionMenu( ++ self.frameColourSet, self.highlightTarget, None, ++ highlightthickness=0) #, command=self.SetHighlightTargetBinding ++ self.radioFg = Radiobutton( ++ frameFgBg, variable=self.fgHilite, value=1, ++ text='Foreground', command=self.SetColourSampleBinding) ++ self.radioBg=Radiobutton( ++ frameFgBg, variable=self.fgHilite, value=0, ++ text='Background', command=self.SetColourSampleBinding) + self.fgHilite.set(1) +- buttonSaveCustomTheme=Button(frameCustom, +- text='Save as New Custom Theme',command=self.SaveAsNewTheme) ++ buttonSaveCustomTheme = Button( ++ frameCustom, text='Save as New Custom Theme', ++ command=self.SaveAsNewTheme) + #frameTheme +- labelTypeTitle=Label(frameTheme,text='Select : ') +- self.radioThemeBuiltin=Radiobutton(frameTheme,variable=self.themeIsBuiltin, +- value=1,command=self.SetThemeType,text='a Built-in Theme') +- self.radioThemeCustom=Radiobutton(frameTheme,variable=self.themeIsBuiltin, +- value=0,command=self.SetThemeType,text='a Custom Theme') +- self.optMenuThemeBuiltin=DynOptionMenu(frameTheme, +- self.builtinTheme,None,command=None) +- self.optMenuThemeCustom=DynOptionMenu(frameTheme, +- self.customTheme,None,command=None) +- self.buttonDeleteCustomTheme=Button(frameTheme,text='Delete Custom Theme', ++ labelTypeTitle = Label(frameTheme, text='Select : ') ++ self.radioThemeBuiltin = Radiobutton( ++ frameTheme, variable=self.themeIsBuiltin, value=1, ++ command=self.SetThemeType, text='a Built-in Theme') ++ self.radioThemeCustom = Radiobutton( ++ frameTheme, variable=self.themeIsBuiltin, value=0, ++ command=self.SetThemeType, text='a Custom Theme') ++ self.optMenuThemeBuiltin = DynOptionMenu( ++ frameTheme, self.builtinTheme, None, command=None) ++ self.optMenuThemeCustom=DynOptionMenu( ++ frameTheme, self.customTheme, None, command=None) ++ self.buttonDeleteCustomTheme=Button( ++ frameTheme, text='Delete Custom Theme', + command=self.DeleteCustomTheme) ++ + ##widget packing + #body +- frameCustom.pack(side=LEFT,padx=5,pady=5,expand=TRUE,fill=BOTH) +- frameTheme.pack(side=LEFT,padx=5,pady=5,fill=Y) ++ frameCustom.pack(side=LEFT, padx=5, pady=5, expand=TRUE, fill=BOTH) ++ frameTheme.pack(side=LEFT, padx=5, pady=5, fill=Y) + #frameCustom +- self.frameColourSet.pack(side=TOP,padx=5,pady=5,expand=TRUE,fill=X) +- frameFgBg.pack(side=TOP,padx=5,pady=0) +- self.textHighlightSample.pack(side=TOP,padx=5,pady=5,expand=TRUE, +- fill=BOTH) +- buttonSetColour.pack(side=TOP,expand=TRUE,fill=X,padx=8,pady=4) +- self.optMenuHighlightTarget.pack(side=TOP,expand=TRUE,fill=X,padx=8,pady=3) +- self.radioFg.pack(side=LEFT,anchor=E) +- self.radioBg.pack(side=RIGHT,anchor=W) +- buttonSaveCustomTheme.pack(side=BOTTOM,fill=X,padx=5,pady=5) ++ self.frameColourSet.pack(side=TOP, padx=5, pady=5, expand=TRUE, fill=X) ++ frameFgBg.pack(side=TOP, padx=5, pady=0) ++ self.textHighlightSample.pack( ++ side=TOP, padx=5, pady=5, expand=TRUE, fill=BOTH) ++ buttonSetColour.pack(side=TOP, expand=TRUE, fill=X, padx=8, pady=4) ++ self.optMenuHighlightTarget.pack( ++ side=TOP, expand=TRUE, fill=X, padx=8, pady=3) ++ self.radioFg.pack(side=LEFT, anchor=E) ++ self.radioBg.pack(side=RIGHT, anchor=W) ++ buttonSaveCustomTheme.pack(side=BOTTOM, fill=X, padx=5, pady=5) + #frameTheme +- labelTypeTitle.pack(side=TOP,anchor=W,padx=5,pady=5) +- self.radioThemeBuiltin.pack(side=TOP,anchor=W,padx=5) +- self.radioThemeCustom.pack(side=TOP,anchor=W,padx=5,pady=2) +- self.optMenuThemeBuiltin.pack(side=TOP,fill=X,padx=5,pady=5) +- self.optMenuThemeCustom.pack(side=TOP,fill=X,anchor=W,padx=5,pady=5) +- self.buttonDeleteCustomTheme.pack(side=TOP,fill=X,padx=5,pady=5) ++ labelTypeTitle.pack(side=TOP, anchor=W, padx=5, pady=5) ++ self.radioThemeBuiltin.pack(side=TOP, anchor=W, padx=5) ++ self.radioThemeCustom.pack(side=TOP, anchor=W, padx=5, pady=2) ++ self.optMenuThemeBuiltin.pack(side=TOP, fill=X, padx=5, pady=5) ++ self.optMenuThemeCustom.pack(side=TOP, fill=X, anchor=W, padx=5, pady=5) ++ self.buttonDeleteCustomTheme.pack(side=TOP, fill=X, padx=5, pady=5) + return frame + + def CreatePageKeys(self): +- #tkVars +- self.bindingTarget=StringVar(self) +- self.builtinKeys=StringVar(self) +- self.customKeys=StringVar(self) +- self.keysAreBuiltin=BooleanVar(self) +- self.keyBinding=StringVar(self) ++ parent = self.parent ++ self.bindingTarget = StringVar(parent) ++ self.builtinKeys = StringVar(parent) ++ self.customKeys = StringVar(parent) ++ self.keysAreBuiltin = BooleanVar(parent) ++ self.keyBinding = StringVar(parent) ++ + ##widget creation + #body frame +- frame=self.tabPages.pages['Keys'].frame ++ frame = self.tabPages.pages['Keys'].frame + #body section frames +- frameCustom=LabelFrame(frame,borderwidth=2,relief=GROOVE, +- text=' Custom Key Bindings ') +- frameKeySets=LabelFrame(frame,borderwidth=2,relief=GROOVE, +- text=' Key Set ') ++ frameCustom = LabelFrame( ++ frame, borderwidth=2, relief=GROOVE, ++ text=' Custom Key Bindings ') ++ frameKeySets = LabelFrame( ++ frame, borderwidth=2, relief=GROOVE, text=' Key Set ') + #frameCustom +- frameTarget=Frame(frameCustom) +- labelTargetTitle=Label(frameTarget,text='Action - Key(s)') +- scrollTargetY=Scrollbar(frameTarget) +- scrollTargetX=Scrollbar(frameTarget,orient=HORIZONTAL) +- self.listBindings=Listbox(frameTarget,takefocus=FALSE, +- exportselection=FALSE) +- self.listBindings.bind('',self.KeyBindingSelected) ++ frameTarget = Frame(frameCustom) ++ labelTargetTitle = Label(frameTarget, text='Action - Key(s)') ++ scrollTargetY = Scrollbar(frameTarget) ++ scrollTargetX = Scrollbar(frameTarget, orient=HORIZONTAL) ++ self.listBindings = Listbox( ++ frameTarget, takefocus=FALSE, exportselection=FALSE) ++ self.listBindings.bind('', self.KeyBindingSelected) + scrollTargetY.config(command=self.listBindings.yview) + scrollTargetX.config(command=self.listBindings.xview) + self.listBindings.config(yscrollcommand=scrollTargetY.set) + self.listBindings.config(xscrollcommand=scrollTargetX.set) +- self.buttonNewKeys=Button(frameCustom,text='Get New Keys for Selection', +- command=self.GetNewKeys,state=DISABLED) ++ self.buttonNewKeys = Button( ++ frameCustom, text='Get New Keys for Selection', ++ command=self.GetNewKeys, state=DISABLED) + #frameKeySets + frames = [Frame(frameKeySets, padx=2, pady=2, borderwidth=0) + for i in range(2)] +- self.radioKeysBuiltin=Radiobutton(frames[0],variable=self.keysAreBuiltin, +- value=1,command=self.SetKeysType,text='Use a Built-in Key Set') +- self.radioKeysCustom=Radiobutton(frames[0],variable=self.keysAreBuiltin, +- value=0,command=self.SetKeysType,text='Use a Custom Key Set') +- self.optMenuKeysBuiltin=DynOptionMenu(frames[0], +- self.builtinKeys,None,command=None) +- self.optMenuKeysCustom=DynOptionMenu(frames[0], +- self.customKeys,None,command=None) +- self.buttonDeleteCustomKeys=Button(frames[1],text='Delete Custom Key Set', ++ self.radioKeysBuiltin = Radiobutton( ++ frames[0], variable=self.keysAreBuiltin, value=1, ++ command=self.SetKeysType, text='Use a Built-in Key Set') ++ self.radioKeysCustom = Radiobutton( ++ frames[0], variable=self.keysAreBuiltin, value=0, ++ command=self.SetKeysType, text='Use a Custom Key Set') ++ self.optMenuKeysBuiltin = DynOptionMenu( ++ frames[0], self.builtinKeys, None, command=None) ++ self.optMenuKeysCustom = DynOptionMenu( ++ frames[0], self.customKeys, None, command=None) ++ self.buttonDeleteCustomKeys = Button( ++ frames[1], text='Delete Custom Key Set', + command=self.DeleteCustomKeys) +- buttonSaveCustomKeys=Button(frames[1], +- text='Save as New Custom Key Set',command=self.SaveAsNewKeySet) ++ buttonSaveCustomKeys = Button( ++ frames[1], text='Save as New Custom Key Set', ++ command=self.SaveAsNewKeySet) ++ + ##widget packing + #body +- frameCustom.pack(side=BOTTOM,padx=5,pady=5,expand=TRUE,fill=BOTH) +- frameKeySets.pack(side=BOTTOM,padx=5,pady=5,fill=BOTH) ++ frameCustom.pack(side=BOTTOM, padx=5, pady=5, expand=TRUE, fill=BOTH) ++ frameKeySets.pack(side=BOTTOM, padx=5, pady=5, fill=BOTH) + #frameCustom +- self.buttonNewKeys.pack(side=BOTTOM,fill=X,padx=5,pady=5) +- frameTarget.pack(side=LEFT,padx=5,pady=5,expand=TRUE,fill=BOTH) ++ self.buttonNewKeys.pack(side=BOTTOM, fill=X, padx=5, pady=5) ++ frameTarget.pack(side=LEFT, padx=5, pady=5, expand=TRUE, fill=BOTH) + #frame target +- frameTarget.columnconfigure(0,weight=1) +- frameTarget.rowconfigure(1,weight=1) +- labelTargetTitle.grid(row=0,column=0,columnspan=2,sticky=W) +- self.listBindings.grid(row=1,column=0,sticky=NSEW) +- scrollTargetY.grid(row=1,column=1,sticky=NS) +- scrollTargetX.grid(row=2,column=0,sticky=EW) ++ frameTarget.columnconfigure(0, weight=1) ++ frameTarget.rowconfigure(1, weight=1) ++ labelTargetTitle.grid(row=0, column=0, columnspan=2, sticky=W) ++ self.listBindings.grid(row=1, column=0, sticky=NSEW) ++ scrollTargetY.grid(row=1, column=1, sticky=NS) ++ scrollTargetX.grid(row=2, column=0, sticky=EW) + #frameKeySets + self.radioKeysBuiltin.grid(row=0, column=0, sticky=W+NS) + self.radioKeysCustom.grid(row=1, column=0, sticky=W+NS) + self.optMenuKeysBuiltin.grid(row=0, column=1, sticky=NSEW) + self.optMenuKeysCustom.grid(row=1, column=1, sticky=NSEW) +- self.buttonDeleteCustomKeys.pack(side=LEFT,fill=X,expand=True,padx=2) +- buttonSaveCustomKeys.pack(side=LEFT,fill=X,expand=True,padx=2) ++ self.buttonDeleteCustomKeys.pack(side=LEFT, fill=X, expand=True, padx=2) ++ buttonSaveCustomKeys.pack(side=LEFT, fill=X, expand=True, padx=2) + frames[0].pack(side=TOP, fill=BOTH, expand=True) + frames[1].pack(side=TOP, fill=X, expand=True, pady=2) + return frame + + def CreatePageGeneral(self): +- #tkVars +- self.winWidth=StringVar(self) +- self.winHeight=StringVar(self) +- self.paraWidth=StringVar(self) +- self.startupEdit=IntVar(self) +- self.autoSave=IntVar(self) +- self.encoding=StringVar(self) +- self.userHelpBrowser=BooleanVar(self) +- self.helpBrowser=StringVar(self) ++ parent = self.parent ++ self.winWidth = StringVar(parent) ++ self.winHeight = StringVar(parent) ++ self.paraWidth = StringVar(parent) ++ self.startupEdit = IntVar(parent) ++ self.autoSave = IntVar(parent) ++ self.encoding = StringVar(parent) ++ self.userHelpBrowser = BooleanVar(parent) ++ self.helpBrowser = StringVar(parent) ++ + #widget creation + #body +- frame=self.tabPages.pages['General'].frame ++ frame = self.tabPages.pages['General'].frame + #body section frames +- frameRun=LabelFrame(frame,borderwidth=2,relief=GROOVE, +- text=' Startup Preferences ') +- frameSave=LabelFrame(frame,borderwidth=2,relief=GROOVE, +- text=' Autosave Preferences ') +- frameWinSize=Frame(frame,borderwidth=2,relief=GROOVE) +- frameParaSize=Frame(frame,borderwidth=2,relief=GROOVE) +- frameHelp=LabelFrame(frame,borderwidth=2,relief=GROOVE, +- text=' Additional Help Sources ') ++ frameRun = LabelFrame(frame, borderwidth=2, relief=GROOVE, ++ text=' Startup Preferences ') ++ frameSave = LabelFrame(frame, borderwidth=2, relief=GROOVE, ++ text=' Autosave Preferences ') ++ frameWinSize = Frame(frame, borderwidth=2, relief=GROOVE) ++ frameParaSize = Frame(frame, borderwidth=2, relief=GROOVE) ++ frameHelp = LabelFrame(frame, borderwidth=2, relief=GROOVE, ++ text=' Additional Help Sources ') + #frameRun +- labelRunChoiceTitle=Label(frameRun,text='At Startup') +- radioStartupEdit=Radiobutton(frameRun,variable=self.startupEdit, +- value=1,command=self.SetKeysType,text="Open Edit Window") +- radioStartupShell=Radiobutton(frameRun,variable=self.startupEdit, +- value=0,command=self.SetKeysType,text='Open Shell Window') ++ labelRunChoiceTitle = Label(frameRun, text='At Startup') ++ radioStartupEdit = Radiobutton( ++ frameRun, variable=self.startupEdit, value=1, ++ command=self.SetKeysType, text="Open Edit Window") ++ radioStartupShell = Radiobutton( ++ frameRun, variable=self.startupEdit, value=0, ++ command=self.SetKeysType, text='Open Shell Window') + #frameSave +- labelRunSaveTitle=Label(frameSave,text='At Start of Run (F5) ') +- radioSaveAsk=Radiobutton(frameSave,variable=self.autoSave, +- value=0,command=self.SetKeysType,text="Prompt to Save") +- radioSaveAuto=Radiobutton(frameSave,variable=self.autoSave, +- value=1,command=self.SetKeysType,text='No Prompt') ++ labelRunSaveTitle = Label(frameSave, text='At Start of Run (F5) ') ++ radioSaveAsk = Radiobutton( ++ frameSave, variable=self.autoSave, value=0, ++ command=self.SetKeysType, text="Prompt to Save") ++ radioSaveAuto = Radiobutton( ++ frameSave, variable=self.autoSave, value=1, ++ command=self.SetKeysType, text='No Prompt') + #frameWinSize +- labelWinSizeTitle=Label(frameWinSize,text='Initial Window Size'+ +- ' (in characters)') +- labelWinWidthTitle=Label(frameWinSize,text='Width') +- entryWinWidth=Entry(frameWinSize,textvariable=self.winWidth, +- width=3) +- labelWinHeightTitle=Label(frameWinSize,text='Height') +- entryWinHeight=Entry(frameWinSize,textvariable=self.winHeight, +- width=3) ++ labelWinSizeTitle = Label( ++ frameWinSize, text='Initial Window Size (in characters)') ++ labelWinWidthTitle = Label(frameWinSize, text='Width') ++ entryWinWidth = Entry( ++ frameWinSize, textvariable=self.winWidth, width=3) ++ labelWinHeightTitle = Label(frameWinSize, text='Height') ++ entryWinHeight = Entry( ++ frameWinSize, textvariable=self.winHeight, width=3) + #paragraphFormatWidth +- labelParaWidthTitle=Label(frameParaSize,text='Paragraph reformat'+ +- ' width (in characters)') +- entryParaWidth=Entry(frameParaSize,textvariable=self.paraWidth, +- width=3) ++ labelParaWidthTitle = Label( ++ frameParaSize, text='Paragraph reformat width (in characters)') ++ entryParaWidth = Entry( ++ frameParaSize, textvariable=self.paraWidth, width=3) + #frameHelp +- frameHelpList=Frame(frameHelp) +- frameHelpListButtons=Frame(frameHelpList) +- scrollHelpList=Scrollbar(frameHelpList) +- self.listHelp=Listbox(frameHelpList,height=5,takefocus=FALSE, ++ frameHelpList = Frame(frameHelp) ++ frameHelpListButtons = Frame(frameHelpList) ++ scrollHelpList = Scrollbar(frameHelpList) ++ self.listHelp = Listbox( ++ frameHelpList, height=5, takefocus=FALSE, + exportselection=FALSE) + scrollHelpList.config(command=self.listHelp.yview) + self.listHelp.config(yscrollcommand=scrollHelpList.set) +- self.listHelp.bind('',self.HelpSourceSelected) +- self.buttonHelpListEdit=Button(frameHelpListButtons,text='Edit', +- state=DISABLED,width=8,command=self.HelpListItemEdit) +- self.buttonHelpListAdd=Button(frameHelpListButtons,text='Add', +- width=8,command=self.HelpListItemAdd) +- self.buttonHelpListRemove=Button(frameHelpListButtons,text='Remove', +- state=DISABLED,width=8,command=self.HelpListItemRemove) ++ self.listHelp.bind('', self.HelpSourceSelected) ++ self.buttonHelpListEdit = Button( ++ frameHelpListButtons, text='Edit', state=DISABLED, ++ width=8, command=self.HelpListItemEdit) ++ self.buttonHelpListAdd = Button( ++ frameHelpListButtons, text='Add', ++ width=8, command=self.HelpListItemAdd) ++ self.buttonHelpListRemove = Button( ++ frameHelpListButtons, text='Remove', state=DISABLED, ++ width=8, command=self.HelpListItemRemove) ++ + #widget packing + #body +- frameRun.pack(side=TOP,padx=5,pady=5,fill=X) +- frameSave.pack(side=TOP,padx=5,pady=5,fill=X) +- frameWinSize.pack(side=TOP,padx=5,pady=5,fill=X) +- frameParaSize.pack(side=TOP,padx=5,pady=5,fill=X) +- frameHelp.pack(side=TOP,padx=5,pady=5,expand=TRUE,fill=BOTH) ++ frameRun.pack(side=TOP, padx=5, pady=5, fill=X) ++ frameSave.pack(side=TOP, padx=5, pady=5, fill=X) ++ frameWinSize.pack(side=TOP, padx=5, pady=5, fill=X) ++ frameParaSize.pack(side=TOP, padx=5, pady=5, fill=X) ++ frameHelp.pack(side=TOP, padx=5, pady=5, expand=TRUE, fill=BOTH) + #frameRun +- labelRunChoiceTitle.pack(side=LEFT,anchor=W,padx=5,pady=5) +- radioStartupShell.pack(side=RIGHT,anchor=W,padx=5,pady=5) +- radioStartupEdit.pack(side=RIGHT,anchor=W,padx=5,pady=5) ++ labelRunChoiceTitle.pack(side=LEFT, anchor=W, padx=5, pady=5) ++ radioStartupShell.pack(side=RIGHT, anchor=W, padx=5, pady=5) ++ radioStartupEdit.pack(side=RIGHT, anchor=W, padx=5, pady=5) + #frameSave +- labelRunSaveTitle.pack(side=LEFT,anchor=W,padx=5,pady=5) +- radioSaveAuto.pack(side=RIGHT,anchor=W,padx=5,pady=5) +- radioSaveAsk.pack(side=RIGHT,anchor=W,padx=5,pady=5) ++ labelRunSaveTitle.pack(side=LEFT, anchor=W, padx=5, pady=5) ++ radioSaveAuto.pack(side=RIGHT, anchor=W, padx=5, pady=5) ++ radioSaveAsk.pack(side=RIGHT, anchor=W, padx=5, pady=5) + #frameWinSize +- labelWinSizeTitle.pack(side=LEFT,anchor=W,padx=5,pady=5) +- entryWinHeight.pack(side=RIGHT,anchor=E,padx=10,pady=5) +- labelWinHeightTitle.pack(side=RIGHT,anchor=E,pady=5) +- entryWinWidth.pack(side=RIGHT,anchor=E,padx=10,pady=5) +- labelWinWidthTitle.pack(side=RIGHT,anchor=E,pady=5) ++ labelWinSizeTitle.pack(side=LEFT, anchor=W, padx=5, pady=5) ++ entryWinHeight.pack(side=RIGHT, anchor=E, padx=10, pady=5) ++ labelWinHeightTitle.pack(side=RIGHT, anchor=E, pady=5) ++ entryWinWidth.pack(side=RIGHT, anchor=E, padx=10, pady=5) ++ labelWinWidthTitle.pack(side=RIGHT, anchor=E, pady=5) + #paragraphFormatWidth +- labelParaWidthTitle.pack(side=LEFT,anchor=W,padx=5,pady=5) +- entryParaWidth.pack(side=RIGHT,anchor=E,padx=10,pady=5) ++ labelParaWidthTitle.pack(side=LEFT, anchor=W, padx=5, pady=5) ++ entryParaWidth.pack(side=RIGHT, anchor=E, padx=10, pady=5) + #frameHelp +- frameHelpListButtons.pack(side=RIGHT,padx=5,pady=5,fill=Y) +- frameHelpList.pack(side=TOP,padx=5,pady=5,expand=TRUE,fill=BOTH) +- scrollHelpList.pack(side=RIGHT,anchor=W,fill=Y) +- self.listHelp.pack(side=LEFT,anchor=E,expand=TRUE,fill=BOTH) +- self.buttonHelpListEdit.pack(side=TOP,anchor=W,pady=5) +- self.buttonHelpListAdd.pack(side=TOP,anchor=W) +- self.buttonHelpListRemove.pack(side=TOP,anchor=W,pady=5) ++ frameHelpListButtons.pack(side=RIGHT, padx=5, pady=5, fill=Y) ++ frameHelpList.pack(side=TOP, padx=5, pady=5, expand=TRUE, fill=BOTH) ++ scrollHelpList.pack(side=RIGHT, anchor=W, fill=Y) ++ self.listHelp.pack(side=LEFT, anchor=E, expand=TRUE, fill=BOTH) ++ self.buttonHelpListEdit.pack(side=TOP, anchor=W, pady=5) ++ self.buttonHelpListAdd.pack(side=TOP, anchor=W) ++ self.buttonHelpListRemove.pack(side=TOP, anchor=W, pady=5) + return frame + + def AttachVarCallbacks(self): +- self.fontSize.trace_variable('w',self.VarChanged_fontSize) +- self.fontName.trace_variable('w',self.VarChanged_fontName) +- self.fontBold.trace_variable('w',self.VarChanged_fontBold) +- self.spaceNum.trace_variable('w',self.VarChanged_spaceNum) +- self.colour.trace_variable('w',self.VarChanged_colour) +- self.builtinTheme.trace_variable('w',self.VarChanged_builtinTheme) +- self.customTheme.trace_variable('w',self.VarChanged_customTheme) +- self.themeIsBuiltin.trace_variable('w',self.VarChanged_themeIsBuiltin) +- self.highlightTarget.trace_variable('w',self.VarChanged_highlightTarget) +- self.keyBinding.trace_variable('w',self.VarChanged_keyBinding) +- self.builtinKeys.trace_variable('w',self.VarChanged_builtinKeys) +- self.customKeys.trace_variable('w',self.VarChanged_customKeys) +- self.keysAreBuiltin.trace_variable('w',self.VarChanged_keysAreBuiltin) +- self.winWidth.trace_variable('w',self.VarChanged_winWidth) +- self.winHeight.trace_variable('w',self.VarChanged_winHeight) +- self.paraWidth.trace_variable('w',self.VarChanged_paraWidth) +- self.startupEdit.trace_variable('w',self.VarChanged_startupEdit) +- self.autoSave.trace_variable('w',self.VarChanged_autoSave) +- self.encoding.trace_variable('w',self.VarChanged_encoding) ++ self.fontSize.trace_variable('w', self.VarChanged_fontSize) ++ self.fontName.trace_variable('w', self.VarChanged_fontName) ++ self.fontBold.trace_variable('w', self.VarChanged_fontBold) ++ self.spaceNum.trace_variable('w', self.VarChanged_spaceNum) ++ self.colour.trace_variable('w', self.VarChanged_colour) ++ self.builtinTheme.trace_variable('w', self.VarChanged_builtinTheme) ++ self.customTheme.trace_variable('w', self.VarChanged_customTheme) ++ self.themeIsBuiltin.trace_variable('w', self.VarChanged_themeIsBuiltin) ++ self.highlightTarget.trace_variable('w', self.VarChanged_highlightTarget) ++ self.keyBinding.trace_variable('w', self.VarChanged_keyBinding) ++ self.builtinKeys.trace_variable('w', self.VarChanged_builtinKeys) ++ self.customKeys.trace_variable('w', self.VarChanged_customKeys) ++ self.keysAreBuiltin.trace_variable('w', self.VarChanged_keysAreBuiltin) ++ self.winWidth.trace_variable('w', self.VarChanged_winWidth) ++ self.winHeight.trace_variable('w', self.VarChanged_winHeight) ++ self.paraWidth.trace_variable('w', self.VarChanged_paraWidth) ++ self.startupEdit.trace_variable('w', self.VarChanged_startupEdit) ++ self.autoSave.trace_variable('w', self.VarChanged_autoSave) ++ self.encoding.trace_variable('w', self.VarChanged_encoding) + +- def VarChanged_fontSize(self,*params): +- value=self.fontSize.get() +- self.AddChangedItem('main','EditorWindow','font-size',value) ++ def VarChanged_fontSize(self, *params): ++ value = self.fontSize.get() ++ self.AddChangedItem('main', 'EditorWindow', 'font-size', value) + +- def VarChanged_fontName(self,*params): +- value=self.fontName.get() +- self.AddChangedItem('main','EditorWindow','font',value) ++ def VarChanged_fontName(self, *params): ++ value = self.fontName.get() ++ self.AddChangedItem('main', 'EditorWindow', 'font', value) + +- def VarChanged_fontBold(self,*params): +- value=self.fontBold.get() +- self.AddChangedItem('main','EditorWindow','font-bold',value) ++ def VarChanged_fontBold(self, *params): ++ value = self.fontBold.get() ++ self.AddChangedItem('main', 'EditorWindow', 'font-bold', value) + +- def VarChanged_spaceNum(self,*params): +- value=self.spaceNum.get() +- self.AddChangedItem('main','Indent','num-spaces',value) ++ def VarChanged_spaceNum(self, *params): ++ value = self.spaceNum.get() ++ self.AddChangedItem('main', 'Indent', 'num-spaces', value) + +- def VarChanged_colour(self,*params): ++ def VarChanged_colour(self, *params): + self.OnNewColourSet() + +- def VarChanged_builtinTheme(self,*params): +- value=self.builtinTheme.get() +- self.AddChangedItem('main','Theme','name',value) ++ def VarChanged_builtinTheme(self, *params): ++ value = self.builtinTheme.get() ++ self.AddChangedItem('main', 'Theme', 'name', value) + self.PaintThemeSample() + +- def VarChanged_customTheme(self,*params): +- value=self.customTheme.get() ++ def VarChanged_customTheme(self, *params): ++ value = self.customTheme.get() + if value != '- no custom themes -': +- self.AddChangedItem('main','Theme','name',value) ++ self.AddChangedItem('main', 'Theme', 'name', value) + self.PaintThemeSample() + +- def VarChanged_themeIsBuiltin(self,*params): +- value=self.themeIsBuiltin.get() +- self.AddChangedItem('main','Theme','default',value) ++ def VarChanged_themeIsBuiltin(self, *params): ++ value = self.themeIsBuiltin.get() ++ self.AddChangedItem('main', 'Theme', 'default', value) + if value: + self.VarChanged_builtinTheme() + else: + self.VarChanged_customTheme() + +- def VarChanged_highlightTarget(self,*params): ++ def VarChanged_highlightTarget(self, *params): + self.SetHighlightTarget() + +- def VarChanged_keyBinding(self,*params): +- value=self.keyBinding.get() +- keySet=self.customKeys.get() +- event=self.listBindings.get(ANCHOR).split()[0] ++ def VarChanged_keyBinding(self, *params): ++ value = self.keyBinding.get() ++ keySet = self.customKeys.get() ++ event = self.listBindings.get(ANCHOR).split()[0] + if idleConf.IsCoreBinding(event): + #this is a core keybinding +- self.AddChangedItem('keys',keySet,event,value) ++ self.AddChangedItem('keys', keySet, event, value) + else: #this is an extension key binding +- extName=idleConf.GetExtnNameForEvent(event) +- extKeybindSection=extName+'_cfgBindings' +- self.AddChangedItem('extensions',extKeybindSection,event,value) ++ extName = idleConf.GetExtnNameForEvent(event) ++ extKeybindSection = extName + '_cfgBindings' ++ self.AddChangedItem('extensions', extKeybindSection, event, value) + +- def VarChanged_builtinKeys(self,*params): +- value=self.builtinKeys.get() +- self.AddChangedItem('main','Keys','name',value) ++ def VarChanged_builtinKeys(self, *params): ++ value = self.builtinKeys.get() ++ self.AddChangedItem('main', 'Keys', 'name', value) + self.LoadKeysList(value) + +- def VarChanged_customKeys(self,*params): +- value=self.customKeys.get() ++ def VarChanged_customKeys(self, *params): ++ value = self.customKeys.get() + if value != '- no custom keys -': +- self.AddChangedItem('main','Keys','name',value) ++ self.AddChangedItem('main', 'Keys', 'name', value) + self.LoadKeysList(value) + +- def VarChanged_keysAreBuiltin(self,*params): +- value=self.keysAreBuiltin.get() +- self.AddChangedItem('main','Keys','default',value) ++ def VarChanged_keysAreBuiltin(self, *params): ++ value = self.keysAreBuiltin.get() ++ self.AddChangedItem('main', 'Keys', 'default', value) + if value: + self.VarChanged_builtinKeys() + else: + self.VarChanged_customKeys() + +- def VarChanged_winWidth(self,*params): +- value=self.winWidth.get() +- self.AddChangedItem('main','EditorWindow','width',value) ++ def VarChanged_winWidth(self, *params): ++ value = self.winWidth.get() ++ self.AddChangedItem('main', 'EditorWindow', 'width', value) + +- def VarChanged_winHeight(self,*params): +- value=self.winHeight.get() +- self.AddChangedItem('main','EditorWindow','height',value) ++ def VarChanged_winHeight(self, *params): ++ value = self.winHeight.get() ++ self.AddChangedItem('main', 'EditorWindow', 'height', value) + +- def VarChanged_paraWidth(self,*params): +- value=self.paraWidth.get() +- self.AddChangedItem('main','FormatParagraph','paragraph',value) ++ def VarChanged_paraWidth(self, *params): ++ value = self.paraWidth.get() ++ self.AddChangedItem('main', 'FormatParagraph', 'paragraph', value) + +- def VarChanged_startupEdit(self,*params): +- value=self.startupEdit.get() +- self.AddChangedItem('main','General','editor-on-startup',value) ++ def VarChanged_startupEdit(self, *params): ++ value = self.startupEdit.get() ++ self.AddChangedItem('main', 'General', 'editor-on-startup', value) + +- def VarChanged_autoSave(self,*params): +- value=self.autoSave.get() +- self.AddChangedItem('main','General','autosave',value) ++ def VarChanged_autoSave(self, *params): ++ value = self.autoSave.get() ++ self.AddChangedItem('main', 'General', 'autosave', value) + +- def VarChanged_encoding(self,*params): +- value=self.encoding.get() +- self.AddChangedItem('main','EditorWindow','encoding',value) ++ def VarChanged_encoding(self, *params): ++ value = self.encoding.get() ++ self.AddChangedItem('main', 'EditorWindow', 'encoding', value) + + def ResetChangedItems(self): + #When any config item is changed in this dialog, an entry +@@ -548,24 +596,25 @@ + #dictionary. The key should be the config file section name and the + #value a dictionary, whose key:value pairs are item=value pairs for + #that config file section. +- self.changedItems={'main':{},'highlight':{},'keys':{},'extensions':{}} ++ self.changedItems = {'main':{}, 'highlight':{}, 'keys':{}, ++ 'extensions':{}} + +- def AddChangedItem(self,type,section,item,value): +- value=str(value) #make sure we use a string +- if section not in self.changedItems[type]: +- self.changedItems[type][section]={} +- self.changedItems[type][section][item]=value ++ def AddChangedItem(self, typ, section, item, value): ++ value = str(value) #make sure we use a string ++ if section not in self.changedItems[typ]: ++ self.changedItems[typ][section] = {} ++ self.changedItems[typ][section][item] = value + + def GetDefaultItems(self): +- dItems={'main':{},'highlight':{},'keys':{},'extensions':{}} ++ dItems={'main':{}, 'highlight':{}, 'keys':{}, 'extensions':{}} + for configType in dItems: +- sections=idleConf.GetSectionList('default',configType) ++ sections = idleConf.GetSectionList('default', configType) + for section in sections: +- dItems[configType][section]={} +- options=idleConf.defaultCfg[configType].GetOptionList(section) ++ dItems[configType][section] = {} ++ options = idleConf.defaultCfg[configType].GetOptionList(section) + for option in options: +- dItems[configType][section][option]=( +- idleConf.defaultCfg[configType].Get(section,option)) ++ dItems[configType][section][option] = ( ++ idleConf.defaultCfg[configType].Get(section, option)) + return dItems + + def SetThemeType(self): +@@ -591,26 +640,26 @@ + self.buttonDeleteCustomKeys.config(state=NORMAL) + + def GetNewKeys(self): +- listIndex=self.listBindings.index(ANCHOR) +- binding=self.listBindings.get(listIndex) +- bindName=binding.split()[0] #first part, up to first space ++ listIndex = self.listBindings.index(ANCHOR) ++ binding = self.listBindings.get(listIndex) ++ bindName = binding.split()[0] #first part, up to first space + if self.keysAreBuiltin.get(): +- currentKeySetName=self.builtinKeys.get() ++ currentKeySetName = self.builtinKeys.get() + else: +- currentKeySetName=self.customKeys.get() +- currentBindings=idleConf.GetCurrentKeySet() ++ currentKeySetName = self.customKeys.get() ++ currentBindings = idleConf.GetCurrentKeySet() + if currentKeySetName in self.changedItems['keys']: #unsaved changes +- keySetChanges=self.changedItems['keys'][currentKeySetName] ++ keySetChanges = self.changedItems['keys'][currentKeySetName] + for event in keySetChanges: +- currentBindings[event]=keySetChanges[event].split() ++ currentBindings[event] = keySetChanges[event].split() + currentKeySequences = list(currentBindings.values()) +- newKeys=GetKeysDialog(self,'Get New Keys',bindName, ++ newKeys = GetKeysDialog(self, 'Get New Keys', bindName, + currentKeySequences).result + if newKeys: #new keys were specified + if self.keysAreBuiltin.get(): #current key set is a built-in +- message=('Your changes will be saved as a new Custom Key Set. '+ +- 'Enter a name for your new Custom Key Set below.') +- newKeySet=self.GetNewKeysName(message) ++ message = ('Your changes will be saved as a new Custom Key Set.' ++ ' Enter a name for your new Custom Key Set below.') ++ newKeySet = self.GetNewKeysName(message) + if not newKeySet: #user cancelled custom key set creation + self.listBindings.select_set(listIndex) + self.listBindings.select_anchor(listIndex) +@@ -618,7 +667,7 @@ + else: #create new custom key set based on previously active key set + self.CreateNewKeySet(newKeySet) + self.listBindings.delete(listIndex) +- self.listBindings.insert(listIndex,bindName+' - '+newKeys) ++ self.listBindings.insert(listIndex, bindName+' - '+newKeys) + self.listBindings.select_set(listIndex) + self.listBindings.select_anchor(listIndex) + self.keyBinding.set(newKeys) +@@ -626,65 +675,65 @@ + self.listBindings.select_set(listIndex) + self.listBindings.select_anchor(listIndex) + +- def GetNewKeysName(self,message): +- usedNames=(idleConf.GetSectionList('user','keys')+ +- idleConf.GetSectionList('default','keys')) +- newKeySet=GetCfgSectionNameDialog(self,'New Custom Key Set', +- message,usedNames).result ++ def GetNewKeysName(self, message): ++ usedNames = (idleConf.GetSectionList('user', 'keys') + ++ idleConf.GetSectionList('default', 'keys')) ++ newKeySet = GetCfgSectionNameDialog( ++ self, 'New Custom Key Set', message, usedNames).result + return newKeySet + + def SaveAsNewKeySet(self): +- newKeysName=self.GetNewKeysName('New Key Set Name:') ++ newKeysName = self.GetNewKeysName('New Key Set Name:') + if newKeysName: + self.CreateNewKeySet(newKeysName) + +- def KeyBindingSelected(self,event): ++ def KeyBindingSelected(self, event): + self.buttonNewKeys.config(state=NORMAL) + +- def CreateNewKeySet(self,newKeySetName): ++ def CreateNewKeySet(self, newKeySetName): + #creates new custom key set based on the previously active key set, + #and makes the new key set active + if self.keysAreBuiltin.get(): +- prevKeySetName=self.builtinKeys.get() ++ prevKeySetName = self.builtinKeys.get() + else: +- prevKeySetName=self.customKeys.get() +- prevKeys=idleConf.GetCoreKeys(prevKeySetName) +- newKeys={} ++ prevKeySetName = self.customKeys.get() ++ prevKeys = idleConf.GetCoreKeys(prevKeySetName) ++ newKeys = {} + for event in prevKeys: #add key set to changed items +- eventName=event[2:-2] #trim off the angle brackets +- binding=' '.join(prevKeys[event]) +- newKeys[eventName]=binding ++ eventName = event[2:-2] #trim off the angle brackets ++ binding = ' '.join(prevKeys[event]) ++ newKeys[eventName] = binding + #handle any unsaved changes to prev key set + if prevKeySetName in self.changedItems['keys']: +- keySetChanges=self.changedItems['keys'][prevKeySetName] ++ keySetChanges = self.changedItems['keys'][prevKeySetName] + for event in keySetChanges: +- newKeys[event]=keySetChanges[event] ++ newKeys[event] = keySetChanges[event] + #save the new theme +- self.SaveNewKeySet(newKeySetName,newKeys) ++ self.SaveNewKeySet(newKeySetName, newKeys) + #change gui over to the new key set +- customKeyList=idleConf.GetSectionList('user','keys') ++ customKeyList = idleConf.GetSectionList('user', 'keys') + customKeyList.sort() +- self.optMenuKeysCustom.SetMenu(customKeyList,newKeySetName) ++ self.optMenuKeysCustom.SetMenu(customKeyList, newKeySetName) + self.keysAreBuiltin.set(0) + self.SetKeysType() + +- def LoadKeysList(self,keySetName): +- reselect=0 +- newKeySet=0 ++ def LoadKeysList(self, keySetName): ++ reselect = 0 ++ newKeySet = 0 + if self.listBindings.curselection(): +- reselect=1 +- listIndex=self.listBindings.index(ANCHOR) +- keySet=idleConf.GetKeySet(keySetName) ++ reselect = 1 ++ listIndex = self.listBindings.index(ANCHOR) ++ keySet = idleConf.GetKeySet(keySetName) + bindNames = list(keySet.keys()) + bindNames.sort() +- self.listBindings.delete(0,END) ++ self.listBindings.delete(0, END) + for bindName in bindNames: +- key=' '.join(keySet[bindName]) #make key(s) into a string +- bindName=bindName[2:-2] #trim off the angle brackets ++ key = ' '.join(keySet[bindName]) #make key(s) into a string ++ bindName = bindName[2:-2] #trim off the angle brackets + if keySetName in self.changedItems['keys']: + #handle any unsaved changes to this key set + if bindName in self.changedItems['keys'][keySetName]: +- key=self.changedItems['keys'][keySetName][bindName] ++ key = self.changedItems['keys'][keySetName][bindName] + self.listBindings.insert(END, bindName+' - '+key) + if reselect: + self.listBindings.see(listIndex) +@@ -693,9 +742,9 @@ + + def DeleteCustomKeys(self): + keySetName=self.customKeys.get() +- if not tkMessageBox.askyesno('Delete Key Set','Are you sure you wish '+ +- 'to delete the key set %r ?' % (keySetName), +- parent=self): ++ delmsg = 'Are you sure you wish to delete the key set %r ?' ++ if not tkMessageBox.askyesno( ++ 'Delete Key Set', delmsg % keySetName, parent=self): + return + #remove key set from config + idleConf.userCfg['keys'].remove_section(keySetName) +@@ -704,25 +753,25 @@ + #write changes + idleConf.userCfg['keys'].Save() + #reload user key set list +- itemList=idleConf.GetSectionList('user','keys') ++ itemList = idleConf.GetSectionList('user', 'keys') + itemList.sort() + if not itemList: + self.radioKeysCustom.config(state=DISABLED) +- self.optMenuKeysCustom.SetMenu(itemList,'- no custom keys -') ++ self.optMenuKeysCustom.SetMenu(itemList, '- no custom keys -') + else: +- self.optMenuKeysCustom.SetMenu(itemList,itemList[0]) ++ self.optMenuKeysCustom.SetMenu(itemList, itemList[0]) + #revert to default key set +- self.keysAreBuiltin.set(idleConf.defaultCfg['main'].Get('Keys','default')) +- self.builtinKeys.set(idleConf.defaultCfg['main'].Get('Keys','name')) ++ self.keysAreBuiltin.set(idleConf.defaultCfg['main'].Get('Keys', 'default')) ++ self.builtinKeys.set(idleConf.defaultCfg['main'].Get('Keys', 'name')) + #user can't back out of these changes, they must be applied now + self.Apply() + self.SetKeysType() + + def DeleteCustomTheme(self): +- themeName=self.customTheme.get() +- if not tkMessageBox.askyesno('Delete Theme','Are you sure you wish '+ +- 'to delete the theme %r ?' % (themeName,), +- parent=self): ++ themeName = self.customTheme.get() ++ delmsg = 'Are you sure you wish to delete the theme %r ?' ++ if not tkMessageBox.askyesno( ++ 'Delete Theme', delmsg % themeName, parent=self): + return + #remove theme from config + idleConf.userCfg['highlight'].remove_section(themeName) +@@ -731,153 +780,149 @@ + #write changes + idleConf.userCfg['highlight'].Save() + #reload user theme list +- itemList=idleConf.GetSectionList('user','highlight') ++ itemList = idleConf.GetSectionList('user', 'highlight') + itemList.sort() + if not itemList: + self.radioThemeCustom.config(state=DISABLED) +- self.optMenuThemeCustom.SetMenu(itemList,'- no custom themes -') ++ self.optMenuThemeCustom.SetMenu(itemList, '- no custom themes -') + else: +- self.optMenuThemeCustom.SetMenu(itemList,itemList[0]) ++ self.optMenuThemeCustom.SetMenu(itemList, itemList[0]) + #revert to default theme +- self.themeIsBuiltin.set(idleConf.defaultCfg['main'].Get('Theme','default')) +- self.builtinTheme.set(idleConf.defaultCfg['main'].Get('Theme','name')) ++ self.themeIsBuiltin.set(idleConf.defaultCfg['main'].Get('Theme', 'default')) ++ self.builtinTheme.set(idleConf.defaultCfg['main'].Get('Theme', 'name')) + #user can't back out of these changes, they must be applied now + self.Apply() + self.SetThemeType() + + def GetColour(self): +- target=self.highlightTarget.get() +- prevColour=self.frameColourSet.cget('bg') +- rgbTuplet, colourString = tkColorChooser.askcolor(parent=self, +- title='Pick new colour for : '+target,initialcolor=prevColour) +- if colourString and (colourString!=prevColour): ++ target = self.highlightTarget.get() ++ prevColour = self.frameColourSet.cget('bg') ++ rgbTuplet, colourString = tkColorChooser.askcolor( ++ parent=self, title='Pick new colour for : '+target, ++ initialcolor=prevColour) ++ if colourString and (colourString != prevColour): + #user didn't cancel, and they chose a new colour +- if self.themeIsBuiltin.get(): #current theme is a built-in +- message=('Your changes will be saved as a new Custom Theme. '+ +- 'Enter a name for your new Custom Theme below.') +- newTheme=self.GetNewThemeName(message) +- if not newTheme: #user cancelled custom theme creation ++ if self.themeIsBuiltin.get(): #current theme is a built-in ++ message = ('Your changes will be saved as a new Custom Theme. ' ++ 'Enter a name for your new Custom Theme below.') ++ newTheme = self.GetNewThemeName(message) ++ if not newTheme: #user cancelled custom theme creation + return +- else: #create new custom theme based on previously active theme ++ else: #create new custom theme based on previously active theme + self.CreateNewTheme(newTheme) + self.colour.set(colourString) +- else: #current theme is user defined ++ else: #current theme is user defined + self.colour.set(colourString) + + def OnNewColourSet(self): + newColour=self.colour.get() +- self.frameColourSet.config(bg=newColour)#set sample +- if self.fgHilite.get(): plane='foreground' +- else: plane='background' +- sampleElement=self.themeElements[self.highlightTarget.get()][0] ++ self.frameColourSet.config(bg=newColour) #set sample ++ plane ='foreground' if self.fgHilite.get() else 'background' ++ sampleElement = self.themeElements[self.highlightTarget.get()][0] + self.textHighlightSample.tag_config(sampleElement, **{plane:newColour}) +- theme=self.customTheme.get() +- themeElement=sampleElement+'-'+plane +- self.AddChangedItem('highlight',theme,themeElement,newColour) ++ theme = self.customTheme.get() ++ themeElement = sampleElement + '-' + plane ++ self.AddChangedItem('highlight', theme, themeElement, newColour) + +- def GetNewThemeName(self,message): +- usedNames=(idleConf.GetSectionList('user','highlight')+ +- idleConf.GetSectionList('default','highlight')) +- newTheme=GetCfgSectionNameDialog(self,'New Custom Theme', +- message,usedNames).result ++ def GetNewThemeName(self, message): ++ usedNames = (idleConf.GetSectionList('user', 'highlight') + ++ idleConf.GetSectionList('default', 'highlight')) ++ newTheme = GetCfgSectionNameDialog( ++ self, 'New Custom Theme', message, usedNames).result + return newTheme + + def SaveAsNewTheme(self): +- newThemeName=self.GetNewThemeName('New Theme Name:') ++ newThemeName = self.GetNewThemeName('New Theme Name:') + if newThemeName: + self.CreateNewTheme(newThemeName) + +- def CreateNewTheme(self,newThemeName): ++ def CreateNewTheme(self, newThemeName): + #creates new custom theme based on the previously active theme, + #and makes the new theme active + if self.themeIsBuiltin.get(): +- themeType='default' +- themeName=self.builtinTheme.get() ++ themeType = 'default' ++ themeName = self.builtinTheme.get() + else: +- themeType='user' +- themeName=self.customTheme.get() +- newTheme=idleConf.GetThemeDict(themeType,themeName) ++ themeType = 'user' ++ themeName = self.customTheme.get() ++ newTheme = idleConf.GetThemeDict(themeType, themeName) + #apply any of the old theme's unsaved changes to the new theme + if themeName in self.changedItems['highlight']: +- themeChanges=self.changedItems['highlight'][themeName] ++ themeChanges = self.changedItems['highlight'][themeName] + for element in themeChanges: +- newTheme[element]=themeChanges[element] ++ newTheme[element] = themeChanges[element] + #save the new theme +- self.SaveNewTheme(newThemeName,newTheme) ++ self.SaveNewTheme(newThemeName, newTheme) + #change gui over to the new theme +- customThemeList=idleConf.GetSectionList('user','highlight') ++ customThemeList = idleConf.GetSectionList('user', 'highlight') + customThemeList.sort() +- self.optMenuThemeCustom.SetMenu(customThemeList,newThemeName) ++ self.optMenuThemeCustom.SetMenu(customThemeList, newThemeName) + self.themeIsBuiltin.set(0) + self.SetThemeType() + +- def OnListFontButtonRelease(self,event): ++ def OnListFontButtonRelease(self, event): + font = self.listFontName.get(ANCHOR) + self.fontName.set(font.lower()) + self.SetFontSample() + +- def SetFontSample(self,event=None): +- fontName=self.fontName.get() +- if self.fontBold.get(): +- fontWeight=tkFont.BOLD +- else: +- fontWeight=tkFont.NORMAL ++ def SetFontSample(self, event=None): ++ fontName = self.fontName.get() ++ fontWeight = tkFont.BOLD if self.fontBold.get() else tkFont.NORMAL + newFont = (fontName, self.fontSize.get(), fontWeight) + self.labelFontSample.config(font=newFont) + self.textHighlightSample.configure(font=newFont) + + def SetHighlightTarget(self): +- if self.highlightTarget.get()=='Cursor': #bg not possible ++ if self.highlightTarget.get() == 'Cursor': #bg not possible + self.radioFg.config(state=DISABLED) + self.radioBg.config(state=DISABLED) + self.fgHilite.set(1) +- else: #both fg and bg can be set ++ else: #both fg and bg can be set + self.radioFg.config(state=NORMAL) + self.radioBg.config(state=NORMAL) + self.fgHilite.set(1) + self.SetColourSample() + +- def SetColourSampleBinding(self,*args): ++ def SetColourSampleBinding(self, *args): + self.SetColourSample() + + def SetColourSample(self): + #set the colour smaple area +- tag=self.themeElements[self.highlightTarget.get()][0] +- if self.fgHilite.get(): plane='foreground' +- else: plane='background' +- colour=self.textHighlightSample.tag_cget(tag,plane) ++ tag = self.themeElements[self.highlightTarget.get()][0] ++ plane = 'foreground' if self.fgHilite.get() else 'background' ++ colour = self.textHighlightSample.tag_cget(tag, plane) + self.frameColourSet.config(bg=colour) + + def PaintThemeSample(self): +- if self.themeIsBuiltin.get(): #a default theme +- theme=self.builtinTheme.get() +- else: #a user theme +- theme=self.customTheme.get() ++ if self.themeIsBuiltin.get(): #a default theme ++ theme = self.builtinTheme.get() ++ else: #a user theme ++ theme = self.customTheme.get() + for elementTitle in self.themeElements: +- element=self.themeElements[elementTitle][0] +- colours=idleConf.GetHighlight(theme,element) +- if element=='cursor': #cursor sample needs special painting +- colours['background']=idleConf.GetHighlight(theme, +- 'normal', fgBg='bg') ++ element = self.themeElements[elementTitle][0] ++ colours = idleConf.GetHighlight(theme, element) ++ if element == 'cursor': #cursor sample needs special painting ++ colours['background'] = idleConf.GetHighlight( ++ theme, 'normal', fgBg='bg') + #handle any unsaved changes to this theme + if theme in self.changedItems['highlight']: +- themeDict=self.changedItems['highlight'][theme] +- if element+'-foreground' in themeDict: +- colours['foreground']=themeDict[element+'-foreground'] +- if element+'-background' in themeDict: +- colours['background']=themeDict[element+'-background'] ++ themeDict = self.changedItems['highlight'][theme] ++ if element + '-foreground' in themeDict: ++ colours['foreground'] = themeDict[element + '-foreground'] ++ if element + '-background' in themeDict: ++ colours['background'] = themeDict[element + '-background'] + self.textHighlightSample.tag_config(element, **colours) + self.SetColourSample() + +- def HelpSourceSelected(self,event): ++ def HelpSourceSelected(self, event): + self.SetHelpListButtonStates() + + def SetHelpListButtonStates(self): +- if self.listHelp.size()<1: #no entries in list ++ if self.listHelp.size() < 1: #no entries in list + self.buttonHelpListEdit.config(state=DISABLED) + self.buttonHelpListRemove.config(state=DISABLED) + else: #there are some entries +- if self.listHelp.curselection(): #there currently is a selection ++ if self.listHelp.curselection(): #there currently is a selection + self.buttonHelpListEdit.config(state=NORMAL) + self.buttonHelpListRemove.config(state=NORMAL) + else: #there currently is not a selection +@@ -885,28 +930,29 @@ + self.buttonHelpListRemove.config(state=DISABLED) + + def HelpListItemAdd(self): +- helpSource=GetHelpSourceDialog(self,'New Help Source').result ++ helpSource = GetHelpSourceDialog(self, 'New Help Source').result + if helpSource: +- self.userHelpList.append( (helpSource[0],helpSource[1]) ) +- self.listHelp.insert(END,helpSource[0]) ++ self.userHelpList.append((helpSource[0], helpSource[1])) ++ self.listHelp.insert(END, helpSource[0]) + self.UpdateUserHelpChangedItems() + self.SetHelpListButtonStates() + + def HelpListItemEdit(self): +- itemIndex=self.listHelp.index(ANCHOR) +- helpSource=self.userHelpList[itemIndex] +- newHelpSource=GetHelpSourceDialog(self,'Edit Help Source', +- menuItem=helpSource[0],filePath=helpSource[1]).result +- if (not newHelpSource) or (newHelpSource==helpSource): ++ itemIndex = self.listHelp.index(ANCHOR) ++ helpSource = self.userHelpList[itemIndex] ++ newHelpSource = GetHelpSourceDialog( ++ self, 'Edit Help Source', menuItem=helpSource[0], ++ filePath=helpSource[1]).result ++ if (not newHelpSource) or (newHelpSource == helpSource): + return #no changes +- self.userHelpList[itemIndex]=newHelpSource ++ self.userHelpList[itemIndex] = newHelpSource + self.listHelp.delete(itemIndex) +- self.listHelp.insert(itemIndex,newHelpSource[0]) ++ self.listHelp.insert(itemIndex, newHelpSource[0]) + self.UpdateUserHelpChangedItems() + self.SetHelpListButtonStates() + + def HelpListItemRemove(self): +- itemIndex=self.listHelp.index(ANCHOR) ++ itemIndex = self.listHelp.index(ANCHOR) + del(self.userHelpList[itemIndex]) + self.listHelp.delete(itemIndex) + self.UpdateUserHelpChangedItems() +@@ -915,18 +961,19 @@ + def UpdateUserHelpChangedItems(self): + "Clear and rebuild the HelpFiles section in self.changedItems" + self.changedItems['main']['HelpFiles'] = {} +- for num in range(1,len(self.userHelpList)+1): +- self.AddChangedItem('main','HelpFiles',str(num), ++ for num in range(1, len(self.userHelpList) + 1): ++ self.AddChangedItem( ++ 'main', 'HelpFiles', str(num), + ';'.join(self.userHelpList[num-1][:2])) + + def LoadFontCfg(self): + ##base editor font selection list +- fonts=list(tkFont.families(self)) ++ fonts = list(tkFont.families(self)) + fonts.sort() + for font in fonts: +- self.listFontName.insert(END,font) +- configuredFont=idleConf.GetOption('main','EditorWindow','font', +- default='courier') ++ self.listFontName.insert(END, font) ++ configuredFont = idleConf.GetOption( ++ 'main', 'EditorWindow', 'font', default='courier') + lc_configuredFont = configuredFont.lower() + self.fontName.set(lc_configuredFont) + lc_fonts = [s.lower() for s in fonts] +@@ -936,107 +983,107 @@ + self.listFontName.select_set(currentFontIndex) + self.listFontName.select_anchor(currentFontIndex) + ##font size dropdown +- fontSize=idleConf.GetOption('main', 'EditorWindow', 'font-size', +- type='int', default='10') +- self.optMenuFontSize.SetMenu(('7','8','9','10','11','12','13','14', +- '16','18','20','22'), fontSize ) ++ fontSize = idleConf.GetOption( ++ 'main', 'EditorWindow', 'font-size', type='int', default='10') ++ self.optMenuFontSize.SetMenu(('7', '8', '9', '10', '11', '12', '13', ++ '14', '16', '18', '20', '22'), fontSize ) + ##fontWeight +- self.fontBold.set(idleConf.GetOption('main','EditorWindow', +- 'font-bold',default=0,type='bool')) ++ self.fontBold.set(idleConf.GetOption( ++ 'main', 'EditorWindow', 'font-bold', default=0, type='bool')) + ##font sample + self.SetFontSample() + + def LoadTabCfg(self): + ##indent sizes +- spaceNum=idleConf.GetOption('main','Indent','num-spaces', +- default=4,type='int') ++ spaceNum = idleConf.GetOption( ++ 'main', 'Indent', 'num-spaces', default=4, type='int') + self.spaceNum.set(spaceNum) + + def LoadThemeCfg(self): + ##current theme type radiobutton +- self.themeIsBuiltin.set(idleConf.GetOption('main','Theme','default', +- type='bool',default=1)) ++ self.themeIsBuiltin.set(idleConf.GetOption( ++ 'main', 'Theme', 'default', type='bool', default=1)) + ##currently set theme +- currentOption=idleConf.CurrentTheme() ++ currentOption = idleConf.CurrentTheme() + ##load available theme option menus + if self.themeIsBuiltin.get(): #default theme selected +- itemList=idleConf.GetSectionList('default','highlight') ++ itemList = idleConf.GetSectionList('default', 'highlight') + itemList.sort() +- self.optMenuThemeBuiltin.SetMenu(itemList,currentOption) +- itemList=idleConf.GetSectionList('user','highlight') ++ self.optMenuThemeBuiltin.SetMenu(itemList, currentOption) ++ itemList = idleConf.GetSectionList('user', 'highlight') + itemList.sort() + if not itemList: + self.radioThemeCustom.config(state=DISABLED) + self.customTheme.set('- no custom themes -') + else: +- self.optMenuThemeCustom.SetMenu(itemList,itemList[0]) ++ self.optMenuThemeCustom.SetMenu(itemList, itemList[0]) + else: #user theme selected +- itemList=idleConf.GetSectionList('user','highlight') ++ itemList = idleConf.GetSectionList('user', 'highlight') + itemList.sort() +- self.optMenuThemeCustom.SetMenu(itemList,currentOption) +- itemList=idleConf.GetSectionList('default','highlight') ++ self.optMenuThemeCustom.SetMenu(itemList, currentOption) ++ itemList = idleConf.GetSectionList('default', 'highlight') + itemList.sort() +- self.optMenuThemeBuiltin.SetMenu(itemList,itemList[0]) ++ self.optMenuThemeBuiltin.SetMenu(itemList, itemList[0]) + self.SetThemeType() + ##load theme element option menu + themeNames = list(self.themeElements.keys()) + themeNames.sort(key=lambda x: self.themeElements[x][1]) +- self.optMenuHighlightTarget.SetMenu(themeNames,themeNames[0]) ++ self.optMenuHighlightTarget.SetMenu(themeNames, themeNames[0]) + self.PaintThemeSample() + self.SetHighlightTarget() + + def LoadKeyCfg(self): + ##current keys type radiobutton +- self.keysAreBuiltin.set(idleConf.GetOption('main','Keys','default', +- type='bool',default=1)) ++ self.keysAreBuiltin.set(idleConf.GetOption( ++ 'main', 'Keys', 'default', type='bool', default=1)) + ##currently set keys +- currentOption=idleConf.CurrentKeys() ++ currentOption = idleConf.CurrentKeys() + ##load available keyset option menus + if self.keysAreBuiltin.get(): #default theme selected +- itemList=idleConf.GetSectionList('default','keys') ++ itemList = idleConf.GetSectionList('default', 'keys') + itemList.sort() +- self.optMenuKeysBuiltin.SetMenu(itemList,currentOption) +- itemList=idleConf.GetSectionList('user','keys') ++ self.optMenuKeysBuiltin.SetMenu(itemList, currentOption) ++ itemList = idleConf.GetSectionList('user', 'keys') + itemList.sort() + if not itemList: + self.radioKeysCustom.config(state=DISABLED) + self.customKeys.set('- no custom keys -') + else: +- self.optMenuKeysCustom.SetMenu(itemList,itemList[0]) ++ self.optMenuKeysCustom.SetMenu(itemList, itemList[0]) + else: #user key set selected +- itemList=idleConf.GetSectionList('user','keys') ++ itemList = idleConf.GetSectionList('user', 'keys') + itemList.sort() +- self.optMenuKeysCustom.SetMenu(itemList,currentOption) +- itemList=idleConf.GetSectionList('default','keys') ++ self.optMenuKeysCustom.SetMenu(itemList, currentOption) ++ itemList = idleConf.GetSectionList('default', 'keys') + itemList.sort() +- self.optMenuKeysBuiltin.SetMenu(itemList,itemList[0]) ++ self.optMenuKeysBuiltin.SetMenu(itemList, itemList[0]) + self.SetKeysType() + ##load keyset element list +- keySetName=idleConf.CurrentKeys() ++ keySetName = idleConf.CurrentKeys() + self.LoadKeysList(keySetName) + + def LoadGeneralCfg(self): + #startup state +- self.startupEdit.set(idleConf.GetOption('main','General', +- 'editor-on-startup',default=1,type='bool')) ++ self.startupEdit.set(idleConf.GetOption( ++ 'main', 'General', 'editor-on-startup', default=1, type='bool')) + #autosave state +- self.autoSave.set(idleConf.GetOption('main', 'General', 'autosave', +- default=0, type='bool')) ++ self.autoSave.set(idleConf.GetOption( ++ 'main', 'General', 'autosave', default=0, type='bool')) + #initial window size +- self.winWidth.set(idleConf.GetOption('main','EditorWindow','width', +- type='int')) +- self.winHeight.set(idleConf.GetOption('main','EditorWindow','height', +- type='int')) ++ self.winWidth.set(idleConf.GetOption( ++ 'main', 'EditorWindow', 'width', type='int')) ++ self.winHeight.set(idleConf.GetOption( ++ 'main', 'EditorWindow', 'height', type='int')) + #initial paragraph reformat size +- self.paraWidth.set(idleConf.GetOption('main','FormatParagraph','paragraph', +- type='int')) ++ self.paraWidth.set(idleConf.GetOption( ++ 'main', 'FormatParagraph', 'paragraph', type='int')) + # default source encoding +- self.encoding.set(idleConf.GetOption('main', 'EditorWindow', +- 'encoding', default='none')) ++ self.encoding.set(idleConf.GetOption( ++ 'main', 'EditorWindow', 'encoding', default='none')) + # additional help sources + self.userHelpList = idleConf.GetAllExtraHelpSourcesList() + for helpItem in self.userHelpList: +- self.listHelp.insert(END,helpItem[0]) ++ self.listHelp.insert(END, helpItem[0]) + self.SetHelpListButtonStates() + + def LoadConfigs(self): +@@ -1054,7 +1101,7 @@ + ### general page + self.LoadGeneralCfg() + +- def SaveNewKeySet(self,keySetName,keySet): ++ def SaveNewKeySet(self, keySetName, keySet): + """ + save a newly created core key set. + keySetName - string, the name of the new key set +@@ -1063,10 +1110,10 @@ + if not idleConf.userCfg['keys'].has_section(keySetName): + idleConf.userCfg['keys'].add_section(keySetName) + for event in keySet: +- value=keySet[event] +- idleConf.userCfg['keys'].SetOption(keySetName,event,value) ++ value = keySet[event] ++ idleConf.userCfg['keys'].SetOption(keySetName, event, value) + +- def SaveNewTheme(self,themeName,theme): ++ def SaveNewTheme(self, themeName, theme): + """ + save a newly created theme. + themeName - string, the name of the new theme +@@ -1075,16 +1122,16 @@ + if not idleConf.userCfg['highlight'].has_section(themeName): + idleConf.userCfg['highlight'].add_section(themeName) + for element in theme: +- value=theme[element] +- idleConf.userCfg['highlight'].SetOption(themeName,element,value) ++ value = theme[element] ++ idleConf.userCfg['highlight'].SetOption(themeName, element, value) + +- def SetUserValue(self,configType,section,item,value): +- if idleConf.defaultCfg[configType].has_option(section,item): +- if idleConf.defaultCfg[configType].Get(section,item)==value: ++ def SetUserValue(self, configType, section, item, value): ++ if idleConf.defaultCfg[configType].has_option(section, item): ++ if idleConf.defaultCfg[configType].Get(section, item) == value: + #the setting equals a default setting, remove it from user cfg +- return idleConf.userCfg[configType].RemoveOption(section,item) ++ return idleConf.userCfg[configType].RemoveOption(section, item) + #if we got here set the option +- return idleConf.userCfg[configType].SetOption(section,item,value) ++ return idleConf.userCfg[configType].SetOption(section, item, value) + + def SaveAllChangedConfigs(self): + "Save configuration changes to the user config file." +@@ -1098,7 +1145,7 @@ + cfgTypeHasChanges = True + for item in self.changedItems[configType][section]: + value = self.changedItems[configType][section][item] +- if self.SetUserValue(configType,section,item,value): ++ if self.SetUserValue(configType, section, item, value): + cfgTypeHasChanges = True + if cfgTypeHasChanges: + idleConf.userCfg[configType].Save() +@@ -1140,9 +1187,9 @@ + pass + + if __name__ == '__main__': +- #test the dialog +- root=Tk() +- Button(root,text='Dialog', +- command=lambda:ConfigDialog(root,'Settings')).pack() +- root.instance_dict={} +- root.mainloop() ++ import unittest ++ unittest.main('idlelib.idle_test.test_configdialog', ++ verbosity=2, exit=False) ++ ++ from idlelib.idle_test.htest import run ++ run(ConfigDialog) +diff -r c0e311e010fc Lib/idlelib/configHandler.py +--- a/Lib/idlelib/configHandler.py ++++ b/Lib/idlelib/configHandler.py +@@ -20,7 +20,7 @@ + import os + import sys + +-from configparser import ConfigParser, NoOptionError, NoSectionError ++from configparser import ConfigParser + + class InvalidConfigType(Exception): pass + class InvalidConfigSet(Exception): pass +diff -r c0e311e010fc Lib/idlelib/configHelpSourceEdit.py +--- a/Lib/idlelib/configHelpSourceEdit.py ++++ b/Lib/idlelib/configHelpSourceEdit.py +@@ -8,13 +8,14 @@ + import tkinter.filedialog as tkFileDialog + + class GetHelpSourceDialog(Toplevel): +- def __init__(self, parent, title, menuItem='', filePath=''): ++ def __init__(self, parent, title, menuItem='', filePath='', _htest=False): + """Get menu entry and url/ local file location for Additional Help + + User selects a name for the Help resource and provides a web url + or a local file as its source. The user can enter a url or browse + for the file. + ++ _htest - bool, change box location when running htest + """ + Toplevel.__init__(self, parent) + self.configure(borderwidth=5) +@@ -31,12 +32,14 @@ + self.withdraw() #hide while setting geometry + #needs to be done here so that the winfo_reqwidth is valid + self.update_idletasks() +- #centre dialog over parent: +- self.geometry("+%d+%d" % +- ((parent.winfo_rootx() + ((parent.winfo_width()/2) +- -(self.winfo_reqwidth()/2)), +- parent.winfo_rooty() + ((parent.winfo_height()/2) +- -(self.winfo_reqheight()/2))))) ++ #centre dialog over parent. below parent if running htest. ++ self.geometry( ++ "+%d+%d" % ( ++ parent.winfo_rootx() + ++ (parent.winfo_width()/2 - self.winfo_reqwidth()/2), ++ parent.winfo_rooty() + ++ ((parent.winfo_height()/2 - self.winfo_reqheight()/2) ++ if not _htest else 150))) + self.deiconify() #geometry set, unhide + self.bind('', self.Ok) + self.wait_window() +@@ -159,11 +162,5 @@ + self.destroy() + + if __name__ == '__main__': +- #test the dialog +- root = Tk() +- def run(): +- keySeq = '' +- dlg = GetHelpSourceDialog(root, 'Get Help Source') +- print(dlg.result) +- Button(root,text='Dialog', command=run).pack() +- root.mainloop() ++ from idlelib.idle_test.htest import run ++ run(GetHelpSourceDialog) +diff -r c0e311e010fc Lib/idlelib/dynOptionMenuWidget.py +--- a/Lib/idlelib/dynOptionMenuWidget.py ++++ b/Lib/idlelib/dynOptionMenuWidget.py +@@ -2,9 +2,10 @@ + OptionMenu widget modified to allow dynamic menu reconfiguration + and setting of highlightthickness + """ +-from tkinter import OptionMenu +-from tkinter import _setit ++from tkinter import OptionMenu, _setit, Tk, StringVar, Button ++ + import copy ++import re + + class DynOptionMenu(OptionMenu): + """ +@@ -33,3 +34,24 @@ + command=_setit(self.variable,item,self.command)) + if value: + self.variable.set(value) ++ ++def _dyn_option_menu(parent): ++ root = Tk() ++ root.title("Tets dynamic option menu") ++ var = StringVar(root) ++ width, height, x, y = list(map(int, re.split('[x+]', parent.geometry()))) ++ root.geometry("+%d+%d"%(x, y + 150)) ++ var.set("Old option set") #Set the default value ++ dyn = DynOptionMenu(root,var, "old1","old2","old3","old4") ++ dyn.pack() ++ ++ def update(): ++ dyn.SetMenu(["new1","new2","new3","new4"],value="new option set") ++ ++ button = Button(root, text="Change option set", command=update) ++ button.pack() ++ root.mainloop() ++ ++if __name__ == '__main__': ++ from idlelib.idle_test.htest import run ++ run(_dyn_option_menu) +diff -r c0e311e010fc Lib/idlelib/idle_test/README.txt +--- a/Lib/idlelib/idle_test/README.txt ++++ b/Lib/idlelib/idle_test/README.txt +@@ -26,7 +26,6 @@ + with xyz (lowercased) added after 'test_'. + --- + if __name__ == "__main__": +- from test import support; support.use_resources = ['gui'] + import unittest + unittest.main('idlelib.idle_test.test_', verbosity=2, exit=False) + --- +@@ -34,12 +33,12 @@ + + 2. Gui Tests + +-Gui tests need 'requires' and 'use_resources' from test.support +-(test.test_support in 2.7). A test is a gui test if it creates a Tk root or +-master object either directly or indirectly by instantiating a tkinter or +-idle class. For the benefit of buildbot machines that do not have a graphics +-screen, gui tests must be 'guarded' by "requires('gui')" in a setUp +-function or method. This will typically be setUpClass. ++Gui tests need 'requires' from test.support (test.test_support in 2.7). A ++test is a gui test if it creates a Tk root or master object either directly ++or indirectly by instantiating a tkinter or idle class. For the benefit of ++test processes that either have no graphical environment available or are not ++allowed to use it, gui tests must be 'guarded' by "requires('gui')" in a ++setUp function or method. This will typically be setUpClass. + + To avoid interfering with other gui tests, all gui objects must be destroyed + and deleted by the end of the test. If a widget, such as a Tk root, is created +@@ -57,11 +56,17 @@ + del cls.root + --- + +-Support.requires('gui') returns true if it is either called in a main module +-(which never happens on buildbots) or if use_resources contains 'gui'. +-Use_resources is set by test.regrtest but not by unittest. So when running +-tests in another module with unittest, we set it ourselves, as in the xyz.py +-template above. ++Support.requires('gui') causes the test(s) it guards to be skipped if any of ++a few conditions are met: ++ - The tests are being run by regrtest.py, and it was started without ++ enabling the "gui" resource with the "-u" command line option. ++ - The tests are being run on Windows by a service that is not allowed to ++ interact with the graphical environment. ++ - The tests are being run on Mac OSX in a process that cannot make a window ++ manager connection. ++ - tkinter.Tk cannot be successfully instantiated for some reason. ++ - test.support.use_resources has been set by something other than ++ regrtest.py and does not contain "gui". + + Since non-gui tests always run, but gui tests only sometimes, tests of non-gui + operations should best avoid needing a gui. Methods that make incidental use of +@@ -88,8 +93,8 @@ + + To run all idle_test/test_*.py tests, either interactively + ('>>>', with unittest imported) or from a command line, use one of the +-following. (Notes: unittest does not run gui tests; in 2.7, 'test ' (with the +-space) is 'test.regrtest '; where present, -v and -ugui can be omitted.) ++following. (Notes: in 2.7, 'test ' (with the space) is 'test.regrtest '; ++where present, -v and -ugui can be omitted.) + + >>> unittest.main('idlelib.idle_test', verbosity=2, exit=False) + python -m unittest -v idlelib.idle_test +@@ -98,13 +103,13 @@ + + The idle tests are 'discovered' by idlelib.idle_test.__init__.load_tests, + which is also imported into test.test_idle. Normally, neither file should be +-changed when working on individual test modules. The third command runs runs ++changed when working on individual test modules. The third command runs + unittest indirectly through regrtest. The same happens when the entire test + suite is run with 'python -m test'. So that command must work for buildbots + to stay green. Idle tests must not disturb the environment in a way that + makes other tests fail (issue 18081). + + To run an individual Testcase or test method, extend the dotted name given to +-unittest on the command line. (But gui tests will not this way.) ++unittest on the command line. + + python -m unittest -v idlelib.idle_test.test_xyz.Test_case.test_meth +diff -r c0e311e010fc Lib/idlelib/idle_test/htest.py +--- a/Lib/idlelib/idle_test/htest.py ++++ b/Lib/idlelib/idle_test/htest.py +@@ -1,9 +1,12 @@ + '''Run human tests of Idle's window, dialog, and popup widgets. + +-run(test): run *test*, a callable that causes a widget to be displayed. +-runall(): run all tests defined in this file. ++run(*tests) ++Run each callable in tests after finding the matching test spec in this file. ++If there are none, run an htest for each spec dict in this file after finding ++the matching callable in the module named in the spec. + +-Let X be a global name bound to a widget callable. End the module with ++In a tested module, let X be a global name bound to a widget callable. ++End the module with + + if __name__ == '__main__': + +@@ -13,10 +16,10 @@ + The X object must have a .__name__ attribute and a 'parent' parameter. + X will often be a widget class, but a callable instance with .__name__ + or a wrapper function also work. The name of wrapper functions, like +-'_Editor_Window', should start with '_'. ++'_editor_window', should start with '_'. + +-This file must contain a matching instance of the folling template, +-with X.__name__ prepended, as in '_Editor_window_spec ...'. ++This file must contain a matching instance of the following template, ++with X.__name__ prepended, as in '_editor_window_spec ...'. + + _spec = { + 'file': '', +@@ -24,70 +27,343 @@ + 'msg': "" + } + +-file (no .py): used in runall() to import the file and get X. ++file (no .py): used in run() to import the file and get X. + kwds: passed to X (**kwds), after 'parent' is added, to initialize X. + title: an example; used for some widgets, delete if not. + msg: displayed in a master window. Hints as to how the user might + test the widget. Close the window to skip or end the test. ++ ++Modules not being tested at the moment: ++PyShell.PyShellEditorWindow ++Debugger.Debugger ++AutoCompleteWindow.AutoCompleteWindow ++OutputWindow.OutputWindow (indirectly being tested with grep test) + ''' + from importlib import import_module ++from idlelib.macosxSupport import _initializeTkVariantTests + import tkinter as tk + +- +-_Editor_window_spec = { +- 'file': 'EditorWindow', +- 'kwds': {}, +- 'msg': "Test editor functions of interest" +- } +- +-_Help_dialog_spec = { +- 'file': 'EditorWindow', +- 'kwds': {}, +- 'msg': "If the help text displays, this works" +- } +- + AboutDialog_spec = { + 'file': 'aboutDialog', +- 'kwds': {'title': 'About test'}, +- 'msg': "Try each button" ++ 'kwds': {'title': 'aboutDialog test', ++ '_htest': True, ++ }, ++ 'msg': "Test every button. Ensure Python, TK and IDLE versions " ++ "are correctly displayed.\n [Close] to exit.", + } + ++_calltip_window_spec = { ++ 'file': 'CallTipWindow', ++ 'kwds': {}, ++ 'msg': "Typing '(' should display a calltip.\n" ++ "Typing ') should hide the calltip.\n" ++ } ++ ++_class_browser_spec = { ++ 'file': 'ClassBrowser', ++ 'kwds': {}, ++ 'msg': "Inspect names of module, class(with superclass if " ++ "applicable), methods and functions.\nToggle nested items.\n" ++ "Double clicking on items prints a traceback for an exception " ++ "that is ignored." ++ } ++ ++_color_delegator_spec = { ++ 'file': 'ColorDelegator', ++ 'kwds': {}, ++ 'msg': "The text is sample Python code.\n" ++ "Ensure components like comments, keywords, builtins,\n" ++ "string, definitions, and break are correctly colored.\n" ++ "The default color scheme is in idlelib/config-highlight.def" ++ } ++ ++ConfigDialog_spec = { ++ 'file': 'configDialog', ++ 'kwds': {'title': 'Settings', ++ '_htest': True,}, ++ 'msg': "IDLE preferences dialog.\n" ++ "In the 'Fonts/Tabs' tab, changing font face, should update the " ++ "font face of the text in the area below it.\nIn the " ++ "'Highlighting' tab, try different color schemes. Clicking " ++ "items in the sample program should update the choices above it." ++ "\nIn the 'Keys' and 'General' tab, test settings of interest." ++ "\n[Ok] to close the dialog.[Apply] to apply the settings and " ++ "and [Cancel] to revert all changes.\nRe-run the test to ensure " ++ "changes made have persisted." ++ } ++ ++_dyn_option_menu_spec = { ++ 'file': 'dynOptionMenuWidget', ++ 'kwds': {}, ++ 'msg': "Select one of the many options in the 'old option set'.\n" ++ "Click the button to change the option set.\n" ++ "Select one of the many options in the 'new option set'." ++ } ++ ++_editor_window_spec = { ++ 'file': 'EditorWindow', ++ 'kwds': {}, ++ 'msg': "Test editor functions of interest." ++ } + + GetCfgSectionNameDialog_spec = { + 'file': 'configSectionNameDialog', + 'kwds': {'title':'Get Name', +- 'message':'Enter something', +- 'used_names': {'abc'}, +- '_htest': True}, ++ 'message':'Enter something', ++ 'used_names': {'abc'}, ++ '_htest': True}, + 'msg': "After the text entered with [Ok] is stripped, , " +- "'abc', or more that 30 chars are errors.\n" +- "Close 'Get Name' with a valid entry (printed to Shell), [Cancel], or [X]", ++ "'abc', or more that 30 chars are errors.\n" ++ "Close 'Get Name' with a valid entry (printed to Shell), " ++ "[Cancel], or [X]", + } + +-def run(test): +- "Display a widget with callable *test* using a _spec dict" ++GetHelpSourceDialog_spec = { ++ 'file': 'configHelpSourceEdit', ++ 'kwds': {'title': 'Get helpsource', ++ '_htest': True}, ++ 'msg': "Enter menu item name and help file path\n " ++ " and more than 30 chars are invalid menu item names.\n" ++ ", file does not exist are invalid path items.\n" ++ "Test for incomplete web address for help file path.\n" ++ "A valid entry will be printed to shell with [0k].\n" ++ "[Cancel] will print None to shell", ++ } ++ ++# Update once issue21519 is resolved. ++GetKeysDialog_spec = { ++ 'file': 'keybindingDialog', ++ 'kwds': {'title': 'Test keybindings', ++ 'action': 'find-again', ++ 'currentKeySequences': [''] , ++ '_htest': True, ++ }, ++ 'msg': "Test for different key modifier sequences.\n" ++ " is invalid.\n" ++ "No modifier key is invalid.\n" ++ "Shift key with [a-z],[0-9], function key, move key, tab, space" ++ "is invalid.\nNo validitity checking if advanced key binding " ++ "entry is used." ++ } ++ ++_grep_dialog_spec = { ++ 'file': 'GrepDialog', ++ 'kwds': {}, ++ 'msg': "Click the 'Show GrepDialog' button.\n" ++ "Test the various 'Find-in-files' functions.\n" ++ "The results should be displayed in a new '*Output*' window.\n" ++ "'Right-click'->'Goto file/line' anywhere in the search results " ++ "should open that file \nin a new EditorWindow." ++ } ++ ++_help_dialog_spec = { ++ 'file': 'EditorWindow', ++ 'kwds': {}, ++ 'msg': "If the help text displays, this works.\n" ++ "Text is selectable. Window is scrollable." ++ } ++ ++_io_binding_spec = { ++ 'file': 'IOBinding', ++ 'kwds': {}, ++ 'msg': "Test the following bindings\n" ++ " to display open window from file dialog.\n" ++ " to save the file\n" ++ } ++ ++_multi_call_spec = { ++ 'file': 'MultiCall', ++ 'kwds': {}, ++ 'msg': "The following actions should trigger a print to console or IDLE" ++ " Shell.\nEntering and leaving the text area, key entry, " ++ ",\n, , " ++ ", \n, and " ++ "focusing out of the window\nare sequences to be tested." ++ } ++ ++_multistatus_bar_spec = { ++ 'file': 'MultiStatusBar', ++ 'kwds': {}, ++ 'msg': "Ensure presence of multi-status bar below text area.\n" ++ "Click 'Update Status' to change the multi-status text" ++ } ++ ++_object_browser_spec = { ++ 'file': 'ObjectBrowser', ++ 'kwds': {}, ++ 'msg': "Double click on items upto the lowest level.\n" ++ "Attributes of the objects and related information " ++ "will be displayed side-by-side at each level." ++ } ++ ++_path_browser_spec = { ++ 'file': 'PathBrowser', ++ 'kwds': {}, ++ 'msg': "Test for correct display of all paths in sys.path.\n" ++ "Toggle nested items upto the lowest level.\n" ++ "Double clicking on an item prints a traceback\n" ++ "for an exception that is ignored." ++ } ++ ++_percolator_spec = { ++ 'file': 'Percolator', ++ 'kwds': {}, ++ 'msg': "There are two tracers which can be toggled using a checkbox.\n" ++ "Toggling a tracer 'on' by checking it should print tracer" ++ "output to the console or to the IDLE shell.\n" ++ "If both the tracers are 'on', the output from the tracer which " ++ "was switched 'on' later, should be printed first\n" ++ "Test for actions like text entry, and removal." ++ } ++ ++_replace_dialog_spec = { ++ 'file': 'ReplaceDialog', ++ 'kwds': {}, ++ 'msg': "Click the 'Replace' button.\n" ++ "Test various replace options in the 'Replace dialog'.\n" ++ "Click [Close] or [X] to close the 'Replace Dialog'." ++ } ++ ++_search_dialog_spec = { ++ 'file': 'SearchDialog', ++ 'kwds': {}, ++ 'msg': "Click the 'Search' button.\n" ++ "Test various search options in the 'Search dialog'.\n" ++ "Click [Close] or [X] to close the 'Search Dialog'." ++ } ++ ++_scrolled_list_spec = { ++ 'file': 'ScrolledList', ++ 'kwds': {}, ++ 'msg': "You should see a scrollable list of items\n" ++ "Selecting (clicking) or double clicking an item " ++ "prints the name to the console or Idle shell.\n" ++ "Right clicking an item will display a popup." ++ } ++ ++_stack_viewer_spec = { ++ 'file': 'StackViewer', ++ 'kwds': {}, ++ 'msg': "A stacktrace for a NameError exception.\n" ++ "Expand 'idlelib ...' and ''.\n" ++ "Check that exc_value, exc_tb, and exc_type are correct.\n" ++ } ++ ++_tabbed_pages_spec = { ++ 'file': 'tabbedpages', ++ 'kwds': {}, ++ 'msg': "Toggle between the two tabs 'foo' and 'bar'\n" ++ "Add a tab by entering a suitable name for it.\n" ++ "Remove an existing tab by entering its name.\n" ++ "Remove all existing tabs.\n" ++ " is an invalid add page and remove page name.\n" ++ } ++ ++TextViewer_spec = { ++ 'file': 'textView', ++ 'kwds': {'title': 'Test textView', ++ 'text':'The quick brown fox jumps over the lazy dog.\n'*35, ++ '_htest': True}, ++ 'msg': "Test for read-only property of text.\n" ++ "Text is selectable. Window is scrollable.", ++ } ++ ++_tooltip_spec = { ++ 'file': 'ToolTip', ++ 'kwds': {}, ++ 'msg': "Place mouse cursor over both the buttons\n" ++ "A tooltip should appear with some text." ++ } ++ ++_tree_widget_spec = { ++ 'file': 'TreeWidget', ++ 'kwds': {}, ++ 'msg': "The canvas is scrollable.\n" ++ "Click on folders upto to the lowest level." ++ } ++ ++_undo_delegator_spec = { ++ 'file': 'UndoDelegator', ++ 'kwds': {}, ++ 'msg': "Click [Undo] to undo any action.\n" ++ "Click [Redo] to redo any action.\n" ++ "Click [Dump] to dump the current state " ++ "by printing to the console or the IDLE shell.\n" ++ } ++ ++_widget_redirector_spec = { ++ 'file': 'WidgetRedirector', ++ 'kwds': {}, ++ 'msg': "Every text insert should be printed to the console." ++ "or the IDLE shell." ++ } ++ ++def run(*tests): + root = tk.Tk() +- test_spec = globals()[test.__name__ + '_spec'] +- test_kwds = test_spec['kwds'] +- test_kwds['parent'] = root ++ root.title('IDLE htest') ++ root.resizable(0, 0) ++ _initializeTkVariantTests(root) ++ ++ # a scrollable Label like constant width text widget. ++ frameLabel = tk.Frame(root, padx=10) ++ frameLabel.pack() ++ text = tk.Text(frameLabel, wrap='word') ++ text.configure(bg=root.cget('bg'), relief='flat', height=4, width=70) ++ scrollbar = tk.Scrollbar(frameLabel, command=text.yview) ++ text.config(yscrollcommand=scrollbar.set) ++ scrollbar.pack(side='right', fill='y', expand=False) ++ text.pack(side='left', fill='both', expand=True) ++ ++ test_list = [] # List of tuples of the form (spec, callable widget) ++ if tests: ++ for test in tests: ++ test_spec = globals()[test.__name__ + '_spec'] ++ test_spec['name'] = test.__name__ ++ test_list.append((test_spec, test)) ++ else: ++ for k, d in globals().items(): ++ if k.endswith('_spec'): ++ test_name = k[:-5] ++ test_spec = d ++ test_spec['name'] = test_name ++ mod = import_module('idlelib.' + test_spec['file']) ++ test = getattr(mod, test_name) ++ test_list.append((test_spec, test)) ++ ++ test_name = tk.StringVar('') ++ callable_object = None ++ test_kwds = None ++ ++ def next(): ++ ++ nonlocal test_name, callable_object, test_kwds ++ if len(test_list) == 1: ++ next_button.pack_forget() ++ test_spec, callable_object = test_list.pop() ++ test_kwds = test_spec['kwds'] ++ test_kwds['parent'] = root ++ test_name.set('Test ' + test_spec['name']) ++ ++ text.configure(state='normal') # enable text editing ++ text.delete('1.0','end') ++ text.insert("1.0",test_spec['msg']) ++ text.configure(state='disabled') # preserve read-only property + + def run_test(): +- widget = test(**test_kwds) ++ widget = callable_object(**test_kwds) + try: + print(widget.result) + except AttributeError: + pass +- tk.Label(root, text=test_spec['msg'], justify='left').pack() +- tk.Button(root, text='Test ' + test.__name__, command=run_test).pack() ++ ++ button = tk.Button(root, textvariable=test_name, command=run_test) ++ button.pack() ++ next_button = tk.Button(root, text="Next", command=next) ++ next_button.pack() ++ ++ next() ++ + root.mainloop() + +-def runall(): +- "Run all tests. Quick and dirty version." +- for k, d in globals().items(): +- if k.endswith('_spec'): +- mod = import_module('idlelib.' + d['file']) +- test = getattr(mod, k[:-5]) +- run(test) +- + if __name__ == '__main__': +- runall() ++ run() +diff -r c0e311e010fc Lib/idlelib/idle_test/mock_idle.py +--- a/Lib/idlelib/idle_test/mock_idle.py ++++ b/Lib/idlelib/idle_test/mock_idle.py +@@ -5,6 +5,33 @@ + + from idlelib.idle_test.mock_tk import Text + ++class Func: ++ '''Mock function captures args and returns result set by test. ++ ++ Attributes: ++ self.called - records call even if no args, kwds passed. ++ self.result - set by init, returned by call. ++ self.args - captures positional arguments. ++ self.kwds - captures keyword arguments. ++ ++ Most common use will probably be to mock methods. ++ Mock_tk.Var and Mbox_func are special variants of this. ++ ''' ++ def __init__(self, result=None): ++ self.called = False ++ self.result = result ++ self.args = None ++ self.kwds = None ++ def __call__(self, *args, **kwds): ++ self.called = True ++ self.args = args ++ self.kwds = kwds ++ if isinstance(self.result, BaseException): ++ raise self.result ++ else: ++ return self.result ++ ++ + class Editor: + '''Minimally imitate EditorWindow.EditorWindow class. + ''' +@@ -17,6 +44,7 @@ + last = self.text.index('end') + return first, last + ++ + class UndoDelegator: + '''Minimally imitate UndoDelegator,UndoDelegator class. + ''' +diff -r c0e311e010fc Lib/idlelib/idle_test/mock_tk.py +--- a/Lib/idlelib/idle_test/mock_tk.py ++++ b/Lib/idlelib/idle_test/mock_tk.py +@@ -1,9 +1,27 @@ + """Classes that replace tkinter gui objects used by an object being tested. + +-A gui object is anything with a master or parent paramenter, which is typically +-required in spite of what the doc strings say. ++A gui object is anything with a master or parent paramenter, which is ++typically required in spite of what the doc strings say. + """ + ++class Event: ++ '''Minimal mock with attributes for testing event handlers. ++ ++ This is not a gui object, but is used as an argument for callbacks ++ that access attributes of the event passed. If a callback ignores ++ the event, other than the fact that is happened, pass 'event'. ++ ++ Keyboard, mouse, window, and other sources generate Event instances. ++ Event instances have the following attributes: serial (number of ++ event), time (of event), type (of event as number), widget (in which ++ event occurred), and x,y (position of mouse). There are other ++ attributes for specific events, such as keycode for key events. ++ tkinter.Event.__doc__ has more but is still not complete. ++ ''' ++ def __init__(self, **kwds): ++ "Create event with attributes needed for test" ++ self.__dict__.update(kwds) ++ + class Var: + "Use for String/Int/BooleanVar: incomplete" + def __init__(self, master=None, value=None, name=None): +@@ -20,9 +38,10 @@ + + Instead of displaying a message box, the mock's call method saves the + arguments as instance attributes, which test functions can then examime. ++ The test can set the result returned to ask function + """ +- def __init__(self): +- self.result = None # The return for all show funcs ++ def __init__(self, result=None): ++ self.result = result # Return None for all show funcs + def __call__(self, title, message, *args, **kwds): + # Save all args for possible examination by tester + self.title = title +diff -r c0e311e010fc Lib/idlelib/idle_test/test_autocomplete.py +--- /dev/null ++++ b/Lib/idlelib/idle_test/test_autocomplete.py +@@ -0,0 +1,143 @@ ++import unittest ++from test.support import requires ++from tkinter import Tk, Text, TclError ++ ++import idlelib.AutoComplete as ac ++import idlelib.AutoCompleteWindow as acw ++import idlelib.macosxSupport as mac ++from idlelib.idle_test.mock_idle import Func ++from idlelib.idle_test.mock_tk import Event ++ ++class AutoCompleteWindow: ++ def complete(): ++ return ++ ++class DummyEditwin: ++ def __init__(self, root, text): ++ self.root = root ++ self.text = text ++ self.indentwidth = 8 ++ self.tabwidth = 8 ++ self.context_use_ps1 = True ++ ++ ++class AutoCompleteTest(unittest.TestCase): ++ ++ @classmethod ++ def setUpClass(cls): ++ requires('gui') ++ cls.root = Tk() ++ mac.setupApp(cls.root, None) ++ cls.text = Text(cls.root) ++ cls.editor = DummyEditwin(cls.root, cls.text) ++ ++ @classmethod ++ def tearDownClass(cls): ++ cls.root.destroy() ++ del cls.text ++ del cls.editor ++ del cls.root ++ ++ def setUp(self): ++ self.editor.text.delete('1.0', 'end') ++ self.autocomplete = ac.AutoComplete(self.editor) ++ ++ def test_init(self): ++ self.assertEqual(self.autocomplete.editwin, self.editor) ++ ++ def test_make_autocomplete_window(self): ++ testwin = self.autocomplete._make_autocomplete_window() ++ self.assertIsInstance(testwin, acw.AutoCompleteWindow) ++ ++ def test_remove_autocomplete_window(self): ++ self.autocomplete.autocompletewindow = ( ++ self.autocomplete._make_autocomplete_window()) ++ self.autocomplete._remove_autocomplete_window() ++ self.assertIsNone(self.autocomplete.autocompletewindow) ++ ++ def test_force_open_completions_event(self): ++ # Test that force_open_completions_event calls _open_completions ++ o_cs = Func() ++ self.autocomplete.open_completions = o_cs ++ self.autocomplete.force_open_completions_event('event') ++ self.assertEqual(o_cs.args, (True, False, True)) ++ ++ def test_try_open_completions_event(self): ++ Equal = self.assertEqual ++ autocomplete = self.autocomplete ++ trycompletions = self.autocomplete.try_open_completions_event ++ o_c_l = Func() ++ autocomplete._open_completions_later = o_c_l ++ ++ # _open_completions_later should not be called with no text in editor ++ trycompletions('event') ++ Equal(o_c_l.args, None) ++ ++ # _open_completions_later should be called with COMPLETE_ATTRIBUTES (1) ++ self.text.insert('1.0', 're.') ++ trycompletions('event') ++ Equal(o_c_l.args, (False, False, False, 1)) ++ ++ # _open_completions_later should be called with COMPLETE_FILES (2) ++ self.text.delete('1.0', 'end') ++ self.text.insert('1.0', '"./Lib/') ++ trycompletions('event') ++ Equal(o_c_l.args, (False, False, False, 2)) ++ ++ def test_autocomplete_event(self): ++ Equal = self.assertEqual ++ autocomplete = self.autocomplete ++ ++ # Test that the autocomplete event is ignored if user is pressing a ++ # modifier key in addition to the tab key ++ ev = Event(mc_state=True) ++ self.assertIsNone(autocomplete.autocomplete_event(ev)) ++ del ev.mc_state ++ ++ # If autocomplete window is open, complete() method is called ++ testwin = self.autocomplete._make_autocomplete_window() ++ self.text.insert('1.0', 're.') ++ Equal(self.autocomplete.autocomplete_event(ev), 'break') ++ ++ # If autocomplete window is not active or does not exist, ++ # open_completions is called. Return depends on its return. ++ autocomplete._remove_autocomplete_window() ++ o_cs = Func() # .result = None ++ autocomplete.open_completions = o_cs ++ Equal(self.autocomplete.autocomplete_event(ev), None) ++ Equal(o_cs.args, (False, True, True)) ++ o_cs.result = True ++ Equal(self.autocomplete.autocomplete_event(ev), 'break') ++ Equal(o_cs.args, (False, True, True)) ++ ++ def test_open_completions_later(self): ++ # Test that autocomplete._delayed_completion_id is set ++ pass ++ ++ def test_delayed_open_completions(self): ++ # Test that autocomplete._delayed_completion_id set to None and that ++ # open_completions only called if insertion index is the same as ++ # _delayed_completion_index ++ pass ++ ++ def test_open_completions(self): ++ # Test completions of files and attributes as well as non-completion ++ # of errors ++ pass ++ ++ def test_fetch_completions(self): ++ # Test that fetch_completions returns 2 lists: ++ # For attribute completion, a large list containing all variables, and ++ # a small list containing non-private variables. ++ # For file completion, a large list containing all files in the path, ++ # and a small list containing files that do not start with '.' ++ pass ++ ++ def test_get_entity(self): ++ # Test that a name is in the namespace of sys.modules and ++ # __main__.__dict__ ++ pass ++ ++ ++if __name__ == '__main__': ++ unittest.main(verbosity=2) +diff -r c0e311e010fc Lib/idlelib/idle_test/test_autoexpand.py +--- /dev/null ++++ b/Lib/idlelib/idle_test/test_autoexpand.py +@@ -0,0 +1,141 @@ ++"""Unit tests for idlelib.AutoExpand""" ++import unittest ++from test.support import requires ++from tkinter import Text, Tk ++#from idlelib.idle_test.mock_tk import Text ++from idlelib.AutoExpand import AutoExpand ++ ++ ++class Dummy_Editwin: ++ # AutoExpand.__init__ only needs .text ++ def __init__(self, text): ++ self.text = text ++ ++class AutoExpandTest(unittest.TestCase): ++ ++ @classmethod ++ def setUpClass(cls): ++ if 'tkinter' in str(Text): ++ requires('gui') ++ cls.tk = Tk() ++ cls.text = Text(cls.tk) ++ else: ++ cls.text = Text() ++ cls.auto_expand = AutoExpand(Dummy_Editwin(cls.text)) ++ ++ @classmethod ++ def tearDownClass(cls): ++ if hasattr(cls, 'tk'): ++ cls.tk.destroy() ++ del cls.tk ++ del cls.text, cls.auto_expand ++ ++ def tearDown(self): ++ self.text.delete('1.0', 'end') ++ ++ def test_get_prevword(self): ++ text = self.text ++ previous = self.auto_expand.getprevword ++ equal = self.assertEqual ++ ++ equal(previous(), '') ++ ++ text.insert('insert', 't') ++ equal(previous(), 't') ++ ++ text.insert('insert', 'his') ++ equal(previous(), 'this') ++ ++ text.insert('insert', ' ') ++ equal(previous(), '') ++ ++ text.insert('insert', 'is') ++ equal(previous(), 'is') ++ ++ text.insert('insert', '\nsample\nstring') ++ equal(previous(), 'string') ++ ++ text.delete('3.0', 'insert') ++ equal(previous(), '') ++ ++ text.delete('1.0', 'end') ++ equal(previous(), '') ++ ++ def test_before_only(self): ++ previous = self.auto_expand.getprevword ++ expand = self.auto_expand.expand_word_event ++ equal = self.assertEqual ++ ++ self.text.insert('insert', 'ab ac bx ad ab a') ++ equal(self.auto_expand.getwords(), ['ab', 'ad', 'ac', 'a']) ++ expand('event') ++ equal(previous(), 'ab') ++ expand('event') ++ equal(previous(), 'ad') ++ expand('event') ++ equal(previous(), 'ac') ++ expand('event') ++ equal(previous(), 'a') ++ ++ def test_after_only(self): ++ # Also add punctuation 'noise' that shoud be ignored. ++ text = self.text ++ previous = self.auto_expand.getprevword ++ expand = self.auto_expand.expand_word_event ++ equal = self.assertEqual ++ ++ text.insert('insert', 'a, [ab] ac: () bx"" cd ac= ad ya') ++ text.mark_set('insert', '1.1') ++ equal(self.auto_expand.getwords(), ['ab', 'ac', 'ad', 'a']) ++ expand('event') ++ equal(previous(), 'ab') ++ expand('event') ++ equal(previous(), 'ac') ++ expand('event') ++ equal(previous(), 'ad') ++ expand('event') ++ equal(previous(), 'a') ++ ++ def test_both_before_after(self): ++ text = self.text ++ previous = self.auto_expand.getprevword ++ expand = self.auto_expand.expand_word_event ++ equal = self.assertEqual ++ ++ text.insert('insert', 'ab xy yz\n') ++ text.insert('insert', 'a ac by ac') ++ ++ text.mark_set('insert', '2.1') ++ equal(self.auto_expand.getwords(), ['ab', 'ac', 'a']) ++ expand('event') ++ equal(previous(), 'ab') ++ expand('event') ++ equal(previous(), 'ac') ++ expand('event') ++ equal(previous(), 'a') ++ ++ def test_other_expand_cases(self): ++ text = self.text ++ expand = self.auto_expand.expand_word_event ++ equal = self.assertEqual ++ ++ # no expansion candidate found ++ equal(self.auto_expand.getwords(), []) ++ equal(expand('event'), 'break') ++ ++ text.insert('insert', 'bx cy dz a') ++ equal(self.auto_expand.getwords(), []) ++ ++ # reset state by successfully expanding once ++ # move cursor to another position and expand again ++ text.insert('insert', 'ac xy a ac ad a') ++ text.mark_set('insert', '1.7') ++ expand('event') ++ initial_state = self.auto_expand.state ++ text.mark_set('insert', '1.end') ++ expand('event') ++ new_state = self.auto_expand.state ++ self.assertNotEqual(initial_state, new_state) ++ ++if __name__ == '__main__': ++ unittest.main(verbosity=2) +diff -r c0e311e010fc Lib/idlelib/idle_test/test_configdialog.py +--- /dev/null ++++ b/Lib/idlelib/idle_test/test_configdialog.py +@@ -0,0 +1,32 @@ ++'''Unittests for idlelib/configHandler.py ++ ++Coverage: 46% just by creating dialog. The other half is change code. ++ ++''' ++import unittest ++from test.support import requires ++from tkinter import Tk ++from idlelib.configDialog import ConfigDialog ++from idlelib.macosxSupport import _initializeTkVariantTests ++ ++ ++class ConfigDialogTest(unittest.TestCase): ++ ++ @classmethod ++ def setUpClass(cls): ++ requires('gui') ++ cls.root = Tk() ++ _initializeTkVariantTests(cls.root) ++ ++ @classmethod ++ def tearDownClass(cls): ++ cls.root.destroy() ++ del cls.root ++ ++ def test_dialog(self): ++ d=ConfigDialog(self.root, 'Test', _utest=True) ++ d.destroy() ++ ++ ++if __name__ == '__main__': ++ unittest.main(verbosity=2) +diff -r c0e311e010fc Lib/idlelib/idle_test/test_hyperparser.py +--- /dev/null ++++ b/Lib/idlelib/idle_test/test_hyperparser.py +@@ -0,0 +1,273 @@ ++"""Unittest for idlelib.HyperParser""" ++import unittest ++from test.support import requires ++from tkinter import Tk, Text ++from idlelib.EditorWindow import EditorWindow ++from idlelib.HyperParser import HyperParser ++ ++class DummyEditwin: ++ def __init__(self, text): ++ self.text = text ++ self.indentwidth = 8 ++ self.tabwidth = 8 ++ self.context_use_ps1 = True ++ self.num_context_lines = 50, 500, 1000 ++ ++ _build_char_in_string_func = EditorWindow._build_char_in_string_func ++ is_char_in_string = EditorWindow.is_char_in_string ++ ++ ++class HyperParserTest(unittest.TestCase): ++ code = ( ++ '"""This is a module docstring"""\n' ++ '# this line is a comment\n' ++ 'x = "this is a string"\n' ++ "y = 'this is also a string'\n" ++ 'l = [i for i in range(10)]\n' ++ 'm = [py*py for # comment\n' ++ ' py in l]\n' ++ 'x.__len__\n' ++ "z = ((r'asdf')+('a')))\n" ++ '[x for x in\n' ++ 'for = False\n' ++ 'cliché = "this is a string with unicode, what a cliché"' ++ ) ++ ++ @classmethod ++ def setUpClass(cls): ++ requires('gui') ++ cls.root = Tk() ++ cls.text = Text(cls.root) ++ cls.editwin = DummyEditwin(cls.text) ++ ++ @classmethod ++ def tearDownClass(cls): ++ del cls.text, cls.editwin ++ cls.root.destroy() ++ del cls.root ++ ++ def setUp(self): ++ self.text.insert('insert', self.code) ++ ++ def tearDown(self): ++ self.text.delete('1.0', 'end') ++ self.editwin.context_use_ps1 = True ++ ++ def get_parser(self, index): ++ """ ++ Return a parser object with index at 'index' ++ """ ++ return HyperParser(self.editwin, index) ++ ++ def test_init(self): ++ """ ++ test corner cases in the init method ++ """ ++ with self.assertRaises(ValueError) as ve: ++ self.text.tag_add('console', '1.0', '1.end') ++ p = self.get_parser('1.5') ++ self.assertIn('precedes', str(ve.exception)) ++ ++ # test without ps1 ++ self.editwin.context_use_ps1 = False ++ ++ # number of lines lesser than 50 ++ p = self.get_parser('end') ++ self.assertEqual(p.rawtext, self.text.get('1.0', 'end')) ++ ++ # number of lines greater than 50 ++ self.text.insert('end', self.text.get('1.0', 'end')*4) ++ p = self.get_parser('54.5') ++ ++ def test_is_in_string(self): ++ get = self.get_parser ++ ++ p = get('1.0') ++ self.assertFalse(p.is_in_string()) ++ p = get('1.4') ++ self.assertTrue(p.is_in_string()) ++ p = get('2.3') ++ self.assertFalse(p.is_in_string()) ++ p = get('3.3') ++ self.assertFalse(p.is_in_string()) ++ p = get('3.7') ++ self.assertTrue(p.is_in_string()) ++ p = get('4.6') ++ self.assertTrue(p.is_in_string()) ++ p = get('12.54') ++ self.assertTrue(p.is_in_string()) ++ ++ def test_is_in_code(self): ++ get = self.get_parser ++ ++ p = get('1.0') ++ self.assertTrue(p.is_in_code()) ++ p = get('1.1') ++ self.assertFalse(p.is_in_code()) ++ p = get('2.5') ++ self.assertFalse(p.is_in_code()) ++ p = get('3.4') ++ self.assertTrue(p.is_in_code()) ++ p = get('3.6') ++ self.assertFalse(p.is_in_code()) ++ p = get('4.14') ++ self.assertFalse(p.is_in_code()) ++ ++ def test_get_surrounding_bracket(self): ++ get = self.get_parser ++ ++ def without_mustclose(parser): ++ # a utility function to get surrounding bracket ++ # with mustclose=False ++ return parser.get_surrounding_brackets(mustclose=False) ++ ++ def with_mustclose(parser): ++ # a utility function to get surrounding bracket ++ # with mustclose=True ++ return parser.get_surrounding_brackets(mustclose=True) ++ ++ p = get('3.2') ++ self.assertIsNone(with_mustclose(p)) ++ self.assertIsNone(without_mustclose(p)) ++ ++ p = get('5.6') ++ self.assertTupleEqual(without_mustclose(p), ('5.4', '5.25')) ++ self.assertTupleEqual(without_mustclose(p), with_mustclose(p)) ++ ++ p = get('5.23') ++ self.assertTupleEqual(without_mustclose(p), ('5.21', '5.24')) ++ self.assertTupleEqual(without_mustclose(p), with_mustclose(p)) ++ ++ p = get('6.15') ++ self.assertTupleEqual(without_mustclose(p), ('6.4', '6.end')) ++ self.assertIsNone(with_mustclose(p)) ++ ++ p = get('9.end') ++ self.assertIsNone(with_mustclose(p)) ++ self.assertIsNone(without_mustclose(p)) ++ ++ def test_get_expression(self): ++ get = self.get_parser ++ ++ p = get('4.2') ++ self.assertEqual(p.get_expression(), 'y ') ++ ++ p = get('4.7') ++ with self.assertRaises(ValueError) as ve: ++ p.get_expression() ++ self.assertIn('is inside a code', str(ve.exception)) ++ ++ p = get('5.25') ++ self.assertEqual(p.get_expression(), 'range(10)') ++ ++ p = get('6.7') ++ self.assertEqual(p.get_expression(), 'py') ++ ++ p = get('6.8') ++ self.assertEqual(p.get_expression(), '') ++ ++ p = get('7.9') ++ self.assertEqual(p.get_expression(), 'py') ++ ++ p = get('8.end') ++ self.assertEqual(p.get_expression(), 'x.__len__') ++ ++ p = get('9.13') ++ self.assertEqual(p.get_expression(), "r'asdf'") ++ ++ p = get('9.17') ++ with self.assertRaises(ValueError) as ve: ++ p.get_expression() ++ self.assertIn('is inside a code', str(ve.exception)) ++ ++ p = get('10.0') ++ self.assertEqual(p.get_expression(), '') ++ ++ p = get('10.6') ++ self.assertEqual(p.get_expression(), '') ++ ++ p = get('10.11') ++ self.assertEqual(p.get_expression(), '') ++ ++ p = get('11.3') ++ self.assertEqual(p.get_expression(), '') ++ ++ p = get('11.11') ++ self.assertEqual(p.get_expression(), 'False') ++ ++ p = get('12.6') ++ self.assertEqual(p.get_expression(), 'cliché') ++ ++ def test_eat_identifier(self): ++ def is_valid_id(candidate): ++ result = HyperParser._eat_identifier(candidate, 0, len(candidate)) ++ if result == len(candidate): ++ return True ++ elif result == 0: ++ return False ++ else: ++ err_msg = "Unexpected result: {} (expected 0 or {}".format( ++ result, len(candidate) ++ ) ++ raise Exception(err_msg) ++ ++ # invalid first character which is valid elsewhere in an identifier ++ self.assertFalse(is_valid_id('2notid')) ++ ++ # ASCII-only valid identifiers ++ self.assertTrue(is_valid_id('valid_id')) ++ self.assertTrue(is_valid_id('_valid_id')) ++ self.assertTrue(is_valid_id('valid_id_')) ++ self.assertTrue(is_valid_id('_2valid_id')) ++ ++ # keywords which should be "eaten" ++ self.assertTrue(is_valid_id('True')) ++ self.assertTrue(is_valid_id('False')) ++ self.assertTrue(is_valid_id('None')) ++ ++ # keywords which should not be "eaten" ++ self.assertFalse(is_valid_id('for')) ++ self.assertFalse(is_valid_id('import')) ++ self.assertFalse(is_valid_id('return')) ++ ++ # valid unicode identifiers ++ self.assertTrue(is_valid_id('cliche')) ++ self.assertTrue(is_valid_id('cliché')) ++ self.assertTrue(is_valid_id('a٢')) ++ ++ # invalid unicode identifiers ++ self.assertFalse(is_valid_id('2a')) ++ self.assertFalse(is_valid_id('٢a')) ++ self.assertFalse(is_valid_id('a²')) ++ ++ # valid identifier after "punctuation" ++ self.assertEqual(HyperParser._eat_identifier('+ var', 0, 5), len('var')) ++ self.assertEqual(HyperParser._eat_identifier('+var', 0, 4), len('var')) ++ self.assertEqual(HyperParser._eat_identifier('.var', 0, 4), len('var')) ++ ++ # invalid identifiers ++ self.assertFalse(is_valid_id('+')) ++ self.assertFalse(is_valid_id(' ')) ++ self.assertFalse(is_valid_id(':')) ++ self.assertFalse(is_valid_id('?')) ++ self.assertFalse(is_valid_id('^')) ++ self.assertFalse(is_valid_id('\\')) ++ self.assertFalse(is_valid_id('"')) ++ self.assertFalse(is_valid_id('"a string"')) ++ ++ def test_eat_identifier_various_lengths(self): ++ eat_id = HyperParser._eat_identifier ++ ++ for length in range(1, 21): ++ self.assertEqual(eat_id('a' * length, 0, length), length) ++ self.assertEqual(eat_id('é' * length, 0, length), length) ++ self.assertEqual(eat_id('a' + '2' * (length - 1), 0, length), length) ++ self.assertEqual(eat_id('é' + '2' * (length - 1), 0, length), length) ++ self.assertEqual(eat_id('é' + 'a' * (length - 1), 0, length), length) ++ self.assertEqual(eat_id('é' * (length - 1) + 'a', 0, length), length) ++ self.assertEqual(eat_id('+' * length, 0, length), 0) ++ self.assertEqual(eat_id('2' + 'a' * (length - 1), 0, length), 0) ++ self.assertEqual(eat_id('2' + 'é' * (length - 1), 0, length), 0) ++ ++if __name__ == '__main__': ++ unittest.main(verbosity=2) +diff -r c0e311e010fc Lib/idlelib/idle_test/test_parenmatch.py +--- /dev/null ++++ b/Lib/idlelib/idle_test/test_parenmatch.py +@@ -0,0 +1,109 @@ ++"""Test idlelib.ParenMatch.""" ++# This must currently be a gui test because ParenMatch methods use ++# several text methods not defined on idlelib.idle_test.mock_tk.Text. ++ ++import unittest ++from unittest.mock import Mock ++from test.support import requires ++from tkinter import Tk, Text ++from idlelib.ParenMatch import ParenMatch ++ ++class DummyEditwin: ++ def __init__(self, text): ++ self.text = text ++ self.indentwidth = 8 ++ self.tabwidth = 8 ++ self.context_use_ps1 = True ++ ++ ++class ParenMatchTest(unittest.TestCase): ++ ++ @classmethod ++ def setUpClass(cls): ++ requires('gui') ++ cls.root = Tk() ++ cls.text = Text(cls.root) ++ cls.editwin = DummyEditwin(cls.text) ++ cls.editwin.text_frame = Mock() ++ ++ @classmethod ++ def tearDownClass(cls): ++ del cls.text, cls.editwin ++ cls.root.destroy() ++ del cls.root ++ ++ def tearDown(self): ++ self.text.delete('1.0', 'end') ++ ++ def test_paren_expression(self): ++ """ ++ Test ParenMatch with 'expression' style. ++ """ ++ text = self.text ++ pm = ParenMatch(self.editwin) ++ pm.set_style('expression') ++ ++ text.insert('insert', 'def foobar(a, b') ++ pm.flash_paren_event('event') ++ self.assertIn('<>', text.event_info()) ++ self.assertTupleEqual(text.tag_prevrange('paren', 'end'), ++ ('1.10', '1.15')) ++ text.insert('insert', ')') ++ pm.restore_event() ++ self.assertNotIn('<>', text.event_info()) ++ self.assertEqual(text.tag_prevrange('paren', 'end'), ()) ++ ++ # paren_closed_event can only be tested as below ++ pm.paren_closed_event('event') ++ self.assertTupleEqual(text.tag_prevrange('paren', 'end'), ++ ('1.10', '1.16')) ++ ++ def test_paren_default(self): ++ """ ++ Test ParenMatch with 'default' style. ++ """ ++ text = self.text ++ pm = ParenMatch(self.editwin) ++ pm.set_style('default') ++ ++ text.insert('insert', 'def foobar(a, b') ++ pm.flash_paren_event('event') ++ self.assertIn('<>', text.event_info()) ++ self.assertTupleEqual(text.tag_prevrange('paren', 'end'), ++ ('1.10', '1.11')) ++ text.insert('insert', ')') ++ pm.restore_event() ++ self.assertNotIn('<>', text.event_info()) ++ self.assertEqual(text.tag_prevrange('paren', 'end'), ()) ++ ++ def test_paren_corner(self): ++ """ ++ Test corner cases in flash_paren_event and paren_closed_event. ++ ++ These cases force conditional expression and alternate paths. ++ """ ++ text = self.text ++ pm = ParenMatch(self.editwin) ++ ++ text.insert('insert', '# this is a commen)') ++ self.assertIsNone(pm.paren_closed_event('event')) ++ ++ text.insert('insert', '\ndef') ++ self.assertIsNone(pm.flash_paren_event('event')) ++ self.assertIsNone(pm.paren_closed_event('event')) ++ ++ text.insert('insert', ' a, *arg)') ++ self.assertIsNone(pm.paren_closed_event('event')) ++ ++ def test_handle_restore_timer(self): ++ pm = ParenMatch(self.editwin) ++ pm.restore_event = Mock() ++ pm.handle_restore_timer(0) ++ self.assertTrue(pm.restore_event.called) ++ pm.restore_event.reset_mock() ++ pm.handle_restore_timer(1) ++ self.assertFalse(pm.restore_event.called) ++ ++ ++if __name__ == '__main__': ++ unittest.main(verbosity=2) +diff -r c0e311e010fc Lib/idlelib/idle_test/test_searchdialogbase.py +--- /dev/null ++++ b/Lib/idlelib/idle_test/test_searchdialogbase.py +@@ -0,0 +1,165 @@ ++'''Unittests for idlelib/SearchDialogBase.py ++ ++Coverage: 99%. The only thing not covered is inconsequential -- ++testing skipping of suite when self.needwrapbutton is false. ++ ++''' ++import unittest ++from test.support import requires ++from tkinter import Tk, Toplevel, Frame, Label, BooleanVar, StringVar ++from idlelib import SearchEngine as se ++from idlelib import SearchDialogBase as sdb ++from idlelib.idle_test.mock_idle import Func ++from idlelib.idle_test.mock_tk import Var, Mbox ++ ++# The following could help make some tests gui-free. ++# However, they currently make radiobutton tests fail. ++##def setUpModule(): ++## # Replace tk objects used to initialize se.SearchEngine. ++## se.BooleanVar = Var ++## se.StringVar = Var ++## ++##def tearDownModule(): ++## se.BooleanVar = BooleanVar ++## se.StringVar = StringVar ++ ++class SearchDialogBaseTest(unittest.TestCase): ++ ++ @classmethod ++ def setUpClass(cls): ++ requires('gui') ++ cls.root = Tk() ++ ++ @classmethod ++ def tearDownClass(cls): ++ cls.root.destroy() ++ del cls.root ++ ++ def setUp(self): ++ self.engine = se.SearchEngine(self.root) # None also seems to work ++ self.dialog = sdb.SearchDialogBase(root=self.root, engine=self.engine) ++ ++ def tearDown(self): ++ self.dialog.close() ++ ++ def test_open_and_close(self): ++ # open calls create_widgets, which needs default_command ++ self.dialog.default_command = None ++ ++ # Since text parameter of .open is not used in base class, ++ # pass dummy 'text' instead of tk.Text(). ++ self.dialog.open('text') ++ self.assertEqual(self.dialog.top.state(), 'normal') ++ self.dialog.close() ++ self.assertEqual(self.dialog.top.state(), 'withdrawn') ++ ++ self.dialog.open('text', searchphrase="hello") ++ self.assertEqual(self.dialog.ent.get(), 'hello') ++ self.dialog.close() ++ ++ def test_create_widgets(self): ++ self.dialog.create_entries = Func() ++ self.dialog.create_option_buttons = Func() ++ self.dialog.create_other_buttons = Func() ++ self.dialog.create_command_buttons = Func() ++ ++ self.dialog.default_command = None ++ self.dialog.create_widgets() ++ ++ self.assertTrue(self.dialog.create_entries.called) ++ self.assertTrue(self.dialog.create_option_buttons.called) ++ self.assertTrue(self.dialog.create_other_buttons.called) ++ self.assertTrue(self.dialog.create_command_buttons.called) ++ ++ def test_make_entry(self): ++ equal = self.assertEqual ++ self.dialog.row = 0 ++ self.dialog.top = Toplevel(self.root) ++ entry, label = self.dialog.make_entry("Test:", 'hello') ++ equal(label['text'], 'Test:') ++ ++ self.assertIn(entry.get(), 'hello') ++ egi = entry.grid_info() ++ equal(int(egi['row']), 0) ++ equal(int(egi['column']), 1) ++ equal(int(egi['rowspan']), 1) ++ equal(int(egi['columnspan']), 1) ++ equal(self.dialog.row, 1) ++ ++ def test_create_entries(self): ++ self.dialog.row = 0 ++ self.engine.setpat('hello') ++ self.dialog.create_entries() ++ self.assertIn(self.dialog.ent.get(), 'hello') ++ ++ def test_make_frame(self): ++ self.dialog.row = 0 ++ self.dialog.top = Toplevel(self.root) ++ frame, label = self.dialog.make_frame() ++ self.assertEqual(label, '') ++ self.assertIsInstance(frame, Frame) ++ ++ frame, label = self.dialog.make_frame('testlabel') ++ self.assertEqual(label['text'], 'testlabel') ++ self.assertIsInstance(frame, Frame) ++ ++ def btn_test_setup(self, meth): ++ self.dialog.top = Toplevel(self.root) ++ self.dialog.row = 0 ++ return meth() ++ ++ def test_create_option_buttons(self): ++ e = self.engine ++ for state in (0, 1): ++ for var in (e.revar, e.casevar, e.wordvar, e.wrapvar): ++ var.set(state) ++ frame, options = self.btn_test_setup( ++ self.dialog.create_option_buttons) ++ for spec, button in zip (options, frame.pack_slaves()): ++ var, label = spec ++ self.assertEqual(button['text'], label) ++ self.assertEqual(var.get(), state) ++ if state == 1: ++ button.deselect() ++ else: ++ button.select() ++ self.assertEqual(var.get(), 1 - state) ++ ++ def test_create_other_buttons(self): ++ for state in (False, True): ++ var = self.engine.backvar ++ var.set(state) ++ frame, others = self.btn_test_setup( ++ self.dialog.create_other_buttons) ++ buttons = frame.pack_slaves() ++ for spec, button in zip(others, buttons): ++ val, label = spec ++ self.assertEqual(button['text'], label) ++ if val == state: ++ # hit other button, then this one ++ # indexes depend on button order ++ self.assertEqual(var.get(), state) ++ buttons[val].select() ++ self.assertEqual(var.get(), 1 - state) ++ buttons[1-val].select() ++ self.assertEqual(var.get(), state) ++ ++ def test_make_button(self): ++ self.dialog.top = Toplevel(self.root) ++ self.dialog.buttonframe = Frame(self.dialog.top) ++ btn = self.dialog.make_button('Test', self.dialog.close) ++ self.assertEqual(btn['text'], 'Test') ++ ++ def test_create_command_buttons(self): ++ self.dialog.create_command_buttons() ++ # Look for close button command in buttonframe ++ closebuttoncommand = '' ++ for child in self.dialog.buttonframe.winfo_children(): ++ if child['text'] == 'close': ++ closebuttoncommand = child['command'] ++ self.assertIn('close', closebuttoncommand) ++ ++ ++ ++if __name__ == '__main__': ++ unittest.main(verbosity=2, exit=2) +diff -r c0e311e010fc Lib/idlelib/idle_test/test_textview.py +--- /dev/null ++++ b/Lib/idlelib/idle_test/test_textview.py +@@ -0,0 +1,97 @@ ++'''Test the functions and main class method of textView.py. ++ ++Since all methods and functions create (or destroy) a TextViewer, which ++is a widget containing multiple widgets, all tests must be gui tests. ++Using mock Text would not change this. Other mocks are used to retrieve ++information about calls. ++ ++The coverage is essentially 100%. ++''' ++from test.support import requires ++requires('gui') ++ ++import unittest ++import os ++from tkinter import Tk ++from idlelib import textView as tv ++from idlelib.idle_test.mock_idle import Func ++from idlelib.idle_test.mock_tk import Mbox ++ ++def setUpModule(): ++ global root ++ root = Tk() ++ ++def tearDownModule(): ++ global root ++ root.destroy() # pyflakes falsely sees root as undefined ++ del root ++ ++ ++class TV(tv.TextViewer): # used by TextViewTest ++ transient = Func() ++ grab_set = Func() ++ wait_window = Func() ++ ++class TextViewTest(unittest.TestCase): ++ ++ def setUp(self): ++ TV.transient.__init__() ++ TV.grab_set.__init__() ++ TV.wait_window.__init__() ++ ++ def test_init_modal(self): ++ view = TV(root, 'Title', 'test text') ++ self.assertTrue(TV.transient.called) ++ self.assertTrue(TV.grab_set.called) ++ self.assertTrue(TV.wait_window.called) ++ view.Ok() ++ ++ def test_init_nonmodal(self): ++ view = TV(root, 'Title', 'test text', modal=False) ++ self.assertFalse(TV.transient.called) ++ self.assertFalse(TV.grab_set.called) ++ self.assertFalse(TV.wait_window.called) ++ view.Ok() ++ ++ def test_ok(self): ++ view = TV(root, 'Title', 'test text', modal=False) ++ view.destroy = Func() ++ view.Ok() ++ self.assertTrue(view.destroy.called) ++ del view.destroy # unmask real function ++ view.destroy ++ ++ ++class textviewTest(unittest.TestCase): ++ ++ @classmethod ++ def setUpClass(cls): ++ cls.orig_mbox = tv.tkMessageBox ++ tv.tkMessageBox = Mbox ++ ++ @classmethod ++ def tearDownClass(cls): ++ tv.tkMessageBox = cls.orig_mbox ++ del cls.orig_mbox ++ ++ def test_view_text(self): ++ # If modal True, tkinter will error with 'can't invoke "event" command' ++ view = tv.view_text(root, 'Title', 'test text', modal=False) ++ self.assertIsInstance(view, tv.TextViewer) ++ ++ def test_view_file(self): ++ test_dir = os.path.dirname(__file__) ++ testfile = os.path.join(test_dir, 'test_textview.py') ++ view = tv.view_file(root, 'Title', testfile, modal=False) ++ self.assertIsInstance(view, tv.TextViewer) ++ self.assertIn('Test', view.textView.get('1.0', '1.end')) ++ view.Ok() ++ ++ # Mock messagebox will be used and view_file will not return anything ++ testfile = os.path.join(test_dir, '../notthere.py') ++ view = tv.view_file(root, 'Title', testfile, modal=False) ++ self.assertIsNone(view) ++ ++ ++if __name__ == '__main__': ++ unittest.main(verbosity=2) +diff -r c0e311e010fc Lib/idlelib/idle_test/test_widgetredir.py +--- /dev/null ++++ b/Lib/idlelib/idle_test/test_widgetredir.py +@@ -0,0 +1,122 @@ ++"""Unittest for idlelib.WidgetRedirector ++ ++100% coverage ++""" ++from test.support import requires ++import unittest ++from idlelib.idle_test.mock_idle import Func ++from tkinter import Tk, Text, TclError ++from idlelib.WidgetRedirector import WidgetRedirector ++ ++ ++class InitCloseTest(unittest.TestCase): ++ ++ @classmethod ++ def setUpClass(cls): ++ requires('gui') ++ cls.tk = Tk() ++ cls.text = Text(cls.tk) ++ ++ @classmethod ++ def tearDownClass(cls): ++ cls.text.destroy() ++ cls.tk.destroy() ++ del cls.text, cls.tk ++ ++ def test_init(self): ++ redir = WidgetRedirector(self.text) ++ self.assertEqual(redir.widget, self.text) ++ self.assertEqual(redir.tk, self.text.tk) ++ self.assertRaises(TclError, WidgetRedirector, self.text) ++ redir.close() # restore self.tk, self.text ++ ++ def test_close(self): ++ redir = WidgetRedirector(self.text) ++ redir.register('insert', Func) ++ redir.close() ++ self.assertEqual(redir._operations, {}) ++ self.assertFalse(hasattr(self.text, 'widget')) ++ ++ ++class WidgetRedirectorTest(unittest.TestCase): ++ ++ @classmethod ++ def setUpClass(cls): ++ requires('gui') ++ cls.tk = Tk() ++ cls.text = Text(cls.tk) ++ ++ @classmethod ++ def tearDownClass(cls): ++ cls.text.destroy() ++ cls.tk.destroy() ++ del cls.text, cls.tk ++ ++ def setUp(self): ++ self.redir = WidgetRedirector(self.text) ++ self.func = Func() ++ self.orig_insert = self.redir.register('insert', self.func) ++ self.text.insert('insert', 'asdf') # leaves self.text empty ++ ++ def tearDown(self): ++ self.text.delete('1.0', 'end') ++ self.redir.close() ++ ++ def test_repr(self): # partly for 100% coverage ++ self.assertIn('Redirector', repr(self.redir)) ++ self.assertIn('Original', repr(self.orig_insert)) ++ ++ def test_register(self): ++ self.assertEqual(self.text.get('1.0', 'end'), '\n') ++ self.assertEqual(self.func.args, ('insert', 'asdf')) ++ self.assertIn('insert', self.redir._operations) ++ self.assertIn('insert', self.text.__dict__) ++ self.assertEqual(self.text.insert, self.func) ++ ++ def test_original_command(self): ++ self.assertEqual(self.orig_insert.operation, 'insert') ++ self.assertEqual(self.orig_insert.tk_call, self.text.tk.call) ++ self.orig_insert('insert', 'asdf') ++ self.assertEqual(self.text.get('1.0', 'end'), 'asdf\n') ++ ++ def test_unregister(self): ++ self.assertIsNone(self.redir.unregister('invalid operation name')) ++ self.assertEqual(self.redir.unregister('insert'), self.func) ++ self.assertNotIn('insert', self.redir._operations) ++ self.assertNotIn('insert', self.text.__dict__) ++ ++ def test_unregister_no_attribute(self): ++ del self.text.insert ++ self.assertEqual(self.redir.unregister('insert'), self.func) ++ ++ def test_dispatch_intercept(self): ++ self.func.__init__(True) ++ self.assertTrue(self.redir.dispatch('insert', False)) ++ self.assertFalse(self.func.args[0]) ++ ++ def test_dispatch_bypass(self): ++ self.orig_insert('insert', 'asdf') ++ # tk.call returns '' where Python would return None ++ self.assertEqual(self.redir.dispatch('delete', '1.0', 'end'), '') ++ self.assertEqual(self.text.get('1.0', 'end'), '\n') ++ ++ def test_dispatch_error(self): ++ self.func.__init__(TclError()) ++ self.assertEqual(self.redir.dispatch('insert', False), '') ++ self.assertEqual(self.redir.dispatch('invalid'), '') ++ ++ def test_command_dispatch(self): ++ # Test that .__init__ causes redirection of tk calls ++ # through redir.dispatch ++ self.tk.call(self.text._w, 'insert', 'hello') ++ self.assertEqual(self.func.args, ('hello',)) ++ self.assertEqual(self.text.get('1.0', 'end'), '\n') ++ # Ensure that called through redir .dispatch and not through ++ # self.text.insert by having mock raise TclError. ++ self.func.__init__(TclError()) ++ self.assertEqual(self.tk.call(self.text._w, 'insert', 'boo'), '') ++ ++ ++ ++if __name__ == '__main__': ++ unittest.main(verbosity=2) +diff -r c0e311e010fc Lib/idlelib/keybindingDialog.py +--- a/Lib/idlelib/keybindingDialog.py ++++ b/Lib/idlelib/keybindingDialog.py +@@ -7,12 +7,13 @@ + import sys + + class GetKeysDialog(Toplevel): +- def __init__(self,parent,title,action,currentKeySequences): ++ def __init__(self,parent,title,action,currentKeySequences,_htest=False): + """ + action - string, the name of the virtual event these keys will be + mapped to + currentKeys - list, a list of all key sequence lists currently mapped + to virtual events, for overlap checking ++ _htest - bool, change box location when running htest + """ + Toplevel.__init__(self, parent) + self.configure(borderwidth=5) +@@ -38,11 +39,14 @@ + self.LoadFinalKeyList() + self.withdraw() #hide while setting geometry + self.update_idletasks() +- self.geometry("+%d+%d" % +- ((parent.winfo_rootx()+((parent.winfo_width()/2) +- -(self.winfo_reqwidth()/2)), +- parent.winfo_rooty()+((parent.winfo_height()/2) +- -(self.winfo_reqheight()/2)) )) ) #centre dialog over parent ++ self.geometry( ++ "+%d+%d" % ( ++ parent.winfo_rootx() + ++ (parent.winfo_width()/2 - self.winfo_reqwidth()/2), ++ parent.winfo_rooty() + ++ ((parent.winfo_height()/2 - self.winfo_reqheight()/2) ++ if not _htest else 150) ++ ) ) #centre dialog over parent (or below htest box) + self.deiconify() #geometry set, unhide + self.wait_window() + +@@ -258,11 +262,5 @@ + return keysOK + + if __name__ == '__main__': +- #test the dialog +- root=Tk() +- def run(): +- keySeq='' +- dlg=GetKeysDialog(root,'Get Keys','find-again',[]) +- print(dlg.result) +- Button(root,text='Dialog',command=run).pack() +- root.mainloop() ++ from idlelib.idle_test.htest import run ++ run(GetKeysDialog) +diff -r c0e311e010fc Lib/idlelib/tabbedpages.py +--- a/Lib/idlelib/tabbedpages.py ++++ b/Lib/idlelib/tabbedpages.py +@@ -467,9 +467,12 @@ + + self._tab_set.set_selected_tab(page_name) + +-if __name__ == '__main__': ++def _tabbed_pages(parent): + # test dialog + root=Tk() ++ width, height, x, y = list(map(int, re.split('[x+]', parent.geometry()))) ++ root.geometry("+%d+%d"%(x, y + 175)) ++ root.title("Test tabbed pages") + tabPage=TabbedPageSet(root, page_names=['Foobar','Baz'], n_rows=0, + expand_tabs=False, + ) +@@ -488,3 +491,8 @@ + labelPgName.pack(padx=5) + entryPgName.pack(padx=5) + root.mainloop() ++ ++ ++if __name__ == '__main__': ++ from idlelib.idle_test.htest import run ++ run(_tabbed_pages) +diff -r c0e311e010fc Lib/idlelib/textView.py +--- a/Lib/idlelib/textView.py ++++ b/Lib/idlelib/textView.py +@@ -9,15 +9,21 @@ + """A simple text viewer dialog for IDLE + + """ +- def __init__(self, parent, title, text, modal=True): ++ def __init__(self, parent, title, text, modal=True, _htest=False): + """Show the given text in a scrollable window with a 'close' button + ++ If modal option set to False, user can interact with other windows, ++ otherwise they will be unable to interact with other windows until ++ the textview window is closed. ++ ++ _htest - bool; change box location when running htest. + """ + Toplevel.__init__(self, parent) + self.configure(borderwidth=5) ++ # place dialog below parent if running htest + self.geometry("=%dx%d+%d+%d" % (625, 500, +- parent.winfo_rootx() + 10, +- parent.winfo_rooty() + 10)) ++ parent.winfo_rootx() + 10, ++ parent.winfo_rooty() + (10 if not _htest else 100))) + #elguavas - config placeholders til config stuff completed + self.bg = '#ffffff' + self.fg = '#000000' +@@ -66,32 +72,15 @@ + try: + with open(filename, 'r', encoding=encoding) as file: + contents = file.read() +- except OSError: +- import tkinter.messagebox as tkMessageBox ++ except IOError: + tkMessageBox.showerror(title='File Load Error', + message='Unable to load file %r .' % filename, + parent=parent) + else: + return view_text(parent, title, contents, modal) + +- + if __name__ == '__main__': +- #test the dialog +- root=Tk() +- root.title('textView test') +- filename = './textView.py' +- with open(filename, 'r') as f: +- text = f.read() +- btn1 = Button(root, text='view_text', +- command=lambda:view_text(root, 'view_text', text)) +- btn1.pack(side=LEFT) +- btn2 = Button(root, text='view_file', +- command=lambda:view_file(root, 'view_file', filename)) +- btn2.pack(side=LEFT) +- btn3 = Button(root, text='nonmodal view_text', +- command=lambda:view_text(root, 'nonmodal view_text', text, +- modal=False)) +- btn3.pack(side=LEFT) +- close = Button(root, text='Close', command=root.destroy) +- close.pack(side=RIGHT) +- root.mainloop() ++ import unittest ++ unittest.main('idlelib.idle_test.test_textview', verbosity=2, exit=False) ++ from idlelib.idle_test.htest import run ++ run(TextViewer) +diff -r c0e311e010fc Lib/inspect.py +--- a/Lib/inspect.py ++++ b/Lib/inspect.py +@@ -1912,6 +1912,10 @@ + pass + else: + if sig is not None: ++ if not isinstance(sig, Signature): ++ raise TypeError( ++ 'unexpected object {!r} in __signature__ ' ++ 'attribute'.format(sig)) + return sig + + try: +diff -r c0e311e010fc Lib/logging/__init__.py +--- a/Lib/logging/__init__.py ++++ b/Lib/logging/__init__.py +@@ -52,34 +52,6 @@ + #--------------------------------------------------------------------------- + + # +-# _srcfile is used when walking the stack to check when we've got the first +-# caller stack frame. +-# +-if hasattr(sys, 'frozen'): #support for py2exe +- _srcfile = "logging%s__init__%s" % (os.sep, __file__[-4:]) +-else: +- _srcfile = __file__ +-_srcfile = os.path.normcase(_srcfile) +- +- +-if hasattr(sys, '_getframe'): +- currentframe = lambda: sys._getframe(3) +-else: #pragma: no cover +- def currentframe(): +- """Return the frame object for the caller's stack frame.""" +- try: +- raise Exception +- except Exception: +- return sys.exc_info()[2].tb_frame.f_back +- +-# _srcfile is only used in conjunction with sys._getframe(). +-# To provide compatibility with older versions of Python, set _srcfile +-# to None if _getframe() is not available; this value will prevent +-# findCaller() from being called. +-#if not hasattr(sys, "_getframe"): +-# _srcfile = None +- +-# + #_startTime is used as the base when calculating the relative time of events + # + _startTime = time.time() +@@ -172,6 +144,40 @@ + finally: + _releaseLock() + ++if hasattr(sys, '_getframe'): ++ currentframe = lambda: sys._getframe(3) ++else: #pragma: no cover ++ def currentframe(): ++ """Return the frame object for the caller's stack frame.""" ++ try: ++ raise Exception ++ except Exception: ++ return sys.exc_info()[2].tb_frame.f_back ++ ++# ++# _srcfile is used when walking the stack to check when we've got the first ++# caller stack frame, by skipping frames whose filename is that of this ++# module's source. It therefore should contain the filename of this module's ++# source file. ++# ++# Ordinarily we would use __file__ for this, but frozen modules don't always ++# have __file__ set, for some reason (see Issue #21736). Thus, we get the ++# filename from a handy code object from a function defined in this module. ++# (There's no particular reason for picking addLevelName.) ++# ++ ++_srcfile = os.path.normcase(addLevelName.__code__.co_filename) ++ ++# _srcfile is only used in conjunction with sys._getframe(). ++# To provide compatibility with older versions of Python, set _srcfile ++# to None if _getframe() is not available; this value will prevent ++# findCaller() from being called. You can also do this if you want to avoid ++# the overhead of fetching caller information, even when _getframe() is ++# available. ++#if not hasattr(sys, '_getframe'): ++# _srcfile = None ++ ++ + def _checkLevel(level): + if isinstance(level, int): + rv = level +diff -r c0e311e010fc Lib/logging/handlers.py +--- a/Lib/logging/handlers.py ++++ b/Lib/logging/handlers.py +@@ -463,6 +463,7 @@ + # we have an open file handle, clean it up + self.stream.flush() + self.stream.close() ++ self.stream = None # See Issue #21742: _open () might fail. + # open a new file handle and get new stat info from that fd + self.stream = self._open() + self._statstream() +diff -r c0e311e010fc Lib/mailbox.py +--- a/Lib/mailbox.py ++++ b/Lib/mailbox.py +@@ -103,7 +103,7 @@ + + def itervalues(self): + """Return an iterator over all messages.""" +- for key in self.keys(): ++ for key in self.iterkeys(): + try: + value = self[key] + except KeyError: +@@ -119,7 +119,7 @@ + + def iteritems(self): + """Return an iterator over (key, message) tuples.""" +- for key in self.keys(): ++ for key in self.iterkeys(): + try: + value = self[key] + except KeyError: +@@ -154,7 +154,7 @@ + + def popitem(self): + """Delete an arbitrary (key, message) pair and return it.""" +- for key in self.keys(): ++ for key in self.iterkeys(): + return (key, self.pop(key)) # This is only run once. + else: + raise KeyError('No messages in mailbox') +@@ -162,7 +162,7 @@ + def update(self, arg=None): + """Change the messages that correspond to certain keys.""" + if hasattr(arg, 'iteritems'): +- source = arg.items() ++ source = arg.iteritems() + elif hasattr(arg, 'items'): + source = arg.items() + else: +@@ -559,7 +559,7 @@ + def next(self): + """Return the next message in a one-time iteration.""" + if not hasattr(self, '_onetime_keys'): +- self._onetime_keys = iter(self.keys()) ++ self._onetime_keys = self.iterkeys() + while True: + try: + return self[next(self._onetime_keys)] +@@ -1078,7 +1078,7 @@ + + def __len__(self): + """Return a count of messages in the mailbox.""" +- return len(list(self.keys())) ++ return len(list(self.iterkeys())) + + def lock(self): + """Lock the mailbox.""" +@@ -1192,7 +1192,7 @@ + sequences = self.get_sequences() + prev = 0 + changes = [] +- for key in self.keys(): ++ for key in self.iterkeys(): + if key - 1 != prev: + changes.append((key, prev + 1)) + if hasattr(os, 'link'): +diff -r c0e311e010fc Lib/modulefinder.py +--- a/Lib/modulefinder.py ++++ b/Lib/modulefinder.py +@@ -568,11 +568,12 @@ + if isinstance(consts[i], type(co)): + consts[i] = self.replace_paths_in_code(consts[i]) + +- return types.CodeType(co.co_argcount, co.co_nlocals, co.co_stacksize, +- co.co_flags, co.co_code, tuple(consts), co.co_names, +- co.co_varnames, new_filename, co.co_name, +- co.co_firstlineno, co.co_lnotab, +- co.co_freevars, co.co_cellvars) ++ return types.CodeType(co.co_argcount, co.co_kwonlyargcount, ++ co.co_nlocals, co.co_stacksize, co.co_flags, ++ co.co_code, tuple(consts), co.co_names, ++ co.co_varnames, new_filename, co.co_name, ++ co.co_firstlineno, co.co_lnotab, co.co_freevars, ++ co.co_cellvars) + + + def test(): +diff -r c0e311e010fc Lib/multiprocessing/dummy/__init__.py +--- a/Lib/multiprocessing/dummy/__init__.py ++++ b/Lib/multiprocessing/dummy/__init__.py +@@ -104,7 +104,7 @@ + self._value = value + value = property(_get, _set) + def __repr__(self): +- return '<%r(%r, %r)>'%(type(self).__name__,self._typecode,self._value) ++ return '<%s(%r, %r)>'%(type(self).__name__,self._typecode,self._value) + + def Manager(): + return sys.modules[__name__] +diff -r c0e311e010fc Lib/nntplib.py +--- a/Lib/nntplib.py ++++ b/Lib/nntplib.py +@@ -86,7 +86,7 @@ + ] + + # maximal line length when calling readline(). This is to prevent +-# reading arbitrary lenght lines. RFC 3977 limits NNTP line length to ++# reading arbitrary length lines. RFC 3977 limits NNTP line length to + # 512 characters, including CRLF. We have selected 2048 just to be on + # the safe side. + _MAXLINE = 2048 +diff -r c0e311e010fc Lib/os.py +--- a/Lib/os.py ++++ b/Lib/os.py +@@ -1,4 +1,4 @@ +-r"""OS routines for Mac, NT, or Posix depending on what system we're on. ++r"""OS routines for NT or Posix depending on what system we're on. + + This exports: + - all functions from posix, nt or ce, e.g. unlink, stat, etc. +@@ -312,11 +312,12 @@ + + When topdown is true, the caller can modify the dirnames list in-place + (e.g., via del or slice assignment), and walk will only recurse into the +- subdirectories whose names remain in dirnames; this can be used to prune +- the search, or to impose a specific order of visiting. Modifying +- dirnames when topdown is false is ineffective, since the directories in +- dirnames have already been generated by the time dirnames itself is +- generated. ++ subdirectories whose names remain in dirnames; this can be used to prune the ++ search, or to impose a specific order of visiting. Modifying dirnames when ++ topdown is false is ineffective, since the directories in dirnames have ++ already been generated by the time dirnames itself is generated. No matter ++ the value of topdown, the list of subdirectories is retrieved before the ++ tuples for the directory and its subdirectories are generated. + + By default errors from the os.listdir() call are ignored. If + optional arg 'onerror' is specified, it should be a function; it +@@ -344,6 +345,7 @@ + print("bytes in", len(files), "non-directory files") + if 'CVS' in dirs: + dirs.remove('CVS') # don't visit CVS directories ++ + """ + + islink, join, isdir = path.islink, path.join, path.isdir +diff -r c0e311e010fc Lib/pathlib.py +--- a/Lib/pathlib.py ++++ b/Lib/pathlib.py +@@ -749,17 +749,20 @@ + """Return a new path with the file name changed.""" + if not self.name: + raise ValueError("%r has an empty name" % (self,)) ++ drv, root, parts = self._flavour.parse_parts((name,)) ++ if (not name or name[-1] in [self._flavour.sep, self._flavour.altsep] ++ or drv or root or len(parts) != 1): ++ raise ValueError("Invalid name %r" % (name)) + return self._from_parsed_parts(self._drv, self._root, + self._parts[:-1] + [name]) + + def with_suffix(self, suffix): + """Return a new path with the file suffix changed (or added, if none).""" + # XXX if suffix is None, should the current suffix be removed? +- drv, root, parts = self._flavour.parse_parts((suffix,)) +- if drv or root or len(parts) != 1: ++ f = self._flavour ++ if f.sep in suffix or f.altsep and f.altsep in suffix: + raise ValueError("Invalid suffix %r" % (suffix)) +- suffix = parts[0] +- if not suffix.startswith('.'): ++ if suffix and not suffix.startswith('.') or suffix == '.': + raise ValueError("Invalid suffix %r" % (suffix)) + name = self.name + if not name: +diff -r c0e311e010fc Lib/pdb.py +--- a/Lib/pdb.py ++++ b/Lib/pdb.py +@@ -673,7 +673,7 @@ + # now set the break point + err = self.set_break(filename, line, temporary, cond, funcname) + if err: +- self.error(err, file=self.stdout) ++ self.error(err) + else: + bp = self.get_breaks(filename, line)[-1] + self.message("Breakpoint %d at %s:%d" % +diff -r c0e311e010fc Lib/pkgutil.py +--- a/Lib/pkgutil.py ++++ b/Lib/pkgutil.py +@@ -456,6 +456,8 @@ + """ + if module_or_name in sys.modules: + module_or_name = sys.modules[module_or_name] ++ if module_or_name is None: ++ return None + if isinstance(module_or_name, ModuleType): + module = module_or_name + loader = getattr(module, '__loader__', None) +@@ -487,7 +489,7 @@ + # pkgutil previously raised ImportError + msg = "Error while finding loader for {!r} ({}: {})" + raise ImportError(msg.format(fullname, type(ex), ex)) from ex +- return spec.loader ++ return spec.loader if spec is not None else None + + + def extend_path(path, name): +diff -r c0e311e010fc Lib/plistlib.py +--- a/Lib/plistlib.py ++++ b/Lib/plistlib.py +@@ -619,10 +619,7 @@ + offset_table_offset + ) = struct.unpack('>6xBBQQQ', trailer) + self._fp.seek(offset_table_offset) +- offset_format = '>' + _BINARY_FORMAT[offset_size] * num_objects +- self._ref_format = _BINARY_FORMAT[self._ref_size] +- self._object_offsets = struct.unpack( +- offset_format, self._fp.read(offset_size * num_objects)) ++ self._object_offsets = self._read_ints(num_objects, offset_size) + return self._read_object(self._object_offsets[top_object]) + + except (OSError, IndexError, struct.error): +@@ -638,9 +635,16 @@ + + return tokenL + ++ def _read_ints(self, n, size): ++ data = self._fp.read(size * n) ++ if size in _BINARY_FORMAT: ++ return struct.unpack('>' + _BINARY_FORMAT[size] * n, data) ++ else: ++ return tuple(int.from_bytes(data[i: i + size], 'big') ++ for i in range(0, size * n, size)) ++ + def _read_refs(self, n): +- return struct.unpack( +- '>' + self._ref_format * n, self._fp.read(n * self._ref_size)) ++ return self._read_ints(n, self._ref_size) + + def _read_object(self, offset): + """ +@@ -980,18 +984,16 @@ + fp.seek(0) + for info in _FORMATS.values(): + if info['detect'](header): +- p = info['parser']( +- use_builtin_types=use_builtin_types, +- dict_type=dict_type, +- ) ++ P = info['parser'] + break + + else: + raise InvalidFileException() + + else: +- p = _FORMATS[fmt]['parser'](use_builtin_types=use_builtin_types) ++ P = _FORMATS[fmt]['parser'] + ++ p = P(use_builtin_types=use_builtin_types, dict_type=dict_type) + return p.parse(fp) + + +diff -r c0e311e010fc Lib/posixpath.py +--- a/Lib/posixpath.py ++++ b/Lib/posixpath.py +@@ -48,7 +48,6 @@ + + def normcase(s): + """Normalize case of pathname. Has no effect under Posix""" +- # TODO: on Mac OS X, this should really return s.lower(). + if not isinstance(s, (bytes, str)): + raise TypeError("normcase() argument must be str or bytes, " + "not '{}'".format(s.__class__.__name__)) +diff -r c0e311e010fc Lib/pydoc.py +--- a/Lib/pydoc.py ++++ b/Lib/pydoc.py +@@ -64,6 +64,7 @@ + import sys + import time + import tokenize ++import urllib.parse + import warnings + from collections import deque + from reprlib import Repr +@@ -595,10 +596,15 @@ + elif pep: + url = 'http://www.python.org/dev/peps/pep-%04d/' % int(pep) + results.append('%s' % (url, escape(all))) ++ elif selfdot: ++ # Create a link for methods like 'self.method(...)' ++ # and use for attributes like 'self.attr' ++ if text[end:end+1] == '(': ++ results.append('self.' + self.namelink(name, methods)) ++ else: ++ results.append('self.%s' % name) + elif text[end:end+1] == '(': + results.append(self.namelink(name, methods, funcs, classes)) +- elif selfdot: +- results.append('self.%s' % name) + else: + results.append(self.namelink(name, classes)) + here = end +@@ -643,10 +649,7 @@ + head = '%s' % linkedname + try: + path = inspect.getabsfile(object) +- url = path +- if sys.platform == 'win32': +- import nturl2path +- url = nturl2path.pathname2url(path) ++ url = urllib.parse.quote(path) + filelink = self.filelink(url, path) + except TypeError: + filelink = '(built-in)' +@@ -1412,6 +1415,8 @@ + + def getpager(): + """Decide what method to use for paging through text.""" ++ if not hasattr(sys.stdin, "isatty"): ++ return plainpager + if not hasattr(sys.stdout, "isatty"): + return plainpager + if not sys.stdin.isatty() or not sys.stdout.isatty(): +@@ -1733,7 +1738,6 @@ + 'TRACEBACKS': 'TYPES', + 'NONE': ('bltin-null-object', ''), + 'ELLIPSIS': ('bltin-ellipsis-object', 'SLICINGS'), +- 'FILES': ('bltin-file-objects', ''), + 'SPECIALATTRIBUTES': ('specialattrs', ''), + 'CLASSES': ('types', 'class SPECIALMETHODS PRIVATENAMES'), + 'MODULES': ('typesmodules', 'import'), +@@ -2347,7 +2351,7 @@ + + def html_getfile(path): + """Get and display a source file listing safely.""" +- path = path.replace('%20', ' ') ++ path = urllib.parse.unquote(path) + with tokenize.open(path) as fp: + lines = html.escape(fp.read()) + body = '
%s
' % lines +diff -r c0e311e010fc Lib/quopri.py +--- a/Lib/quopri.py ++++ b/Lib/quopri.py +@@ -44,13 +44,11 @@ + def encode(input, output, quotetabs, header=False): + """Read 'input', apply quoted-printable encoding, and write to 'output'. + +- 'input' and 'output' are files with readline() and write() methods. +- The 'quotetabs' flag indicates whether embedded tabs and spaces should be +- quoted. Note that line-ending tabs and spaces are always encoded, as per +- RFC 1521. +- The 'header' flag indicates whether we are encoding spaces as _ as per +- RFC 1522. +- """ ++ 'input' and 'output' are binary file objects. The 'quotetabs' flag ++ indicates whether embedded tabs and spaces should be quoted. Note that ++ line-ending tabs and spaces are always encoded, as per RFC 1521. ++ The 'header' flag indicates whether we are encoding spaces as _ as per RFC ++ 1522.""" + + if b2a_qp is not None: + data = input.read() +@@ -118,7 +116,7 @@ + + def decode(input, output, header=False): + """Read 'input', apply quoted-printable decoding, and write to 'output'. +- 'input' and 'output' are files with readline() and write() methods. ++ 'input' and 'output' are binary file objects. + If 'header' is true, decode underscore as space (per RFC 1522).""" + + if a2b_qp is not None: +diff -r c0e311e010fc Lib/random.py +--- a/Lib/random.py ++++ b/Lib/random.py +@@ -355,7 +355,10 @@ + + """ + u = self.random() +- c = 0.5 if mode is None else (mode - low) / (high - low) ++ try: ++ c = 0.5 if mode is None else (mode - low) / (high - low) ++ except ZeroDivisionError: ++ return low + if u > c: + u = 1.0 - u + c = 1.0 - c +diff -r c0e311e010fc Lib/site.py +--- a/Lib/site.py ++++ b/Lib/site.py +@@ -373,7 +373,7 @@ + dirs.extend([os.path.join(here, os.pardir), here, os.curdir]) + builtins.license = _sitebuiltins._Printer( + "license", +- "See http://www.python.org/download/releases/%.5s/license" % sys.version, ++ "See http://www.python.org/psf/license/", + files, dirs) + + +diff -r c0e311e010fc Lib/smtplib.py +--- a/Lib/smtplib.py ++++ b/Lib/smtplib.py +@@ -377,6 +377,7 @@ + if self.debuglevel > 0: + print('reply:', repr(line), file=stderr) + if len(line) > _MAXLINE: ++ self.close() + raise SMTPResponseException(500, "Line too long.") + resp.append(line[4:].strip(b' \t\r\n')) + code = line[:3] +diff -r c0e311e010fc Lib/socketserver.py +--- a/Lib/socketserver.py ++++ b/Lib/socketserver.py +@@ -523,35 +523,39 @@ + + def collect_children(self): + """Internal routine to wait for children that have exited.""" +- if self.active_children is None: return ++ if self.active_children is None: ++ return ++ ++ # If we're above the max number of children, wait and reap them until ++ # we go back below threshold. Note that we use waitpid(-1) below to be ++ # able to collect children in size() syscalls instead ++ # of size(): the downside is that this might reap children ++ # which we didn't spawn, which is why we only resort to this when we're ++ # above max_children. + while len(self.active_children) >= self.max_children: +- # XXX: This will wait for any child process, not just ones +- # spawned by this library. This could confuse other +- # libraries that expect to be able to wait for their own +- # children. + try: +- pid, status = os.waitpid(0, 0) ++ pid, _ = os.waitpid(-1, 0) ++ self.active_children.discard(pid) ++ except InterruptedError: ++ pass ++ except ChildProcessError: ++ # we don't have any children, we're done ++ self.active_children.clear() + except OSError: +- pid = None +- if pid not in self.active_children: continue +- self.active_children.remove(pid) ++ break + +- # XXX: This loop runs more system calls than it ought +- # to. There should be a way to put the active_children into a +- # process group and then use os.waitpid(-pgid) to wait for any +- # of that set, but I couldn't find a way to allocate pgids +- # that couldn't collide. +- for child in self.active_children: ++ # Now reap all defunct children. ++ for pid in self.active_children.copy(): + try: +- pid, status = os.waitpid(child, os.WNOHANG) ++ pid, _ = os.waitpid(pid, os.WNOHANG) ++ # if the child hasn't exited yet, pid will be 0 and ignored by ++ # discard() below ++ self.active_children.discard(pid) ++ except ChildProcessError: ++ # someone else reaped it ++ self.active_children.discard(pid) + except OSError: +- pid = None +- if not pid: continue +- try: +- self.active_children.remove(pid) +- except ValueError as e: +- raise ValueError('%s. x=%d and list=%r' % (e.message, pid, +- self.active_children)) ++ pass + + def handle_timeout(self): + """Wait for zombies after self.timeout seconds of inactivity. +@@ -573,8 +577,8 @@ + if pid: + # Parent process + if self.active_children is None: +- self.active_children = [] +- self.active_children.append(pid) ++ self.active_children = set() ++ self.active_children.add(pid) + self.close_request(request) + return + else: +diff -r c0e311e010fc Lib/sqlite3/dbapi2.py +--- a/Lib/sqlite3/dbapi2.py ++++ b/Lib/sqlite3/dbapi2.py +@@ -22,6 +22,7 @@ + + import datetime + import time ++import collections.abc + + from _sqlite3 import * + +@@ -50,6 +51,7 @@ + sqlite_version_info = tuple([int(x) for x in sqlite_version.split(".")]) + + Binary = memoryview ++collections.abc.Sequence.register(Row) + + def register_adapters_and_converters(): + def adapt_date(val): +diff -r c0e311e010fc Lib/sqlite3/test/factory.py +--- a/Lib/sqlite3/test/factory.py ++++ b/Lib/sqlite3/test/factory.py +@@ -23,6 +23,7 @@ + + import unittest + import sqlite3 as sqlite ++from collections.abc import Sequence + + class MyConnection(sqlite.Connection): + def __init__(self, *args, **kwargs): +@@ -96,9 +97,19 @@ + self.assertEqual(col1, 1, "by name: wrong result for column 'A'") + self.assertEqual(col2, 2, "by name: wrong result for column 'B'") + +- col1, col2 = row[0], row[1] +- self.assertEqual(col1, 1, "by index: wrong result for column 0") +- self.assertEqual(col2, 2, "by index: wrong result for column 1") ++ self.assertEqual(row[0], 1, "by index: wrong result for column 0") ++ self.assertEqual(row[1], 2, "by index: wrong result for column 1") ++ self.assertEqual(row[-1], 2, "by index: wrong result for column -1") ++ self.assertEqual(row[-2], 1, "by index: wrong result for column -2") ++ ++ with self.assertRaises(IndexError): ++ row['c'] ++ with self.assertRaises(IndexError): ++ row[2] ++ with self.assertRaises(IndexError): ++ row[-3] ++ with self.assertRaises(IndexError): ++ row[2**1000] + + def CheckSqliteRowIter(self): + """Checks if the row object is iterable""" +@@ -142,6 +153,15 @@ + self.assertNotEqual(row_1, row_3) + self.assertNotEqual(hash(row_1), hash(row_3)) + ++ def CheckSqliteRowAsSequence(self): ++ """ Checks if the row object can act like a sequence """ ++ self.con.row_factory = sqlite.Row ++ row = self.con.execute("select 1 as a, 2 as b").fetchone() ++ ++ as_tuple = tuple(row) ++ self.assertEqual(list(reversed(row)), list(reversed(as_tuple))) ++ self.assertIsInstance(row, Sequence) ++ + def tearDown(self): + self.con.close() + +diff -r c0e311e010fc Lib/sre_parse.py +--- a/Lib/sre_parse.py ++++ b/Lib/sre_parse.py +@@ -616,7 +616,8 @@ + "%r" % name) + gid = state.groupdict.get(name) + if gid is None: +- raise error("unknown group name") ++ msg = "unknown group name: {0!r}".format(name) ++ raise error(msg) + subpatternappend((GROUPREF, gid)) + continue + else: +@@ -669,7 +670,8 @@ + if condname.isidentifier(): + condgroup = state.groupdict.get(condname) + if condgroup is None: +- raise error("unknown group name") ++ msg = "unknown group name: {0!r}".format(condname) ++ raise error(msg) + else: + try: + condgroup = int(condname) +@@ -806,7 +808,8 @@ + try: + index = pattern.groupindex[name] + except KeyError: +- raise IndexError("unknown group name") ++ msg = "unknown group name: {0!r}".format(name) ++ raise IndexError(msg) + addgroup(index) + elif c == "0": + if s.next in OCTDIGITS: +diff -r c0e311e010fc Lib/tarfile.py +--- a/Lib/tarfile.py ++++ b/Lib/tarfile.py +@@ -1423,7 +1423,8 @@ + fileobj = bltn_open(name, self._mode) + self._extfileobj = False + else: +- if name is None and hasattr(fileobj, "name"): ++ if (name is None and hasattr(fileobj, "name") and ++ isinstance(fileobj.name, (str, bytes))): + name = fileobj.name + if hasattr(fileobj, "mode"): + self._mode = fileobj.mode +diff -r c0e311e010fc Lib/test/datetimetester.py +--- a/Lib/test/datetimetester.py ++++ b/Lib/test/datetimetester.py +@@ -5,6 +5,7 @@ + + import sys + import pickle ++import random + import unittest + + from operator import lt, le, gt, ge, eq, ne, truediv, floordiv, mod +@@ -76,8 +77,18 @@ + def __init__(self, offset=None, name=None, dstoffset=None): + FixedOffset.__init__(self, offset, name, dstoffset) + ++class _TZInfo(tzinfo): ++ def utcoffset(self, datetime_module): ++ return random.random() ++ + class TestTZInfo(unittest.TestCase): + ++ def test_refcnt_crash_bug_22044(self): ++ tz1 = _TZInfo() ++ dt1 = datetime(2014, 7, 21, 11, 32, 3, 0, tz1) ++ with self.assertRaises(TypeError): ++ dt1.utcoffset() ++ + def test_non_abstractness(self): + # In order to allow subclasses to get pickled, the C implementation + # wasn't able to get away with having __init__ raise +diff -r c0e311e010fc Lib/test/make_ssl_certs.py +--- a/Lib/test/make_ssl_certs.py ++++ b/Lib/test/make_ssl_certs.py +@@ -115,7 +115,7 @@ + with open(os.path.join('cadir','index.txt'),'a+') as f: + pass # empty file + with open(os.path.join('cadir','crl.txt'),'a+') as f: +- r.write("00") ++ f.write("00") + with open(os.path.join('cadir','index.txt.attr'),'w+') as f: + f.write('unique_subject = no') + +diff -r c0e311e010fc Lib/test/multibytecodec_support.py +--- a/Lib/test/multibytecodec_support.py ++++ b/Lib/test/multibytecodec_support.py +@@ -277,8 +277,7 @@ + supmaps = [] + codectests = [] + +- def __init__(self, *args, **kw): +- unittest.TestCase.__init__(self, *args, **kw) ++ def setUp(self): + try: + self.open_mapping_file().close() # test it to report the error early + except (OSError, HTTPException): +diff -r c0e311e010fc Lib/test/pydoc_mod.py +--- a/Lib/test/pydoc_mod.py ++++ b/Lib/test/pydoc_mod.py +@@ -15,6 +15,16 @@ + NO_MEANING = "eggs" + pass + ++class C(object): ++ def say_no(self): ++ return "no" ++ def get_answer(self): ++ """ Return say_no() """ ++ return self.say_no() ++ def is_it_true(self): ++ """ Return self.get_answer() """ ++ return self.get_answer() ++ + def doc_func(): + """ + This function solves all of the world's problems: +diff -r c0e311e010fc Lib/test/pystone.py +--- a/Lib/test/pystone.py ++++ b/Lib/test/pystone.py +@@ -3,7 +3,7 @@ + """ + "PYSTONE" Benchmark Program + +-Version: Python/1.1 (corresponds to C/1.1 plus 2 Pystone fixes) ++Version: Python/1.2 (corresponds to C/1.1 plus 3 Pystone fixes) + + Author: Reinhold P. Weicker, CACM Vol 27, No 10, 10/84 pg. 1013. + +@@ -30,13 +30,20 @@ + percent faster than version 1.0, so benchmark figures + of different versions can't be compared directly. + ++ Version 1.2 changes the division to floor division. ++ ++ Under Python 3 version 1.1 would use the normal division ++ operator, resulting in some of the operations mistakenly ++ yielding floats. Version 1.2 instead uses floor division ++ making the benchmark a integer benchmark again. ++ + """ + + LOOPS = 50000 + + from time import clock + +-__version__ = "1.1" ++__version__ = "1.2" + + [Ident1, Ident2, Ident3, Ident4, Ident5] = range(1, 6) + +@@ -123,7 +130,7 @@ + EnumLoc = Proc6(Ident1) + CharIndex = chr(ord(CharIndex)+1) + IntLoc3 = IntLoc2 * IntLoc1 +- IntLoc2 = IntLoc3 / IntLoc1 ++ IntLoc2 = IntLoc3 // IntLoc1 + IntLoc2 = 7 * (IntLoc3 - IntLoc2) - IntLoc1 + IntLoc1 = Proc2(IntLoc1) + +diff -r c0e311e010fc Lib/test/regrtest.py +--- a/Lib/test/regrtest.py ++++ b/Lib/test/regrtest.py +@@ -1273,8 +1273,10 @@ + # tests. If not, use normal unittest test loading. + test_runner = getattr(the_module, "test_main", None) + if test_runner is None: +- tests = unittest.TestLoader().loadTestsFromModule(the_module) +- test_runner = lambda: support.run_unittest(tests) ++ def test_runner(): ++ loader = unittest.TestLoader() ++ tests = loader.loadTestsFromModule(the_module) ++ support.run_unittest(tests) + test_runner() + if huntrleaks: + refleak = dash_R(the_module, test, test_runner, huntrleaks) +diff -r c0e311e010fc Lib/test/script_helper.py +--- a/Lib/test/script_helper.py ++++ b/Lib/test/script_helper.py +@@ -155,8 +155,8 @@ + script_name = make_script(zip_dir, script_basename, source) + unlink.append(script_name) + if compiled: +- init_name = py_compile(init_name, doraise=True) +- script_name = py_compile(script_name, doraise=True) ++ init_name = py_compile.compile(init_name, doraise=True) ++ script_name = py_compile.compile(script_name, doraise=True) + unlink.extend((init_name, script_name)) + pkg_names = [os.sep.join([pkg_name]*i) for i in range(1, depth+1)] + script_name_in_zip = os.path.join(pkg_names[-1], os.path.basename(script_name)) +diff -r c0e311e010fc Lib/test/support/__init__.py +--- a/Lib/test/support/__init__.py ++++ b/Lib/test/support/__init__.py +@@ -3,28 +3,29 @@ + if __name__ != 'test.support': + raise ImportError('support must be imported from the test package') + ++import collections.abc + import contextlib + import errno ++import fnmatch + import functools + import gc +-import socket +-import sys ++import importlib ++import importlib.util ++import logging.handlers + import os + import platform ++import re + import shutil ++import socket ++import stat ++import struct ++import subprocess ++import sys ++import sysconfig ++import tempfile ++import time ++import unittest + import warnings +-import unittest +-import importlib +-import importlib.util +-import collections.abc +-import re +-import subprocess +-import time +-import sysconfig +-import fnmatch +-import logging.handlers +-import struct +-import tempfile + + try: + import _thread, threading +@@ -84,7 +85,7 @@ + "skip_unless_symlink", "requires_gzip", "requires_bz2", "requires_lzma", + "bigmemtest", "bigaddrspacetest", "cpython_only", "get_attribute", + "requires_IEEE_754", "skip_unless_xattr", "requires_zlib", +- "anticipate_failure", ++ "anticipate_failure", "load_package_tests", + # sys + "is_jython", "check_impl_detail", + # network +@@ -187,6 +188,25 @@ + return unittest.expectedFailure + return lambda f: f + ++def load_package_tests(pkg_dir, loader, standard_tests, pattern): ++ """Generic load_tests implementation for simple test packages. ++ ++ Most packages can implement load_tests using this function as follows: ++ ++ def load_tests(*args): ++ return load_package_tests(os.path.dirname(__file__), *args) ++ """ ++ if pattern is None: ++ pattern = "test*" ++ top_dir = os.path.dirname( # Lib ++ os.path.dirname( # test ++ os.path.dirname(__file__))) # support ++ package_tests = loader.discover(start_dir=pkg_dir, ++ top_level_dir=top_dir, ++ pattern=pattern) ++ standard_tests.addTests(package_tests) ++ return standard_tests ++ + + def import_fresh_module(name, fresh=(), blocked=(), deprecated=False): + """Import and return a module, deliberately bypassing sys.modules. +@@ -316,7 +336,13 @@ + def _rmtree_inner(path): + for name in os.listdir(path): + fullname = os.path.join(path, name) +- if os.path.isdir(fullname): ++ try: ++ mode = os.lstat(fullname).st_mode ++ except OSError as exc: ++ print("support.rmtree(): os.lstat(%r) failed with %s" % (fullname, exc), ++ file=sys.__stderr__) ++ mode = 0 ++ if stat.S_ISDIR(mode): + _waitfor(_rmtree_inner, fullname, waitall=True) + os.rmdir(fullname) + else: +@@ -454,23 +480,17 @@ + return _is_gui_available.result + + def is_resource_enabled(resource): +- """Test whether a resource is enabled. Known resources are set by +- regrtest.py.""" +- return use_resources is not None and resource in use_resources ++ """Test whether a resource is enabled. ++ ++ Known resources are set by regrtest.py. If not running under regrtest.py, ++ all resources are assumed enabled unless use_resources has been set. ++ """ ++ return use_resources is None or resource in use_resources + + def requires(resource, msg=None): +- """Raise ResourceDenied if the specified resource is not available. +- +- If the caller's module is __main__ then automatically return True. The +- possibility of False being returned occurs when regrtest.py is +- executing. +- """ ++ """Raise ResourceDenied if the specified resource is not available.""" + if resource == 'gui' and not _is_gui_available(): + raise ResourceDenied(_is_gui_available.reason) +- # see if the caller's module is __main__ - if so, treat as if +- # the resource was set +- if sys._getframe(1).f_globals.get("__name__") == "__main__": +- return + if not is_resource_enabled(resource): + if msg is None: + msg = "Use of the %r resource not enabled" % resource +diff -r c0e311e010fc Lib/test/test__osx_support.py +--- a/Lib/test/test__osx_support.py ++++ b/Lib/test/test__osx_support.py +@@ -109,7 +109,9 @@ + + def test__supports_universal_builds(self): + import platform +- self.assertEqual(platform.mac_ver()[0].split('.') >= ['10', '4'], ++ mac_ver_tuple = tuple(int(i) for i in ++ platform.mac_ver()[0].split('.')[0:2]) ++ self.assertEqual(mac_ver_tuple >= (10, 4), + _osx_support._supports_universal_builds()) + + def test__find_appropriate_compiler(self): +diff -r c0e311e010fc Lib/test/test_argparse.py +--- a/Lib/test/test_argparse.py ++++ b/Lib/test/test_argparse.py +@@ -235,8 +235,8 @@ + parser = self._get_parser(tester) + for args_str in tester.failures: + args = args_str.split() +- raises = tester.assertRaises +- raises(ArgumentParserError, parser.parse_args, args) ++ with tester.assertRaises(ArgumentParserError, msg=args): ++ parser.parse_args(args) + + def test_successes(self, tester): + parser = self._get_parser(tester) +@@ -4551,6 +4551,12 @@ + self.assertTrue(ns2 != ns3) + self.assertTrue(ns2 != ns4) + ++ def test_equality_returns_notimplemeted(self): ++ # See issue 21481 ++ ns = argparse.Namespace(a=1, b=2) ++ self.assertIs(ns.__eq__(None), NotImplemented) ++ self.assertIs(ns.__ne__(None), NotImplemented) ++ + + # =================== + # File encoding tests +diff -r c0e311e010fc Lib/test/test_asynchat.py +--- a/Lib/test/test_asynchat.py ++++ b/Lib/test/test_asynchat.py +@@ -5,9 +5,14 @@ + # If this fails, the test will be skipped. + thread = support.import_module('_thread') + +-import asyncore, asynchat, socket, time ++import asynchat ++import asyncore ++import errno ++import socket ++import sys ++import time + import unittest +-import sys ++import unittest.mock + try: + import threading + except ImportError: +@@ -28,8 +33,8 @@ + self.event = event + self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) + self.port = support.bind_port(self.sock) +- # This will be set if the client wants us to wait before echoing data +- # back. ++ # This will be set if the client wants us to wait before echoing ++ # data back. + self.start_resend_event = None + + def run(self): +@@ -52,8 +57,8 @@ + + # re-send entire set of collected data + try: +- # this may fail on some tests, such as test_close_when_done, since +- # the client closes the channel when it's done sending ++ # this may fail on some tests, such as test_close_when_done, ++ # since the client closes the channel when it's done sending + while self.buffer: + n = conn.send(self.buffer[:self.chunk_size]) + time.sleep(0.001) +@@ -96,7 +101,7 @@ + s.start() + event.wait() + event.clear() +- time.sleep(0.01) # Give server time to start accepting. ++ time.sleep(0.01) # Give server time to start accepting. + return s, event + + +@@ -104,10 +109,10 @@ + class TestAsynchat(unittest.TestCase): + usepoll = False + +- def setUp (self): ++ def setUp(self): + self._threads = support.threading_setup() + +- def tearDown (self): ++ def tearDown(self): + support.threading_cleanup(*self._threads) + + def line_terminator_check(self, term, server_chunk): +@@ -117,7 +122,7 @@ + s.start() + event.wait() + event.clear() +- time.sleep(0.01) # Give server time to start accepting. ++ time.sleep(0.01) # Give server time to start accepting. + c = echo_client(term, s.port) + c.push(b"hello ") + c.push(b"world" + term) +@@ -136,17 +141,17 @@ + + def test_line_terminator1(self): + # test one-character terminator +- for l in (1,2,3): ++ for l in (1, 2, 3): + self.line_terminator_check(b'\n', l) + + def test_line_terminator2(self): + # test two-character terminator +- for l in (1,2,3): ++ for l in (1, 2, 3): + self.line_terminator_check(b'\r\n', l) + + def test_line_terminator3(self): + # test three-character terminator +- for l in (1,2,3): ++ for l in (1, 2, 3): + self.line_terminator_check(b'qqq', l) + + def numeric_terminator_check(self, termlen): +@@ -249,15 +254,48 @@ + # (which could still result in the client not having received anything) + self.assertGreater(len(s.buffer), 0) + ++ def test_push(self): ++ # Issue #12523: push() should raise a TypeError if it doesn't get ++ # a bytes string ++ s, event = start_echo_server() ++ c = echo_client(b'\n', s.port) ++ data = b'bytes\n' ++ c.push(data) ++ c.push(bytearray(data)) ++ c.push(memoryview(data)) ++ self.assertRaises(TypeError, c.push, 10) ++ self.assertRaises(TypeError, c.push, 'unicode') ++ c.push(SERVER_QUIT) ++ asyncore.loop(use_poll=self.usepoll, count=300, timeout=.01) ++ s.join(timeout=TIMEOUT) ++ self.assertEqual(c.contents, [b'bytes', b'bytes', b'bytes']) ++ + + class TestAsynchat_WithPoll(TestAsynchat): + usepoll = True + ++ ++class TestAsynchatMocked(unittest.TestCase): ++ def test_blockingioerror(self): ++ # Issue #16133: handle_read() must ignore BlockingIOError ++ sock = unittest.mock.Mock() ++ sock.recv.side_effect = BlockingIOError(errno.EAGAIN) ++ ++ dispatcher = asynchat.async_chat() ++ dispatcher.set_socket(sock) ++ self.addCleanup(dispatcher.del_channel) ++ ++ with unittest.mock.patch.object(dispatcher, 'handle_error') as error: ++ dispatcher.handle_read() ++ self.assertFalse(error.called) ++ ++ + class TestHelperFunctions(unittest.TestCase): + def test_find_prefix_at_end(self): + self.assertEqual(asynchat.find_prefix_at_end("qwerty\r", "\r\n"), 1) + self.assertEqual(asynchat.find_prefix_at_end("qwertydkjf", "\r\n"), 0) + ++ + class TestFifo(unittest.TestCase): + def test_basic(self): + f = asynchat.fifo() +@@ -283,5 +321,13 @@ + self.assertEqual(f.pop(), (0, None)) + + ++class TestNotConnected(unittest.TestCase): ++ def test_disallow_negative_terminator(self): ++ # Issue #11259 ++ client = asynchat.async_chat() ++ self.assertRaises(ValueError, client.set_terminator, -1) ++ ++ ++ + if __name__ == "__main__": + unittest.main() +diff -r c0e311e010fc Lib/test/test_asyncio/__init__.py +--- a/Lib/test/test_asyncio/__init__.py ++++ b/Lib/test/test_asyncio/__init__.py +@@ -1,29 +1,10 @@ + import os +-import sys +-import unittest +-from test.support import run_unittest, import_module ++from test.support import load_package_tests, import_module + + # Skip tests if we don't have threading. + import_module('threading') + # Skip tests if we don't have concurrent.futures. + import_module('concurrent.futures') + +- +-def suite(): +- tests = unittest.TestSuite() +- loader = unittest.TestLoader() +- for fn in os.listdir(os.path.dirname(__file__)): +- if fn.startswith("test") and fn.endswith(".py"): +- mod_name = 'test.test_asyncio.' + fn[:-3] +- try: +- __import__(mod_name) +- except unittest.SkipTest: +- pass +- else: +- mod = sys.modules[mod_name] +- tests.addTests(loader.loadTestsFromModule(mod)) +- return tests +- +- +-def test_main(): +- run_unittest(suite()) ++def load_tests(*args): ++ return load_package_tests(os.path.dirname(__file__), *args) +diff -r c0e311e010fc Lib/test/test_asyncio/__main__.py +--- a/Lib/test/test_asyncio/__main__.py ++++ b/Lib/test/test_asyncio/__main__.py +@@ -1,5 +1,4 @@ +-from . import test_main ++from . import load_tests ++import unittest + +- +-if __name__ == '__main__': +- test_main() ++unittest.main() +diff -r c0e311e010fc Lib/test/test_asyncio/test_base_events.py +--- a/Lib/test/test_asyncio/test_base_events.py ++++ b/Lib/test/test_asyncio/test_base_events.py +@@ -7,6 +7,7 @@ + import time + import unittest + from unittest import mock ++from test.script_helper import assert_python_ok + from test.support import IPV6_ENABLED + + import asyncio +@@ -19,12 +20,13 @@ + PY34 = sys.version_info >= (3, 4) + + +-class BaseEventLoopTests(unittest.TestCase): ++class BaseEventLoopTests(test_utils.TestCase): + + def setUp(self): + self.loop = base_events.BaseEventLoop() + self.loop._selector = mock.Mock() +- asyncio.set_event_loop(None) ++ self.loop._selector.select.return_value = () ++ self.set_event_loop(self.loop) + + def test_not_implemented(self): + m = mock.Mock() +@@ -42,8 +44,6 @@ + self.assertRaises( + NotImplementedError, self.loop._write_to_self) + self.assertRaises( +- NotImplementedError, self.loop._read_from_self) +- self.assertRaises( + NotImplementedError, + self.loop._make_read_pipe_transport, m, m) + self.assertRaises( +@@ -52,6 +52,20 @@ + gen = self.loop._make_subprocess_transport(m, m, m, m, m, m, m) + self.assertRaises(NotImplementedError, next, iter(gen)) + ++ def test_close(self): ++ self.assertFalse(self.loop.is_closed()) ++ self.loop.close() ++ self.assertTrue(self.loop.is_closed()) ++ ++ # it should be possible to call close() more than once ++ self.loop.close() ++ self.loop.close() ++ ++ # operation blocked when the loop is closed ++ f = asyncio.Future(loop=self.loop) ++ self.assertRaises(RuntimeError, self.loop.run_forever) ++ self.assertRaises(RuntimeError, self.loop.run_until_complete, f) ++ + def test__add_callback_handle(self): + h = asyncio.Handle(lambda: False, (), self.loop) + +@@ -141,7 +155,7 @@ + pass + + other_loop = base_events.BaseEventLoop() +- other_loop._selector = unittest.mock.Mock() ++ other_loop._selector = mock.Mock() + asyncio.set_event_loop(other_loop) + + # raise RuntimeError if the event loop is different in debug mode +@@ -226,30 +240,27 @@ + self.loop.set_debug(False) + self.assertFalse(self.loop.get_debug()) + +- @mock.patch('asyncio.base_events.time') + @mock.patch('asyncio.base_events.logger') +- def test__run_once_logging(self, m_logger, m_time): ++ def test__run_once_logging(self, m_logger): ++ def slow_select(timeout): ++ # Sleep a bit longer than a second to avoid timer resolution issues. ++ time.sleep(1.1) ++ return [] ++ ++ # logging needs debug flag ++ self.loop.set_debug(True) ++ + # Log to INFO level if timeout > 1.0 sec. +- idx = -1 +- data = [10.0, 10.0, 12.0, 13.0] +- +- def monotonic(): +- nonlocal data, idx +- idx += 1 +- return data[idx] +- +- m_time.monotonic = monotonic +- +- self.loop._scheduled.append( +- asyncio.TimerHandle(11.0, lambda: True, (), self.loop)) ++ self.loop._selector.select = slow_select + self.loop._process_events = mock.Mock() + self.loop._run_once() + self.assertEqual(logging.INFO, m_logger.log.call_args[0][0]) + +- idx = -1 +- data = [10.0, 10.0, 10.3, 13.0] +- self.loop._scheduled = [asyncio.TimerHandle(11.0, lambda: True, (), +- self.loop)] ++ def fast_select(timeout): ++ time.sleep(0.001) ++ return [] ++ ++ self.loop._selector.select = fast_select + self.loop._run_once() + self.assertEqual(logging.DEBUG, m_logger.log.call_args[0][0]) + +@@ -276,6 +287,12 @@ + self.assertRaises(TypeError, + self.loop.run_until_complete, 'blah') + ++ def test_run_until_complete_loop(self): ++ task = asyncio.Future(loop=self.loop) ++ other_loop = self.new_test_loop() ++ self.assertRaises(ValueError, ++ other_loop.run_until_complete, task) ++ + def test_subprocess_exec_invalid_args(self): + args = [sys.executable, '-c', 'pass'] + +@@ -388,19 +405,22 @@ + 1/0 + + def run_loop(): +- self.loop.call_soon(zero_error) ++ handle = self.loop.call_soon(zero_error) + self.loop._run_once() ++ return handle + ++ self.loop.set_debug(True) + self.loop._process_events = mock.Mock() + + mock_handler = mock.Mock() + self.loop.set_exception_handler(mock_handler) +- run_loop() ++ handle = run_loop() + mock_handler.assert_called_with(self.loop, { + 'exception': MOCK_ANY, + 'message': test_utils.MockPattern( + 'Exception in callback.*zero_error'), +- 'handle': MOCK_ANY, ++ 'handle': handle, ++ 'source_traceback': handle._source_traceback, + }) + mock_handler.reset_mock() + +@@ -482,6 +502,52 @@ + self.assertIs(type(_context['context']['exception']), + ZeroDivisionError) + ++ def test_env_var_debug(self): ++ code = '\n'.join(( ++ 'import asyncio', ++ 'loop = asyncio.get_event_loop()', ++ 'print(loop.get_debug())')) ++ ++ # Test with -E to not fail if the unit test was run with ++ # PYTHONASYNCIODEBUG set to a non-empty string ++ sts, stdout, stderr = assert_python_ok('-E', '-c', code) ++ self.assertEqual(stdout.rstrip(), b'False') ++ ++ sts, stdout, stderr = assert_python_ok('-c', code, ++ PYTHONASYNCIODEBUG='') ++ self.assertEqual(stdout.rstrip(), b'False') ++ ++ sts, stdout, stderr = assert_python_ok('-c', code, ++ PYTHONASYNCIODEBUG='1') ++ self.assertEqual(stdout.rstrip(), b'True') ++ ++ sts, stdout, stderr = assert_python_ok('-E', '-c', code, ++ PYTHONASYNCIODEBUG='1') ++ self.assertEqual(stdout.rstrip(), b'False') ++ ++ def test_create_task(self): ++ class MyTask(asyncio.Task): ++ pass ++ ++ @asyncio.coroutine ++ def test(): ++ pass ++ ++ class EventLoop(base_events.BaseEventLoop): ++ def create_task(self, coro): ++ return MyTask(coro, loop=loop) ++ ++ loop = EventLoop() ++ self.set_event_loop(loop) ++ ++ coro = test() ++ task = asyncio.async(coro, loop=loop) ++ self.assertIsInstance(task, MyTask) ++ ++ # make warnings quiet ++ task._log_destroy_pending = False ++ coro.close() ++ + + class MyProto(asyncio.Protocol): + done = None +@@ -541,14 +607,11 @@ + self.done.set_result(None) + + +-class BaseEventLoopWithSelectorTests(unittest.TestCase): ++class BaseEventLoopWithSelectorTests(test_utils.TestCase): + + def setUp(self): + self.loop = asyncio.new_event_loop() +- asyncio.set_event_loop(None) +- +- def tearDown(self): +- self.loop.close() ++ self.set_event_loop(self.loop) + + @mock.patch('asyncio.base_events.socket') + def test_create_connection_multiple_errors(self, m_socket): +@@ -583,6 +646,27 @@ + + self.assertEqual(str(cm.exception), 'Multiple exceptions: err1, err2') + ++ @mock.patch('asyncio.base_events.socket') ++ def test_create_connection_timeout(self, m_socket): ++ # Ensure that the socket is closed on timeout ++ sock = mock.Mock() ++ m_socket.socket.return_value = sock ++ ++ def getaddrinfo(*args, **kw): ++ fut = asyncio.Future(loop=self.loop) ++ addr = (socket.AF_INET, socket.SOCK_STREAM, 0, '', ++ ('127.0.0.1', 80)) ++ fut.set_result([addr]) ++ return fut ++ self.loop.getaddrinfo = getaddrinfo ++ ++ with mock.patch.object(self.loop, 'sock_connect', ++ side_effect=asyncio.TimeoutError): ++ coro = self.loop.create_connection(MyProto, '127.0.0.1', 80) ++ with self.assertRaises(asyncio.TimeoutError): ++ self.loop.run_until_complete(coro) ++ self.assertTrue(sock.close.called) ++ + def test_create_connection_host_port_sock(self): + coro = self.loop.create_connection( + MyProto, 'example.com', 80, sock=object()) +@@ -944,6 +1028,34 @@ + with self.assertRaises(TypeError): + self.loop.run_in_executor(None, coroutine_function) + ++ @mock.patch('asyncio.base_events.logger') ++ def test_log_slow_callbacks(self, m_logger): ++ def stop_loop_cb(loop): ++ loop.stop() ++ ++ @asyncio.coroutine ++ def stop_loop_coro(loop): ++ yield from () ++ loop.stop() ++ ++ asyncio.set_event_loop(self.loop) ++ self.loop.set_debug(True) ++ self.loop.slow_callback_duration = 0.0 ++ ++ # slow callback ++ self.loop.call_soon(stop_loop_cb, self.loop) ++ self.loop.run_forever() ++ fmt, *args = m_logger.warning.call_args[0] ++ self.assertRegex(fmt % tuple(args), ++ "^Executing took .* seconds$") ++ ++ # slow task ++ asyncio.async(stop_loop_coro(self.loop), loop=self.loop) ++ self.loop.run_forever() ++ fmt, *args = m_logger.warning.call_args[0] ++ self.assertRegex(fmt % tuple(args), ++ "^Executing took .* seconds$") ++ + + if __name__ == '__main__': + unittest.main() +diff -r c0e311e010fc Lib/test/test_asyncio/test_events.py +--- a/Lib/test/test_asyncio/test_events.py ++++ b/Lib/test/test_asyncio/test_events.py +@@ -5,6 +5,7 @@ + import io + import os + import platform ++import re + import signal + import socket + try: +@@ -223,7 +224,7 @@ + def setUp(self): + super().setUp() + self.loop = self.create_event_loop() +- asyncio.set_event_loop(None) ++ self.set_event_loop(self.loop) + + def tearDown(self): + # just in case if we have transport close callbacks +@@ -382,6 +383,24 @@ + self.assertEqual(read, data) + + def _basetest_sock_client_ops(self, httpd, sock): ++ # in debug mode, socket operations must fail ++ # if the socket is not in blocking mode ++ self.loop.set_debug(True) ++ sock.setblocking(True) ++ with self.assertRaises(ValueError): ++ self.loop.run_until_complete( ++ self.loop.sock_connect(sock, httpd.address)) ++ with self.assertRaises(ValueError): ++ self.loop.run_until_complete( ++ self.loop.sock_sendall(sock, b'GET / HTTP/1.0\r\n\r\n')) ++ with self.assertRaises(ValueError): ++ self.loop.run_until_complete( ++ self.loop.sock_recv(sock, 1024)) ++ with self.assertRaises(ValueError): ++ self.loop.run_until_complete( ++ self.loop.sock_accept(sock)) ++ ++ # test in non-blocking mode + sock.setblocking(False) + self.loop.run_until_complete( + self.loop.sock_connect(sock, httpd.address)) +@@ -521,6 +540,7 @@ + tr, pr = self.loop.run_until_complete(connection_fut) + self.assertIsInstance(tr, asyncio.Transport) + self.assertIsInstance(pr, asyncio.Protocol) ++ self.assertIs(pr.transport, tr) + if check_sockname: + self.assertIsNotNone(tr.get_extra_info('sockname')) + self.loop.run_until_complete(pr.done) +@@ -713,7 +733,7 @@ + with self.assertRaisesRegex(ValueError, + 'path and sock can not be specified ' + 'at the same time'): +- server = self.loop.run_until_complete(f) ++ self.loop.run_until_complete(f) + + def _create_ssl_context(self, certfile, keyfile=None): + sslcontext = ssl.SSLContext(ssl.PROTOCOL_SSLv23) +@@ -817,9 +837,10 @@ + # no CA loaded + f_c = self.loop.create_connection(MyProto, host, port, + ssl=sslcontext_client) +- with self.assertRaisesRegex(ssl.SSLError, +- 'certificate verify failed '): +- self.loop.run_until_complete(f_c) ++ with test_utils.disable_logger(): ++ with self.assertRaisesRegex(ssl.SSLError, ++ 'certificate verify failed '): ++ self.loop.run_until_complete(f_c) + + # close connection + self.assertIsNone(proto.transport) +@@ -843,9 +864,10 @@ + f_c = self.loop.create_unix_connection(MyProto, path, + ssl=sslcontext_client, + server_hostname='invalid') +- with self.assertRaisesRegex(ssl.SSLError, +- 'certificate verify failed '): +- self.loop.run_until_complete(f_c) ++ with test_utils.disable_logger(): ++ with self.assertRaisesRegex(ssl.SSLError, ++ 'certificate verify failed '): ++ self.loop.run_until_complete(f_c) + + # close connection + self.assertIsNone(proto.transport) +@@ -869,10 +891,11 @@ + # incorrect server_hostname + f_c = self.loop.create_connection(MyProto, host, port, + ssl=sslcontext_client) +- with self.assertRaisesRegex( +- ssl.CertificateError, +- "hostname '127.0.0.1' doesn't match 'localhost'"): +- self.loop.run_until_complete(f_c) ++ with test_utils.disable_logger(): ++ with self.assertRaisesRegex( ++ ssl.CertificateError, ++ "hostname '127.0.0.1' doesn't match 'localhost'"): ++ self.loop.run_until_complete(f_c) + + # close connection + proto.transport.close() +@@ -1044,12 +1067,21 @@ + s_transport, server = self.loop.run_until_complete(coro) + host, port = s_transport.get_extra_info('sockname') + ++ self.assertIsInstance(s_transport, asyncio.Transport) ++ self.assertIsInstance(server, TestMyDatagramProto) ++ self.assertEqual('INITIALIZED', server.state) ++ self.assertIs(server.transport, s_transport) ++ + coro = self.loop.create_datagram_endpoint( + lambda: MyDatagramProto(loop=self.loop), + remote_addr=(host, port)) + transport, client = self.loop.run_until_complete(coro) + ++ self.assertIsInstance(transport, asyncio.Transport) ++ self.assertIsInstance(client, MyDatagramProto) + self.assertEqual('INITIALIZED', client.state) ++ self.assertIs(client.transport, transport) ++ + transport.sendto(b'xxx') + test_utils.run_until(self.loop, lambda: server.nbytes) + self.assertEqual(3, server.nbytes) +@@ -1070,6 +1102,7 @@ + def test_internal_fds(self): + loop = self.create_event_loop() + if not isinstance(loop, selector_events.BaseSelectorEventLoop): ++ loop.close() + self.skipTest('loop is not a BaseSelectorEventLoop') + + self.assertEqual(1, loop._internal_fds) +@@ -1363,6 +1396,15 @@ + with self.assertRaises(RuntimeError): + loop.add_writer(w, callback) + ++ def test_close_running_event_loop(self): ++ @asyncio.coroutine ++ def close_loop(loop): ++ self.loop.close() ++ ++ coro = close_loop(self.loop) ++ with self.assertRaises(RuntimeError): ++ self.loop.run_until_complete(coro) ++ + + class SubprocessTestsMixin: + +@@ -1627,14 +1669,14 @@ + + if sys.platform == 'win32': + +- class SelectEventLoopTests(EventLoopTestsMixin, unittest.TestCase): ++ class SelectEventLoopTests(EventLoopTestsMixin, test_utils.TestCase): + + def create_event_loop(self): + return asyncio.SelectorEventLoop() + + class ProactorEventLoopTests(EventLoopTestsMixin, + SubprocessTestsMixin, +- unittest.TestCase): ++ test_utils.TestCase): + + def create_event_loop(self): + return asyncio.ProactorEventLoop() +@@ -1689,7 +1731,7 @@ + if hasattr(selectors, 'KqueueSelector'): + class KqueueEventLoopTests(UnixEventLoopTestsMixin, + SubprocessTestsMixin, +- unittest.TestCase): ++ test_utils.TestCase): + + def create_event_loop(self): + return asyncio.SelectorEventLoop( +@@ -1714,7 +1756,7 @@ + if hasattr(selectors, 'EpollSelector'): + class EPollEventLoopTests(UnixEventLoopTestsMixin, + SubprocessTestsMixin, +- unittest.TestCase): ++ test_utils.TestCase): + + def create_event_loop(self): + return asyncio.SelectorEventLoop(selectors.EpollSelector()) +@@ -1722,7 +1764,7 @@ + if hasattr(selectors, 'PollSelector'): + class PollEventLoopTests(UnixEventLoopTestsMixin, + SubprocessTestsMixin, +- unittest.TestCase): ++ test_utils.TestCase): + + def create_event_loop(self): + return asyncio.SelectorEventLoop(selectors.PollSelector()) +@@ -1730,71 +1772,159 @@ + # Should always exist. + class SelectEventLoopTests(UnixEventLoopTestsMixin, + SubprocessTestsMixin, +- unittest.TestCase): ++ test_utils.TestCase): + + def create_event_loop(self): + return asyncio.SelectorEventLoop(selectors.SelectSelector()) + + +-class HandleTests(unittest.TestCase): ++def noop(*args): ++ pass ++ ++ ++class HandleTests(test_utils.TestCase): ++ ++ def setUp(self): ++ self.loop = mock.Mock() ++ self.loop.get_debug.return_value = True + + def test_handle(self): + def callback(*args): + return args + + args = () +- h = asyncio.Handle(callback, args, mock.Mock()) ++ h = asyncio.Handle(callback, args, self.loop) + self.assertIs(h._callback, callback) + self.assertIs(h._args, args) + self.assertFalse(h._cancelled) + +- r = repr(h) +- self.assertTrue(r.startswith( +- 'Handle(' +- '.callback')) +- self.assertTrue(r.endswith('())')) +- + h.cancel() + self.assertTrue(h._cancelled) + +- r = repr(h) +- self.assertTrue(r.startswith( +- 'Handle(' +- '.callback')) +- self.assertTrue(r.endswith('())'), r) +- + def test_handle_from_handle(self): + def callback(*args): + return args +- m_loop = object() +- h1 = asyncio.Handle(callback, (), loop=m_loop) ++ h1 = asyncio.Handle(callback, (), loop=self.loop) + self.assertRaises( +- AssertionError, asyncio.Handle, h1, (), m_loop) ++ AssertionError, asyncio.Handle, h1, (), self.loop) + + def test_callback_with_exception(self): + def callback(): + raise ValueError() + +- m_loop = mock.Mock() +- m_loop.call_exception_handler = mock.Mock() ++ self.loop = mock.Mock() ++ self.loop.call_exception_handler = mock.Mock() + +- h = asyncio.Handle(callback, (), m_loop) ++ h = asyncio.Handle(callback, (), self.loop) + h._run() + +- m_loop.call_exception_handler.assert_called_with({ ++ self.loop.call_exception_handler.assert_called_with({ + 'message': test_utils.MockPattern('Exception in callback.*'), + 'exception': mock.ANY, +- 'handle': h ++ 'handle': h, ++ 'source_traceback': h._source_traceback, + }) + + def test_handle_weakref(self): + wd = weakref.WeakValueDictionary() +- h = asyncio.Handle(lambda: None, (), object()) ++ h = asyncio.Handle(lambda: None, (), self.loop) + wd['h'] = h # Would fail without __weakref__ slot. + ++ def test_handle_repr(self): ++ self.loop.get_debug.return_value = False ++ ++ # simple function ++ h = asyncio.Handle(noop, (1, 2), self.loop) ++ filename, lineno = test_utils.get_function_source(noop) ++ self.assertEqual(repr(h), ++ '' ++ % (filename, lineno)) ++ ++ # cancelled handle ++ h.cancel() ++ self.assertEqual(repr(h), ++ '') ++ ++ # decorated function ++ cb = asyncio.coroutine(noop) ++ h = asyncio.Handle(cb, (), self.loop) ++ self.assertEqual(repr(h), ++ '' ++ % (filename, lineno)) ++ ++ # partial function ++ cb = functools.partial(noop, 1, 2) ++ h = asyncio.Handle(cb, (3,), self.loop) ++ regex = (r'^$' ++ % (re.escape(filename), lineno)) ++ self.assertRegex(repr(h), regex) ++ ++ # partial method ++ if sys.version_info >= (3, 4): ++ method = HandleTests.test_handle_repr ++ cb = functools.partialmethod(method) ++ filename, lineno = test_utils.get_function_source(method) ++ h = asyncio.Handle(cb, (), self.loop) ++ ++ cb_regex = r'' ++ cb_regex = (r'functools.partialmethod\(%s, , \)\(\)' % cb_regex) ++ regex = (r'^$' ++ % (cb_regex, re.escape(filename), lineno)) ++ self.assertRegex(repr(h), regex) ++ ++ def test_handle_repr_debug(self): ++ self.loop.get_debug.return_value = True ++ ++ # simple function ++ create_filename = __file__ ++ create_lineno = sys._getframe().f_lineno + 1 ++ h = asyncio.Handle(noop, (1, 2), self.loop) ++ filename, lineno = test_utils.get_function_source(noop) ++ self.assertEqual(repr(h), ++ '' ++ % (filename, lineno, create_filename, create_lineno)) ++ ++ # cancelled handle ++ h.cancel() ++ self.assertEqual(repr(h), ++ '' ++ % (create_filename, create_lineno)) ++ ++ def test_handle_source_traceback(self): ++ loop = asyncio.get_event_loop_policy().new_event_loop() ++ loop.set_debug(True) ++ self.set_event_loop(loop) ++ ++ def check_source_traceback(h): ++ lineno = sys._getframe(1).f_lineno - 1 ++ self.assertIsInstance(h._source_traceback, list) ++ self.assertEqual(h._source_traceback[-1][:3], ++ (__file__, ++ lineno, ++ 'test_handle_source_traceback')) ++ ++ # call_soon ++ h = loop.call_soon(noop) ++ check_source_traceback(h) ++ ++ # call_soon_threadsafe ++ h = loop.call_soon_threadsafe(noop) ++ check_source_traceback(h) ++ ++ # call_later ++ h = loop.call_later(0, noop) ++ check_source_traceback(h) ++ ++ # call_at ++ h = loop.call_later(0, noop) ++ check_source_traceback(h) ++ + + class TimerTests(unittest.TestCase): + ++ def setUp(self): ++ self.loop = mock.Mock() ++ + def test_hash(self): + when = time.monotonic() + h = asyncio.TimerHandle(when, lambda: False, (), +@@ -1805,36 +1935,66 @@ + def callback(*args): + return args + +- args = () ++ args = (1, 2, 3) + when = time.monotonic() + h = asyncio.TimerHandle(when, callback, args, mock.Mock()) + self.assertIs(h._callback, callback) + self.assertIs(h._args, args) + self.assertFalse(h._cancelled) + +- r = repr(h) +- self.assertTrue(r.endswith('())')) +- ++ # cancel + h.cancel() + self.assertTrue(h._cancelled) ++ self.assertIsNone(h._callback) ++ self.assertIsNone(h._args) + +- r = repr(h) +- self.assertTrue(r.endswith('())'), r) +- ++ # when cannot be None + self.assertRaises(AssertionError, + asyncio.TimerHandle, None, callback, args, +- mock.Mock()) ++ self.loop) ++ ++ def test_timer_repr(self): ++ self.loop.get_debug.return_value = False ++ ++ # simple function ++ h = asyncio.TimerHandle(123, noop, (), self.loop) ++ src = test_utils.get_function_source(noop) ++ self.assertEqual(repr(h), ++ '' % src) ++ ++ # cancelled handle ++ h.cancel() ++ self.assertEqual(repr(h), ++ '') ++ ++ def test_timer_repr_debug(self): ++ self.loop.get_debug.return_value = True ++ ++ # simple function ++ create_filename = __file__ ++ create_lineno = sys._getframe().f_lineno + 1 ++ h = asyncio.TimerHandle(123, noop, (), self.loop) ++ filename, lineno = test_utils.get_function_source(noop) ++ self.assertEqual(repr(h), ++ '' ++ % (filename, lineno, create_filename, create_lineno)) ++ ++ # cancelled handle ++ h.cancel() ++ self.assertEqual(repr(h), ++ '' ++ % (create_filename, create_lineno)) ++ + + def test_timer_comparison(self): +- loop = mock.Mock() +- + def callback(*args): + return args + + when = time.monotonic() + +- h1 = asyncio.TimerHandle(when, callback, (), loop) +- h2 = asyncio.TimerHandle(when, callback, (), loop) ++ h1 = asyncio.TimerHandle(when, callback, (), self.loop) ++ h2 = asyncio.TimerHandle(when, callback, (), self.loop) + # TODO: Use assertLess etc. + self.assertFalse(h1 < h2) + self.assertFalse(h2 < h1) +@@ -1850,8 +2010,8 @@ + h2.cancel() + self.assertFalse(h1 == h2) + +- h1 = asyncio.TimerHandle(when, callback, (), loop) +- h2 = asyncio.TimerHandle(when + 10.0, callback, (), loop) ++ h1 = asyncio.TimerHandle(when, callback, (), self.loop) ++ h2 = asyncio.TimerHandle(when + 10.0, callback, (), self.loop) + self.assertTrue(h1 < h2) + self.assertFalse(h2 < h1) + self.assertTrue(h1 <= h2) +@@ -1863,7 +2023,7 @@ + self.assertFalse(h1 == h2) + self.assertTrue(h1 != h2) + +- h3 = asyncio.Handle(callback, (), loop) ++ h3 = asyncio.Handle(callback, (), self.loop) + self.assertIs(NotImplemented, h1.__eq__(h3)) + self.assertIs(NotImplemented, h1.__ne__(h3)) + +@@ -1882,8 +2042,12 @@ + self.assertRaises( + NotImplementedError, loop.is_running) + self.assertRaises( ++ NotImplementedError, loop.is_closed) ++ self.assertRaises( + NotImplementedError, loop.close) + self.assertRaises( ++ NotImplementedError, loop.create_task, None) ++ self.assertRaises( + NotImplementedError, loop.call_later, None, None) + self.assertRaises( + NotImplementedError, loop.call_at, f, f) +@@ -1940,6 +2104,16 @@ + mock.sentinel) + self.assertRaises( + NotImplementedError, loop.subprocess_exec, f) ++ self.assertRaises( ++ NotImplementedError, loop.set_exception_handler, f) ++ self.assertRaises( ++ NotImplementedError, loop.default_exception_handler, f) ++ self.assertRaises( ++ NotImplementedError, loop.call_exception_handler, f) ++ self.assertRaises( ++ NotImplementedError, loop.get_debug) ++ self.assertRaises( ++ NotImplementedError, loop.set_debug, f) + + + class ProtocolsAbsTests(unittest.TestCase): +diff -r c0e311e010fc Lib/test/test_asyncio/test_futures.py +--- a/Lib/test/test_asyncio/test_futures.py ++++ b/Lib/test/test_asyncio/test_futures.py +@@ -1,8 +1,11 @@ + """Tests for futures.py.""" + + import concurrent.futures ++import re ++import sys + import threading + import unittest ++from test import support + from unittest import mock + + import asyncio +@@ -12,15 +15,17 @@ + def _fakefunc(f): + return f + ++def first_cb(): ++ pass + +-class FutureTests(unittest.TestCase): ++def last_cb(): ++ pass ++ ++ ++class FutureTests(test_utils.TestCase): + + def setUp(self): +- self.loop = test_utils.TestLoop() +- asyncio.set_event_loop(None) +- +- def tearDown(self): +- self.loop.close() ++ self.loop = self.new_test_loop() + + def test_initial_state(self): + f = asyncio.Future(loop=self.loop) +@@ -30,12 +35,9 @@ + self.assertTrue(f.cancelled()) + + def test_init_constructor_default_loop(self): +- try: +- asyncio.set_event_loop(self.loop) +- f = asyncio.Future() +- self.assertIs(f._loop, self.loop) +- finally: +- asyncio.set_event_loop(None) ++ asyncio.set_event_loop(self.loop) ++ f = asyncio.Future() ++ self.assertIs(f._loop, self.loop) + + def test_constructor_positional(self): + # Make sure Future doesn't accept a positional argument +@@ -102,39 +104,69 @@ + # The second "yield from f" does not yield f. + self.assertEqual(next(g), ('C', 42)) # yield 'C', y. + +- def test_repr(self): ++ def test_future_repr(self): ++ self.loop.set_debug(True) ++ f_pending_debug = asyncio.Future(loop=self.loop) ++ frame = f_pending_debug._source_traceback[-1] ++ self.assertEqual(repr(f_pending_debug), ++ '' ++ % (frame[0], frame[1])) ++ f_pending_debug.cancel() ++ ++ self.loop.set_debug(False) + f_pending = asyncio.Future(loop=self.loop) +- self.assertEqual(repr(f_pending), 'Future') ++ self.assertEqual(repr(f_pending), '') + f_pending.cancel() + + f_cancelled = asyncio.Future(loop=self.loop) + f_cancelled.cancel() +- self.assertEqual(repr(f_cancelled), 'Future') ++ self.assertEqual(repr(f_cancelled), '') + + f_result = asyncio.Future(loop=self.loop) + f_result.set_result(4) +- self.assertEqual(repr(f_result), 'Future') ++ self.assertEqual(repr(f_result), '') + self.assertEqual(f_result.result(), 4) + + exc = RuntimeError() + f_exception = asyncio.Future(loop=self.loop) + f_exception.set_exception(exc) +- self.assertEqual(repr(f_exception), 'Future') ++ self.assertEqual(repr(f_exception), '') + self.assertIs(f_exception.exception(), exc) + +- f_few_callbacks = asyncio.Future(loop=self.loop) +- f_few_callbacks.add_done_callback(_fakefunc) +- self.assertIn('Future' % fake_repr) ++ f_one_callbacks.cancel() ++ self.assertEqual(repr(f_one_callbacks), ++ '') ++ ++ f_two_callbacks = asyncio.Future(loop=self.loop) ++ f_two_callbacks.add_done_callback(first_cb) ++ f_two_callbacks.add_done_callback(last_cb) ++ first_repr = func_repr(first_cb) ++ last_repr = func_repr(last_cb) ++ self.assertRegex(repr(f_two_callbacks), ++ r'' ++ % (first_repr, last_repr)) + + f_many_callbacks = asyncio.Future(loop=self.loop) +- for i in range(20): ++ f_many_callbacks.add_done_callback(first_cb) ++ for i in range(8): + f_many_callbacks.add_done_callback(_fakefunc) +- r = repr(f_many_callbacks) +- self.assertIn('Future', r) ++ f_many_callbacks.add_done_callback(last_cb) ++ cb_regex = r'%s, <8 more>, %s' % (first_repr, last_repr) ++ self.assertRegex(repr(f_many_callbacks), ++ r'' % cb_regex) + f_many_callbacks.cancel() ++ self.assertEqual(repr(f_many_callbacks), ++ '') + + def test_copy_state(self): + # Test the internal _copy_state method since it's being directly +@@ -263,15 +295,74 @@ + self.assertEqual(f1.result(), 42) + self.assertTrue(f2.cancelled()) + ++ def test_future_source_traceback(self): ++ self.loop.set_debug(True) + +-class FutureDoneCallbackTests(unittest.TestCase): ++ future = asyncio.Future(loop=self.loop) ++ lineno = sys._getframe().f_lineno - 1 ++ self.assertIsInstance(future._source_traceback, list) ++ self.assertEqual(future._source_traceback[-1][:3], ++ (__file__, ++ lineno, ++ 'test_future_source_traceback')) ++ ++ @mock.patch('asyncio.base_events.logger') ++ def test_future_exception_never_retrieved(self, m_log): ++ self.loop.set_debug(True) ++ ++ def memory_error(): ++ try: ++ raise MemoryError() ++ except BaseException as exc: ++ return exc ++ exc = memory_error() ++ ++ future = asyncio.Future(loop=self.loop) ++ source_traceback = future._source_traceback ++ future.set_exception(exc) ++ future = None ++ test_utils.run_briefly(self.loop) ++ support.gc_collect() ++ ++ if sys.version_info >= (3, 4): ++ frame = source_traceback[-1] ++ regex = (r'^Future exception was never retrieved\n' ++ r'future: \n' ++ r'source_traceback: Object created at \(most recent call last\):\n' ++ r' File' ++ r'.*\n' ++ r' File "{filename}", line {lineno}, in test_future_exception_never_retrieved\n' ++ r' future = asyncio\.Future\(loop=self\.loop\)$' ++ ).format(filename=re.escape(frame[0]), lineno=frame[1]) ++ exc_info = (type(exc), exc, exc.__traceback__) ++ m_log.error.assert_called_once_with(mock.ANY, exc_info=exc_info) ++ else: ++ frame = source_traceback[-1] ++ regex = (r'^Future/Task exception was never retrieved\n' ++ r'Future/Task created at \(most recent call last\):\n' ++ r' File' ++ r'.*\n' ++ r' File "{filename}", line {lineno}, in test_future_exception_never_retrieved\n' ++ r' future = asyncio\.Future\(loop=self\.loop\)\n' ++ r'Traceback \(most recent call last\):\n' ++ r'.*\n' ++ r'MemoryError$' ++ ).format(filename=re.escape(frame[0]), lineno=frame[1]) ++ m_log.error.assert_called_once_with(mock.ANY, exc_info=False) ++ message = m_log.error.call_args[0][0] ++ self.assertRegex(message, re.compile(regex, re.DOTALL)) ++ ++ def test_set_result_unless_cancelled(self): ++ fut = asyncio.Future(loop=self.loop) ++ fut.cancel() ++ fut._set_result_unless_cancelled(2) ++ self.assertTrue(fut.cancelled()) ++ ++ ++class FutureDoneCallbackTests(test_utils.TestCase): + + def setUp(self): +- self.loop = test_utils.TestLoop() +- asyncio.set_event_loop(None) +- +- def tearDown(self): +- self.loop.close() ++ self.loop = self.new_test_loop() + + def run_briefly(self): + test_utils.run_briefly(self.loop) +diff -r c0e311e010fc Lib/test/test_asyncio/test_locks.py +--- a/Lib/test/test_asyncio/test_locks.py ++++ b/Lib/test/test_asyncio/test_locks.py +@@ -17,14 +17,10 @@ + RGX_REPR = re.compile(STR_RGX_REPR) + + +-class LockTests(unittest.TestCase): ++class LockTests(test_utils.TestCase): + + def setUp(self): +- self.loop = test_utils.TestLoop() +- asyncio.set_event_loop(None) +- +- def tearDown(self): +- self.loop.close() ++ self.loop = self.new_test_loop() + + def test_ctor_loop(self): + loop = mock.Mock() +@@ -35,12 +31,9 @@ + self.assertIs(lock._loop, self.loop) + + def test_ctor_noloop(self): +- try: +- asyncio.set_event_loop(self.loop) +- lock = asyncio.Lock() +- self.assertIs(lock._loop, self.loop) +- finally: +- asyncio.set_event_loop(None) ++ asyncio.set_event_loop(self.loop) ++ lock = asyncio.Lock() ++ self.assertIs(lock._loop, self.loop) + + def test_repr(self): + lock = asyncio.Lock(loop=self.loop) +@@ -240,14 +233,10 @@ + self.assertFalse(lock.locked()) + + +-class EventTests(unittest.TestCase): ++class EventTests(test_utils.TestCase): + + def setUp(self): +- self.loop = test_utils.TestLoop() +- asyncio.set_event_loop(None) +- +- def tearDown(self): +- self.loop.close() ++ self.loop = self.new_test_loop() + + def test_ctor_loop(self): + loop = mock.Mock() +@@ -258,12 +247,9 @@ + self.assertIs(ev._loop, self.loop) + + def test_ctor_noloop(self): +- try: +- asyncio.set_event_loop(self.loop) +- ev = asyncio.Event() +- self.assertIs(ev._loop, self.loop) +- finally: +- asyncio.set_event_loop(None) ++ asyncio.set_event_loop(self.loop) ++ ev = asyncio.Event() ++ self.assertIs(ev._loop, self.loop) + + def test_repr(self): + ev = asyncio.Event(loop=self.loop) +@@ -376,14 +362,10 @@ + self.assertTrue(t.result()) + + +-class ConditionTests(unittest.TestCase): ++class ConditionTests(test_utils.TestCase): + + def setUp(self): +- self.loop = test_utils.TestLoop() +- asyncio.set_event_loop(None) +- +- def tearDown(self): +- self.loop.close() ++ self.loop = self.new_test_loop() + + def test_ctor_loop(self): + loop = mock.Mock() +@@ -394,12 +376,9 @@ + self.assertIs(cond._loop, self.loop) + + def test_ctor_noloop(self): +- try: +- asyncio.set_event_loop(self.loop) +- cond = asyncio.Condition() +- self.assertIs(cond._loop, self.loop) +- finally: +- asyncio.set_event_loop(None) ++ asyncio.set_event_loop(self.loop) ++ cond = asyncio.Condition() ++ self.assertIs(cond._loop, self.loop) + + def test_wait(self): + cond = asyncio.Condition(loop=self.loop) +@@ -677,15 +656,26 @@ + + self.assertFalse(cond.locked()) + ++ def test_explicit_lock(self): ++ lock = asyncio.Lock(loop=self.loop) ++ cond = asyncio.Condition(lock, loop=self.loop) + +-class SemaphoreTests(unittest.TestCase): ++ self.assertIs(cond._lock, lock) ++ self.assertIs(cond._loop, lock._loop) ++ ++ def test_ambiguous_loops(self): ++ loop = self.new_test_loop() ++ self.addCleanup(loop.close) ++ ++ lock = asyncio.Lock(loop=self.loop) ++ with self.assertRaises(ValueError): ++ asyncio.Condition(lock, loop=loop) ++ ++ ++class SemaphoreTests(test_utils.TestCase): + + def setUp(self): +- self.loop = test_utils.TestLoop() +- asyncio.set_event_loop(None) +- +- def tearDown(self): +- self.loop.close() ++ self.loop = self.new_test_loop() + + def test_ctor_loop(self): + loop = mock.Mock() +@@ -696,12 +686,9 @@ + self.assertIs(sem._loop, self.loop) + + def test_ctor_noloop(self): +- try: +- asyncio.set_event_loop(self.loop) +- sem = asyncio.Semaphore() +- self.assertIs(sem._loop, self.loop) +- finally: +- asyncio.set_event_loop(None) ++ asyncio.set_event_loop(self.loop) ++ sem = asyncio.Semaphore() ++ self.assertIs(sem._loop, self.loop) + + def test_initial_value_zero(self): + sem = asyncio.Semaphore(0, loop=self.loop) +@@ -811,6 +798,7 @@ + + # cleanup locked semaphore + sem.release() ++ self.loop.run_until_complete(t4) + + def test_acquire_cancel(self): + sem = asyncio.Semaphore(loop=self.loop) +diff -r c0e311e010fc Lib/test/test_asyncio/test_proactor_events.py +--- a/Lib/test/test_asyncio/test_proactor_events.py ++++ b/Lib/test/test_asyncio/test_proactor_events.py +@@ -12,10 +12,10 @@ + from asyncio import test_utils + + +-class ProactorSocketTransportTests(unittest.TestCase): ++class ProactorSocketTransportTests(test_utils.TestCase): + + def setUp(self): +- self.loop = test_utils.TestLoop() ++ self.loop = self.new_test_loop() + self.proactor = mock.Mock() + self.loop._proactor = self.proactor + self.protocol = test_utils.make_test_protocol(asyncio.Protocol) +@@ -343,7 +343,7 @@ + tr.close() + + +-class BaseProactorEventLoopTests(unittest.TestCase): ++class BaseProactorEventLoopTests(test_utils.TestCase): + + def setUp(self): + self.sock = mock.Mock(socket.socket) +@@ -356,17 +356,19 @@ + return (self.ssock, self.csock) + + self.loop = EventLoop(self.proactor) ++ self.set_event_loop(self.loop, cleanup=False) + +- @mock.patch.object(BaseProactorEventLoop, 'call_soon') ++ @mock.patch.object(BaseProactorEventLoop, '_call_soon') + @mock.patch.object(BaseProactorEventLoop, '_socketpair') +- def test_ctor(self, socketpair, call_soon): ++ def test_ctor(self, socketpair, _call_soon): + ssock, csock = socketpair.return_value = ( + mock.Mock(), mock.Mock()) + loop = BaseProactorEventLoop(self.proactor) + self.assertIs(loop._ssock, ssock) + self.assertIs(loop._csock, csock) + self.assertEqual(loop._internal_fds, 1) +- call_soon.assert_called_with(loop._loop_self_reading) ++ _call_soon.assert_called_with(loop._loop_self_reading, (), ++ check_loop=False) + + def test_close_self_pipe(self): + self.loop._close_self_pipe() +@@ -433,7 +435,7 @@ + + def test_write_to_self(self): + self.loop._write_to_self() +- self.csock.send.assert_called_with(b'x') ++ self.csock.send.assert_called_with(b'\0') + + def test_process_events(self): + self.loop._process_events([]) +diff -r c0e311e010fc Lib/test/test_asyncio/test_queues.py +--- a/Lib/test/test_asyncio/test_queues.py ++++ b/Lib/test/test_asyncio/test_queues.py +@@ -7,14 +7,10 @@ + from asyncio import test_utils + + +-class _QueueTestBase(unittest.TestCase): ++class _QueueTestBase(test_utils.TestCase): + + def setUp(self): +- self.loop = test_utils.TestLoop() +- asyncio.set_event_loop(None) +- +- def tearDown(self): +- self.loop.close() ++ self.loop = self.new_test_loop() + + + class QueueBasicTests(_QueueTestBase): +@@ -32,8 +28,7 @@ + self.assertAlmostEqual(0.2, when) + yield 0.1 + +- loop = test_utils.TestLoop(gen) +- self.addCleanup(loop.close) ++ loop = self.new_test_loop(gen) + + q = asyncio.Queue(loop=loop) + self.assertTrue(fn(q).startswith('= (3, 4)) ++PY35 = (sys.version_info >= (3, 5)) ++ ++ + @asyncio.coroutine + def coroutine_function(): + pass + + ++def format_coroutine(qualname, state, src, source_traceback, generator=False): ++ if generator: ++ state = '%s' % state ++ else: ++ state = '%s, defined' % state ++ if source_traceback is not None: ++ frame = source_traceback[-1] ++ return ('coro=<%s() %s at %s> created at %s:%s' ++ % (qualname, state, src, frame[0], frame[1])) ++ else: ++ return 'coro=<%s() %s at %s>' % (qualname, state, src) ++ ++ + class Dummy: + + def __repr__(self): +- return 'Dummy()' ++ return '' + + def __call__(self, *args): + pass + + +-class TaskTests(unittest.TestCase): ++class TaskTests(test_utils.TestCase): + + def setUp(self): +- self.loop = test_utils.TestLoop() +- asyncio.set_event_loop(None) +- +- def tearDown(self): +- self.loop.close() +- gc.collect() ++ self.loop = self.new_test_loop() + + def test_task_class(self): + @asyncio.coroutine +@@ -46,8 +61,10 @@ + self.assertIs(t._loop, self.loop) + + loop = asyncio.new_event_loop() ++ self.set_event_loop(loop) + t = asyncio.Task(notmuch(), loop=loop) + self.assertIs(t._loop, loop) ++ loop.run_until_complete(t) + loop.close() + + def test_async_coroutine(self): +@@ -61,8 +78,10 @@ + self.assertIs(t._loop, self.loop) + + loop = asyncio.new_event_loop() ++ self.set_event_loop(loop) + t = asyncio.async(notmuch(), loop=loop) + self.assertIs(t._loop, loop) ++ loop.run_until_complete(t) + loop.close() + + def test_async_future(self): +@@ -76,6 +95,7 @@ + self.assertIs(f, f_orig) + + loop = asyncio.new_event_loop() ++ self.set_event_loop(loop) + + with self.assertRaises(ValueError): + f = asyncio.async(f_orig, loop=loop) +@@ -97,6 +117,7 @@ + self.assertIs(t, t_orig) + + loop = asyncio.new_event_loop() ++ self.set_event_loop(loop) + + with self.assertRaises(ValueError): + t = asyncio.async(t_orig, loop=loop) +@@ -111,40 +132,144 @@ + asyncio.async('ok') + + def test_task_repr(self): ++ self.loop.set_debug(False) ++ + @asyncio.coroutine + def notmuch(): + yield from [] + return 'abc' + +- t = asyncio.Task(notmuch(), loop=self.loop) ++ # test coroutine function ++ self.assertEqual(notmuch.__name__, 'notmuch') ++ if PY35: ++ self.assertEqual(notmuch.__qualname__, ++ 'TaskTests.test_task_repr..notmuch') ++ self.assertEqual(notmuch.__module__, __name__) ++ ++ filename, lineno = test_utils.get_function_source(notmuch) ++ src = "%s:%s" % (filename, lineno) ++ ++ # test coroutine object ++ gen = notmuch() ++ if coroutines._DEBUG or PY35: ++ coro_qualname = 'TaskTests.test_task_repr..notmuch' ++ else: ++ coro_qualname = 'notmuch' ++ self.assertEqual(gen.__name__, 'notmuch') ++ if PY35: ++ self.assertEqual(gen.__qualname__, ++ coro_qualname) ++ ++ # test pending Task ++ t = asyncio.Task(gen, loop=self.loop) + t.add_done_callback(Dummy()) +- self.assertEqual(repr(t), 'Task()') ++ ++ coro = format_coroutine(coro_qualname, 'running', src, ++ t._source_traceback, generator=True) ++ self.assertEqual(repr(t), ++ '()]>' % coro) ++ ++ # test cancelling Task + t.cancel() # Does not take immediate effect! +- self.assertEqual(repr(t), 'Task()') ++ self.assertEqual(repr(t), ++ '()]>' % coro) ++ ++ # test cancelled Task + self.assertRaises(asyncio.CancelledError, + self.loop.run_until_complete, t) +- self.assertEqual(repr(t), 'Task()') ++ coro = format_coroutine(coro_qualname, 'done', src, ++ t._source_traceback) ++ self.assertEqual(repr(t), ++ '' % coro) ++ ++ # test finished Task + t = asyncio.Task(notmuch(), loop=self.loop) + self.loop.run_until_complete(t) +- self.assertEqual(repr(t), "Task()") ++ coro = format_coroutine(coro_qualname, 'done', src, ++ t._source_traceback) ++ self.assertEqual(repr(t), ++ "" % coro) + +- def test_task_repr_custom(self): ++ def test_task_repr_coro_decorator(self): ++ self.loop.set_debug(False) ++ + @asyncio.coroutine +- def coro(): +- pass ++ def notmuch(): ++ # notmuch() function doesn't use yield from: it will be wrapped by ++ # @coroutine decorator ++ return 123 + +- class T(asyncio.Future): +- def __repr__(self): +- return 'T[]' ++ # test coroutine function ++ self.assertEqual(notmuch.__name__, 'notmuch') ++ if PY35: ++ self.assertEqual(notmuch.__qualname__, ++ 'TaskTests.test_task_repr_coro_decorator..notmuch') ++ self.assertEqual(notmuch.__module__, __name__) + +- class MyTask(asyncio.Task, T): +- def __repr__(self): +- return super().__repr__() ++ # test coroutine object ++ gen = notmuch() ++ if coroutines._DEBUG or PY35: ++ # On Python >= 3.5, generators now inherit the name of the ++ # function, as expected, and have a qualified name (__qualname__ ++ # attribute). ++ coro_name = 'notmuch' ++ coro_qualname = 'TaskTests.test_task_repr_coro_decorator..notmuch' ++ else: ++ # On Python < 3.5, generators inherit the name of the code, not of ++ # the function. See: http://bugs.python.org/issue21205 ++ coro_name = coro_qualname = 'coro' ++ self.assertEqual(gen.__name__, coro_name) ++ if PY35: ++ self.assertEqual(gen.__qualname__, coro_qualname) + +- gen = coro() +- t = MyTask(gen, loop=self.loop) +- self.assertEqual(repr(t), 'T[]()') +- gen.close() ++ # test repr(CoroWrapper) ++ if coroutines._DEBUG: ++ # format the coroutine object ++ if coroutines._DEBUG: ++ filename, lineno = test_utils.get_function_source(notmuch) ++ frame = gen._source_traceback[-1] ++ coro = ('%s() running, defined at %s:%s, created at %s:%s' ++ % (coro_qualname, filename, lineno, ++ frame[0], frame[1])) ++ else: ++ code = gen.gi_code ++ coro = ('%s() running at %s:%s' ++ % (coro_qualname, code.co_filename, code.co_firstlineno)) ++ ++ self.assertEqual(repr(gen), '' % coro) ++ ++ # test pending Task ++ t = asyncio.Task(gen, loop=self.loop) ++ t.add_done_callback(Dummy()) ++ ++ # format the coroutine object ++ if coroutines._DEBUG: ++ src = '%s:%s' % test_utils.get_function_source(notmuch) ++ else: ++ code = gen.gi_code ++ src = '%s:%s' % (code.co_filename, code.co_firstlineno) ++ coro = format_coroutine(coro_qualname, 'running', src, ++ t._source_traceback, ++ generator=not coroutines._DEBUG) ++ self.assertEqual(repr(t), ++ '()]>' % coro) ++ self.loop.run_until_complete(t) ++ ++ def test_task_repr_wait_for(self): ++ self.loop.set_debug(False) ++ ++ @asyncio.coroutine ++ def wait_for(fut): ++ return (yield from fut) ++ ++ fut = asyncio.Future(loop=self.loop) ++ task = asyncio.Task(wait_for(fut), loop=self.loop) ++ test_utils.run_briefly(self.loop) ++ self.assertRegex(repr(task), ++ '' % re.escape(repr(fut))) ++ ++ fut.set_result(None) ++ self.loop.run_until_complete(task) + + def test_task_basics(self): + @asyncio.coroutine +@@ -171,8 +296,7 @@ + self.assertAlmostEqual(10.0, when) + yield 0 + +- loop = test_utils.TestLoop(gen) +- self.addCleanup(loop.close) ++ loop = self.new_test_loop(gen) + + @asyncio.coroutine + def task(): +@@ -297,7 +421,7 @@ + + def test_cancel_current_task(self): + loop = asyncio.new_event_loop() +- self.addCleanup(loop.close) ++ self.set_event_loop(loop) + + @asyncio.coroutine + def task(): +@@ -325,8 +449,7 @@ + self.assertAlmostEqual(0.3, when) + yield 0.1 + +- loop = test_utils.TestLoop(gen) +- self.addCleanup(loop.close) ++ loop = self.new_test_loop(gen) + + x = 0 + waiters = [] +@@ -342,8 +465,10 @@ + loop.stop() + + t = asyncio.Task(task(), loop=loop) +- self.assertRaises( +- RuntimeError, loop.run_until_complete, t) ++ with self.assertRaises(RuntimeError) as cm: ++ loop.run_until_complete(t) ++ self.assertEqual(str(cm.exception), ++ 'Event loop stopped before Future completed.') + self.assertFalse(t.done()) + self.assertEqual(x, 2) + self.assertAlmostEqual(0.3, loop.time()) +@@ -351,6 +476,8 @@ + # close generators + for w in waiters: + w.close() ++ t.cancel() ++ self.assertRaises(asyncio.CancelledError, loop.run_until_complete, t) + + def test_wait_for(self): + +@@ -361,8 +488,7 @@ + self.assertAlmostEqual(0.1, when) + when = yield 0.1 + +- loop = test_utils.TestLoop(gen) +- self.addCleanup(loop.close) ++ loop = self.new_test_loop(gen) + + foo_running = None + +@@ -387,8 +513,7 @@ + self.assertEqual(foo_running, False) + + def test_wait_for_blocking(self): +- loop = test_utils.TestLoop() +- self.addCleanup(loop.close) ++ loop = self.new_test_loop() + + @asyncio.coroutine + def coro(): +@@ -408,8 +533,7 @@ + self.assertAlmostEqual(0.01, when) + yield 0.01 + +- loop = test_utils.TestLoop(gen) +- self.addCleanup(loop.close) ++ loop = self.new_test_loop(gen) + + @asyncio.coroutine + def foo(): +@@ -437,8 +561,7 @@ + self.assertAlmostEqual(0.15, when) + yield 0.15 + +- loop = test_utils.TestLoop(gen) +- self.addCleanup(loop.close) ++ loop = self.new_test_loop(gen) + + a = asyncio.Task(asyncio.sleep(0.1, loop=loop), loop=loop) + b = asyncio.Task(asyncio.sleep(0.15, loop=loop), loop=loop) +@@ -468,8 +591,7 @@ + self.assertAlmostEqual(0.015, when) + yield 0.015 + +- loop = test_utils.TestLoop(gen) +- self.addCleanup(loop.close) ++ loop = self.new_test_loop(gen) + + a = asyncio.Task(asyncio.sleep(0.01, loop=loop), loop=loop) + b = asyncio.Task(asyncio.sleep(0.015, loop=loop), loop=loop) +@@ -482,11 +604,8 @@ + return 42 + + asyncio.set_event_loop(loop) +- try: +- res = loop.run_until_complete( +- asyncio.Task(foo(), loop=loop)) +- finally: +- asyncio.set_event_loop(None) ++ res = loop.run_until_complete( ++ asyncio.Task(foo(), loop=loop)) + + self.assertEqual(res, 42) + +@@ -510,10 +629,13 @@ + ValueError, self.loop.run_until_complete, + asyncio.wait(set(), loop=self.loop)) + +- self.assertRaises( +- ValueError, self.loop.run_until_complete, +- asyncio.wait([asyncio.sleep(10.0, loop=self.loop)], +- return_when=-1, loop=self.loop)) ++ # -1 is an invalid return_when value ++ sleep_coro = asyncio.sleep(10.0, loop=self.loop) ++ wait_coro = asyncio.wait([sleep_coro], return_when=-1, loop=self.loop) ++ self.assertRaises(ValueError, ++ self.loop.run_until_complete, wait_coro) ++ ++ sleep_coro.close() + + def test_wait_first_completed(self): + +@@ -524,8 +646,7 @@ + self.assertAlmostEqual(0.1, when) + yield 0.1 + +- loop = test_utils.TestLoop(gen) +- self.addCleanup(loop.close) ++ loop = self.new_test_loop(gen) + + a = asyncio.Task(asyncio.sleep(10.0, loop=loop), loop=loop) + b = asyncio.Task(asyncio.sleep(0.1, loop=loop), loop=loop) +@@ -580,8 +701,7 @@ + self.assertAlmostEqual(10.0, when) + yield 0 + +- loop = test_utils.TestLoop(gen) +- self.addCleanup(loop.close) ++ loop = self.new_test_loop(gen) + + # first_exception, task already has exception + a = asyncio.Task(asyncio.sleep(10.0, loop=loop), loop=loop) +@@ -614,8 +734,7 @@ + self.assertAlmostEqual(0.01, when) + yield 0.01 + +- loop = test_utils.TestLoop(gen) +- self.addCleanup(loop.close) ++ loop = self.new_test_loop(gen) + + # first_exception, exception during waiting + a = asyncio.Task(asyncio.sleep(10.0, loop=loop), loop=loop) +@@ -647,8 +766,7 @@ + self.assertAlmostEqual(0.15, when) + yield 0.15 + +- loop = test_utils.TestLoop(gen) +- self.addCleanup(loop.close) ++ loop = self.new_test_loop(gen) + + a = asyncio.Task(asyncio.sleep(0.1, loop=loop), loop=loop) + +@@ -684,8 +802,7 @@ + self.assertAlmostEqual(0.11, when) + yield 0.11 + +- loop = test_utils.TestLoop(gen) +- self.addCleanup(loop.close) ++ loop = self.new_test_loop(gen) + + a = asyncio.Task(asyncio.sleep(0.1, loop=loop), loop=loop) + b = asyncio.Task(asyncio.sleep(0.15, loop=loop), loop=loop) +@@ -715,8 +832,7 @@ + self.assertAlmostEqual(0.1, when) + yield 0.1 + +- loop = test_utils.TestLoop(gen) +- self.addCleanup(loop.close) ++ loop = self.new_test_loop(gen) + + a = asyncio.Task(asyncio.sleep(0.1, loop=loop), loop=loop) + b = asyncio.Task(asyncio.sleep(0.15, loop=loop), loop=loop) +@@ -740,8 +856,9 @@ + yield 0.01 + yield 0 + +- loop = test_utils.TestLoop(gen) +- self.addCleanup(loop.close) ++ loop = self.new_test_loop(gen) ++ # disable "slow callback" warning ++ loop.slow_callback_duration = 1.0 + completed = set() + time_shifted = False + +@@ -784,8 +901,7 @@ + yield 0 + yield 0.1 + +- loop = test_utils.TestLoop(gen) +- self.addCleanup(loop.close) ++ loop = self.new_test_loop(gen) + + a = asyncio.sleep(0.1, 'a', loop=loop) + b = asyncio.sleep(0.15, 'b', loop=loop) +@@ -821,8 +937,7 @@ + yield 0 + yield 0.01 + +- loop = test_utils.TestLoop(gen) +- self.addCleanup(loop.close) ++ loop = self.new_test_loop(gen) + + a = asyncio.sleep(0.01, 'a', loop=loop) + +@@ -841,8 +956,7 @@ + yield 0.05 + yield 0 + +- loop = test_utils.TestLoop(gen) +- self.addCleanup(loop.close) ++ loop = self.new_test_loop(gen) + + a = asyncio.sleep(0.05, 'a', loop=loop) + b = asyncio.sleep(0.10, 'b', loop=loop) +@@ -867,8 +981,7 @@ + self.assertAlmostEqual(0.05, when) + yield 0.05 + +- loop = test_utils.TestLoop(gen) +- self.addCleanup(loop.close) ++ loop = self.new_test_loop(gen) + + a = asyncio.sleep(0.05, 'a', loop=loop) + b = asyncio.sleep(0.05, 'b', loop=loop) +@@ -909,8 +1022,7 @@ + self.assertAlmostEqual(0.1, when) + yield 0.05 + +- loop = test_utils.TestLoop(gen) +- self.addCleanup(loop.close) ++ loop = self.new_test_loop(gen) + + @asyncio.coroutine + def sleeper(dt, arg): +@@ -931,8 +1043,7 @@ + self.assertAlmostEqual(10.0, when) + yield 0 + +- loop = test_utils.TestLoop(gen) +- self.addCleanup(loop.close) ++ loop = self.new_test_loop(gen) + + t = asyncio.Task(asyncio.sleep(10.0, 'yeah', loop=loop), + loop=loop) +@@ -940,9 +1051,9 @@ + handle = None + orig_call_later = loop.call_later + +- def call_later(self, delay, callback, *args): ++ def call_later(delay, callback, *args): + nonlocal handle +- handle = orig_call_later(self, delay, callback, *args) ++ handle = orig_call_later(delay, callback, *args) + return handle + + loop.call_later = call_later +@@ -963,8 +1074,7 @@ + self.assertAlmostEqual(5000, when) + yield 0.1 + +- loop = test_utils.TestLoop(gen) +- self.addCleanup(loop.close) ++ loop = self.new_test_loop(gen) + + @asyncio.coroutine + def sleep(dt): +@@ -1074,8 +1184,7 @@ + self.assertAlmostEqual(10.0, when) + yield 0 + +- loop = test_utils.TestLoop(gen) +- self.addCleanup(loop.close) ++ loop = self.new_test_loop(gen) + + @asyncio.coroutine + def sleeper(): +@@ -1372,8 +1481,10 @@ + # as_completed() expects a list of futures, not a future instance + self.assertRaises(TypeError, self.loop.run_until_complete, + asyncio.as_completed(fut, loop=self.loop)) ++ coro = coroutine_function() + self.assertRaises(TypeError, self.loop.run_until_complete, +- asyncio.as_completed(coroutine_function(), loop=self.loop)) ++ asyncio.as_completed(coro, loop=self.loop)) ++ coro.close() + + def test_wait_invalid_args(self): + fut = asyncio.Future(loop=self.loop) +@@ -1381,8 +1492,10 @@ + # wait() expects a list of futures, not a future instance + self.assertRaises(TypeError, self.loop.run_until_complete, + asyncio.wait(fut, loop=self.loop)) ++ coro = coroutine_function() + self.assertRaises(TypeError, self.loop.run_until_complete, +- asyncio.wait(coroutine_function(), loop=self.loop)) ++ asyncio.wait(coro, loop=self.loop)) ++ coro.close() + + # wait() expects at least a future + self.assertRaises(ValueError, self.loop.run_until_complete, +@@ -1420,23 +1533,23 @@ + self.assertIsNone(gen.gi_frame) + + # Save debug flag. +- old_debug = asyncio.tasks._DEBUG ++ old_debug = asyncio.coroutines._DEBUG + try: + # Test with debug flag cleared. +- asyncio.tasks._DEBUG = False ++ asyncio.coroutines._DEBUG = False + check() + + # Test with debug flag set. +- asyncio.tasks._DEBUG = True ++ asyncio.coroutines._DEBUG = True + check() + + finally: + # Restore original debug flag. +- asyncio.tasks._DEBUG = old_debug ++ asyncio.coroutines._DEBUG = old_debug + + def test_yield_from_corowrapper(self): +- old_debug = asyncio.tasks._DEBUG +- asyncio.tasks._DEBUG = True ++ old_debug = asyncio.coroutines._DEBUG ++ asyncio.coroutines._DEBUG = True + try: + @asyncio.coroutine + def t1(): +@@ -1456,7 +1569,7 @@ + val = self.loop.run_until_complete(task) + self.assertEqual(val, (1, 2, 3)) + finally: +- asyncio.tasks._DEBUG = old_debug ++ asyncio.coroutines._DEBUG = old_debug + + def test_yield_from_corowrapper_send(self): + def foo(): +@@ -1464,7 +1577,7 @@ + return a + + def call(arg): +- cw = asyncio.tasks.CoroWrapper(foo(), foo) ++ cw = asyncio.coroutines.CoroWrapper(foo(), foo) + cw.send(None) + try: + cw.send(arg) +@@ -1479,20 +1592,102 @@ + def test_corowrapper_weakref(self): + wd = weakref.WeakValueDictionary() + def foo(): yield from [] +- cw = asyncio.tasks.CoroWrapper(foo(), foo) ++ cw = asyncio.coroutines.CoroWrapper(foo(), foo) + wd['cw'] = cw # Would fail without __weakref__ slot. + cw.gen = None # Suppress warning from __del__. + ++ @unittest.skipUnless(PY34, ++ 'need python 3.4 or later') ++ def test_log_destroyed_pending_task(self): ++ @asyncio.coroutine ++ def kill_me(loop): ++ future = asyncio.Future(loop=loop) ++ yield from future ++ # at this point, the only reference to kill_me() task is ++ # the Task._wakeup() method in future._callbacks ++ raise Exception("code never reached") ++ ++ mock_handler = mock.Mock() ++ self.loop.set_debug(True) ++ self.loop.set_exception_handler(mock_handler) ++ ++ # schedule the task ++ coro = kill_me(self.loop) ++ task = asyncio.async(coro, loop=self.loop) ++ self.assertEqual(asyncio.Task.all_tasks(loop=self.loop), {task}) ++ ++ # execute the task so it waits for future ++ self.loop._run_once() ++ self.assertEqual(len(self.loop._ready), 0) ++ ++ # remove the future used in kill_me(), and references to the task ++ del coro.gi_frame.f_locals['future'] ++ coro = None ++ source_traceback = task._source_traceback ++ task = None ++ ++ # no more reference to kill_me() task: the task is destroyed by the GC ++ support.gc_collect() ++ ++ self.assertEqual(asyncio.Task.all_tasks(loop=self.loop), set()) ++ ++ mock_handler.assert_called_with(self.loop, { ++ 'message': 'Task was destroyed but it is pending!', ++ 'task': mock.ANY, ++ 'source_traceback': source_traceback, ++ }) ++ mock_handler.reset_mock() ++ ++ @mock.patch('asyncio.coroutines.logger') ++ def test_coroutine_never_yielded(self, m_log): ++ debug = asyncio.coroutines._DEBUG ++ try: ++ asyncio.coroutines._DEBUG = True ++ @asyncio.coroutine ++ def coro_noop(): ++ pass ++ finally: ++ asyncio.coroutines._DEBUG = debug ++ ++ tb_filename = __file__ ++ tb_lineno = sys._getframe().f_lineno + 2 ++ # create a coroutine object but don't use it ++ coro_noop() ++ support.gc_collect() ++ ++ self.assertTrue(m_log.error.called) ++ message = m_log.error.call_args[0][0] ++ func_filename, func_lineno = test_utils.get_function_source(coro_noop) ++ regex = (r'^ was never yielded from\n' ++ r'Coroutine object created at \(most recent call last\):\n' ++ r'.*\n' ++ r' File "%s", line %s, in test_coroutine_never_yielded\n' ++ r' coro_noop\(\)$' ++ % (re.escape(coro_noop.__qualname__), ++ re.escape(func_filename), func_lineno, ++ re.escape(tb_filename), tb_lineno)) ++ ++ self.assertRegex(message, re.compile(regex, re.DOTALL)) ++ ++ def test_task_source_traceback(self): ++ self.loop.set_debug(True) ++ ++ task = asyncio.Task(coroutine_function(), loop=self.loop) ++ lineno = sys._getframe().f_lineno - 1 ++ self.assertIsInstance(task._source_traceback, list) ++ self.assertEqual(task._source_traceback[-1][:3], ++ (__file__, ++ lineno, ++ 'test_task_source_traceback')) ++ self.loop.run_until_complete(task) ++ + + class GatherTestsBase: + + def setUp(self): +- self.one_loop = test_utils.TestLoop() +- self.other_loop = test_utils.TestLoop() +- +- def tearDown(self): +- self.one_loop.close() +- self.other_loop.close() ++ self.one_loop = self.new_test_loop() ++ self.other_loop = self.new_test_loop() ++ self.set_event_loop(self.one_loop, cleanup=False) + + def _run_loop(self, loop): + while loop._ready: +@@ -1558,13 +1753,9 @@ + self.assertEqual(fut.result(), [3, 1, exc, exc2]) + + def test_env_var_debug(self): +- path = os.path.dirname(asyncio.__file__) +- path = os.path.normpath(os.path.join(path, '..')) + code = '\n'.join(( +- 'import sys', +- 'sys.path.insert(0, %r)' % path, +- 'import asyncio.tasks', +- 'print(asyncio.tasks._DEBUG)')) ++ 'import asyncio.coroutines', ++ 'print(asyncio.coroutines._DEBUG)')) + + # Test with -E to not fail if the unit test was run with + # PYTHONASYNCIODEBUG set to a non-empty string +@@ -1584,7 +1775,7 @@ + self.assertEqual(stdout.rstrip(), b'False') + + +-class FutureGatherTests(GatherTestsBase, unittest.TestCase): ++class FutureGatherTests(GatherTestsBase, test_utils.TestCase): + + def wrap_futures(self, *futures): + return futures +@@ -1668,16 +1859,12 @@ + cb.assert_called_once_with(fut) + + +-class CoroutineGatherTests(GatherTestsBase, unittest.TestCase): ++class CoroutineGatherTests(GatherTestsBase, test_utils.TestCase): + + def setUp(self): + super().setUp() + asyncio.set_event_loop(self.one_loop) + +- def tearDown(self): +- asyncio.set_event_loop(None) +- super().tearDown() +- + def wrap_futures(self, *futures): + coros = [] + for fut in futures: +@@ -1695,14 +1882,14 @@ + gen2 = coro() + fut = asyncio.gather(gen1, gen2) + self.assertIs(fut._loop, self.one_loop) +- gen1.close() +- gen2.close() ++ self.one_loop.run_until_complete(fut) ++ ++ self.set_event_loop(self.other_loop, cleanup=False) + gen3 = coro() + gen4 = coro() +- fut = asyncio.gather(gen3, gen4, loop=self.other_loop) +- self.assertIs(fut._loop, self.other_loop) +- gen3.close() +- gen4.close() ++ fut2 = asyncio.gather(gen3, gen4, loop=self.other_loop) ++ self.assertIs(fut2._loop, self.other_loop) ++ self.other_loop.run_until_complete(fut2) + + def test_duplicate_coroutines(self): + @asyncio.coroutine +diff -r c0e311e010fc Lib/test/test_asyncio/test_unix_events.py +--- a/Lib/test/test_asyncio/test_unix_events.py ++++ b/Lib/test/test_asyncio/test_unix_events.py +@@ -29,14 +29,11 @@ + + + @unittest.skipUnless(signal, 'Signals are not supported') +-class SelectorEventLoopSignalTests(unittest.TestCase): ++class SelectorEventLoopSignalTests(test_utils.TestCase): + + def setUp(self): + self.loop = asyncio.SelectorEventLoop() +- asyncio.set_event_loop(None) +- +- def tearDown(self): +- self.loop.close() ++ self.set_event_loop(self.loop) + + def test_check_signal(self): + self.assertRaises( +@@ -45,7 +42,7 @@ + ValueError, self.loop._check_signal, signal.NSIG + 1) + + def test_handle_signal_no_handler(self): +- self.loop._handle_signal(signal.NSIG + 1, ()) ++ self.loop._handle_signal(signal.NSIG + 1) + + def test_handle_signal_cancelled_handler(self): + h = asyncio.Handle(mock.Mock(), (), +@@ -53,7 +50,7 @@ + h.cancel() + self.loop._signal_handlers[signal.NSIG + 1] = h + self.loop.remove_signal_handler = mock.Mock() +- self.loop._handle_signal(signal.NSIG + 1, ()) ++ self.loop._handle_signal(signal.NSIG + 1) + self.loop.remove_signal_handler.assert_called_with(signal.NSIG + 1) + + @mock.patch('asyncio.unix_events.signal') +@@ -208,14 +205,11 @@ + + @unittest.skipUnless(hasattr(socket, 'AF_UNIX'), + 'UNIX Sockets are not supported') +-class SelectorEventLoopUnixSocketTests(unittest.TestCase): ++class SelectorEventLoopUnixSocketTests(test_utils.TestCase): + + def setUp(self): + self.loop = asyncio.SelectorEventLoop() +- asyncio.set_event_loop(None) +- +- def tearDown(self): +- self.loop.close() ++ self.set_event_loop(self.loop) + + def test_create_unix_server_existing_path_sock(self): + with test_utils.unix_socket_path() as path: +@@ -256,6 +250,24 @@ + 'A UNIX Domain Socket was expected'): + self.loop.run_until_complete(coro) + ++ @mock.patch('asyncio.unix_events.socket') ++ def test_create_unix_server_bind_error(self, m_socket): ++ # Ensure that the socket is closed on any bind error ++ sock = mock.Mock() ++ m_socket.socket.return_value = sock ++ ++ sock.bind.side_effect = OSError ++ coro = self.loop.create_unix_server(lambda: None, path="/test") ++ with self.assertRaises(OSError): ++ self.loop.run_until_complete(coro) ++ self.assertTrue(sock.close.called) ++ ++ sock.bind.side_effect = MemoryError ++ coro = self.loop.create_unix_server(lambda: None, path="/test") ++ with self.assertRaises(MemoryError): ++ self.loop.run_until_complete(coro) ++ self.assertTrue(sock.close.called) ++ + def test_create_unix_connection_path_sock(self): + coro = self.loop.create_unix_connection( + lambda: None, '/dev/null', sock=object()) +@@ -286,17 +298,17 @@ + self.loop.run_until_complete(coro) + + +-class UnixReadPipeTransportTests(unittest.TestCase): ++class UnixReadPipeTransportTests(test_utils.TestCase): + + def setUp(self): +- self.loop = test_utils.TestLoop() ++ self.loop = self.new_test_loop() + self.protocol = test_utils.make_test_protocol(asyncio.Protocol) + self.pipe = mock.Mock(spec_set=io.RawIOBase) + self.pipe.fileno.return_value = 5 + +- fcntl_patcher = mock.patch('fcntl.fcntl') +- fcntl_patcher.start() +- self.addCleanup(fcntl_patcher.stop) ++ blocking_patcher = mock.patch('asyncio.unix_events._set_nonblocking') ++ blocking_patcher.start() ++ self.addCleanup(blocking_patcher.stop) + + fstat_patcher = mock.patch('os.fstat') + m_fstat = fstat_patcher.start() +@@ -423,6 +435,8 @@ + def test__call_connection_lost(self): + tr = unix_events._UnixReadPipeTransport( + self.loop, self.pipe, self.protocol) ++ self.assertIsNotNone(tr._protocol) ++ self.assertIsNotNone(tr._loop) + + err = None + tr._call_connection_lost(err) +@@ -430,15 +444,13 @@ + self.pipe.close.assert_called_with() + + self.assertIsNone(tr._protocol) +- self.assertEqual(2, sys.getrefcount(self.protocol), +- pprint.pformat(gc.get_referrers(self.protocol))) + self.assertIsNone(tr._loop) +- self.assertEqual(4, sys.getrefcount(self.loop), +- pprint.pformat(gc.get_referrers(self.loop))) + + def test__call_connection_lost_with_err(self): + tr = unix_events._UnixReadPipeTransport( + self.loop, self.pipe, self.protocol) ++ self.assertIsNotNone(tr._protocol) ++ self.assertIsNotNone(tr._loop) + + err = OSError() + tr._call_connection_lost(err) +@@ -446,25 +458,20 @@ + self.pipe.close.assert_called_with() + + self.assertIsNone(tr._protocol) ++ self.assertIsNone(tr._loop) + +- self.assertEqual(2, sys.getrefcount(self.protocol), +- pprint.pformat(gc.get_referrers(self.protocol))) +- self.assertIsNone(tr._loop) +- self.assertEqual(4, sys.getrefcount(self.loop), +- pprint.pformat(gc.get_referrers(self.loop))) + +- +-class UnixWritePipeTransportTests(unittest.TestCase): ++class UnixWritePipeTransportTests(test_utils.TestCase): + + def setUp(self): +- self.loop = test_utils.TestLoop() ++ self.loop = self.new_test_loop() + self.protocol = test_utils.make_test_protocol(asyncio.BaseProtocol) + self.pipe = mock.Mock(spec_set=io.RawIOBase) + self.pipe.fileno.return_value = 5 + +- fcntl_patcher = mock.patch('fcntl.fcntl') +- fcntl_patcher.start() +- self.addCleanup(fcntl_patcher.stop) ++ blocking_patcher = mock.patch('asyncio.unix_events._set_nonblocking') ++ blocking_patcher.start() ++ self.addCleanup(blocking_patcher.stop) + + fstat_patcher = mock.patch('os.fstat') + m_fstat = fstat_patcher.start() +@@ -709,6 +716,8 @@ + def test__call_connection_lost(self): + tr = unix_events._UnixWritePipeTransport( + self.loop, self.pipe, self.protocol) ++ self.assertIsNotNone(tr._protocol) ++ self.assertIsNotNone(tr._loop) + + err = None + tr._call_connection_lost(err) +@@ -716,15 +725,13 @@ + self.pipe.close.assert_called_with() + + self.assertIsNone(tr._protocol) +- self.assertEqual(2, sys.getrefcount(self.protocol), +- pprint.pformat(gc.get_referrers(self.protocol))) + self.assertIsNone(tr._loop) +- self.assertEqual(4, sys.getrefcount(self.loop), +- pprint.pformat(gc.get_referrers(self.loop))) + + def test__call_connection_lost_with_err(self): + tr = unix_events._UnixWritePipeTransport( + self.loop, self.pipe, self.protocol) ++ self.assertIsNotNone(tr._protocol) ++ self.assertIsNotNone(tr._loop) + + err = OSError() + tr._call_connection_lost(err) +@@ -732,11 +739,7 @@ + self.pipe.close.assert_called_with() + + self.assertIsNone(tr._protocol) +- self.assertEqual(2, sys.getrefcount(self.protocol), +- pprint.pformat(gc.get_referrers(self.protocol))) + self.assertIsNone(tr._loop) +- self.assertEqual(4, sys.getrefcount(self.loop), +- pprint.pformat(gc.get_referrers(self.loop))) + + def test_close(self): + tr = unix_events._UnixWritePipeTransport( +@@ -816,7 +819,7 @@ + ignore_warnings = mock.patch.object(log.logger, "warning") + + def setUp(self): +- self.loop = test_utils.TestLoop() ++ self.loop = self.new_test_loop() + self.running = False + self.zombies = {} + +@@ -1374,7 +1377,7 @@ + + # attach a new loop + old_loop = self.loop +- self.loop = test_utils.TestLoop() ++ self.loop = self.new_test_loop() + patch = mock.patch.object + + with patch(old_loop, "remove_signal_handler") as m_old_remove, \ +@@ -1429,7 +1432,7 @@ + self.assertFalse(callback3.called) + + # attach a new loop +- self.loop = test_utils.TestLoop() ++ self.loop = self.new_test_loop() + + with mock.patch.object( + self.loop, "add_signal_handler") as m_add_signal_handler: +@@ -1487,12 +1490,12 @@ + self.assertFalse(self.watcher._zombies) + + +-class SafeChildWatcherTests (ChildWatcherTestsMixin, unittest.TestCase): ++class SafeChildWatcherTests (ChildWatcherTestsMixin, test_utils.TestCase): + def create_watcher(self): + return asyncio.SafeChildWatcher() + + +-class FastChildWatcherTests (ChildWatcherTestsMixin, unittest.TestCase): ++class FastChildWatcherTests (ChildWatcherTestsMixin, test_utils.TestCase): + def create_watcher(self): + return asyncio.FastChildWatcher() + +diff -r c0e311e010fc Lib/test/test_asyncio/test_windows_events.py +--- a/Lib/test/test_asyncio/test_windows_events.py ++++ b/Lib/test/test_asyncio/test_windows_events.py +@@ -9,6 +9,7 @@ + + import asyncio + from asyncio import _overlapped ++from asyncio import test_utils + from asyncio import windows_events + + +@@ -26,15 +27,11 @@ + self.trans.close() + + +-class ProactorTests(unittest.TestCase): ++class ProactorTests(test_utils.TestCase): + + def setUp(self): + self.loop = asyncio.ProactorEventLoop() +- asyncio.set_event_loop(None) +- +- def tearDown(self): +- self.loop.close() +- self.loop = None ++ self.set_event_loop(self.loop) + + def test_close(self): + a, b = self.loop._socketpair() +@@ -97,38 +94,48 @@ + event = _overlapped.CreateEvent(None, True, False, None) + self.addCleanup(_winapi.CloseHandle, event) + +- # Wait for unset event with 0.2s timeout; ++ # Wait for unset event with 0.5s timeout; + # result should be False at timeout +- f = self.loop._proactor.wait_for_handle(event, 0.2) ++ fut = self.loop._proactor.wait_for_handle(event, 0.5) + start = self.loop.time() +- self.loop.run_until_complete(f) ++ self.loop.run_until_complete(fut) + elapsed = self.loop.time() - start +- self.assertFalse(f.result()) +- self.assertTrue(0.18 < elapsed < 0.9, elapsed) ++ self.assertFalse(fut.result()) ++ self.assertTrue(0.48 < elapsed < 0.9, elapsed) + + _overlapped.SetEvent(event) + + # Wait for for set event; + # result should be True immediately +- f = self.loop._proactor.wait_for_handle(event, 10) ++ fut = self.loop._proactor.wait_for_handle(event, 10) + start = self.loop.time() +- self.loop.run_until_complete(f) ++ self.loop.run_until_complete(fut) + elapsed = self.loop.time() - start +- self.assertTrue(f.result()) +- self.assertTrue(0 <= elapsed < 0.1, elapsed) ++ self.assertTrue(fut.result()) ++ self.assertTrue(0 <= elapsed < 0.3, elapsed) + +- _overlapped.ResetEvent(event) ++ # Tulip issue #195: cancelling a done _WaitHandleFuture must not crash ++ fut.cancel() ++ ++ def test_wait_for_handle_cancel(self): ++ event = _overlapped.CreateEvent(None, True, False, None) ++ self.addCleanup(_winapi.CloseHandle, event) + + # Wait for unset event with a cancelled future; + # CancelledError should be raised immediately +- f = self.loop._proactor.wait_for_handle(event, 10) +- f.cancel() ++ fut = self.loop._proactor.wait_for_handle(event, 10) ++ fut.cancel() + start = self.loop.time() + with self.assertRaises(asyncio.CancelledError): +- self.loop.run_until_complete(f) ++ self.loop.run_until_complete(fut) + elapsed = self.loop.time() - start + self.assertTrue(0 <= elapsed < 0.1, elapsed) + ++ # Tulip issue #195: cancelling a _WaitHandleFuture twice must not crash ++ fut = self.loop._proactor.wait_for_handle(event) ++ fut.cancel() ++ fut.cancel() ++ + + if __name__ == '__main__': + unittest.main() +diff -r c0e311e010fc Lib/test/test_asyncio/test_windows_utils.py +--- a/Lib/test/test_asyncio/test_windows_utils.py ++++ b/Lib/test/test_asyncio/test_windows_utils.py +@@ -51,6 +51,15 @@ + self.assertRaises(ValueError, + windows_utils.socketpair, proto=1) + ++ @mock.patch('asyncio.windows_utils.socket') ++ def test_winsocketpair_close(self, m_socket): ++ m_socket.AF_INET = socket.AF_INET ++ m_socket.SOCK_STREAM = socket.SOCK_STREAM ++ sock = mock.Mock() ++ m_socket.socket.return_value = sock ++ sock.bind.side_effect = OSError ++ self.assertRaises(OSError, windows_utils.socketpair) ++ self.assertTrue(sock.close.called) + + + class PipeTests(unittest.TestCase): +@@ -155,6 +164,8 @@ + self.assertTrue(msg.upper().rstrip().startswith(out)) + self.assertTrue(b"stderr".startswith(err)) + ++ p.wait() ++ + + if __name__ == '__main__': + unittest.main() +diff -r c0e311e010fc Lib/test/test_asyncore.py +--- a/Lib/test/test_asyncore.py ++++ b/Lib/test/test_asyncore.py +@@ -5,14 +5,12 @@ + import socket + import sys + import time +-import warnings + import errno + import struct ++import warnings + + from test import support +-from test.support import TESTFN, run_unittest, unlink, HOST, HOSTv6 + from io import BytesIO +-from io import StringIO + + try: + import threading +@@ -94,7 +92,7 @@ + """Helper function to bind a socket according to its family.""" + if HAS_UNIX_SOCKETS and sock.family == socket.AF_UNIX: + # Make sure the path doesn't exist. +- unlink(addr) ++ support.unlink(addr) + sock.bind(addr) + + +@@ -257,40 +255,29 @@ + d = asyncore.dispatcher() + + # capture output of dispatcher.log() (to stderr) +- fp = StringIO() +- stderr = sys.stderr + l1 = "Lovely spam! Wonderful spam!" + l2 = "I don't like spam!" +- try: +- sys.stderr = fp ++ with support.captured_stderr() as stderr: + d.log(l1) + d.log(l2) +- finally: +- sys.stderr = stderr + +- lines = fp.getvalue().splitlines() ++ lines = stderr.getvalue().splitlines() + self.assertEqual(lines, ['log: %s' % l1, 'log: %s' % l2]) + + def test_log_info(self): + d = asyncore.dispatcher() + + # capture output of dispatcher.log_info() (to stdout via print) +- fp = StringIO() +- stdout = sys.stdout + l1 = "Have you got anything without spam?" + l2 = "Why can't she have egg bacon spam and sausage?" + l3 = "THAT'S got spam in it!" +- try: +- sys.stdout = fp ++ with support.captured_stdout() as stdout: + d.log_info(l1, 'EGGS') + d.log_info(l2) + d.log_info(l3, 'SPAM') +- finally: +- sys.stdout = stdout + +- lines = fp.getvalue().splitlines() ++ lines = stdout.getvalue().splitlines() + expected = ['EGGS: %s' % l1, 'info: %s' % l2, 'SPAM: %s' % l3] +- + self.assertEqual(lines, expected) + + def test_unhandled(self): +@@ -298,18 +285,13 @@ + d.ignore_log_types = () + + # capture output of dispatcher.log_info() (to stdout via print) +- fp = StringIO() +- stdout = sys.stdout +- try: +- sys.stdout = fp ++ with support.captured_stdout() as stdout: + d.handle_expt() + d.handle_read() + d.handle_write() + d.handle_connect() +- finally: +- sys.stdout = stdout + +- lines = fp.getvalue().splitlines() ++ lines = stdout.getvalue().splitlines() + expected = ['warning: unhandled incoming priority event', + 'warning: unhandled read event', + 'warning: unhandled write event', +@@ -378,7 +360,7 @@ + data = b"Suppose there isn't a 16-ton weight?" + d = dispatcherwithsend_noread() + d.create_socket() +- d.connect((HOST, port)) ++ d.connect((support.HOST, port)) + + # give time for socket to connect + time.sleep(0.1) +@@ -410,14 +392,14 @@ + class FileWrapperTest(unittest.TestCase): + def setUp(self): + self.d = b"It's not dead, it's sleeping!" +- with open(TESTFN, 'wb') as file: ++ with open(support.TESTFN, 'wb') as file: + file.write(self.d) + + def tearDown(self): +- unlink(TESTFN) ++ support.unlink(support.TESTFN) + + def test_recv(self): +- fd = os.open(TESTFN, os.O_RDONLY) ++ fd = os.open(support.TESTFN, os.O_RDONLY) + w = asyncore.file_wrapper(fd) + os.close(fd) + +@@ -431,20 +413,20 @@ + def test_send(self): + d1 = b"Come again?" + d2 = b"I want to buy some cheese." +- fd = os.open(TESTFN, os.O_WRONLY | os.O_APPEND) ++ fd = os.open(support.TESTFN, os.O_WRONLY | os.O_APPEND) + w = asyncore.file_wrapper(fd) + os.close(fd) + + w.write(d1) + w.send(d2) + w.close() +- with open(TESTFN, 'rb') as file: ++ with open(support.TESTFN, 'rb') as file: + self.assertEqual(file.read(), self.d + d1 + d2) + + @unittest.skipUnless(hasattr(asyncore, 'file_dispatcher'), + 'asyncore.file_dispatcher required') + def test_dispatcher(self): +- fd = os.open(TESTFN, os.O_RDONLY) ++ fd = os.open(support.TESTFN, os.O_RDONLY) + data = [] + class FileDispatcher(asyncore.file_dispatcher): + def handle_read(self): +@@ -454,6 +436,26 @@ + asyncore.loop(timeout=0.01, use_poll=True, count=2) + self.assertEqual(b"".join(data), self.d) + ++ def test_resource_warning(self): ++ # Issue #11453 ++ fd = os.open(support.TESTFN, os.O_RDONLY) ++ f = asyncore.file_wrapper(fd) ++ ++ os.close(fd) ++ with support.check_warnings(('', ResourceWarning)): ++ f = None ++ support.gc_collect() ++ ++ def test_close_twice(self): ++ fd = os.open(support.TESTFN, os.O_RDONLY) ++ f = asyncore.file_wrapper(fd) ++ os.close(fd) ++ ++ f.close() ++ self.assertEqual(f.fd, -1) ++ # calling close twice should not fail ++ f.close() ++ + + class BaseTestHandler(asyncore.dispatcher): + +@@ -815,12 +817,12 @@ + + class TestAPI_UseIPv4Sockets(BaseTestAPI): + family = socket.AF_INET +- addr = (HOST, 0) ++ addr = (support.HOST, 0) + + @unittest.skipUnless(support.IPV6_ENABLED, 'IPv6 support required') + class TestAPI_UseIPv6Sockets(BaseTestAPI): + family = socket.AF_INET6 +- addr = (HOSTv6, 0) ++ addr = (support.HOSTv6, 0) + + @unittest.skipUnless(HAS_UNIX_SOCKETS, 'Unix sockets required') + class TestAPI_UseUnixSockets(BaseTestAPI): +@@ -829,7 +831,7 @@ + addr = support.TESTFN + + def tearDown(self): +- unlink(self.addr) ++ support.unlink(self.addr) + BaseTestAPI.tearDown(self) + + class TestAPI_UseIPv4Select(TestAPI_UseIPv4Sockets, unittest.TestCase): +diff -r c0e311e010fc Lib/test/test_bytes.py +--- a/Lib/test/test_bytes.py ++++ b/Lib/test/test_bytes.py +@@ -700,7 +700,7 @@ + type2test = bytes + + def test_buffer_is_readonly(self): +- fd = os.dup(sys.stdin.fileno()) ++ fd = os.open(__file__, os.O_RDONLY) + with open(fd, "rb", buffering=0) as f: + self.assertRaises(TypeError, f.readinto, b"") + +diff -r c0e311e010fc Lib/test/test_cmd.py +--- a/Lib/test/test_cmd.py ++++ b/Lib/test/test_cmd.py +@@ -229,7 +229,7 @@ + trace = support.import_module('trace') + tracer=trace.Trace(ignoredirs=[sys.base_prefix, sys.base_exec_prefix,], + trace=0, count=1) +- tracer.run('reload(cmd);test_main()') ++ tracer.run('import importlib; importlib.reload(cmd); test_main()') + r=tracer.results() + print("Writing coverage results...") + r.write_results(show_missing=True, summary=True, coverdir=coverdir) +diff -r c0e311e010fc Lib/test/test_codecmaps_cn.py +--- a/Lib/test/test_codecmaps_cn.py ++++ b/Lib/test/test_codecmaps_cn.py +@@ -25,8 +25,5 @@ + 'trunk/charset/data/xml/gb-18030-2000.xml' + + +-def test_main(): +- support.run_unittest(__name__) +- + if __name__ == "__main__": +- test_main() ++ unittest.main() +diff -r c0e311e010fc Lib/test/test_codecmaps_hk.py +--- a/Lib/test/test_codecmaps_hk.py ++++ b/Lib/test/test_codecmaps_hk.py +@@ -12,9 +12,5 @@ + encoding = 'big5hkscs' + mapfileurl = 'http://people.freebsd.org/~perky/i18n/BIG5HKSCS-2004.TXT' + +-def test_main(): +- support.run_unittest(__name__) +- + if __name__ == "__main__": +- support.use_resources = ['urlfetch'] +- test_main() ++ unittest.main() +diff -r c0e311e010fc Lib/test/test_codecmaps_jp.py +--- a/Lib/test/test_codecmaps_jp.py ++++ b/Lib/test/test_codecmaps_jp.py +@@ -59,8 +59,5 @@ + mapfileurl = 'http://people.freebsd.org/~perky/i18n/SHIFT_JISX0213.TXT' + + +-def test_main(): +- support.run_unittest(__name__) +- + if __name__ == "__main__": +- test_main() ++ unittest.main() +diff -r c0e311e010fc Lib/test/test_codecmaps_kr.py +--- a/Lib/test/test_codecmaps_kr.py ++++ b/Lib/test/test_codecmaps_kr.py +@@ -36,8 +36,5 @@ + pass_enctest = [(b'\\', '\u20a9')] + pass_dectest = [(b'\\', '\u20a9')] + +-def test_main(): +- support.run_unittest(__name__) +- + if __name__ == "__main__": +- test_main() ++ unittest.main() +diff -r c0e311e010fc Lib/test/test_codecmaps_tw.py +--- a/Lib/test/test_codecmaps_tw.py ++++ b/Lib/test/test_codecmaps_tw.py +@@ -26,8 +26,5 @@ + (b"\xFFxy", "replace", "\ufffdxy"), + ) + +-def test_main(): +- support.run_unittest(__name__) +- + if __name__ == "__main__": +- test_main() ++ unittest.main() +diff -r c0e311e010fc Lib/test/test_collections.py +--- a/Lib/test/test_collections.py ++++ b/Lib/test/test_collections.py +@@ -720,14 +720,166 @@ + + cs = MyComparableSet() + ncs = MyNonComparableSet() ++ self.assertFalse(ncs < cs) ++ self.assertTrue(ncs <= cs) ++ self.assertFalse(ncs > cs) ++ self.assertTrue(ncs >= cs) ++ ++ def assertSameSet(self, s1, s2): ++ # coerce both to a real set then check equality ++ self.assertSetEqual(set(s1), set(s2)) ++ ++ def test_Set_interoperability_with_real_sets(self): ++ # Issue: 8743 ++ class ListSet(Set): ++ def __init__(self, elements=()): ++ self.data = [] ++ for elem in elements: ++ if elem not in self.data: ++ self.data.append(elem) ++ def __contains__(self, elem): ++ return elem in self.data ++ def __iter__(self): ++ return iter(self.data) ++ def __len__(self): ++ return len(self.data) ++ def __repr__(self): ++ return 'Set({!r})'.format(self.data) ++ ++ r1 = set('abc') ++ r2 = set('bcd') ++ r3 = set('abcde') ++ f1 = ListSet('abc') ++ f2 = ListSet('bcd') ++ f3 = ListSet('abcde') ++ l1 = list('abccba') ++ l2 = list('bcddcb') ++ l3 = list('abcdeedcba') ++ ++ target = r1 & r2 ++ self.assertSameSet(f1 & f2, target) ++ self.assertSameSet(f1 & r2, target) ++ self.assertSameSet(r2 & f1, target) ++ self.assertSameSet(f1 & l2, target) ++ ++ target = r1 | r2 ++ self.assertSameSet(f1 | f2, target) ++ self.assertSameSet(f1 | r2, target) ++ self.assertSameSet(r2 | f1, target) ++ self.assertSameSet(f1 | l2, target) ++ ++ fwd_target = r1 - r2 ++ rev_target = r2 - r1 ++ self.assertSameSet(f1 - f2, fwd_target) ++ self.assertSameSet(f2 - f1, rev_target) ++ self.assertSameSet(f1 - r2, fwd_target) ++ self.assertSameSet(f2 - r1, rev_target) ++ self.assertSameSet(r1 - f2, fwd_target) ++ self.assertSameSet(r2 - f1, rev_target) ++ self.assertSameSet(f1 - l2, fwd_target) ++ self.assertSameSet(f2 - l1, rev_target) ++ ++ target = r1 ^ r2 ++ self.assertSameSet(f1 ^ f2, target) ++ self.assertSameSet(f1 ^ r2, target) ++ self.assertSameSet(r2 ^ f1, target) ++ self.assertSameSet(f1 ^ l2, target) ++ ++ # Don't change the following to use assertLess or other ++ # "more specific" unittest assertions. The current ++ # assertTrue/assertFalse style makes the pattern of test ++ # case combinations clear and allows us to know for sure ++ # the exact operator being invoked. ++ ++ # proper subset ++ self.assertTrue(f1 < f3) ++ self.assertFalse(f1 < f1) ++ self.assertFalse(f1 < f2) ++ self.assertTrue(r1 < f3) ++ self.assertFalse(r1 < f1) ++ self.assertFalse(r1 < f2) ++ self.assertTrue(r1 < r3) ++ self.assertFalse(r1 < r1) ++ self.assertFalse(r1 < r2) + with self.assertRaises(TypeError): +- ncs < cs ++ f1 < l3 + with self.assertRaises(TypeError): +- ncs <= cs ++ f1 < l1 + with self.assertRaises(TypeError): +- cs > ncs ++ f1 < l2 ++ ++ # any subset ++ self.assertTrue(f1 <= f3) ++ self.assertTrue(f1 <= f1) ++ self.assertFalse(f1 <= f2) ++ self.assertTrue(r1 <= f3) ++ self.assertTrue(r1 <= f1) ++ self.assertFalse(r1 <= f2) ++ self.assertTrue(r1 <= r3) ++ self.assertTrue(r1 <= r1) ++ self.assertFalse(r1 <= r2) + with self.assertRaises(TypeError): +- cs >= ncs ++ f1 <= l3 ++ with self.assertRaises(TypeError): ++ f1 <= l1 ++ with self.assertRaises(TypeError): ++ f1 <= l2 ++ ++ # proper superset ++ self.assertTrue(f3 > f1) ++ self.assertFalse(f1 > f1) ++ self.assertFalse(f2 > f1) ++ self.assertTrue(r3 > r1) ++ self.assertFalse(f1 > r1) ++ self.assertFalse(f2 > r1) ++ self.assertTrue(r3 > r1) ++ self.assertFalse(r1 > r1) ++ self.assertFalse(r2 > r1) ++ with self.assertRaises(TypeError): ++ f1 > l3 ++ with self.assertRaises(TypeError): ++ f1 > l1 ++ with self.assertRaises(TypeError): ++ f1 > l2 ++ ++ # any superset ++ self.assertTrue(f3 >= f1) ++ self.assertTrue(f1 >= f1) ++ self.assertFalse(f2 >= f1) ++ self.assertTrue(r3 >= r1) ++ self.assertTrue(f1 >= r1) ++ self.assertFalse(f2 >= r1) ++ self.assertTrue(r3 >= r1) ++ self.assertTrue(r1 >= r1) ++ self.assertFalse(r2 >= r1) ++ with self.assertRaises(TypeError): ++ f1 >= l3 ++ with self.assertRaises(TypeError): ++ f1 >=l1 ++ with self.assertRaises(TypeError): ++ f1 >= l2 ++ ++ # equality ++ self.assertTrue(f1 == f1) ++ self.assertTrue(r1 == f1) ++ self.assertTrue(f1 == r1) ++ self.assertFalse(f1 == f3) ++ self.assertFalse(r1 == f3) ++ self.assertFalse(f1 == r3) ++ self.assertFalse(f1 == l3) ++ self.assertFalse(f1 == l1) ++ self.assertFalse(f1 == l2) ++ ++ # inequality ++ self.assertFalse(f1 != f1) ++ self.assertFalse(r1 != f1) ++ self.assertFalse(f1 != r1) ++ self.assertTrue(f1 != f3) ++ self.assertTrue(r1 != f3) ++ self.assertTrue(f1 != r3) ++ self.assertTrue(f1 != l3) ++ self.assertTrue(f1 != l1) ++ self.assertTrue(f1 != l2) + + def test_Mapping(self): + for sample in [dict]: +diff -r c0e311e010fc Lib/test/test_compile.py +--- a/Lib/test/test_compile.py ++++ b/Lib/test/test_compile.py +@@ -1,3 +1,4 @@ ++import math + import unittest + import sys + import _ast +@@ -501,8 +502,43 @@ + check_limit("a", "*a") + + +-def test_main(): +- support.run_unittest(TestSpecifics) ++class TestStackSize(unittest.TestCase): ++ # These tests check that the computed stack size for a code object ++ # stays within reasonable bounds (see issue #21523 for an example ++ # dysfunction). ++ N = 100 ++ ++ def check_stack_size(self, code): ++ # To assert that the alleged stack size is not O(N), we ++ # check that it is smaller than log(N). ++ if isinstance(code, str): ++ code = compile(code, "", "single") ++ max_size = math.ceil(math.log(len(code.co_code))) ++ self.assertLessEqual(code.co_stacksize, max_size) ++ ++ def test_and(self): ++ self.check_stack_size("x and " * self.N + "x") ++ ++ def test_or(self): ++ self.check_stack_size("x or " * self.N + "x") ++ ++ def test_and_or(self): ++ self.check_stack_size("x and x or " * self.N + "x") ++ ++ def test_chained_comparison(self): ++ self.check_stack_size("x < " * self.N + "x") ++ ++ def test_if_else(self): ++ self.check_stack_size("x if x else " * self.N + "x") ++ ++ def test_binop(self): ++ self.check_stack_size("x + " * self.N + "x") ++ ++ def test_func_and(self): ++ code = "def f(x):\n" ++ code += " x and x\n" * self.N ++ self.check_stack_size(code) ++ + + if __name__ == "__main__": +- test_main() ++ unittest.main() +diff -r c0e311e010fc Lib/test/test_ctypes.py +--- a/Lib/test/test_ctypes.py ++++ b/Lib/test/test_ctypes.py +@@ -1,16 +1,6 @@ + import unittest + +-from test.support import import_module +- +-# Skip tests if _ctypes module was not built. +-import_module('_ctypes') +- +-import ctypes.test +- +-def load_tests(*args): +- skipped, testcases = ctypes.test.get_tests(ctypes.test, "test_*.py", verbosity=0) +- suites = [unittest.makeSuite(t) for t in testcases] +- return unittest.TestSuite(suites) ++from ctypes.test import load_tests + + if __name__ == "__main__": + unittest.main() +diff -r c0e311e010fc Lib/test/test_decimal.py +--- a/Lib/test/test_decimal.py ++++ b/Lib/test/test_decimal.py +@@ -5429,7 +5429,7 @@ + all_tests.insert(0, CheckAttributes) + + +-def test_main(arith=False, verbose=None, todo_tests=None, debug=None): ++def test_main(arith=None, verbose=None, todo_tests=None, debug=None): + """ Execute the tests. + + Runs all arithmetic tests if arith is True or if the "decimal" resource +@@ -5439,7 +5439,7 @@ + init(C) + init(P) + global TEST_ALL, DEBUG +- TEST_ALL = arith or is_resource_enabled('decimal') ++ TEST_ALL = arith if arith is not None else is_resource_enabled('decimal') + DEBUG = debug + + if todo_tests is None: +diff -r c0e311e010fc Lib/test/test_descr.py +--- a/Lib/test/test_descr.py ++++ b/Lib/test/test_descr.py +@@ -1149,7 +1149,7 @@ + except (TypeError, UnicodeEncodeError): + pass + else: +- raise TestFailed("[chr(128)] slots not caught") ++ self.fail("[chr(128)] slots not caught") + + # Test leaks + class Counted(object): +diff -r c0e311e010fc Lib/test/test_difflib.py +--- a/Lib/test/test_difflib.py ++++ b/Lib/test/test_difflib.py +@@ -76,6 +76,15 @@ + diff_gen = difflib.unified_diff([], []) + self.assertRaises(StopIteration, next, diff_gen) + ++ def test_matching_blocks_cache(self): ++ # Issue #21635 ++ s = difflib.SequenceMatcher(None, "abxcd", "abcd") ++ first = s.get_matching_blocks() ++ second = s.get_matching_blocks() ++ self.assertEqual(second[0].size, 2) ++ self.assertEqual(second[1].size, 2) ++ self.assertEqual(second[2].size, 0) ++ + def test_added_tab_hint(self): + # Check fix for bug #1488943 + diff = list(difflib.Differ().compare(["\tI am a buggy"],["\t\tI am a bug"])) +diff -r c0e311e010fc Lib/test/test_email/__init__.py +--- a/Lib/test/test_email/__init__.py ++++ b/Lib/test/test_email/__init__.py +@@ -1,31 +1,16 @@ + import os + import sys + import unittest +-import test.support + import collections + import email + from email.message import Message + from email._policybase import compat32 ++from test.support import load_package_tests + from test.test_email import __file__ as landmark + +-# Run all tests in package for '-m unittest test.test_email' +-def load_tests(loader, standard_tests, pattern): +- this_dir = os.path.dirname(__file__) +- if pattern is None: +- pattern = "test*" +- package_tests = loader.discover(start_dir=this_dir, pattern=pattern) +- standard_tests.addTests(package_tests) +- return standard_tests +- +- +-# used by regrtest and __main__. +-def test_main(): +- here = os.path.dirname(__file__) +- # Unittest mucks with the path, so we have to save and restore +- # it to keep regrtest happy. +- savepath = sys.path[:] +- test.support._run_suite(unittest.defaultTestLoader.discover(here)) +- sys.path[:] = savepath ++# Load all tests in package ++def load_tests(*args): ++ return load_package_tests(os.path.dirname(__file__), *args) + + + # helper code used by a number of test modules. +diff -r c0e311e010fc Lib/test/test_email/__main__.py +--- a/Lib/test/test_email/__main__.py ++++ b/Lib/test/test_email/__main__.py +@@ -1,3 +1,4 @@ +-from test.test_email import test_main ++from test.test_email import load_tests ++import unittest + +-test_main() ++unittest.main() +diff -r c0e311e010fc Lib/test/test_email/test__header_value_parser.py +--- a/Lib/test/test_email/test__header_value_parser.py ++++ b/Lib/test/test_email/test__header_value_parser.py +@@ -2443,6 +2443,18 @@ + self.assertEqual(str(address_list.addresses[1]), + str(address_list.mailboxes[2])) + ++ def test_invalid_content_disposition(self): ++ content_disp = self._test_parse_x( ++ parser.parse_content_disposition_header, ++ ";attachment", "; attachment", ";attachment", ++ [errors.InvalidHeaderDefect]*2 ++ ) ++ ++ def test_invalid_content_transfer_encoding(self): ++ cte = self._test_parse_x( ++ parser.parse_content_transfer_encoding_header, ++ ";foo", ";foo", ";foo", [errors.InvalidHeaderDefect]*3 ++ ) + + @parameterize + class Test_parse_mime_version(TestParserMixin, TestEmailBase): +diff -r c0e311e010fc Lib/test/test_email/test_email.py +--- a/Lib/test/test_email/test_email.py ++++ b/Lib/test/test_email/test_email.py +@@ -10,6 +10,7 @@ + + from io import StringIO, BytesIO + from itertools import chain ++from random import choice + + import email + import email.policy +@@ -3353,16 +3354,71 @@ + bsf.push(il) + nt += n + n1 = 0 +- while True: +- ol = bsf.readline() +- if ol == NeedMoreData: +- break ++ for ol in iter(bsf.readline, NeedMoreData): + om.append(ol) + n1 += 1 + self.assertEqual(n, n1) + self.assertEqual(len(om), nt) + self.assertEqual(''.join([il for il, n in imt]), ''.join(om)) + ++ def test_push_random(self): ++ from email.feedparser import BufferedSubFile, NeedMoreData ++ ++ n = 10000 ++ chunksize = 5 ++ chars = 'abcd \t\r\n' ++ ++ s = ''.join(choice(chars) for i in range(n)) + '\n' ++ target = s.splitlines(True) ++ ++ bsf = BufferedSubFile() ++ lines = [] ++ for i in range(0, len(s), chunksize): ++ chunk = s[i:i+chunksize] ++ bsf.push(chunk) ++ lines.extend(iter(bsf.readline, NeedMoreData)) ++ self.assertEqual(lines, target) ++ ++ ++class TestFeedParsers(TestEmailBase): ++ ++ def parse(self, chunks): ++ from email.feedparser import FeedParser ++ feedparser = FeedParser() ++ for chunk in chunks: ++ feedparser.feed(chunk) ++ return feedparser.close() ++ ++ def test_newlines(self): ++ m = self.parse(['a:\nb:\rc:\r\nd:\n']) ++ self.assertEqual(m.keys(), ['a', 'b', 'c', 'd']) ++ m = self.parse(['a:\nb:\rc:\r\nd:']) ++ self.assertEqual(m.keys(), ['a', 'b', 'c', 'd']) ++ m = self.parse(['a:\rb', 'c:\n']) ++ self.assertEqual(m.keys(), ['a', 'bc']) ++ m = self.parse(['a:\r', 'b:\n']) ++ self.assertEqual(m.keys(), ['a', 'b']) ++ m = self.parse(['a:\r', '\nb:\n']) ++ self.assertEqual(m.keys(), ['a', 'b']) ++ m = self.parse(['a:\x85b:\u2028c:\n']) ++ self.assertEqual(m.items(), [('a', '\x85'), ('b', '\u2028'), ('c', '')]) ++ m = self.parse(['a:\r', 'b:\x85', 'c:\n']) ++ self.assertEqual(m.items(), [('a', ''), ('b', '\x85'), ('c', '')]) ++ ++ def test_long_lines(self): ++ # Expected peak memory use on 32-bit platform: 6*N*M bytes. ++ M, N = 1000, 20000 ++ m = self.parse(['a:b\n\n'] + ['x'*M] * N) ++ self.assertEqual(m.items(), [('a', 'b')]) ++ self.assertEqual(m.get_payload(), 'x'*M*N) ++ m = self.parse(['a:b\r\r'] + ['x'*M] * N) ++ self.assertEqual(m.items(), [('a', 'b')]) ++ self.assertEqual(m.get_payload(), 'x'*M*N) ++ m = self.parse(['a:b\r\r'] + ['x'*M+'\x85'] * N) ++ self.assertEqual(m.items(), [('a', 'b')]) ++ self.assertEqual(m.get_payload(), ('x'*M+'\x85')*N) ++ m = self.parse(['a:\r', 'b: '] + ['x'*M] * N) ++ self.assertEqual(m.items(), [('a', ''), ('b', 'x'*M*N)]) + + + class TestParsers(TestEmailBase): +@@ -3390,6 +3446,31 @@ + self.assertIsInstance(msg.get_payload(), str) + self.assertIsInstance(msg.get_payload(decode=True), bytes) + ++ def test_bytes_parser_does_not_close_file(self): ++ with openfile('msg_02.txt', 'rb') as fp: ++ email.parser.BytesParser().parse(fp) ++ self.assertFalse(fp.closed) ++ ++ def test_bytes_parser_on_exception_does_not_close_file(self): ++ with openfile('msg_15.txt', 'rb') as fp: ++ bytesParser = email.parser.BytesParser ++ self.assertRaises(email.errors.StartBoundaryNotFoundDefect, ++ bytesParser(policy=email.policy.strict).parse, ++ fp) ++ self.assertFalse(fp.closed) ++ ++ def test_parser_does_not_close_file(self): ++ with openfile('msg_02.txt', 'r') as fp: ++ email.parser.Parser().parse(fp) ++ self.assertFalse(fp.closed) ++ ++ def test_parser_on_exception_does_not_close_file(self): ++ with openfile('msg_15.txt', 'r') as fp: ++ parser = email.parser.Parser ++ self.assertRaises(email.errors.StartBoundaryNotFoundDefect, ++ parser(policy=email.policy.strict).parse, fp) ++ self.assertFalse(fp.closed) ++ + def test_whitespace_continuation(self): + eq = self.assertEqual + # This message contains a line after the Subject: header that has only +diff -r c0e311e010fc Lib/test/test_enum.py +--- a/Lib/test/test_enum.py ++++ b/Lib/test/test_enum.py +@@ -1528,9 +1528,7 @@ + helper = pydoc.Helper(output=output) + helper(self.Color) + result = output.getvalue().strip() +- if result != expected_text: +- print_diffs(expected_text, result) +- self.fail("outputs are not equal, see diff above") ++ self.assertEqual(result, expected_text) + + def test_inspect_getmembers(self): + values = dict(( +diff -r c0e311e010fc Lib/test/test_faulthandler.py +--- a/Lib/test/test_faulthandler.py ++++ b/Lib/test/test_faulthandler.py +@@ -10,6 +10,7 @@ + from test.script_helper import assert_python_ok + import tempfile + import unittest ++from textwrap import dedent + + try: + import threading +@@ -47,6 +48,7 @@ + build, and replace "Current thread 0x00007f8d8fbd9700" by "Current + thread XXX". + """ ++ code = dedent(code).strip() + with support.SuppressCrashReport(): + process = script_helper.spawn_python('-c', code) + stdout, stderr = process.communicate() +@@ -76,15 +78,15 @@ + else: + header = 'Stack (most recent call first)' + regex = """ +-^Fatal Python error: {name} ++ ^Fatal Python error: {name} + +-{header}: +- File "", line {lineno} in +-""".strip() +- regex = regex.format( ++ {header}: ++ File "", line {lineno} in ++ """ ++ regex = dedent(regex.format( + lineno=line_number, + name=name_regex, +- header=re.escape(header)) ++ header=re.escape(header))).strip() + if other_regex: + regex += '|' + other_regex + output, exitcode = self.get_output(code, filename) +@@ -96,29 +98,29 @@ + "the first page of memory is a mapped read-only on AIX") + def test_read_null(self): + self.check_fatal_error(""" +-import faulthandler +-faulthandler.enable() +-faulthandler._read_null() +-""".strip(), ++ import faulthandler ++ faulthandler.enable() ++ faulthandler._read_null() ++ """, + 3, + # Issue #12700: Read NULL raises SIGILL on Mac OS X Lion + '(?:Segmentation fault|Bus error|Illegal instruction)') + + def test_sigsegv(self): + self.check_fatal_error(""" +-import faulthandler +-faulthandler.enable() +-faulthandler._sigsegv() +-""".strip(), ++ import faulthandler ++ faulthandler.enable() ++ faulthandler._sigsegv() ++ """, + 3, + 'Segmentation fault') + + def test_sigabrt(self): + self.check_fatal_error(""" +-import faulthandler +-faulthandler.enable() +-faulthandler._sigabrt() +-""".strip(), ++ import faulthandler ++ faulthandler.enable() ++ faulthandler._sigabrt() ++ """, + 3, + 'Aborted') + +@@ -126,10 +128,10 @@ + "SIGFPE cannot be caught on Windows") + def test_sigfpe(self): + self.check_fatal_error(""" +-import faulthandler +-faulthandler.enable() +-faulthandler._sigfpe() +-""".strip(), ++ import faulthandler ++ faulthandler.enable() ++ faulthandler._sigfpe() ++ """, + 3, + 'Floating point exception') + +@@ -137,10 +139,10 @@ + "need faulthandler._sigbus()") + def test_sigbus(self): + self.check_fatal_error(""" +-import faulthandler +-faulthandler.enable() +-faulthandler._sigbus() +-""".strip(), ++ import faulthandler ++ faulthandler.enable() ++ faulthandler._sigbus() ++ """, + 3, + 'Bus error') + +@@ -148,18 +150,18 @@ + "need faulthandler._sigill()") + def test_sigill(self): + self.check_fatal_error(""" +-import faulthandler +-faulthandler.enable() +-faulthandler._sigill() +-""".strip(), ++ import faulthandler ++ faulthandler.enable() ++ faulthandler._sigill() ++ """, + 3, + 'Illegal instruction') + + def test_fatal_error(self): + self.check_fatal_error(""" +-import faulthandler +-faulthandler._fatal_error(b'xyz') +-""".strip(), ++ import faulthandler ++ faulthandler._fatal_error(b'xyz') ++ """, + 2, + 'xyz') + +@@ -170,52 +172,52 @@ + 'need faulthandler._stack_overflow()') + def test_stack_overflow(self): + self.check_fatal_error(""" +-import faulthandler +-faulthandler.enable() +-faulthandler._stack_overflow() +-""".strip(), ++ import faulthandler ++ faulthandler.enable() ++ faulthandler._stack_overflow() ++ """, + 3, + '(?:Segmentation fault|Bus error)', + other_regex='unable to raise a stack overflow') + + def test_gil_released(self): + self.check_fatal_error(""" +-import faulthandler +-faulthandler.enable() +-faulthandler._read_null(True) +-""".strip(), ++ import faulthandler ++ faulthandler.enable() ++ faulthandler._read_null(True) ++ """, + 3, + '(?:Segmentation fault|Bus error|Illegal instruction)') + + def test_enable_file(self): + with temporary_filename() as filename: + self.check_fatal_error(""" +-import faulthandler +-output = open({filename}, 'wb') +-faulthandler.enable(output) +-faulthandler._sigsegv() +-""".strip().format(filename=repr(filename)), ++ import faulthandler ++ output = open({filename}, 'wb') ++ faulthandler.enable(output) ++ faulthandler._sigsegv() ++ """.format(filename=repr(filename)), + 4, + 'Segmentation fault', + filename=filename) + + def test_enable_single_thread(self): + self.check_fatal_error(""" +-import faulthandler +-faulthandler.enable(all_threads=False) +-faulthandler._sigsegv() +-""".strip(), ++ import faulthandler ++ faulthandler.enable(all_threads=False) ++ faulthandler._sigsegv() ++ """, + 3, + 'Segmentation fault', + all_threads=False) + + def test_disable(self): + code = """ +-import faulthandler +-faulthandler.enable() +-faulthandler.disable() +-faulthandler._sigsegv() +-""".strip() ++ import faulthandler ++ faulthandler.enable() ++ faulthandler.disable() ++ faulthandler._sigsegv() ++ """ + not_expected = 'Fatal Python error' + stderr, exitcode = self.get_output(code) + stder = '\n'.join(stderr) +@@ -283,20 +285,20 @@ + Raise an error if the output doesn't match the expected format. + """ + code = """ +-import faulthandler ++ import faulthandler + +-def funcB(): +- if {has_filename}: +- with open({filename}, "wb") as fp: +- faulthandler.dump_traceback(fp, all_threads=False) +- else: +- faulthandler.dump_traceback(all_threads=False) ++ def funcB(): ++ if {has_filename}: ++ with open({filename}, "wb") as fp: ++ faulthandler.dump_traceback(fp, all_threads=False) ++ else: ++ faulthandler.dump_traceback(all_threads=False) + +-def funcA(): +- funcB() ++ def funcA(): ++ funcB() + +-funcA() +-""".strip() ++ funcA() ++ """ + code = code.format( + filename=repr(filename), + has_filename=bool(filename), +@@ -327,13 +329,13 @@ + func_name = 'x' * (maxlen + 50) + truncated = 'x' * maxlen + '...' + code = """ +-import faulthandler ++ import faulthandler + +-def {func_name}(): +- faulthandler.dump_traceback(all_threads=False) ++ def {func_name}(): ++ faulthandler.dump_traceback(all_threads=False) + +-{func_name}() +-""".strip() ++ {func_name}() ++ """ + code = code.format( + func_name=func_name, + ) +@@ -353,37 +355,37 @@ + Raise an error if the output doesn't match the expected format. + """ + code = """ +-import faulthandler +-from threading import Thread, Event +-import time ++ import faulthandler ++ from threading import Thread, Event ++ import time + +-def dump(): +- if {filename}: +- with open({filename}, "wb") as fp: +- faulthandler.dump_traceback(fp, all_threads=True) +- else: +- faulthandler.dump_traceback(all_threads=True) ++ def dump(): ++ if {filename}: ++ with open({filename}, "wb") as fp: ++ faulthandler.dump_traceback(fp, all_threads=True) ++ else: ++ faulthandler.dump_traceback(all_threads=True) + +-class Waiter(Thread): +- # avoid blocking if the main thread raises an exception. +- daemon = True ++ class Waiter(Thread): ++ # avoid blocking if the main thread raises an exception. ++ daemon = True + +- def __init__(self): +- Thread.__init__(self) +- self.running = Event() +- self.stop = Event() ++ def __init__(self): ++ Thread.__init__(self) ++ self.running = Event() ++ self.stop = Event() + +- def run(self): +- self.running.set() +- self.stop.wait() ++ def run(self): ++ self.running.set() ++ self.stop.wait() + +-waiter = Waiter() +-waiter.start() +-waiter.running.wait() +-dump() +-waiter.stop.set() +-waiter.join() +-""".strip() ++ waiter = Waiter() ++ waiter.start() ++ waiter.running.wait() ++ dump() ++ waiter.stop.set() ++ waiter.join() ++ """ + code = code.format(filename=repr(filename)) + output, exitcode = self.get_output(code, filename) + output = '\n'.join(output) +@@ -392,17 +394,17 @@ + else: + lineno = 10 + regex = """ +-^Thread 0x[0-9a-f]+ \(most recent call first\): +-(?: File ".*threading.py", line [0-9]+ in [_a-z]+ +-){{1,3}} File "", line 23 in run +- File ".*threading.py", line [0-9]+ in _bootstrap_inner +- File ".*threading.py", line [0-9]+ in _bootstrap ++ ^Thread 0x[0-9a-f]+ \(most recent call first\): ++ (?: File ".*threading.py", line [0-9]+ in [_a-z]+ ++ ){{1,3}} File "", line 23 in run ++ File ".*threading.py", line [0-9]+ in _bootstrap_inner ++ File ".*threading.py", line [0-9]+ in _bootstrap + +-Current thread XXX \(most recent call first\): +- File "", line {lineno} in dump +- File "", line 28 in $ +-""".strip() +- regex = regex.format(lineno=lineno) ++ Current thread XXX \(most recent call first\): ++ File "", line {lineno} in dump ++ File "", line 28 in $ ++ """ ++ regex = dedent(regex.format(lineno=lineno)).strip() + self.assertRegex(output, regex) + self.assertEqual(exitcode, 0) + +@@ -423,29 +425,29 @@ + """ + timeout_str = str(datetime.timedelta(seconds=TIMEOUT)) + code = """ +-import faulthandler +-import time ++ import faulthandler ++ import time + +-def func(timeout, repeat, cancel, file, loops): +- for loop in range(loops): +- faulthandler.dump_traceback_later(timeout, repeat=repeat, file=file) +- if cancel: +- faulthandler.cancel_dump_traceback_later() +- time.sleep(timeout * 5) +- faulthandler.cancel_dump_traceback_later() ++ def func(timeout, repeat, cancel, file, loops): ++ for loop in range(loops): ++ faulthandler.dump_traceback_later(timeout, repeat=repeat, file=file) ++ if cancel: ++ faulthandler.cancel_dump_traceback_later() ++ time.sleep(timeout * 5) ++ faulthandler.cancel_dump_traceback_later() + +-timeout = {timeout} +-repeat = {repeat} +-cancel = {cancel} +-loops = {loops} +-if {has_filename}: +- file = open({filename}, "wb") +-else: +- file = None +-func(timeout, repeat, cancel, file, loops) +-if file is not None: +- file.close() +-""".strip() ++ timeout = {timeout} ++ repeat = {repeat} ++ cancel = {cancel} ++ loops = {loops} ++ if {has_filename}: ++ file = open({filename}, "wb") ++ else: ++ file = None ++ func(timeout, repeat, cancel, file, loops) ++ if file is not None: ++ file.close() ++ """ + code = code.format( + timeout=TIMEOUT, + repeat=repeat, +@@ -512,45 +514,45 @@ + """ + signum = signal.SIGUSR1 + code = """ +-import faulthandler +-import os +-import signal +-import sys ++ import faulthandler ++ import os ++ import signal ++ import sys + +-def func(signum): +- os.kill(os.getpid(), signum) ++ def func(signum): ++ os.kill(os.getpid(), signum) + +-def handler(signum, frame): +- handler.called = True +-handler.called = False ++ def handler(signum, frame): ++ handler.called = True ++ handler.called = False + +-exitcode = 0 +-signum = {signum} +-unregister = {unregister} +-chain = {chain} ++ exitcode = 0 ++ signum = {signum} ++ unregister = {unregister} ++ chain = {chain} + +-if {has_filename}: +- file = open({filename}, "wb") +-else: +- file = None +-if chain: +- signal.signal(signum, handler) +-faulthandler.register(signum, file=file, +- all_threads={all_threads}, chain={chain}) +-if unregister: +- faulthandler.unregister(signum) +-func(signum) +-if chain and not handler.called: +- if file is not None: +- output = file +- else: +- output = sys.stderr +- print("Error: signal handler not called!", file=output) +- exitcode = 1 +-if file is not None: +- file.close() +-sys.exit(exitcode) +-""".strip() ++ if {has_filename}: ++ file = open({filename}, "wb") ++ else: ++ file = None ++ if chain: ++ signal.signal(signum, handler) ++ faulthandler.register(signum, file=file, ++ all_threads={all_threads}, chain={chain}) ++ if unregister: ++ faulthandler.unregister(signum) ++ func(signum) ++ if chain and not handler.called: ++ if file is not None: ++ output = file ++ else: ++ output = sys.stderr ++ print("Error: signal handler not called!", file=output) ++ exitcode = 1 ++ if file is not None: ++ file.close() ++ sys.exit(exitcode) ++ """ + code = code.format( + filename=repr(filename), + has_filename=bool(filename), +diff -r c0e311e010fc Lib/test/test_filecmp.py +--- a/Lib/test/test_filecmp.py ++++ b/Lib/test/test_filecmp.py +@@ -27,13 +27,13 @@ + os.unlink(self.name_diff) + + def test_matching(self): +- self.assertTrue(filecmp.cmp(self.name, self.name_same), +- "Comparing file to itself fails") +- self.assertTrue(filecmp.cmp(self.name, self.name_same, shallow=False), ++ self.assertTrue(filecmp.cmp(self.name, self.name), + "Comparing file to itself fails") + self.assertTrue(filecmp.cmp(self.name, self.name, shallow=False), ++ "Comparing file to itself fails") ++ self.assertTrue(filecmp.cmp(self.name, self.name_same), + "Comparing file to identical file fails") +- self.assertTrue(filecmp.cmp(self.name, self.name), ++ self.assertTrue(filecmp.cmp(self.name, self.name_same, shallow=False), + "Comparing file to identical file fails") + + def test_different(self): +diff -r c0e311e010fc Lib/test/test_frame.py +--- a/Lib/test/test_frame.py ++++ b/Lib/test/test_frame.py +@@ -1,5 +1,6 @@ + import gc + import sys ++import types + import unittest + import weakref + +@@ -109,6 +110,57 @@ + self.assertIs(None, wr()) + + ++class FrameLocalsTest(unittest.TestCase): ++ """ ++ Tests for the .f_locals attribute. ++ """ ++ ++ def make_frames(self): ++ def outer(): ++ x = 5 ++ y = 6 ++ def inner(): ++ z = x + 2 ++ 1/0 ++ t = 9 ++ return inner() ++ try: ++ outer() ++ except ZeroDivisionError as e: ++ tb = e.__traceback__ ++ frames = [] ++ while tb: ++ frames.append(tb.tb_frame) ++ tb = tb.tb_next ++ return frames ++ ++ def test_locals(self): ++ f, outer, inner = self.make_frames() ++ outer_locals = outer.f_locals ++ self.assertIsInstance(outer_locals.pop('inner'), types.FunctionType) ++ self.assertEqual(outer_locals, {'x': 5, 'y': 6}) ++ inner_locals = inner.f_locals ++ self.assertEqual(inner_locals, {'x': 5, 'z': 7}) ++ ++ def test_clear_locals(self): ++ # Test f_locals after clear() (issue #21897) ++ f, outer, inner = self.make_frames() ++ outer.clear() ++ inner.clear() ++ self.assertEqual(outer.f_locals, {}) ++ self.assertEqual(inner.f_locals, {}) ++ ++ def test_locals_clear_locals(self): ++ # Test f_locals before and after clear() (to exercise caching) ++ f, outer, inner = self.make_frames() ++ outer.f_locals ++ inner.f_locals ++ outer.clear() ++ inner.clear() ++ self.assertEqual(outer.f_locals, {}) ++ self.assertEqual(inner.f_locals, {}) ++ ++ + def test_main(): + support.run_unittest(__name__) + +diff -r c0e311e010fc Lib/test/test_functools.py +--- a/Lib/test/test_functools.py ++++ b/Lib/test/test_functools.py +@@ -1070,6 +1070,13 @@ + self.assertEqual(test_func(DoubleEq(2)), # Trigger a re-entrant __eq__ call + DoubleEq(2)) # Verify the correct return value + ++ def test_early_detection_of_bad_call(self): ++ # Issue #22184 ++ with self.assertRaises(TypeError): ++ @functools.lru_cache ++ def f(): ++ pass ++ + + class TestSingleDispatch(unittest.TestCase): + def test_simple_overloads(self): +diff -r c0e311e010fc Lib/test/test_gdb.py +--- a/Lib/test/test_gdb.py ++++ b/Lib/test/test_gdb.py +@@ -22,7 +22,7 @@ + from test.support import run_unittest, findfile, python_is_optimized + + try: +- gdb_version, _ = subprocess.Popen(["gdb", "--version"], ++ gdb_version, _ = subprocess.Popen(["gdb", "-nx", "--version"], + stdout=subprocess.PIPE).communicate() + except OSError: + # This is what "no gdb" looks like. There may, however, be other +@@ -54,7 +54,9 @@ + env.update(env_vars) + else: + env = None +- base_cmd = ('gdb', '--batch') ++ # -nx: Do not execute commands from any .gdbinit initialization files ++ # (issue #22188) ++ base_cmd = ('gdb', '--batch', '-nx') + if (gdb_major_version, gdb_minor_version) >= (7, 4): + base_cmd += ('-iex', 'add-auto-load-safe-path ' + checkout_hook_path) + out, err = subprocess.Popen(base_cmd + args, +@@ -130,7 +132,7 @@ + # print commands + + # Use "commands" to generate the arguments with which to invoke "gdb": +- args = ["gdb", "--batch"] ++ args = ["gdb", "--batch", "-nx"] + args += ['--eval-command=%s' % cmd for cmd in commands] + args += ["--args", + sys.executable] +diff -r c0e311e010fc Lib/test/test_gettext.py +--- a/Lib/test/test_gettext.py ++++ b/Lib/test/test_gettext.py +@@ -77,7 +77,7 @@ + def tearDown(self): + self.env.__exit__() + del self.env +- shutil.rmtree(os.path.split(LOCALEDIR)[0]) ++ support.rmtree(os.path.split(LOCALEDIR)[0]) + + + class GettextTestCase1(GettextBaseTest): +diff -r c0e311e010fc Lib/test/test_grammar.py +--- a/Lib/test/test_grammar.py ++++ b/Lib/test/test_grammar.py +@@ -80,6 +80,12 @@ + x = .3e14 + x = 3.1e4 + ++ def test_float_exponent_tokenization(self): ++ # See issue 21642. ++ self.assertEqual(1 if 1else 0, 1) ++ self.assertEqual(1 if 0else 0, 0) ++ self.assertRaises(SyntaxError, eval, "0 if 1Else 0") ++ + def test_string_literals(self): + x = ''; y = ""; self.assertTrue(len(x) == 0 and x == y) + x = '\''; y = "'"; self.assertTrue(len(x) == 1 and x == y and ord(x) == 39) +@@ -384,6 +390,31 @@ + check_syntax_error(self, "x + 1 = 1") + check_syntax_error(self, "a + 1 = b + 2") + ++ # Check the heuristic for print & exec covers significant cases ++ # As well as placing some limits on false positives ++ def test_former_statements_refer_to_builtins(self): ++ keywords = "print", "exec" ++ # Cases where we want the custom error ++ cases = [ ++ "{} foo", ++ "{} {{1:foo}}", ++ "if 1: {} foo", ++ "if 1: {} {{1:foo}}", ++ "if 1:\n {} foo", ++ "if 1:\n {} {{1:foo}}", ++ ] ++ for keyword in keywords: ++ custom_msg = "call to '{}'".format(keyword) ++ for case in cases: ++ source = case.format(keyword) ++ with self.subTest(source=source): ++ with self.assertRaisesRegex(SyntaxError, custom_msg): ++ exec(source) ++ source = source.replace("foo", "(foo.)") ++ with self.subTest(source=source): ++ with self.assertRaisesRegex(SyntaxError, "invalid syntax"): ++ exec(source) ++ + def test_del_stmt(self): + # 'del' exprlist + abc = [1,2,3] +diff -r c0e311e010fc Lib/test/test_httpservers.py +--- a/Lib/test/test_httpservers.py ++++ b/Lib/test/test_httpservers.py +@@ -14,6 +14,7 @@ + import base64 + import shutil + import urllib.parse ++import html + import http.client + import tempfile + from io import BytesIO +@@ -125,7 +126,7 @@ + + def test_request_line_trimming(self): + self.con._http_vsn_str = 'HTTP/1.1\n' +- self.con.putrequest('GET', '/') ++ self.con.putrequest('XYZBOGUS', '/') + self.con.endheaders() + res = self.con.getresponse() + self.assertEqual(res.status, 501) +@@ -152,8 +153,9 @@ + self.assertEqual(res.status, 501) + + def test_version_none(self): ++ # Test that a valid method is rejected when not HTTP/1.x + self.con._http_vsn_str = '' +- self.con.putrequest('PUT', '/') ++ self.con.putrequest('CUSTOM', '/') + self.con.endheaders() + res = self.con.getresponse() + self.assertEqual(res.status, 400) +@@ -265,6 +267,32 @@ + self.assertIsNotNone(response.reason) + if data: + self.assertEqual(data, body) ++ return body ++ ++ @unittest.skipUnless(support.TESTFN_UNDECODABLE, ++ 'need support.TESTFN_UNDECODABLE') ++ def test_undecodable_filename(self): ++ enc = sys.getfilesystemencoding() ++ filename = os.fsdecode(support.TESTFN_UNDECODABLE) + '.txt' ++ with open(os.path.join(self.tempdir, filename), 'wb') as f: ++ f.write(support.TESTFN_UNDECODABLE) ++ response = self.request(self.tempdir_name + '/') ++ if sys.platform == 'darwin': ++ # On Mac OS the HFS+ filesystem replaces bytes that aren't valid ++ # UTF-8 into a percent-encoded value. ++ for name in os.listdir(self.tempdir): ++ if name != 'test': # Ignore a filename created in setUp(). ++ filename = name ++ break ++ body = self.check_status_and_reason(response, 200) ++ quotedname = urllib.parse.quote(filename, errors='surrogatepass') ++ self.assertIn(('href="%s"' % quotedname) ++ .encode(enc, 'surrogateescape'), body) ++ self.assertIn(('>%s<' % html.escape(filename)) ++ .encode(enc, 'surrogateescape'), body) ++ response = self.request(self.tempdir_name + '/' + quotedname) ++ self.check_status_and_reason(response, 200, ++ data=support.TESTFN_UNDECODABLE) + + def test_get(self): + #constructs the path relative to the root directory of the HTTPServer +@@ -345,10 +373,13 @@ + self.cwd = os.getcwd() + self.parent_dir = tempfile.mkdtemp() + self.cgi_dir = os.path.join(self.parent_dir, 'cgi-bin') ++ self.cgi_child_dir = os.path.join(self.cgi_dir, 'child-dir') + os.mkdir(self.cgi_dir) ++ os.mkdir(self.cgi_child_dir) + self.nocgi_path = None + self.file1_path = None + self.file2_path = None ++ self.file3_path = None + + # The shebang line should be pure ASCII: use symlink if possible. + # See issue #7668. +@@ -382,6 +413,11 @@ + file2.write(cgi_file2 % self.pythonexe) + os.chmod(self.file2_path, 0o777) + ++ self.file3_path = os.path.join(self.cgi_child_dir, 'file3.py') ++ with open(self.file3_path, 'w', encoding='utf-8') as file3: ++ file3.write(cgi_file1 % self.pythonexe) ++ os.chmod(self.file3_path, 0o777) ++ + os.chdir(self.parent_dir) + + def tearDown(self): +@@ -395,6 +431,9 @@ + os.remove(self.file1_path) + if self.file2_path: + os.remove(self.file2_path) ++ if self.file3_path: ++ os.remove(self.file3_path) ++ os.rmdir(self.cgi_child_dir) + os.rmdir(self.cgi_dir) + os.rmdir(self.parent_dir) + finally: +@@ -485,6 +524,16 @@ + (res.read(), res.getheader('Content-type'), res.status)) + self.assertEqual(os.environ['SERVER_SOFTWARE'], signature) + ++ def test_urlquote_decoding_in_cgi_check(self): ++ res = self.request('/cgi-bin%2ffile1.py') ++ self.assertEqual((b'Hello World' + self.linesep, 'text/html', 200), ++ (res.read(), res.getheader('Content-type'), res.status)) ++ ++ def test_nested_cgi_path_issue21323(self): ++ res = self.request('/cgi-bin/child-dir/file3.py') ++ self.assertEqual((b'Hello World' + self.linesep, 'text/html', 200), ++ (res.read(), res.getheader('Content-type'), res.status)) ++ + + class SocketlessRequestHandler(SimpleHTTPRequestHandler): + def __init__(self): +diff -r c0e311e010fc Lib/test/test_idle.py +--- a/Lib/test/test_idle.py ++++ b/Lib/test/test_idle.py +@@ -13,8 +13,4 @@ + load_tests = idletest.load_tests + + if __name__ == '__main__': +- # Until unittest supports resources, we emulate regrtest's -ugui +- # so loaded tests run the same as if textually present here. +- # If any Idle test ever needs another resource, add it to the list. +- support.use_resources = ['gui'] # use_resources is initially None + unittest.main(verbosity=2, exit=False) +diff -r c0e311e010fc Lib/test/test_imaplib.py +--- a/Lib/test/test_imaplib.py ++++ b/Lib/test/test_imaplib.py +@@ -501,5 +501,4 @@ + + + if __name__ == "__main__": +- support.use_resources = ['network'] + unittest.main() +diff -r c0e311e010fc Lib/test/test_import.py +--- a/Lib/test/test_import.py ++++ b/Lib/test/test_import.py +@@ -190,12 +190,12 @@ + # import x.y.z binds x in the current namespace + import test as x + import test.support +- self.assertTrue(x is test, x.__name__) ++ self.assertIs(x, test, x.__name__) + self.assertTrue(hasattr(test.support, "__file__")) + + # import x.y.z as w binds z as w + import test.support as y +- self.assertTrue(y is test.support, y.__name__) ++ self.assertIs(y, test.support, y.__name__) + + def test_failing_reload(self): + # A failing reload should leave the module object in sys.modules. +@@ -223,7 +223,7 @@ + self.assertRaises(ZeroDivisionError, importlib.reload, mod) + # But we still expect the module to be in sys.modules. + mod = sys.modules.get(TESTFN) +- self.assertIsNot(mod, None, "expected module to be in sys.modules") ++ self.assertIsNotNone(mod, "expected module to be in sys.modules") + + # We should have replaced a w/ 10, but the old b value should + # stick. +diff -r c0e311e010fc Lib/test/test_importlib/__init__.py +--- a/Lib/test/test_importlib/__init__.py ++++ b/Lib/test/test_importlib/__init__.py +@@ -1,33 +1,5 @@ + import os +-import sys +-from test import support +-import unittest ++from test.support import load_package_tests + +-def test_suite(package=__package__, directory=os.path.dirname(__file__)): +- suite = unittest.TestSuite() +- for name in os.listdir(directory): +- if name.startswith(('.', '__')): +- continue +- path = os.path.join(directory, name) +- if (os.path.isfile(path) and name.startswith('test_') and +- name.endswith('.py')): +- submodule_name = os.path.splitext(name)[0] +- module_name = "{0}.{1}".format(package, submodule_name) +- __import__(module_name, level=0) +- module_tests = unittest.findTestCases(sys.modules[module_name]) +- suite.addTest(module_tests) +- elif os.path.isdir(path): +- package_name = "{0}.{1}".format(package, name) +- __import__(package_name, level=0) +- package_tests = getattr(sys.modules[package_name], 'test_suite')() +- suite.addTest(package_tests) +- else: +- continue +- return suite +- +- +-def test_main(): +- start_dir = os.path.dirname(__file__) +- top_dir = os.path.dirname(os.path.dirname(start_dir)) +- test_loader = unittest.TestLoader() +- support.run_unittest(test_loader.discover(start_dir, top_level_dir=top_dir)) ++def load_tests(*args): ++ return load_package_tests(os.path.dirname(__file__), *args) +diff -r c0e311e010fc Lib/test/test_importlib/__main__.py +--- a/Lib/test/test_importlib/__main__.py ++++ b/Lib/test/test_importlib/__main__.py +@@ -1,9 +1,4 @@ +-"""Run importlib's test suite. ++from . import load_tests ++import unittest + +-Specifying the ``--builtin`` flag will run tests, where applicable, with +-builtins.__import__ instead of importlib.__import__. +- +-""" +-if __name__ == '__main__': +- from . import test_main +- test_main() ++unittest.main() +diff -r c0e311e010fc Lib/test/test_importlib/builtin/__init__.py +--- a/Lib/test/test_importlib/builtin/__init__.py ++++ b/Lib/test/test_importlib/builtin/__init__.py +@@ -1,12 +1,5 @@ +-from .. import test_suite + import os ++from test.support import load_package_tests + +- +-def test_suite(): +- directory = os.path.dirname(__file__) +- return test_suite('importlib.test.builtin', directory) +- +- +-if __name__ == '__main__': +- from test.support import run_unittest +- run_unittest(test_suite()) ++def load_tests(*args): ++ return load_package_tests(os.path.dirname(__file__), *args) +diff -r c0e311e010fc Lib/test/test_importlib/builtin/__main__.py +--- /dev/null ++++ b/Lib/test/test_importlib/builtin/__main__.py +@@ -0,0 +1,4 @@ ++from . import load_tests ++import unittest ++ ++unittest.main() +diff -r c0e311e010fc Lib/test/test_importlib/builtin/test_loader.py +--- a/Lib/test/test_importlib/builtin/test_loader.py ++++ b/Lib/test/test_importlib/builtin/test_loader.py +@@ -87,7 +87,7 @@ + def test_is_package(self): + # Cannot be a package. + result = self.machinery.BuiltinImporter.is_package(builtin_util.NAME) +- self.assertTrue(not result) ++ self.assertFalse(result) + + def test_not_builtin(self): + # Modules not built-in should raise ImportError. +diff -r c0e311e010fc Lib/test/test_importlib/extension/__init__.py +--- a/Lib/test/test_importlib/extension/__init__.py ++++ b/Lib/test/test_importlib/extension/__init__.py +@@ -1,13 +1,5 @@ +-from .. import test_suite +-import os.path +-import unittest ++import os ++from test.support import load_package_tests + +- +-def test_suite(): +- directory = os.path.dirname(__file__) +- return test_suite('importlib.test.extension', directory) +- +- +-if __name__ == '__main__': +- from test.support import run_unittest +- run_unittest(test_suite()) ++def load_tests(*args): ++ return load_package_tests(os.path.dirname(__file__), *args) +diff -r c0e311e010fc Lib/test/test_importlib/extension/__main__.py +--- /dev/null ++++ b/Lib/test/test_importlib/extension/__main__.py +@@ -0,0 +1,4 @@ ++from . import load_tests ++import unittest ++ ++unittest.main() +diff -r c0e311e010fc Lib/test/test_importlib/frozen/__init__.py +--- a/Lib/test/test_importlib/frozen/__init__.py ++++ b/Lib/test/test_importlib/frozen/__init__.py +@@ -1,13 +1,5 @@ +-from .. import test_suite +-import os.path +-import unittest ++import os ++from test.support import load_package_tests + +- +-def test_suite(): +- directory = os.path.dirname(__file__) +- return test_suite('importlib.test.frozen', directory) +- +- +-if __name__ == '__main__': +- from test.support import run_unittest +- run_unittest(test_suite()) ++def load_tests(*args): ++ return load_package_tests(os.path.dirname(__file__), *args) +diff -r c0e311e010fc Lib/test/test_importlib/frozen/__main__.py +--- /dev/null ++++ b/Lib/test/test_importlib/frozen/__main__.py +@@ -0,0 +1,4 @@ ++from . import load_tests ++import unittest ++ ++unittest.main() +diff -r c0e311e010fc Lib/test/test_importlib/import_/__init__.py +--- a/Lib/test/test_importlib/import_/__init__.py ++++ b/Lib/test/test_importlib/import_/__init__.py +@@ -1,13 +1,5 @@ +-from .. import test_suite +-import os.path +-import unittest ++import os ++from test.support import load_package_tests + +- +-def test_suite(): +- directory = os.path.dirname(__file__) +- return test_suite('importlib.test.import_', directory) +- +- +-if __name__ == '__main__': +- from test.support import run_unittest +- run_unittest(test_suite()) ++def load_tests(*args): ++ return load_package_tests(os.path.dirname(__file__), *args) +diff -r c0e311e010fc Lib/test/test_importlib/import_/__main__.py +--- /dev/null ++++ b/Lib/test/test_importlib/import_/__main__.py +@@ -0,0 +1,4 @@ ++from . import load_tests ++import unittest ++ ++unittest.main() +diff -r c0e311e010fc Lib/test/test_importlib/import_/test_fromlist.py +--- a/Lib/test/test_importlib/import_/test_fromlist.py ++++ b/Lib/test/test_importlib/import_/test_fromlist.py +@@ -61,7 +61,7 @@ + with util.import_state(meta_path=[importer]): + module = self.__import__('module', fromlist=['non_existent']) + self.assertEqual(module.__name__, 'module') +- self.assertTrue(not hasattr(module, 'non_existent')) ++ self.assertFalse(hasattr(module, 'non_existent')) + + def test_module_from_package(self): + # [module] +diff -r c0e311e010fc Lib/test/test_importlib/import_/test_meta_path.py +--- a/Lib/test/test_importlib/import_/test_meta_path.py ++++ b/Lib/test/test_importlib/import_/test_meta_path.py +@@ -96,7 +96,7 @@ + args = log[1][0] + kwargs = log[1][1] + # Assuming all arguments are positional. +- self.assertTrue(not kwargs) ++ self.assertFalse(kwargs) + self.assertEqual(args[0], mod_name) + self.assertIs(args[1], path) + +diff -r c0e311e010fc Lib/test/test_importlib/source/__init__.py +--- a/Lib/test/test_importlib/source/__init__.py ++++ b/Lib/test/test_importlib/source/__init__.py +@@ -1,13 +1,5 @@ +-from .. import test_suite +-import os.path +-import unittest ++import os ++from test.support import load_package_tests + +- +-def test_suite(): +- directory = os.path.dirname(__file__) +- return test.test_suite('importlib.test.source', directory) +- +- +-if __name__ == '__main__': +- from test.support import run_unittest +- run_unittest(test_suite()) ++def load_tests(*args): ++ return load_package_tests(os.path.dirname(__file__), *args) +diff -r c0e311e010fc Lib/test/test_importlib/source/__main__.py +--- /dev/null ++++ b/Lib/test/test_importlib/source/__main__.py +@@ -0,0 +1,4 @@ ++from . import load_tests ++import unittest ++ ++unittest.main() +diff -r c0e311e010fc Lib/test/test_importlib/test_abc.py +--- a/Lib/test/test_importlib/test_abc.py ++++ b/Lib/test/test_importlib/test_abc.py +@@ -783,7 +783,7 @@ + warnings.simplefilter('ignore', DeprecationWarning) + module = self.loader.load_module(self.name) + self.verify_module(module) +- self.assertTrue(not hasattr(module, '__path__')) ++ self.assertFalse(hasattr(module, '__path__')) + + def test_get_source_encoding(self): + # Source is considered encoded in UTF-8 by default unless otherwise +diff -r c0e311e010fc Lib/test/test_inspect.py +--- a/Lib/test/test_inspect.py ++++ b/Lib/test/test_inspect.py +@@ -3048,6 +3048,13 @@ + self.assertEqual(lines[:-1], inspect.getsource(module).splitlines()) + self.assertEqual(err, b'') + ++ def test_custom_getattr(self): ++ def foo(): ++ pass ++ foo.__signature__ = 42 ++ with self.assertRaises(TypeError): ++ inspect.signature(foo) ++ + @unittest.skipIf(ThreadPoolExecutor is None, + 'threads required to test __qualname__ for source files') + def test_qualname_source(self): +diff -r c0e311e010fc Lib/test/test_io.py +--- a/Lib/test/test_io.py ++++ b/Lib/test/test_io.py +@@ -653,6 +653,20 @@ + fileio.close() + f2.readline() + ++ def test_nonbuffered_textio(self): ++ with warnings.catch_warnings(record=True) as recorded: ++ with self.assertRaises(ValueError): ++ self.open(support.TESTFN, 'w', buffering=0) ++ support.gc_collect() ++ self.assertEqual(recorded, []) ++ ++ def test_invalid_newline(self): ++ with warnings.catch_warnings(record=True) as recorded: ++ with self.assertRaises(ValueError): ++ self.open(support.TESTFN, 'w', newline='invalid') ++ support.gc_collect() ++ self.assertEqual(recorded, []) ++ + + class CIOTest(IOTest): + +@@ -792,9 +806,27 @@ + with self.assertRaises(OSError) as err: # exception not swallowed + b.close() + self.assertEqual(err.exception.args, ('close',)) ++ self.assertIsInstance(err.exception.__context__, OSError) + self.assertEqual(err.exception.__context__.args, ('flush',)) + self.assertFalse(b.closed) + ++ def test_nonnormalized_close_error_on_close(self): ++ # Issue #21677 ++ raw = self.MockRawIO() ++ def bad_flush(): ++ raise non_existing_flush ++ def bad_close(): ++ raise non_existing_close ++ raw.close = bad_close ++ b = self.tp(raw) ++ b.flush = bad_flush ++ with self.assertRaises(NameError) as err: # exception not swallowed ++ b.close() ++ self.assertIn('non_existing_close', str(err.exception)) ++ self.assertIsInstance(err.exception.__context__, NameError) ++ self.assertIn('non_existing_flush', str(err.exception.__context__)) ++ self.assertFalse(b.closed) ++ + def test_multi_close(self): + raw = self.MockRawIO() + b = self.tp(raw) +@@ -2576,6 +2608,39 @@ + self.assertRaises(OSError, txt.close) # exception not swallowed + self.assertTrue(txt.closed) + ++ def test_close_error_on_close(self): ++ buffer = self.BytesIO(self.testdata) ++ def bad_flush(): ++ raise OSError('flush') ++ def bad_close(): ++ raise OSError('close') ++ buffer.close = bad_close ++ txt = self.TextIOWrapper(buffer, encoding="ascii") ++ txt.flush = bad_flush ++ with self.assertRaises(OSError) as err: # exception not swallowed ++ txt.close() ++ self.assertEqual(err.exception.args, ('close',)) ++ self.assertIsInstance(err.exception.__context__, OSError) ++ self.assertEqual(err.exception.__context__.args, ('flush',)) ++ self.assertFalse(txt.closed) ++ ++ def test_nonnormalized_close_error_on_close(self): ++ # Issue #21677 ++ buffer = self.BytesIO(self.testdata) ++ def bad_flush(): ++ raise non_existing_flush ++ def bad_close(): ++ raise non_existing_close ++ buffer.close = bad_close ++ txt = self.TextIOWrapper(buffer, encoding="ascii") ++ txt.flush = bad_flush ++ with self.assertRaises(NameError) as err: # exception not swallowed ++ txt.close() ++ self.assertIn('non_existing_close', str(err.exception)) ++ self.assertIsInstance(err.exception.__context__, NameError) ++ self.assertIn('non_existing_flush', str(err.exception.__context__)) ++ self.assertFalse(txt.closed) ++ + def test_multi_close(self): + txt = self.TextIOWrapper(self.BytesIO(self.testdata), encoding="ascii") + txt.close() +diff -r c0e311e010fc Lib/test/test_itertools.py +--- a/Lib/test/test_itertools.py ++++ b/Lib/test/test_itertools.py +@@ -967,6 +967,12 @@ + self.assertEqual(take(2, copy.deepcopy(c)), list('a' * 2)) + self.pickletest(repeat(object='a', times=10)) + ++ def test_repeat_with_negative_times(self): ++ self.assertEqual(repr(repeat('a', -1)), "repeat('a', 0)") ++ self.assertEqual(repr(repeat('a', -2)), "repeat('a', 0)") ++ self.assertEqual(repr(repeat('a', times=-1)), "repeat('a', 0)") ++ self.assertEqual(repr(repeat('a', times=-2)), "repeat('a', 0)") ++ + def test_map(self): + self.assertEqual(list(map(operator.pow, range(3), range(1,7))), + [0**1, 1**2, 2**3]) +@@ -1741,8 +1747,15 @@ + + def test_repeat(self): + self.assertEqual(operator.length_hint(repeat(None, 50)), 50) ++ self.assertEqual(operator.length_hint(repeat(None, 0)), 0) + self.assertEqual(operator.length_hint(repeat(None), 12), 12) + ++ def test_repeat_with_negative_times(self): ++ self.assertEqual(operator.length_hint(repeat(None, -1)), 0) ++ self.assertEqual(operator.length_hint(repeat(None, -2)), 0) ++ self.assertEqual(operator.length_hint(repeat(None, times=-1)), 0) ++ self.assertEqual(operator.length_hint(repeat(None, times=-2)), 0) ++ + class RegressionTests(unittest.TestCase): + + def test_sf_793826(self): +diff -r c0e311e010fc Lib/test/test_json/__init__.py +--- a/Lib/test/test_json/__init__.py ++++ b/Lib/test/test_json/__init__.py +@@ -42,23 +42,12 @@ + '_json') + + +-here = os.path.dirname(__file__) +- +-def load_tests(*args): +- suite = additional_tests() +- loader = unittest.TestLoader() +- for fn in os.listdir(here): +- if fn.startswith("test") and fn.endswith(".py"): +- modname = "test.test_json." + fn[:-3] +- __import__(modname) +- module = sys.modules[modname] +- suite.addTests(loader.loadTestsFromModule(module)) +- return suite +- +-def additional_tests(): ++def load_tests(loader, _, pattern): + suite = unittest.TestSuite() + for mod in (json, json.encoder, json.decoder): + suite.addTest(doctest.DocTestSuite(mod)) + suite.addTest(TestPyTest('test_pyjson')) + suite.addTest(TestCTest('test_cjson')) +- return suite ++ ++ pkg_dir = os.path.dirname(__file__) ++ return support.load_package_tests(pkg_dir, loader, suite, pattern) +diff -r c0e311e010fc Lib/test/test_logging.py +--- a/Lib/test/test_logging.py ++++ b/Lib/test/test_logging.py +@@ -865,9 +865,6 @@ + super(TestTCPServer, self).server_bind() + self.port = self.socket.getsockname()[1] + +- class TestUnixStreamServer(TestTCPServer): +- address_family = socket.AF_UNIX +- + class TestUDPServer(ControlMixin, ThreadingUDPServer): + """ + A UDP server which is controllable using :class:`ControlMixin`. +@@ -915,8 +912,12 @@ + super(TestUDPServer, self).server_close() + self._closed = True + +- class TestUnixDatagramServer(TestUDPServer): +- address_family = socket.AF_UNIX ++ if hasattr(socket, "AF_UNIX"): ++ class TestUnixStreamServer(TestTCPServer): ++ address_family = socket.AF_UNIX ++ ++ class TestUnixDatagramServer(TestUDPServer): ++ address_family = socket.AF_UNIX + + # - end of server_helper section + +@@ -1457,12 +1458,13 @@ + os.remove(fn) + return fn + ++@unittest.skipUnless(hasattr(socket, "AF_UNIX"), "Unix sockets required") + @unittest.skipUnless(threading, 'Threading required for this test.') + class UnixSocketHandlerTest(SocketHandlerTest): + + """Test for SocketHandler with unix sockets.""" + +- if threading: ++ if threading and hasattr(socket, "AF_UNIX"): + server_class = TestUnixStreamServer + + def setUp(self): +@@ -1528,13 +1530,13 @@ + self.handled.wait() + self.assertEqual(self.log_output, "spam\neggs\n") + +- ++@unittest.skipUnless(hasattr(socket, "AF_UNIX"), "Unix sockets required") + @unittest.skipUnless(threading, 'Threading required for this test.') + class UnixDatagramHandlerTest(DatagramHandlerTest): + + """Test for DatagramHandler using Unix sockets.""" + +- if threading: ++ if threading and hasattr(socket, "AF_UNIX"): + server_class = TestUnixDatagramServer + + def setUp(self): +@@ -1603,13 +1605,13 @@ + self.handled.wait() + self.assertEqual(self.log_output, b'<11>h\xc3\xa4m-sp\xc3\xa4m') + +- ++@unittest.skipUnless(hasattr(socket, "AF_UNIX"), "Unix sockets required") + @unittest.skipUnless(threading, 'Threading required for this test.') + class UnixSysLogHandlerTest(SysLogHandlerTest): + + """Test for SysLogHandler with Unix sockets.""" + +- if threading: ++ if threading and hasattr(socket, "AF_UNIX"): + server_class = TestUnixDatagramServer + + def setUp(self): +diff -r c0e311e010fc Lib/test/test_mailbox.py +--- a/Lib/test/test_mailbox.py ++++ b/Lib/test/test_mailbox.py +@@ -300,7 +300,7 @@ + + def test_iterkeys(self): + # Get keys using iterkeys() +- self._check_iteration(self._box.keys, do_keys=True, do_values=False) ++ self._check_iteration(self._box.iterkeys, do_keys=True, do_values=False) + + def test_keys(self): + # Get keys using keys() +@@ -308,7 +308,7 @@ + + def test_itervalues(self): + # Get values using itervalues() +- self._check_iteration(self._box.values, do_keys=False, ++ self._check_iteration(self._box.itervalues, do_keys=False, + do_values=True) + + def test_iter(self): +@@ -322,7 +322,7 @@ + + def test_iteritems(self): + # Get keys and values using iteritems() +- self._check_iteration(self._box.items, do_keys=True, ++ self._check_iteration(self._box.iteritems, do_keys=True, + do_values=True) + + def test_items(self): +@@ -564,12 +564,12 @@ + self.assertRaises(NotImplementedError, lambda: box.__delitem__('')) + self.assertRaises(NotImplementedError, lambda: box.discard('')) + self.assertRaises(NotImplementedError, lambda: box.__setitem__('', '')) ++ self.assertRaises(NotImplementedError, lambda: box.iterkeys()) + self.assertRaises(NotImplementedError, lambda: box.keys()) +- self.assertRaises(NotImplementedError, lambda: box.keys()) +- self.assertRaises(NotImplementedError, lambda: box.values().__next__()) ++ self.assertRaises(NotImplementedError, lambda: box.itervalues().__next__()) + self.assertRaises(NotImplementedError, lambda: box.__iter__().__next__()) + self.assertRaises(NotImplementedError, lambda: box.values()) +- self.assertRaises(NotImplementedError, lambda: box.items().next()) ++ self.assertRaises(NotImplementedError, lambda: box.iteritems().__next__()) + self.assertRaises(NotImplementedError, lambda: box.items()) + self.assertRaises(NotImplementedError, lambda: box.get('')) + self.assertRaises(NotImplementedError, lambda: box.__getitem__('')) +@@ -1020,7 +1020,7 @@ + mtime = os.path.getmtime(self._path) + self._box = self._factory(self._path) + self.assertEqual(len(self._box), 3) +- for key in self._box.keys(): ++ for key in self._box.iterkeys(): + self.assertIn(self._box.get_string(key), values) + self._box.close() + self.assertEqual(mtime, os.path.getmtime(self._path)) +diff -r c0e311e010fc Lib/test/test_minidom.py +--- a/Lib/test/test_minidom.py ++++ b/Lib/test/test_minidom.py +@@ -1531,6 +1531,13 @@ + num_children_after = len(doc.childNodes) + self.assertTrue(num_children_after == num_children_before - 1) + ++ def testProcessingInstructionNameError(self): ++ # wrong variable in .nodeValue property will ++ # lead to "NameError: name 'data' is not defined" ++ doc = parse(tstfile) ++ pi = doc.createProcessingInstruction("y", "z") ++ pi.nodeValue = "crash" ++ + def test_main(): + run_unittest(MinidomTest) + +diff -r c0e311e010fc Lib/test/test_modulefinder.py +--- a/Lib/test/test_modulefinder.py ++++ b/Lib/test/test_modulefinder.py +@@ -245,11 +245,12 @@ + + + class ModuleFinderTest(unittest.TestCase): +- def _do_test(self, info, report=False): ++ def _do_test(self, info, report=False, debug=0, replace_paths=[]): + import_this, modules, missing, maybe_missing, source = info + create_package(source) + try: +- mf = modulefinder.ModuleFinder(path=TEST_PATH) ++ mf = modulefinder.ModuleFinder(path=TEST_PATH, debug=debug, ++ replace_paths=replace_paths) + mf.import_hook(import_this) + if report: + mf.report() +@@ -308,9 +309,16 @@ + os.remove(source_path) + self._do_test(bytecode_test) + ++ def test_replace_paths(self): ++ old_path = os.path.join(TEST_DIR, 'a', 'module.py') ++ new_path = os.path.join(TEST_DIR, 'a', 'spam.py') ++ with support.captured_stdout() as output: ++ self._do_test(maybe_test, debug=2, ++ replace_paths=[(old_path, new_path)]) ++ output = output.getvalue() ++ expected = "co_filename %r changed to %r" % (old_path, new_path) ++ self.assertIn(expected, output) + +-def test_main(): +- support.run_unittest(ModuleFinderTest) + + if __name__ == "__main__": + unittest.main() +diff -r c0e311e010fc Lib/test/test_multiprocessing_main_handling.py +--- a/Lib/test/test_multiprocessing_main_handling.py ++++ b/Lib/test/test_multiprocessing_main_handling.py +@@ -1,4 +1,8 @@ + # tests __main__ module handling in multiprocessing ++from test import support ++# Skip tests if _thread or _multiprocessing wasn't built. ++support.import_module('_thread') ++support.import_module('_multiprocessing') + + import importlib + import importlib.machinery +@@ -9,14 +13,11 @@ + import os.path + import py_compile + +-from test import support + from test.script_helper import ( + make_pkg, make_script, make_zip_pkg, make_zip_script, + assert_python_ok, assert_python_failure, temp_dir, + spawn_python, kill_python) + +-# Skip tests if _multiprocessing wasn't built. +-_multiprocessing = support.import_module('_multiprocessing') + # Look up which start methods are available to test + import multiprocessing + AVAILABLE_START_METHODS = set(multiprocessing.get_all_start_methods()) +diff -r c0e311e010fc Lib/test/test_ntpath.py +--- a/Lib/test/test_ntpath.py ++++ b/Lib/test/test_ntpath.py +@@ -258,6 +258,41 @@ + check('%spam%bar', '%sbar' % nonascii) + check('%{}%bar'.format(nonascii), 'ham%sbar' % nonascii) + ++ def test_expanduser(self): ++ tester('ntpath.expanduser("test")', 'test') ++ ++ with support.EnvironmentVarGuard() as env: ++ env.clear() ++ tester('ntpath.expanduser("~test")', '~test') ++ ++ env['HOMEPATH'] = 'eric\\idle' ++ env['HOMEDRIVE'] = 'C:\\' ++ tester('ntpath.expanduser("~test")', 'C:\\eric\\test') ++ tester('ntpath.expanduser("~")', 'C:\\eric\\idle') ++ ++ del env['HOMEDRIVE'] ++ tester('ntpath.expanduser("~test")', 'eric\\test') ++ tester('ntpath.expanduser("~")', 'eric\\idle') ++ ++ env.clear() ++ env['USERPROFILE'] = 'C:\\eric\\idle' ++ tester('ntpath.expanduser("~test")', 'C:\\eric\\test') ++ tester('ntpath.expanduser("~")', 'C:\\eric\\idle') ++ ++ env.clear() ++ env['HOME'] = 'C:\\idle\\eric' ++ tester('ntpath.expanduser("~test")', 'C:\\idle\\test') ++ tester('ntpath.expanduser("~")', 'C:\\idle\\eric') ++ ++ tester('ntpath.expanduser("~test\\foo\\bar")', ++ 'C:\\idle\\test\\foo\\bar') ++ tester('ntpath.expanduser("~test/foo/bar")', ++ 'C:\\idle\\test/foo/bar') ++ tester('ntpath.expanduser("~\\foo\\bar")', ++ 'C:\\idle\\eric\\foo\\bar') ++ tester('ntpath.expanduser("~/foo/bar")', ++ 'C:\\idle\\eric/foo/bar') ++ + def test_abspath(self): + # ntpath.abspath() can only be used on a system with the "nt" module + # (reasonably), so we protect this test with "import nt". This allows +diff -r c0e311e010fc Lib/test/test_pathlib.py +--- a/Lib/test/test_pathlib.py ++++ b/Lib/test/test_pathlib.py +@@ -540,6 +540,10 @@ + self.assertRaises(ValueError, P('').with_name, 'd.xml') + self.assertRaises(ValueError, P('.').with_name, 'd.xml') + self.assertRaises(ValueError, P('/').with_name, 'd.xml') ++ self.assertRaises(ValueError, P('a/b').with_name, '') ++ self.assertRaises(ValueError, P('a/b').with_name, '/c') ++ self.assertRaises(ValueError, P('a/b').with_name, 'c/') ++ self.assertRaises(ValueError, P('a/b').with_name, 'c/d') + + def test_with_suffix_common(self): + P = self.cls +@@ -547,6 +551,9 @@ + self.assertEqual(P('/a/b').with_suffix('.gz'), P('/a/b.gz')) + self.assertEqual(P('a/b.py').with_suffix('.gz'), P('a/b.gz')) + self.assertEqual(P('/a/b.py').with_suffix('.gz'), P('/a/b.gz')) ++ # Stripping suffix ++ self.assertEqual(P('a/b.py').with_suffix(''), P('a/b')) ++ self.assertEqual(P('/a/b').with_suffix(''), P('/a/b')) + # Path doesn't have a "filename" component + self.assertRaises(ValueError, P('').with_suffix, '.gz') + self.assertRaises(ValueError, P('.').with_suffix, '.gz') +@@ -554,9 +561,12 @@ + # Invalid suffix + self.assertRaises(ValueError, P('a/b').with_suffix, 'gz') + self.assertRaises(ValueError, P('a/b').with_suffix, '/') ++ self.assertRaises(ValueError, P('a/b').with_suffix, '.') + self.assertRaises(ValueError, P('a/b').with_suffix, '/.gz') + self.assertRaises(ValueError, P('a/b').with_suffix, 'c/d') + self.assertRaises(ValueError, P('a/b').with_suffix, '.c/.d') ++ self.assertRaises(ValueError, P('a/b').with_suffix, './.d') ++ self.assertRaises(ValueError, P('a/b').with_suffix, '.d/.') + + def test_relative_to_common(self): + P = self.cls +@@ -950,6 +960,10 @@ + self.assertRaises(ValueError, P('c:').with_name, 'd.xml') + self.assertRaises(ValueError, P('c:/').with_name, 'd.xml') + self.assertRaises(ValueError, P('//My/Share').with_name, 'd.xml') ++ self.assertRaises(ValueError, P('c:a/b').with_name, 'd:') ++ self.assertRaises(ValueError, P('c:a/b').with_name, 'd:e') ++ self.assertRaises(ValueError, P('c:a/b').with_name, 'd:/e') ++ self.assertRaises(ValueError, P('c:a/b').with_name, '//My/Share') + + def test_with_suffix(self): + P = self.cls +@@ -1200,7 +1214,7 @@ + + def setUp(self): + os.mkdir(BASE) +- self.addCleanup(shutil.rmtree, BASE) ++ self.addCleanup(support.rmtree, BASE) + os.mkdir(join('dirA')) + os.mkdir(join('dirB')) + os.mkdir(join('dirC')) +@@ -1385,7 +1399,7 @@ + self._check_resolve_relative(p, P(BASE, 'dirB', 'fileB')) + # Now create absolute symlinks + d = tempfile.mkdtemp(suffix='-dirD') +- self.addCleanup(shutil.rmtree, d) ++ self.addCleanup(support.rmtree, d) + os.symlink(os.path.join(d), join('dirA', 'linkX')) + os.symlink(join('dirB'), os.path.join(d, 'linkY')) + p = P(BASE, 'dirA', 'linkX', 'linkY', 'fileB') +diff -r c0e311e010fc Lib/test/test_pdb.py +--- a/Lib/test/test_pdb.py ++++ b/Lib/test/test_pdb.py +@@ -614,6 +614,8 @@ + ... test_function_2() + ... end = 1 + ++ >>> from bdb import Breakpoint ++ >>> Breakpoint.next = 1 + >>> with PdbTestInput(['break test_function_2', + ... 'continue', + ... 'return', +diff -r c0e311e010fc Lib/test/test_pep277.py +--- a/Lib/test/test_pep277.py ++++ b/Lib/test/test_pep277.py +@@ -56,17 +56,6 @@ + "Unicode-friendly filesystem encoding") + + +-# Destroy directory dirname and all files under it, to one level. +-def deltree(dirname): +- # Don't hide legitimate errors: if one of these suckers exists, it's +- # an error if we can't remove it. +- if os.path.exists(dirname): +- # must pass unicode to os.listdir() so we get back unicode results. +- for fname in os.listdir(str(dirname)): +- os.unlink(os.path.join(dirname, fname)) +- os.rmdir(dirname) +- +- + class UnicodeFileTests(unittest.TestCase): + files = set(filenames) + normal_form = None +@@ -76,6 +65,8 @@ + os.mkdir(support.TESTFN) + except FileExistsError: + pass ++ self.addCleanup(support.rmtree, support.TESTFN) ++ + files = set() + for name in self.files: + name = os.path.join(support.TESTFN, self.norm(name)) +@@ -85,9 +76,6 @@ + files.add(name) + self.files = files + +- def tearDown(self): +- deltree(support.TESTFN) +- + def norm(self, s): + if self.normal_form: + return normalize(self.normal_form, s) +@@ -200,16 +188,13 @@ + + + def test_main(): +- try: +- support.run_unittest( +- UnicodeFileTests, +- UnicodeNFCFileTests, +- UnicodeNFDFileTests, +- UnicodeNFKCFileTests, +- UnicodeNFKDFileTests, +- ) +- finally: +- deltree(support.TESTFN) ++ support.run_unittest( ++ UnicodeFileTests, ++ UnicodeNFCFileTests, ++ UnicodeNFDFileTests, ++ UnicodeNFKCFileTests, ++ UnicodeNFKDFileTests, ++ ) + + + if __name__ == "__main__": +diff -r c0e311e010fc Lib/test/test_pkgutil.py +--- a/Lib/test/test_pkgutil.py ++++ b/Lib/test/test_pkgutil.py +@@ -363,6 +363,20 @@ + loader = pkgutil.get_loader(name) + self.assertIsNone(loader) + ++ def test_get_loader_None_in_sys_modules(self): ++ name = 'totally bogus' ++ sys.modules[name] = None ++ try: ++ loader = pkgutil.get_loader(name) ++ finally: ++ del sys.modules[name] ++ self.assertIsNone(loader) ++ ++ def test_find_loader_missing_module(self): ++ name = 'totally bogus' ++ loader = pkgutil.find_loader(name) ++ self.assertIsNone(loader) ++ + def test_find_loader_avoids_emulation(self): + with check_warnings() as w: + self.assertIsNotNone(pkgutil.find_loader("sys")) +diff -r c0e311e010fc Lib/test/test_plistlib.py +--- a/Lib/test/test_plistlib.py ++++ b/Lib/test/test_plistlib.py +@@ -207,6 +207,9 @@ + for fmt in ALL_FORMATS: + with self.subTest(fmt=fmt): + pl = self._create(fmt=fmt) ++ pl2 = plistlib.loads(TESTDATA[fmt], fmt=fmt) ++ self.assertEqual(dict(pl), dict(pl2), ++ "generated data was not identical to Apple's output") + pl2 = plistlib.loads(TESTDATA[fmt]) + self.assertEqual(dict(pl), dict(pl2), + "generated data was not identical to Apple's output") +@@ -217,6 +220,8 @@ + b = BytesIO() + pl = self._create(fmt=fmt) + plistlib.dump(pl, b, fmt=fmt) ++ pl2 = plistlib.load(BytesIO(b.getvalue()), fmt=fmt) ++ self.assertEqual(dict(pl), dict(pl2)) + pl2 = plistlib.load(BytesIO(b.getvalue())) + self.assertEqual(dict(pl), dict(pl2)) + +@@ -411,6 +416,18 @@ + pl2 = plistlib.loads(data) + self.assertEqual(dict(pl), dict(pl2)) + ++ def test_nonstandard_refs_size(self): ++ # Issue #21538: Refs and offsets are 24-bit integers ++ data = (b'bplist00' ++ b'\xd1\x00\x00\x01\x00\x00\x02QaQb' ++ b'\x00\x00\x08\x00\x00\x0f\x00\x00\x11' ++ b'\x00\x00\x00\x00\x00\x00' ++ b'\x03\x03' ++ b'\x00\x00\x00\x00\x00\x00\x00\x03' ++ b'\x00\x00\x00\x00\x00\x00\x00\x00' ++ b'\x00\x00\x00\x00\x00\x00\x00\x13') ++ self.assertEqual(plistlib.loads(data), {'a': 'b'}) ++ + + class TestPlistlibDeprecated(unittest.TestCase): + def test_io_deprecated(self): +diff -r c0e311e010fc Lib/test/test_posix.py +--- a/Lib/test/test_posix.py ++++ b/Lib/test/test_posix.py +@@ -757,7 +757,7 @@ + + @unittest.skipUnless(hasattr(os, 'getegid'), "test needs os.getegid()") + def test_getgroups(self): +- with os.popen('id -G') as idg: ++ with os.popen('id -G 2>/dev/null') as idg: + groups = idg.read().strip() + ret = idg.close() + +@@ -768,7 +768,7 @@ + if sys.platform == 'darwin': + import sysconfig + dt = sysconfig.get_config_var('MACOSX_DEPLOYMENT_TARGET') or '10.0' +- if float(dt) < 10.6: ++ if tuple(int(n) for n in dt.split('.')[0:2]) < (10, 6): + raise unittest.SkipTest("getgroups(2) is broken prior to 10.6") + + # 'id -G' and 'os.getgroups()' should return the same +diff -r c0e311e010fc Lib/test/test_pydoc.py +--- a/Lib/test/test_pydoc.py ++++ b/Lib/test/test_pydoc.py +@@ -14,6 +14,7 @@ + import time + import types + import unittest ++import urllib.parse + import xml.etree + import textwrap + from io import StringIO +@@ -47,6 +48,7 @@ + builtins.object + A + B ++ C + \x20\x20\x20\x20 + class A(builtins.object) + | Hello and goodbye +@@ -74,6 +76,26 @@ + | Data and other attributes defined here: + |\x20\x20 + | NO_MEANING = 'eggs' ++\x20\x20\x20\x20 ++ class C(builtins.object) ++ | Methods defined here: ++ |\x20\x20 ++ | get_answer(self) ++ | Return say_no() ++ |\x20\x20 ++ | is_it_true(self) ++ | Return self.get_answer() ++ |\x20\x20 ++ | say_no(self) ++ |\x20\x20 ++ | ---------------------------------------------------------------------- ++ | Data descriptors defined here: ++ |\x20\x20 ++ | __dict__ ++ | dictionary for instance variables (if defined) ++ |\x20\x20 ++ | __weakref__ ++ | list of weak references to the object (if defined) + + FUNCTIONS + doc_func() +@@ -124,6 +146,7 @@ +
+
A +
B ++
C +
+ + +@@ -165,6 +188,28 @@ + Data and other attributes defined here:
+
NO_MEANING = 'eggs'
+ ++

++ ++ ++ ++\x20\x20\x20\x20 ++ ++
 
++class C(builtins.object)
    Methods defined here:
++
get_answer(self)
Return say_no()
++ ++
is_it_true(self)
Return self.get_answer()
++ ++
say_no(self)
++ ++
++Data descriptors defined here:
++
__dict__
++
dictionary for instance variables (if defined)
++
++
__weakref__
++
list of weak references to the object (if defined)
++
+

+ + +@@ -358,14 +403,11 @@ + "Docstrings are omitted with -O2 and above") + @unittest.skipIf(hasattr(sys, 'gettrace') and sys.gettrace(), + 'trace function introduces __locals__ unexpectedly') ++ @requires_docstrings + def test_html_doc(self): + result, doc_loc = get_pydoc_html(pydoc_mod) + mod_file = inspect.getabsfile(pydoc_mod) +- if sys.platform == 'win32': +- import nturl2path +- mod_url = nturl2path.pathname2url(mod_file) +- else: +- mod_url = mod_file ++ mod_url = urllib.parse.quote(mod_file) + expected_html = expected_html_pattern % ( + (mod_url, mod_file, doc_loc) + + expected_html_data_docstrings) +@@ -377,6 +419,7 @@ + "Docstrings are omitted with -O2 and above") + @unittest.skipIf(hasattr(sys, 'gettrace') and sys.gettrace(), + 'trace function introduces __locals__ unexpectedly') ++ @requires_docstrings + def test_text_doc(self): + result, doc_loc = get_pydoc_text(pydoc_mod) + expected_text = expected_text_pattern % ( +@@ -402,6 +445,14 @@ + result, doc_loc = get_pydoc_text(xml.etree) + self.assertEqual(doc_loc, "", "MODULE DOCS incorrectly includes a link") + ++ def test_getpager_with_stdin_none(self): ++ previous_stdin = sys.stdin ++ try: ++ sys.stdin = None ++ pydoc.getpager() # Shouldn't fail. ++ finally: ++ sys.stdin = previous_stdin ++ + def test_non_str_name(self): + # issue14638 + # Treat illegal (non-str) name like no name +@@ -443,6 +494,7 @@ + 'Docstrings are omitted with -O2 and above') + @unittest.skipIf(hasattr(sys, 'gettrace') and sys.gettrace(), + 'trace function introduces __locals__ unexpectedly') ++ @requires_docstrings + def test_help_output_redirect(self): + # issue 940286, if output is set in Helper, then all output from + # Helper.help should be redirected +@@ -694,7 +746,7 @@ + try: + pydoc.render_doc(name) + except ImportError: +- self.fail('finding the doc of {!r} failed'.format(o)) ++ self.fail('finding the doc of {!r} failed'.format(name)) + + for name in ('notbuiltins', 'strrr', 'strr.translate', + 'str.trrrranslate', 'builtins.strrr', +diff -r c0e311e010fc Lib/test/test_random.py +--- a/Lib/test/test_random.py ++++ b/Lib/test/test_random.py +@@ -602,7 +602,7 @@ + for variate, args, expected in [ + (g.uniform, (10.0, 10.0), 10.0), + (g.triangular, (10.0, 10.0), 10.0), +- #(g.triangular, (10.0, 10.0, 10.0), 10.0), ++ (g.triangular, (10.0, 10.0, 10.0), 10.0), + (g.expovariate, (float('inf'),), 0.0), + (g.vonmisesvariate, (3.0, float('inf')), 3.0), + (g.gauss, (10.0, 0.0), 10.0), +diff -r c0e311e010fc Lib/test/test_readline.py +--- a/Lib/test/test_readline.py ++++ b/Lib/test/test_readline.py +@@ -1,17 +1,20 @@ + """ + Very minimal unittests for parts of the readline module. +- +-These tests were added to check that the libedit emulation on OSX and +-the "real" readline have the same interface for history manipulation. That's +-why the tests cover only a small subset of the interface. + """ ++import os + import unittest + from test.support import run_unittest, import_module ++from test.script_helper import assert_python_ok + + # Skip tests if there is no readline module + readline = import_module('readline') + + class TestHistoryManipulation (unittest.TestCase): ++ """ ++ These tests were added to check that the libedit emulation on OSX and the ++ "real" readline have the same interface for history manipulation. That's ++ why the tests cover only a small subset of the interface. ++ """ + + @unittest.skipIf(not hasattr(readline, 'clear_history'), + "The history update test cannot be run because the " +@@ -40,8 +43,18 @@ + self.assertEqual(readline.get_current_history_length(), 1) + + ++class TestReadline(unittest.TestCase): ++ def test_init(self): ++ # Issue #19884: Ensure that the ANSI sequence "\033[1034h" is not ++ # written into stdout when the readline module is imported and stdout ++ # is redirected to a pipe. ++ rc, stdout, stderr = assert_python_ok('-c', 'import readline', ++ TERM='xterm-256color') ++ self.assertEqual(stdout, b'') ++ ++ + def test_main(): +- run_unittest(TestHistoryManipulation) ++ run_unittest(TestHistoryManipulation, TestReadline) + + if __name__ == "__main__": + test_main() +diff -r c0e311e010fc Lib/test/test_robotparser.py +--- a/Lib/test/test_robotparser.py ++++ b/Lib/test/test_robotparser.py +@@ -4,6 +4,12 @@ + from urllib.error import URLError, HTTPError + from urllib.request import urlopen + from test import support ++from http.server import BaseHTTPRequestHandler, HTTPServer ++try: ++ import threading ++except ImportError: ++ threading = None ++ + + class RobotTestCase(unittest.TestCase): + def __init__(self, index=None, parser=None, url=None, good=None, agent=None): +@@ -247,33 +253,52 @@ + RobotTest(16, doc, good, bad) + + +-class NetworkTestCase(unittest.TestCase): ++class RobotHandler(BaseHTTPRequestHandler): ++ ++ def do_GET(self): ++ self.send_error(403, "Forbidden access") ++ ++ def log_message(self, format, *args): ++ pass ++ ++ ++@unittest.skipUnless(threading, 'threading required for this test') ++class PasswordProtectedSiteTestCase(unittest.TestCase): ++ ++ def setUp(self): ++ self.server = HTTPServer((support.HOST, 0), RobotHandler) ++ ++ self.t = threading.Thread( ++ name='HTTPServer serving', ++ target=self.server.serve_forever, ++ # Short poll interval to make the test finish quickly. ++ # Time between requests is short enough that we won't wake ++ # up spuriously too many times. ++ kwargs={'poll_interval':0.01}) ++ self.t.daemon = True # In case this function raises. ++ self.t.start() ++ ++ def tearDown(self): ++ self.server.shutdown() ++ self.t.join() ++ self.server.server_close() ++ ++ def runTest(self): ++ self.testPasswordProtectedSite() + + def testPasswordProtectedSite(self): +- support.requires('network') +- with support.transient_internet('mueblesmoraleda.com'): +- url = 'http://mueblesmoraleda.com' +- robots_url = url + "/robots.txt" +- # First check the URL is usable for our purposes, since the +- # test site is a bit flaky. +- try: +- urlopen(robots_url) +- except HTTPError as e: +- if e.code not in {401, 403}: +- self.skipTest( +- "%r should return a 401 or 403 HTTP error, not %r" +- % (robots_url, e.code)) +- else: +- self.skipTest( +- "%r should return a 401 or 403 HTTP error, not succeed" +- % (robots_url)) +- parser = urllib.robotparser.RobotFileParser() +- parser.set_url(url) +- try: +- parser.read() +- except URLError: +- self.skipTest('%s is unavailable' % url) +- self.assertEqual(parser.can_fetch("*", robots_url), False) ++ addr = self.server.server_address ++ url = 'http://' + support.HOST + ':' + str(addr[1]) ++ robots_url = url + "/robots.txt" ++ parser = urllib.robotparser.RobotFileParser() ++ parser.set_url(url) ++ parser.read() ++ self.assertFalse(parser.can_fetch("*", robots_url)) ++ ++ def __str__(self): ++ return '%s' % self.__class__.__name__ ++ ++class NetworkTestCase(unittest.TestCase): + + @unittest.skip('does not handle the gzip encoding delivered by pydotorg') + def testPythonOrg(self): +@@ -288,8 +313,8 @@ + def load_tests(loader, suite, pattern): + suite = unittest.makeSuite(NetworkTestCase) + suite.addTest(tests) ++ suite.addTest(PasswordProtectedSiteTestCase()) + return suite + + if __name__=='__main__': +- support.use_resources = ['network'] + unittest.main() +diff -r c0e311e010fc Lib/test/test_selectors.py +--- a/Lib/test/test_selectors.py ++++ b/Lib/test/test_selectors.py +@@ -378,7 +378,7 @@ + resource.setrlimit(resource.RLIMIT_NOFILE, (hard, hard)) + self.addCleanup(resource.setrlimit, resource.RLIMIT_NOFILE, + (soft, hard)) +- NUM_FDS = hard ++ NUM_FDS = min(hard, 2**16) + except (OSError, ValueError): + NUM_FDS = soft + +diff -r c0e311e010fc Lib/test/test_shutil.py +--- a/Lib/test/test_shutil.py ++++ b/Lib/test/test_shutil.py +@@ -10,6 +10,7 @@ + import errno + import functools + import subprocess ++from contextlib import ExitStack + from test import support + from test.support import TESTFN + from os.path import splitdrive +@@ -116,7 +117,9 @@ + write_file(os.path.join(victim, 'somefile'), 'foo') + victim = os.fsencode(victim) + self.assertIsInstance(victim, bytes) +- shutil.rmtree(victim) ++ win = (os.name == 'nt') ++ with self.assertWarns(DeprecationWarning) if win else ExitStack(): ++ shutil.rmtree(victim) + + @support.skip_unless_symlink + def test_rmtree_fails_on_symlink(self): +diff -r c0e311e010fc Lib/test/test_socket.py +--- a/Lib/test/test_socket.py ++++ b/Lib/test/test_socket.py +@@ -3,6 +3,7 @@ + + import errno + import io ++import itertools + import socket + import select + import tempfile +@@ -37,6 +38,11 @@ + except ImportError: + thread = None + threading = None ++try: ++ import _socket ++except ImportError: ++ _socket = None ++ + + def _have_socket_can(): + """Check whether CAN sockets are supported on this host.""" +@@ -657,6 +663,19 @@ + self.assertIn('[closed]', repr(s)) + self.assertNotIn('laddr', repr(s)) + ++ @unittest.skipUnless(_socket is not None, 'need _socket module') ++ def test_csocket_repr(self): ++ s = _socket.socket(_socket.AF_INET, _socket.SOCK_STREAM) ++ try: ++ expected = ('' ++ % (s.fileno(), s.family, s.type, s.proto)) ++ self.assertEqual(repr(s), expected) ++ finally: ++ s.close() ++ expected = ('' ++ % (s.family, s.type, s.proto)) ++ self.assertEqual(repr(s), expected) ++ + def test_weakref(self): + s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) + p = proxy(s) +@@ -1145,17 +1164,24 @@ + sock.close() + + def test_getsockaddrarg(self): +- host = '0.0.0.0' ++ sock = socket.socket() ++ self.addCleanup(sock.close) + port = support.find_unused_port() + big_port = port + 65536 + neg_port = port - 65536 +- sock = socket.socket() +- try: +- self.assertRaises(OverflowError, sock.bind, (host, big_port)) +- self.assertRaises(OverflowError, sock.bind, (host, neg_port)) +- sock.bind((host, port)) +- finally: +- sock.close() ++ self.assertRaises(OverflowError, sock.bind, (HOST, big_port)) ++ self.assertRaises(OverflowError, sock.bind, (HOST, neg_port)) ++ # Since find_unused_port() is inherently subject to race conditions, we ++ # call it a couple times if necessary. ++ for i in itertools.count(): ++ port = support.find_unused_port() ++ try: ++ sock.bind((HOST, port)) ++ except OSError as e: ++ if e.errno != errno.EADDRINUSE or i == 5: ++ raise ++ else: ++ break + + @unittest.skipUnless(os.name == "nt", "Windows specific") + def test_sock_ioctl(self): +@@ -1456,6 +1482,7 @@ + + + @unittest.skipUnless(HAVE_SOCKET_CAN, 'SocketCan required for this test.') ++@unittest.skipUnless(thread, 'Threading required for this test.') + class CANTest(ThreadedCANSocketTest): + + def __init__(self, methodName='runTest'): +diff -r c0e311e010fc Lib/test/test_spwd.py +--- /dev/null ++++ b/Lib/test/test_spwd.py +@@ -0,0 +1,60 @@ ++import os ++import unittest ++from test import support ++ ++spwd = support.import_module('spwd') ++ ++ ++@unittest.skipUnless(hasattr(os, 'geteuid') and os.geteuid() == 0, ++ 'root privileges required') ++class TestSpwdRoot(unittest.TestCase): ++ ++ def test_getspall(self): ++ entries = spwd.getspall() ++ self.assertIsInstance(entries, list) ++ for entry in entries: ++ self.assertIsInstance(entry, spwd.struct_spwd) ++ ++ def test_getspnam(self): ++ entries = spwd.getspall() ++ if not entries: ++ self.skipTest('empty shadow password database') ++ random_name = entries[0].sp_namp ++ entry = spwd.getspnam(random_name) ++ self.assertIsInstance(entry, spwd.struct_spwd) ++ self.assertEqual(entry.sp_namp, random_name) ++ self.assertEqual(entry.sp_namp, entry[0]) ++ self.assertEqual(entry.sp_namp, entry.sp_nam) ++ self.assertIsInstance(entry.sp_pwdp, str) ++ self.assertEqual(entry.sp_pwdp, entry[1]) ++ self.assertEqual(entry.sp_pwdp, entry.sp_pwd) ++ self.assertIsInstance(entry.sp_lstchg, int) ++ self.assertEqual(entry.sp_lstchg, entry[2]) ++ self.assertIsInstance(entry.sp_min, int) ++ self.assertEqual(entry.sp_min, entry[3]) ++ self.assertIsInstance(entry.sp_max, int) ++ self.assertEqual(entry.sp_max, entry[4]) ++ self.assertIsInstance(entry.sp_warn, int) ++ self.assertEqual(entry.sp_warn, entry[5]) ++ self.assertIsInstance(entry.sp_inact, int) ++ self.assertEqual(entry.sp_inact, entry[6]) ++ self.assertIsInstance(entry.sp_expire, int) ++ self.assertEqual(entry.sp_expire, entry[7]) ++ self.assertIsInstance(entry.sp_flag, int) ++ self.assertEqual(entry.sp_flag, entry[8]) ++ with self.assertRaises(KeyError) as cx: ++ spwd.getspnam('invalid user name') ++ self.assertEqual(str(cx.exception), "'getspnam(): name not found'") ++ self.assertRaises(TypeError, spwd.getspnam) ++ self.assertRaises(TypeError, spwd.getspnam, 0) ++ self.assertRaises(TypeError, spwd.getspnam, random_name, 0) ++ try: ++ bytes_name = os.fsencode(random_name) ++ except UnicodeEncodeError: ++ pass ++ else: ++ self.assertRaises(TypeError, spwd.getspnam, bytes_name) ++ ++ ++if __name__ == "__main__": ++ unittest.main() +diff -r c0e311e010fc Lib/test/test_ssl.py +--- a/Lib/test/test_ssl.py ++++ b/Lib/test/test_ssl.py +@@ -281,11 +281,11 @@ + # Some sanity checks follow + # >= 0.9 + self.assertGreaterEqual(n, 0x900000) +- # < 2.0 +- self.assertLess(n, 0x20000000) ++ # < 3.0 ++ self.assertLess(n, 0x30000000) + major, minor, fix, patch, status = t + self.assertGreaterEqual(major, 0) +- self.assertLess(major, 2) ++ self.assertLess(major, 3) + self.assertGreaterEqual(minor, 0) + self.assertLess(minor, 256) + self.assertGreaterEqual(fix, 0) +@@ -294,9 +294,13 @@ + self.assertLessEqual(patch, 26) + self.assertGreaterEqual(status, 0) + self.assertLessEqual(status, 15) +- # Version string as returned by OpenSSL, the format might change +- self.assertTrue(s.startswith("OpenSSL {:d}.{:d}.{:d}".format(major, minor, fix)), +- (s, t)) ++ # Version string as returned by {Open,Libre}SSL, the format might change ++ if "LibreSSL" in s: ++ self.assertTrue(s.startswith("LibreSSL {:d}.{:d}".format(major, minor)), ++ (s, t)) ++ else: ++ self.assertTrue(s.startswith("OpenSSL {:d}.{:d}.{:d}".format(major, minor, fix)), ++ (s, t)) + + @support.cpython_only + def test_refcycle(self): +diff -r c0e311e010fc Lib/test/test_subprocess.py +--- a/Lib/test/test_subprocess.py ++++ b/Lib/test/test_subprocess.py +@@ -1926,6 +1926,86 @@ + "Some fds not in pass_fds were left open") + self.assertIn(1, remaining_fds, "Subprocess failed") + ++ ++ @unittest.skipIf(sys.platform.startswith("freebsd") and ++ os.stat("/dev").st_dev == os.stat("/dev/fd").st_dev, ++ "Requires fdescfs mounted on /dev/fd on FreeBSD.") ++ def test_close_fds_when_max_fd_is_lowered(self): ++ """Confirm that issue21618 is fixed (may fail under valgrind).""" ++ fd_status = support.findfile("fd_status.py", subdir="subprocessdata") ++ ++ # This launches the meat of the test in a child process to ++ # avoid messing with the larger unittest processes maximum ++ # number of file descriptors. ++ # This process launches: ++ # +--> Process that lowers its RLIMIT_NOFILE aftr setting up ++ # a bunch of high open fds above the new lower rlimit. ++ # Those are reported via stdout before launching a new ++ # process with close_fds=False to run the actual test: ++ # +--> The TEST: This one launches a fd_status.py ++ # subprocess with close_fds=True so we can find out if ++ # any of the fds above the lowered rlimit are still open. ++ p = subprocess.Popen([sys.executable, '-c', textwrap.dedent( ++ ''' ++ import os, resource, subprocess, sys, textwrap ++ open_fds = set() ++ # Add a bunch more fds to pass down. ++ for _ in range(40): ++ fd = os.open("/dev/null", os.O_RDONLY) ++ open_fds.add(fd) ++ ++ # Leave a two pairs of low ones available for use by the ++ # internal child error pipe and the stdout pipe. ++ # We also leave 10 more open as some Python buildbots run into ++ # "too many open files" errors during the test if we do not. ++ for fd in sorted(open_fds)[:14]: ++ os.close(fd) ++ open_fds.remove(fd) ++ ++ for fd in open_fds: ++ #self.addCleanup(os.close, fd) ++ os.set_inheritable(fd, True) ++ ++ max_fd_open = max(open_fds) ++ ++ # Communicate the open_fds to the parent unittest.TestCase process. ++ print(','.join(map(str, sorted(open_fds)))) ++ sys.stdout.flush() ++ ++ rlim_cur, rlim_max = resource.getrlimit(resource.RLIMIT_NOFILE) ++ try: ++ # 29 is lower than the highest fds we are leaving open. ++ resource.setrlimit(resource.RLIMIT_NOFILE, (29, rlim_max)) ++ # Launch a new Python interpreter with our low fd rlim_cur that ++ # inherits open fds above that limit. It then uses subprocess ++ # with close_fds=True to get a report of open fds in the child. ++ # An explicit list of fds to check is passed to fd_status.py as ++ # letting fd_status rely on its default logic would miss the ++ # fds above rlim_cur as it normally only checks up to that limit. ++ subprocess.Popen( ++ [sys.executable, '-c', ++ textwrap.dedent(""" ++ import subprocess, sys ++ subprocess.Popen([sys.executable, %r] + ++ [str(x) for x in range({max_fd})], ++ close_fds=True).wait() ++ """.format(max_fd=max_fd_open+1))], ++ close_fds=False).wait() ++ finally: ++ resource.setrlimit(resource.RLIMIT_NOFILE, (rlim_cur, rlim_max)) ++ ''' % fd_status)], stdout=subprocess.PIPE) ++ ++ output, unused_stderr = p.communicate() ++ output_lines = output.splitlines() ++ self.assertEqual(len(output_lines), 2, ++ msg="expected exactly two lines of output:\n%r" % output) ++ opened_fds = set(map(int, output_lines[0].strip().split(b','))) ++ remaining_fds = set(map(int, output_lines[1].strip().split(b','))) ++ ++ self.assertFalse(remaining_fds & opened_fds, ++ msg="Some fds were left open.") ++ ++ + # Mac OS X Tiger (10.4) has a kernel bug: sometimes, the file + # descriptor of a pipe closed in the parent process is valid in the + # child process according to fstat(), but the mode of the file +diff -r c0e311e010fc Lib/test/test_sys.py +--- a/Lib/test/test_sys.py ++++ b/Lib/test/test_sys.py +@@ -657,6 +657,7 @@ + self.assertEqual(sys.implementation.name, + sys.implementation.name.lower()) + ++ @test.support.cpython_only + def test_debugmallocstats(self): + # Test sys._debugmallocstats() + from test.script_helper import assert_python_ok +diff -r c0e311e010fc Lib/test/test_tarfile.py +--- a/Lib/test/test_tarfile.py ++++ b/Lib/test/test_tarfile.py +@@ -352,10 +352,16 @@ + + + class MiscReadTestBase(CommonReadTest): ++ def requires_name_attribute(self): ++ pass ++ + def test_no_name_argument(self): ++ self.requires_name_attribute() + with open(self.tarname, "rb") as fobj: +- tar = tarfile.open(fileobj=fobj, mode=self.mode) +- self.assertEqual(tar.name, os.path.abspath(fobj.name)) ++ self.assertIsInstance(fobj.name, str) ++ with tarfile.open(fileobj=fobj, mode=self.mode) as tar: ++ self.assertIsInstance(tar.name, str) ++ self.assertEqual(tar.name, os.path.abspath(fobj.name)) + + def test_no_name_attribute(self): + with open(self.tarname, "rb") as fobj: +@@ -363,7 +369,7 @@ + fobj = io.BytesIO(data) + self.assertRaises(AttributeError, getattr, fobj, "name") + tar = tarfile.open(fileobj=fobj, mode=self.mode) +- self.assertEqual(tar.name, None) ++ self.assertIsNone(tar.name) + + def test_empty_name_attribute(self): + with open(self.tarname, "rb") as fobj: +@@ -371,7 +377,25 @@ + fobj = io.BytesIO(data) + fobj.name = "" + with tarfile.open(fileobj=fobj, mode=self.mode) as tar: +- self.assertEqual(tar.name, None) ++ self.assertIsNone(tar.name) ++ ++ def test_int_name_attribute(self): ++ # Issue 21044: tarfile.open() should handle fileobj with an integer ++ # 'name' attribute. ++ fd = os.open(self.tarname, os.O_RDONLY) ++ with open(fd, 'rb') as fobj: ++ self.assertIsInstance(fobj.name, int) ++ with tarfile.open(fileobj=fobj, mode=self.mode) as tar: ++ self.assertIsNone(tar.name) ++ ++ def test_bytes_name_attribute(self): ++ self.requires_name_attribute() ++ tarname = os.fsencode(self.tarname) ++ with open(tarname, 'rb') as fobj: ++ self.assertIsInstance(fobj.name, bytes) ++ with tarfile.open(fileobj=fobj, mode=self.mode) as tar: ++ self.assertIsInstance(tar.name, bytes) ++ self.assertEqual(tar.name, os.path.abspath(fobj.name)) + + def test_illegal_mode_arg(self): + with open(tmpname, 'wb'): +@@ -549,11 +573,11 @@ + pass + + class Bz2MiscReadTest(Bz2Test, MiscReadTestBase, unittest.TestCase): +- def test_no_name_argument(self): ++ def requires_name_attribute(self): + self.skipTest("BZ2File have no name attribute") + + class LzmaMiscReadTest(LzmaTest, MiscReadTestBase, unittest.TestCase): +- def test_no_name_argument(self): ++ def requires_name_attribute(self): + self.skipTest("LZMAFile have no name attribute") + + +diff -r c0e311e010fc Lib/test/test_tcl.py +--- a/Lib/test/test_tcl.py ++++ b/Lib/test/test_tcl.py +@@ -133,6 +133,50 @@ + tcl = self.interp + self.assertRaises(TclError,tcl.unsetvar,'a') + ++ def test_getint(self): ++ tcl = self.interp.tk ++ self.assertEqual(tcl.getint(' 42 '), 42) ++ self.assertEqual(tcl.getint(42), 42) ++ self.assertRaises(TypeError, tcl.getint) ++ self.assertRaises(TypeError, tcl.getint, '42', '10') ++ self.assertRaises(TypeError, tcl.getint, b'42') ++ self.assertRaises(TypeError, tcl.getint, 42.0) ++ self.assertRaises(TclError, tcl.getint, 'a') ++ self.assertRaises((TypeError, ValueError, TclError), ++ tcl.getint, '42\0') ++ self.assertRaises((UnicodeEncodeError, ValueError, TclError), ++ tcl.getint, '42\ud800') ++ ++ def test_getdouble(self): ++ tcl = self.interp.tk ++ self.assertEqual(tcl.getdouble(' 42 '), 42.0) ++ self.assertEqual(tcl.getdouble(' 42.5 '), 42.5) ++ self.assertEqual(tcl.getdouble(42.5), 42.5) ++ self.assertRaises(TypeError, tcl.getdouble) ++ self.assertRaises(TypeError, tcl.getdouble, '42.5', '10') ++ self.assertRaises(TypeError, tcl.getdouble, b'42.5') ++ self.assertRaises(TypeError, tcl.getdouble, 42) ++ self.assertRaises(TclError, tcl.getdouble, 'a') ++ self.assertRaises((TypeError, ValueError, TclError), ++ tcl.getdouble, '42.5\0') ++ self.assertRaises((UnicodeEncodeError, ValueError, TclError), ++ tcl.getdouble, '42.5\ud800') ++ ++ def test_getboolean(self): ++ tcl = self.interp.tk ++ self.assertIs(tcl.getboolean('on'), True) ++ self.assertIs(tcl.getboolean('1'), True) ++ self.assertEqual(tcl.getboolean(42), 42) ++ self.assertRaises(TypeError, tcl.getboolean) ++ self.assertRaises(TypeError, tcl.getboolean, 'on', '1') ++ self.assertRaises(TypeError, tcl.getboolean, b'on') ++ self.assertRaises(TypeError, tcl.getboolean, 1.0) ++ self.assertRaises(TclError, tcl.getboolean, 'a') ++ self.assertRaises((TypeError, ValueError, TclError), ++ tcl.getboolean, 'on\0') ++ self.assertRaises((UnicodeEncodeError, ValueError, TclError), ++ tcl.getboolean, 'on\ud800') ++ + def testEvalFile(self): + tcl = self.interp + with open(support.TESTFN, 'w') as f: +@@ -345,8 +389,12 @@ + self.assertEqual(passValue('str\x00ing'), 'str\x00ing') + self.assertEqual(passValue('str\x00ing\xbd'), 'str\x00ing\xbd') + self.assertEqual(passValue('str\x00ing\u20ac'), 'str\x00ing\u20ac') +- self.assertEqual(passValue(b'str\x00ing'), 'str\x00ing') +- self.assertEqual(passValue(b'str\xc0\x80ing'), 'str\x00ing') ++ self.assertEqual(passValue(b'str\x00ing'), ++ b'str\x00ing' if self.wantobjects else 'str\x00ing') ++ self.assertEqual(passValue(b'str\xc0\x80ing'), ++ b'str\xc0\x80ing' if self.wantobjects else 'str\xc0\x80ing') ++ self.assertEqual(passValue(b'str\xbding'), ++ b'str\xbding' if self.wantobjects else 'str\xbding') + for i in (0, 1, -1, 2**31-1, -2**31): + self.assertEqual(passValue(i), i if self.wantobjects else str(i)) + for f in (0.0, 1.0, -1.0, 1/3, +@@ -362,13 +410,13 @@ + self.assertEqual(passValue(float('inf')), float('inf')) + self.assertEqual(passValue(-float('inf')), -float('inf')) + else: +- f = float(passValue(float('nan'))) +- self.assertNotEqual(f, f) + self.assertEqual(float(passValue(float('inf'))), float('inf')) + self.assertEqual(float(passValue(-float('inf'))), -float('inf')) ++ # XXX NaN representation can be not parsable by float() + self.assertEqual(passValue((1, '2', (3.4,))), + (1, '2', (3.4,)) if self.wantobjects else '1 2 3.4') + ++ @unittest.skipIf(sys.platform.startswith("aix"), 'Issue #21951: crashes on AIX') + def test_user_command(self): + result = None + def testfunc(arg): +@@ -387,9 +435,6 @@ + expected = float(expected) + self.assertAlmostEqual(float(actual), expected, + delta=abs(expected) * 1e-10) +- def nan_eq(actual, expected): +- actual = float(actual) +- self.assertNotEqual(actual, actual) + + check(True, '1') + check(False, '0') +@@ -397,12 +442,14 @@ + check('string\xbd', 'string\xbd') + check('string\u20ac', 'string\u20ac') + check(b'string', 'string') +- check(b'string\xe2\x82\xac', 'string\u20ac') ++ check(b'string\xe2\x82\xac', 'string\xe2\x82\xac') ++ check(b'string\xbd', 'string\xbd') + check('str\x00ing', 'str\x00ing') + check('str\x00ing\xbd', 'str\x00ing\xbd') + check('str\x00ing\u20ac', 'str\x00ing\u20ac') +- check(b'str\xc0\x80ing', 'str\x00ing') +- check(b'str\xc0\x80ing\xe2\x82\xac', 'str\x00ing\u20ac') ++ check(b'str\x00ing', 'str\x00ing') ++ check(b'str\xc0\x80ing', 'str\xc0\x80ing') ++ check(b'str\xc0\x80ing\xe2\x82\xac', 'str\xc0\x80ing\xe2\x82\xac') + for i in (0, 1, -1, 2**31-1, -2**31): + check(i, str(i)) + for f in (0.0, 1.0, -1.0): +@@ -412,7 +459,7 @@ + check(f, f, eq=float_eq) + check(float('inf'), 'Inf', eq=float_eq) + check(-float('inf'), '-Inf', eq=float_eq) +- check(float('nan'), 'NaN', eq=nan_eq) ++ # XXX NaN representation can be not parsable by float() + check((), '') + check((1, (2,), (3, 4), '5 6', ()), '1 2 {3 4} {5 6} {}') + +@@ -447,9 +494,9 @@ + if tcl_version >= (8, 5): + if not self.wantobjects or get_tk_patchlevel() < (8, 5, 5): + # Before 8.5.5 dicts were converted to lists through string +- expected = ('12', '\u20ac', '\u20ac', '3.4') ++ expected = ('12', '\u20ac', '\xe2\x82\xac', '3.4') + else: +- expected = (12, '\u20ac', '\u20ac', (3.4,)) ++ expected = (12, '\u20ac', b'\xe2\x82\xac', (3.4,)) + testcases += [ + (call('dict', 'create', 12, '\u20ac', b'\xe2\x82\xac', (3.4,)), + expected), +@@ -494,9 +541,9 @@ + if tcl_version >= (8, 5): + if not self.wantobjects or get_tk_patchlevel() < (8, 5, 5): + # Before 8.5.5 dicts were converted to lists through string +- expected = ('12', '\u20ac', '\u20ac', '3.4') ++ expected = ('12', '\u20ac', '\xe2\x82\xac', '3.4') + else: +- expected = (12, '\u20ac', '\u20ac', (3.4,)) ++ expected = (12, '\u20ac', b'\xe2\x82\xac', (3.4,)) + testcases += [ + (call('dict', 'create', 12, '\u20ac', b'\xe2\x82\xac', (3.4,)), + expected), +@@ -513,10 +560,35 @@ + @support.cpython_only + @unittest.skipUnless(INT_MAX < PY_SSIZE_T_MAX, "needs UINT_MAX < SIZE_MAX") + @support.bigmemtest(size=INT_MAX + 1, memuse=5, dry_run=False) +- def test_huge_string(self, size): ++ def test_huge_string_call(self, size): + value = ' ' * size + self.assertRaises(OverflowError, self.interp.call, 'set', '_', value) + ++ @support.cpython_only ++ @unittest.skipUnless(INT_MAX < PY_SSIZE_T_MAX, "needs UINT_MAX < SIZE_MAX") ++ @support.bigmemtest(size=INT_MAX + 1, memuse=9, dry_run=False) ++ def test_huge_string_builtins(self, size): ++ value = '1' + ' ' * size ++ self.assertRaises(OverflowError, self.interp.tk.getint, value) ++ self.assertRaises(OverflowError, self.interp.tk.getdouble, value) ++ self.assertRaises(OverflowError, self.interp.tk.getboolean, value) ++ self.assertRaises(OverflowError, self.interp.eval, value) ++ self.assertRaises(OverflowError, self.interp.evalfile, value) ++ self.assertRaises(OverflowError, self.interp.record, value) ++ self.assertRaises(OverflowError, self.interp.adderrorinfo, value) ++ self.assertRaises(OverflowError, self.interp.setvar, value, 'x', 'a') ++ self.assertRaises(OverflowError, self.interp.setvar, 'x', value, 'a') ++ self.assertRaises(OverflowError, self.interp.unsetvar, value) ++ self.assertRaises(OverflowError, self.interp.unsetvar, 'x', value) ++ self.assertRaises(OverflowError, self.interp.adderrorinfo, value) ++ self.assertRaises(OverflowError, self.interp.exprstring, value) ++ self.assertRaises(OverflowError, self.interp.exprlong, value) ++ self.assertRaises(OverflowError, self.interp.exprboolean, value) ++ self.assertRaises(OverflowError, self.interp.splitlist, value) ++ self.assertRaises(OverflowError, self.interp.split, value) ++ self.assertRaises(OverflowError, self.interp.createcommand, value, max) ++ self.assertRaises(OverflowError, self.interp.deletecommand, value) ++ + + def setUpModule(): + if support.verbose: +diff -r c0e311e010fc Lib/test/test_tempfile.py +--- a/Lib/test/test_tempfile.py ++++ b/Lib/test/test_tempfile.py +@@ -762,8 +762,10 @@ + def test_no_leak_fd(self): + # Issue #21058: don't leak file descriptor when io.open() fails + closed = [] ++ os_close = os.close + def close(fd): + closed.append(fd) ++ os_close(fd) + + with mock.patch('os.close', side_effect=close): + with mock.patch('io.open', side_effect=ValueError): +@@ -1076,8 +1078,10 @@ + def test_no_leak_fd(self): + # Issue #21058: don't leak file descriptor when io.open() fails + closed = [] ++ os_close = os.close + def close(fd): + closed.append(fd) ++ os_close(fd) + + with mock.patch('os.close', side_effect=close): + with mock.patch('io.open', side_effect=ValueError): +diff -r c0e311e010fc Lib/test/test_tk.py +--- a/Lib/test/test_tk.py ++++ b/Lib/test/test_tk.py +@@ -10,15 +10,9 @@ + + from tkinter.test import runtktests + +-def test_main(enable_gui=False): +- if enable_gui: +- if support.use_resources is None: +- support.use_resources = ['gui'] +- elif 'gui' not in support.use_resources: +- support.use_resources.append('gui') +- ++def test_main(): + support.run_unittest( + *runtktests.get_tests(text=False, packages=['test_tkinter'])) + + if __name__ == '__main__': +- test_main(enable_gui=True) ++ test_main() +diff -r c0e311e010fc Lib/test/test_tools.py +--- a/Lib/test/test_tools.py ++++ /dev/null +@@ -1,465 +0,0 @@ +-"""Tests for scripts in the Tools directory. +- +-This file contains regression tests for some of the scripts found in the +-Tools directory of a Python checkout or tarball, such as reindent.py. +-""" +- +-import os +-import sys +-import importlib._bootstrap +-import importlib.machinery +-import unittest +-from unittest import mock +-import shutil +-import subprocess +-import sysconfig +-import tempfile +-import textwrap +-from test import support +-from test.script_helper import assert_python_ok, temp_dir +- +-if not sysconfig.is_python_build(): +- # XXX some installers do contain the tools, should we detect that +- # and run the tests in that case too? +- raise unittest.SkipTest('test irrelevant for an installed Python') +- +-basepath = os.path.join(os.path.dirname(os.path.dirname(os.path.dirname(__file__))), +- 'Tools') +-scriptsdir = os.path.join(basepath, 'scripts') +- +- +-class ReindentTests(unittest.TestCase): +- script = os.path.join(scriptsdir, 'reindent.py') +- +- def test_noargs(self): +- assert_python_ok(self.script) +- +- def test_help(self): +- rc, out, err = assert_python_ok(self.script, '-h') +- self.assertEqual(out, b'') +- self.assertGreater(err, b'') +- +- +-class PindentTests(unittest.TestCase): +- script = os.path.join(scriptsdir, 'pindent.py') +- +- def assertFileEqual(self, fn1, fn2): +- with open(fn1) as f1, open(fn2) as f2: +- self.assertEqual(f1.readlines(), f2.readlines()) +- +- def pindent(self, source, *args): +- with subprocess.Popen( +- (sys.executable, self.script) + args, +- stdin=subprocess.PIPE, stdout=subprocess.PIPE, +- universal_newlines=True) as proc: +- out, err = proc.communicate(source) +- self.assertIsNone(err) +- return out +- +- def lstriplines(self, data): +- return '\n'.join(line.lstrip() for line in data.splitlines()) + '\n' +- +- def test_selftest(self): +- self.maxDiff = None +- with temp_dir() as directory: +- data_path = os.path.join(directory, '_test.py') +- with open(self.script) as f: +- closed = f.read() +- with open(data_path, 'w') as f: +- f.write(closed) +- +- rc, out, err = assert_python_ok(self.script, '-d', data_path) +- self.assertEqual(out, b'') +- self.assertEqual(err, b'') +- backup = data_path + '~' +- self.assertTrue(os.path.exists(backup)) +- with open(backup) as f: +- self.assertEqual(f.read(), closed) +- with open(data_path) as f: +- clean = f.read() +- compile(clean, '_test.py', 'exec') +- self.assertEqual(self.pindent(clean, '-c'), closed) +- self.assertEqual(self.pindent(closed, '-d'), clean) +- +- rc, out, err = assert_python_ok(self.script, '-c', data_path) +- self.assertEqual(out, b'') +- self.assertEqual(err, b'') +- with open(backup) as f: +- self.assertEqual(f.read(), clean) +- with open(data_path) as f: +- self.assertEqual(f.read(), closed) +- +- broken = self.lstriplines(closed) +- with open(data_path, 'w') as f: +- f.write(broken) +- rc, out, err = assert_python_ok(self.script, '-r', data_path) +- self.assertEqual(out, b'') +- self.assertEqual(err, b'') +- with open(backup) as f: +- self.assertEqual(f.read(), broken) +- with open(data_path) as f: +- indented = f.read() +- compile(indented, '_test.py', 'exec') +- self.assertEqual(self.pindent(broken, '-r'), indented) +- +- def pindent_test(self, clean, closed): +- self.assertEqual(self.pindent(clean, '-c'), closed) +- self.assertEqual(self.pindent(closed, '-d'), clean) +- broken = self.lstriplines(closed) +- self.assertEqual(self.pindent(broken, '-r', '-e', '-s', '4'), closed) +- +- def test_statements(self): +- clean = textwrap.dedent("""\ +- if a: +- pass +- +- if a: +- pass +- else: +- pass +- +- if a: +- pass +- elif: +- pass +- else: +- pass +- +- while a: +- break +- +- while a: +- break +- else: +- pass +- +- for i in a: +- break +- +- for i in a: +- break +- else: +- pass +- +- try: +- pass +- finally: +- pass +- +- try: +- pass +- except TypeError: +- pass +- except ValueError: +- pass +- else: +- pass +- +- try: +- pass +- except TypeError: +- pass +- except ValueError: +- pass +- finally: +- pass +- +- with a: +- pass +- +- class A: +- pass +- +- def f(): +- pass +- """) +- +- closed = textwrap.dedent("""\ +- if a: +- pass +- # end if +- +- if a: +- pass +- else: +- pass +- # end if +- +- if a: +- pass +- elif: +- pass +- else: +- pass +- # end if +- +- while a: +- break +- # end while +- +- while a: +- break +- else: +- pass +- # end while +- +- for i in a: +- break +- # end for +- +- for i in a: +- break +- else: +- pass +- # end for +- +- try: +- pass +- finally: +- pass +- # end try +- +- try: +- pass +- except TypeError: +- pass +- except ValueError: +- pass +- else: +- pass +- # end try +- +- try: +- pass +- except TypeError: +- pass +- except ValueError: +- pass +- finally: +- pass +- # end try +- +- with a: +- pass +- # end with +- +- class A: +- pass +- # end class A +- +- def f(): +- pass +- # end def f +- """) +- self.pindent_test(clean, closed) +- +- def test_multilevel(self): +- clean = textwrap.dedent("""\ +- def foobar(a, b): +- if a == b: +- a = a+1 +- elif a < b: +- b = b-1 +- if b > a: a = a-1 +- else: +- print 'oops!' +- """) +- closed = textwrap.dedent("""\ +- def foobar(a, b): +- if a == b: +- a = a+1 +- elif a < b: +- b = b-1 +- if b > a: a = a-1 +- # end if +- else: +- print 'oops!' +- # end if +- # end def foobar +- """) +- self.pindent_test(clean, closed) +- +- def test_preserve_indents(self): +- clean = textwrap.dedent("""\ +- if a: +- if b: +- pass +- """) +- closed = textwrap.dedent("""\ +- if a: +- if b: +- pass +- # end if +- # end if +- """) +- self.assertEqual(self.pindent(clean, '-c'), closed) +- self.assertEqual(self.pindent(closed, '-d'), clean) +- broken = self.lstriplines(closed) +- self.assertEqual(self.pindent(broken, '-r', '-e', '-s', '9'), closed) +- clean = textwrap.dedent("""\ +- if a: +- \tif b: +- \t\tpass +- """) +- closed = textwrap.dedent("""\ +- if a: +- \tif b: +- \t\tpass +- \t# end if +- # end if +- """) +- self.assertEqual(self.pindent(clean, '-c'), closed) +- self.assertEqual(self.pindent(closed, '-d'), clean) +- broken = self.lstriplines(closed) +- self.assertEqual(self.pindent(broken, '-r'), closed) +- +- def test_escaped_newline(self): +- clean = textwrap.dedent("""\ +- class\\ +- \\ +- A: +- def\ +- \\ +- f: +- pass +- """) +- closed = textwrap.dedent("""\ +- class\\ +- \\ +- A: +- def\ +- \\ +- f: +- pass +- # end def f +- # end class A +- """) +- self.assertEqual(self.pindent(clean, '-c'), closed) +- self.assertEqual(self.pindent(closed, '-d'), clean) +- +- def test_empty_line(self): +- clean = textwrap.dedent("""\ +- if a: +- +- pass +- """) +- closed = textwrap.dedent("""\ +- if a: +- +- pass +- # end if +- """) +- self.pindent_test(clean, closed) +- +- def test_oneline(self): +- clean = textwrap.dedent("""\ +- if a: pass +- """) +- closed = textwrap.dedent("""\ +- if a: pass +- # end if +- """) +- self.pindent_test(clean, closed) +- +- +-class TestSundryScripts(unittest.TestCase): +- # At least make sure the rest don't have syntax errors. When tests are +- # added for a script it should be added to the whitelist below. +- +- # scripts that have independent tests. +- whitelist = ['reindent.py', 'pdeps.py', 'gprof2html'] +- # scripts that can't be imported without running +- blacklist = ['make_ctype.py'] +- # scripts that use windows-only modules +- windows_only = ['win_add2path.py'] +- # blacklisted for other reasons +- other = ['analyze_dxp.py'] +- +- skiplist = blacklist + whitelist + windows_only + other +- +- def setUp(self): +- cm = support.DirsOnSysPath(scriptsdir) +- cm.__enter__() +- self.addCleanup(cm.__exit__) +- +- def test_sundry(self): +- for fn in os.listdir(scriptsdir): +- if fn.endswith('.py') and fn not in self.skiplist: +- __import__(fn[:-3]) +- +- @unittest.skipIf(sys.platform != "win32", "Windows-only test") +- def test_sundry_windows(self): +- for fn in self.windows_only: +- __import__(fn[:-3]) +- +- @unittest.skipIf(not support.threading, "test requires _thread module") +- def test_analyze_dxp_import(self): +- if hasattr(sys, 'getdxp'): +- import analyze_dxp +- else: +- with self.assertRaises(RuntimeError): +- import analyze_dxp +- +- +-class PdepsTests(unittest.TestCase): +- +- @classmethod +- def setUpClass(self): +- path = os.path.join(scriptsdir, 'pdeps.py') +- spec = importlib.util.spec_from_file_location('pdeps', path) +- self.pdeps = importlib._bootstrap._SpecMethods(spec).load() +- +- @classmethod +- def tearDownClass(self): +- if 'pdeps' in sys.modules: +- del sys.modules['pdeps'] +- +- def test_process_errors(self): +- # Issue #14492: m_import.match(line) can be None. +- with tempfile.TemporaryDirectory() as tmpdir: +- fn = os.path.join(tmpdir, 'foo') +- with open(fn, 'w') as stream: +- stream.write("#!/this/will/fail") +- self.pdeps.process(fn, {}) +- +- def test_inverse_attribute_error(self): +- # Issue #14492: this used to fail with an AttributeError. +- self.pdeps.inverse({'a': []}) +- +- +-class Gprof2htmlTests(unittest.TestCase): +- +- def setUp(self): +- path = os.path.join(scriptsdir, 'gprof2html.py') +- spec = importlib.util.spec_from_file_location('gprof2html', path) +- self.gprof = importlib._bootstrap._SpecMethods(spec).load() +- oldargv = sys.argv +- def fixup(): +- sys.argv = oldargv +- self.addCleanup(fixup) +- sys.argv = [] +- +- def test_gprof(self): +- # Issue #14508: this used to fail with an NameError. +- with mock.patch.object(self.gprof, 'webbrowser') as wmock, \ +- tempfile.TemporaryDirectory() as tmpdir: +- fn = os.path.join(tmpdir, 'abc') +- open(fn, 'w').close() +- sys.argv = ['gprof2html', fn] +- self.gprof.main() +- self.assertTrue(wmock.open.called) +- +- +-# Run the tests in Tools/parser/test_unparse.py +-with support.DirsOnSysPath(os.path.join(basepath, 'parser')): +- from test_unparse import UnparseTestCase +- from test_unparse import DirectoryTestCase +- +- +-def test_main(): +- support.run_unittest(*[obj for obj in globals().values() +- if isinstance(obj, type)]) +- +- +-if __name__ == '__main__': +- unittest.main() +diff -r c0e311e010fc Lib/test/test_tools/__init__.py +--- /dev/null ++++ b/Lib/test/test_tools/__init__.py +@@ -0,0 +1,25 @@ ++"""Support functions for testing scripts in the Tools directory.""" ++import os ++import unittest ++import importlib ++from test import support ++from fnmatch import fnmatch ++ ++basepath = os.path.dirname( # ++ os.path.dirname( # Lib ++ os.path.dirname( # test ++ os.path.dirname(__file__)))) # test_tools ++ ++toolsdir = os.path.join(basepath, 'Tools') ++scriptsdir = os.path.join(toolsdir, 'scripts') ++ ++def skip_if_missing(): ++ if not os.path.isdir(scriptsdir): ++ raise unittest.SkipTest('scripts directory could not be found') ++ ++def import_tool(toolname): ++ with support.DirsOnSysPath(scriptsdir): ++ return importlib.import_module(toolname) ++ ++def load_tests(*args): ++ return support.load_package_tests(os.path.dirname(__file__), *args) +diff -r c0e311e010fc Lib/test/test_tools/__main__.py +--- /dev/null ++++ b/Lib/test/test_tools/__main__.py +@@ -0,0 +1,4 @@ ++from test.test_tools import load_tests ++import unittest ++ ++unittest.main() +diff -r c0e311e010fc Lib/test/test_tools/test_gprof2html.py +--- /dev/null ++++ b/Lib/test/test_tools/test_gprof2html.py +@@ -0,0 +1,36 @@ ++"""Tests for the gprof2html script in the Tools directory.""" ++ ++import os ++import sys ++import importlib ++import unittest ++from unittest import mock ++import tempfile ++ ++from test.test_tools import scriptsdir, skip_if_missing, import_tool ++ ++skip_if_missing() ++ ++class Gprof2htmlTests(unittest.TestCase): ++ ++ def setUp(self): ++ self.gprof = import_tool('gprof2html') ++ oldargv = sys.argv ++ def fixup(): ++ sys.argv = oldargv ++ self.addCleanup(fixup) ++ sys.argv = [] ++ ++ def test_gprof(self): ++ # Issue #14508: this used to fail with an NameError. ++ with mock.patch.object(self.gprof, 'webbrowser') as wmock, \ ++ tempfile.TemporaryDirectory() as tmpdir: ++ fn = os.path.join(tmpdir, 'abc') ++ open(fn, 'w').close() ++ sys.argv = ['gprof2html', fn] ++ self.gprof.main() ++ self.assertTrue(wmock.open.called) ++ ++ ++if __name__ == '__main__': ++ unittest.main() +diff -r c0e311e010fc Lib/test/test_tools/test_md5sum.py +--- /dev/null ++++ b/Lib/test/test_tools/test_md5sum.py +@@ -0,0 +1,77 @@ ++"""Tests for the md5sum script in the Tools directory.""" ++ ++import os ++import sys ++import unittest ++from test import support ++from test.script_helper import assert_python_ok, assert_python_failure ++ ++from test.test_tools import scriptsdir, import_tool, skip_if_missing ++ ++skip_if_missing() ++ ++class MD5SumTests(unittest.TestCase): ++ @classmethod ++ def setUpClass(cls): ++ cls.script = os.path.join(scriptsdir, 'md5sum.py') ++ os.mkdir(support.TESTFN) ++ cls.fodder = os.path.join(support.TESTFN, 'md5sum.fodder') ++ with open(cls.fodder, 'wb') as f: ++ f.write(b'md5sum\r\ntest file\r\n') ++ cls.fodder_md5 = b'd38dae2eb1ab346a292ef6850f9e1a0d' ++ cls.fodder_textmode_md5 = b'a8b07894e2ca3f2a4c3094065fa6e0a5' ++ ++ @classmethod ++ def tearDownClass(cls): ++ support.rmtree(support.TESTFN) ++ ++ def test_noargs(self): ++ rc, out, err = assert_python_ok(self.script) ++ self.assertEqual(rc, 0) ++ self.assertTrue( ++ out.startswith(b'd41d8cd98f00b204e9800998ecf8427e ')) ++ self.assertFalse(err) ++ ++ def test_checksum_fodder(self): ++ rc, out, err = assert_python_ok(self.script, self.fodder) ++ self.assertEqual(rc, 0) ++ self.assertTrue(out.startswith(self.fodder_md5)) ++ for part in self.fodder.split(os.path.sep): ++ self.assertIn(part.encode(), out) ++ self.assertFalse(err) ++ ++ def test_dash_l(self): ++ rc, out, err = assert_python_ok(self.script, '-l', self.fodder) ++ self.assertEqual(rc, 0) ++ self.assertIn(self.fodder_md5, out) ++ parts = self.fodder.split(os.path.sep) ++ self.assertIn(parts[-1].encode(), out) ++ self.assertNotIn(parts[-2].encode(), out) ++ ++ def test_dash_t(self): ++ rc, out, err = assert_python_ok(self.script, '-t', self.fodder) ++ self.assertEqual(rc, 0) ++ self.assertTrue(out.startswith(self.fodder_textmode_md5)) ++ self.assertNotIn(self.fodder_md5, out) ++ ++ def test_dash_s(self): ++ rc, out, err = assert_python_ok(self.script, '-s', '512', self.fodder) ++ self.assertEqual(rc, 0) ++ self.assertIn(self.fodder_md5, out) ++ ++ def test_multiple_files(self): ++ rc, out, err = assert_python_ok(self.script, self.fodder, self.fodder) ++ self.assertEqual(rc, 0) ++ lines = out.splitlines() ++ self.assertEqual(len(lines), 2) ++ self.assertEqual(*lines) ++ ++ def test_usage(self): ++ rc, out, err = assert_python_failure(self.script, '-h') ++ self.assertEqual(rc, 2) ++ self.assertEqual(out, b'') ++ self.assertGreater(err, b'') ++ ++ ++if __name__ == '__main__': ++ unittest.main() +diff -r c0e311e010fc Lib/test/test_tools/test_pdeps.py +--- /dev/null ++++ b/Lib/test/test_tools/test_pdeps.py +@@ -0,0 +1,34 @@ ++"""Tests for the pdeps script in the Tools directory.""" ++ ++import os ++import sys ++import unittest ++import tempfile ++from test import support ++ ++from test.test_tools import scriptsdir, skip_if_missing, import_tool ++ ++skip_if_missing() ++ ++ ++class PdepsTests(unittest.TestCase): ++ ++ @classmethod ++ def setUpClass(self): ++ self.pdeps = import_tool('pdeps') ++ ++ def test_process_errors(self): ++ # Issue #14492: m_import.match(line) can be None. ++ with tempfile.TemporaryDirectory() as tmpdir: ++ fn = os.path.join(tmpdir, 'foo') ++ with open(fn, 'w') as stream: ++ stream.write("#!/this/will/fail") ++ self.pdeps.process(fn, {}) ++ ++ def test_inverse_attribute_error(self): ++ # Issue #14492: this used to fail with an AttributeError. ++ self.pdeps.inverse({'a': []}) ++ ++ ++if __name__ == '__main__': ++ unittest.main() +diff -r c0e311e010fc Lib/test/test_tools/test_pindent.py +--- /dev/null ++++ b/Lib/test/test_tools/test_pindent.py +@@ -0,0 +1,339 @@ ++"""Tests for the pindent script in the Tools directory.""" ++ ++import os ++import sys ++import unittest ++import subprocess ++import textwrap ++from test import support ++from test.script_helper import assert_python_ok ++ ++from test.test_tools import scriptsdir, skip_if_missing ++ ++skip_if_missing() ++ ++ ++class PindentTests(unittest.TestCase): ++ script = os.path.join(scriptsdir, 'pindent.py') ++ ++ def assertFileEqual(self, fn1, fn2): ++ with open(fn1) as f1, open(fn2) as f2: ++ self.assertEqual(f1.readlines(), f2.readlines()) ++ ++ def pindent(self, source, *args): ++ with subprocess.Popen( ++ (sys.executable, self.script) + args, ++ stdin=subprocess.PIPE, stdout=subprocess.PIPE, ++ universal_newlines=True) as proc: ++ out, err = proc.communicate(source) ++ self.assertIsNone(err) ++ return out ++ ++ def lstriplines(self, data): ++ return '\n'.join(line.lstrip() for line in data.splitlines()) + '\n' ++ ++ def test_selftest(self): ++ self.maxDiff = None ++ with support.temp_dir() as directory: ++ data_path = os.path.join(directory, '_test.py') ++ with open(self.script) as f: ++ closed = f.read() ++ with open(data_path, 'w') as f: ++ f.write(closed) ++ ++ rc, out, err = assert_python_ok(self.script, '-d', data_path) ++ self.assertEqual(out, b'') ++ self.assertEqual(err, b'') ++ backup = data_path + '~' ++ self.assertTrue(os.path.exists(backup)) ++ with open(backup) as f: ++ self.assertEqual(f.read(), closed) ++ with open(data_path) as f: ++ clean = f.read() ++ compile(clean, '_test.py', 'exec') ++ self.assertEqual(self.pindent(clean, '-c'), closed) ++ self.assertEqual(self.pindent(closed, '-d'), clean) ++ ++ rc, out, err = assert_python_ok(self.script, '-c', data_path) ++ self.assertEqual(out, b'') ++ self.assertEqual(err, b'') ++ with open(backup) as f: ++ self.assertEqual(f.read(), clean) ++ with open(data_path) as f: ++ self.assertEqual(f.read(), closed) ++ ++ broken = self.lstriplines(closed) ++ with open(data_path, 'w') as f: ++ f.write(broken) ++ rc, out, err = assert_python_ok(self.script, '-r', data_path) ++ self.assertEqual(out, b'') ++ self.assertEqual(err, b'') ++ with open(backup) as f: ++ self.assertEqual(f.read(), broken) ++ with open(data_path) as f: ++ indented = f.read() ++ compile(indented, '_test.py', 'exec') ++ self.assertEqual(self.pindent(broken, '-r'), indented) ++ ++ def pindent_test(self, clean, closed): ++ self.assertEqual(self.pindent(clean, '-c'), closed) ++ self.assertEqual(self.pindent(closed, '-d'), clean) ++ broken = self.lstriplines(closed) ++ self.assertEqual(self.pindent(broken, '-r', '-e', '-s', '4'), closed) ++ ++ def test_statements(self): ++ clean = textwrap.dedent("""\ ++ if a: ++ pass ++ ++ if a: ++ pass ++ else: ++ pass ++ ++ if a: ++ pass ++ elif: ++ pass ++ else: ++ pass ++ ++ while a: ++ break ++ ++ while a: ++ break ++ else: ++ pass ++ ++ for i in a: ++ break ++ ++ for i in a: ++ break ++ else: ++ pass ++ ++ try: ++ pass ++ finally: ++ pass ++ ++ try: ++ pass ++ except TypeError: ++ pass ++ except ValueError: ++ pass ++ else: ++ pass ++ ++ try: ++ pass ++ except TypeError: ++ pass ++ except ValueError: ++ pass ++ finally: ++ pass ++ ++ with a: ++ pass ++ ++ class A: ++ pass ++ ++ def f(): ++ pass ++ """) ++ ++ closed = textwrap.dedent("""\ ++ if a: ++ pass ++ # end if ++ ++ if a: ++ pass ++ else: ++ pass ++ # end if ++ ++ if a: ++ pass ++ elif: ++ pass ++ else: ++ pass ++ # end if ++ ++ while a: ++ break ++ # end while ++ ++ while a: ++ break ++ else: ++ pass ++ # end while ++ ++ for i in a: ++ break ++ # end for ++ ++ for i in a: ++ break ++ else: ++ pass ++ # end for ++ ++ try: ++ pass ++ finally: ++ pass ++ # end try ++ ++ try: ++ pass ++ except TypeError: ++ pass ++ except ValueError: ++ pass ++ else: ++ pass ++ # end try ++ ++ try: ++ pass ++ except TypeError: ++ pass ++ except ValueError: ++ pass ++ finally: ++ pass ++ # end try ++ ++ with a: ++ pass ++ # end with ++ ++ class A: ++ pass ++ # end class A ++ ++ def f(): ++ pass ++ # end def f ++ """) ++ self.pindent_test(clean, closed) ++ ++ def test_multilevel(self): ++ clean = textwrap.dedent("""\ ++ def foobar(a, b): ++ if a == b: ++ a = a+1 ++ elif a < b: ++ b = b-1 ++ if b > a: a = a-1 ++ else: ++ print 'oops!' ++ """) ++ closed = textwrap.dedent("""\ ++ def foobar(a, b): ++ if a == b: ++ a = a+1 ++ elif a < b: ++ b = b-1 ++ if b > a: a = a-1 ++ # end if ++ else: ++ print 'oops!' ++ # end if ++ # end def foobar ++ """) ++ self.pindent_test(clean, closed) ++ ++ def test_preserve_indents(self): ++ clean = textwrap.dedent("""\ ++ if a: ++ if b: ++ pass ++ """) ++ closed = textwrap.dedent("""\ ++ if a: ++ if b: ++ pass ++ # end if ++ # end if ++ """) ++ self.assertEqual(self.pindent(clean, '-c'), closed) ++ self.assertEqual(self.pindent(closed, '-d'), clean) ++ broken = self.lstriplines(closed) ++ self.assertEqual(self.pindent(broken, '-r', '-e', '-s', '9'), closed) ++ clean = textwrap.dedent("""\ ++ if a: ++ \tif b: ++ \t\tpass ++ """) ++ closed = textwrap.dedent("""\ ++ if a: ++ \tif b: ++ \t\tpass ++ \t# end if ++ # end if ++ """) ++ self.assertEqual(self.pindent(clean, '-c'), closed) ++ self.assertEqual(self.pindent(closed, '-d'), clean) ++ broken = self.lstriplines(closed) ++ self.assertEqual(self.pindent(broken, '-r'), closed) ++ ++ def test_escaped_newline(self): ++ clean = textwrap.dedent("""\ ++ class\\ ++ \\ ++ A: ++ def\ ++ \\ ++ f: ++ pass ++ """) ++ closed = textwrap.dedent("""\ ++ class\\ ++ \\ ++ A: ++ def\ ++ \\ ++ f: ++ pass ++ # end def f ++ # end class A ++ """) ++ self.assertEqual(self.pindent(clean, '-c'), closed) ++ self.assertEqual(self.pindent(closed, '-d'), clean) ++ ++ def test_empty_line(self): ++ clean = textwrap.dedent("""\ ++ if a: ++ ++ pass ++ """) ++ closed = textwrap.dedent("""\ ++ if a: ++ ++ pass ++ # end if ++ """) ++ self.pindent_test(clean, closed) ++ ++ def test_oneline(self): ++ clean = textwrap.dedent("""\ ++ if a: pass ++ """) ++ closed = textwrap.dedent("""\ ++ if a: pass ++ # end if ++ """) ++ self.pindent_test(clean, closed) ++ ++ ++if __name__ == '__main__': ++ unittest.main() +diff -r c0e311e010fc Lib/test/test_tools/test_reindent.py +--- /dev/null ++++ b/Lib/test/test_tools/test_reindent.py +@@ -0,0 +1,28 @@ ++"""Tests for scripts in the Tools directory. ++ ++This file contains regression tests for some of the scripts found in the ++Tools directory of a Python checkout or tarball, such as reindent.py. ++""" ++ ++import os ++import unittest ++from test.script_helper import assert_python_ok ++ ++from test.test_tools import scriptsdir, skip_if_missing ++ ++skip_if_missing() ++ ++class ReindentTests(unittest.TestCase): ++ script = os.path.join(scriptsdir, 'reindent.py') ++ ++ def test_noargs(self): ++ assert_python_ok(self.script) ++ ++ def test_help(self): ++ rc, out, err = assert_python_ok(self.script, '-h') ++ self.assertEqual(out, b'') ++ self.assertGreater(err, b'') ++ ++ ++if __name__ == '__main__': ++ unittest.main() +diff -r c0e311e010fc Lib/test/test_tools/test_sundry.py +--- /dev/null ++++ b/Lib/test/test_tools/test_sundry.py +@@ -0,0 +1,53 @@ ++"""Tests for scripts in the Tools directory. ++ ++This file contains extremely basic regression tests for the scripts found in ++the Tools directory of a Python checkout or tarball which don't have separate ++tests of their own, such as h2py.py. ++""" ++ ++import os ++import sys ++import unittest ++from test import support ++ ++from test.test_tools import scriptsdir, import_tool, skip_if_missing ++ ++skip_if_missing() ++ ++class TestSundryScripts(unittest.TestCase): ++ # At least make sure the rest don't have syntax errors. When tests are ++ # added for a script it should be added to the whitelist below. ++ ++ # scripts that have independent tests. ++ whitelist = ['reindent', 'pdeps', 'gprof2html', 'md5sum'] ++ # scripts that can't be imported without running ++ blacklist = ['make_ctype'] ++ # scripts that use windows-only modules ++ windows_only = ['win_add2path'] ++ # blacklisted for other reasons ++ other = ['analyze_dxp'] ++ ++ skiplist = blacklist + whitelist + windows_only + other ++ ++ def test_sundry(self): ++ for fn in os.listdir(scriptsdir): ++ name = fn[:-3] ++ if fn.endswith('.py') and name not in self.skiplist: ++ import_tool(name) ++ ++ @unittest.skipIf(sys.platform != "win32", "Windows-only test") ++ def test_sundry_windows(self): ++ for name in self.windows_only: ++ import_tool(name) ++ ++ @unittest.skipIf(not support.threading, "test requires _thread module") ++ def test_analyze_dxp_import(self): ++ if hasattr(sys, 'getdxp'): ++ import_tool('analyze_dxp') ++ else: ++ with self.assertRaises(RuntimeError): ++ import_tool('analyze_dxp') ++ ++ ++if __name__ == '__main__': ++ unittest.main() +diff -r c0e311e010fc Lib/test/test_tools/test_unparse.py +--- /dev/null ++++ b/Lib/test/test_tools/test_unparse.py +@@ -0,0 +1,282 @@ ++"""Tests for the unparse.py script in the Tools/parser directory.""" ++ ++import unittest ++import test.support ++import io ++import os ++import random ++import tokenize ++import ast ++ ++from test.test_tools import basepath, toolsdir, skip_if_missing ++ ++skip_if_missing() ++ ++parser_path = os.path.join(toolsdir, "parser") ++ ++with test.support.DirsOnSysPath(parser_path): ++ import unparse ++ ++def read_pyfile(filename): ++ """Read and return the contents of a Python source file (as a ++ string), taking into account the file encoding.""" ++ with open(filename, "rb") as pyfile: ++ encoding = tokenize.detect_encoding(pyfile.readline)[0] ++ with open(filename, "r", encoding=encoding) as pyfile: ++ source = pyfile.read() ++ return source ++ ++for_else = """\ ++def f(): ++ for x in range(10): ++ break ++ else: ++ y = 2 ++ z = 3 ++""" ++ ++while_else = """\ ++def g(): ++ while True: ++ break ++ else: ++ y = 2 ++ z = 3 ++""" ++ ++relative_import = """\ ++from . import fred ++from .. import barney ++from .australia import shrimp as prawns ++""" ++ ++nonlocal_ex = """\ ++def f(): ++ x = 1 ++ def g(): ++ nonlocal x ++ x = 2 ++ y = 7 ++ def h(): ++ nonlocal x, y ++""" ++ ++# also acts as test for 'except ... as ...' ++raise_from = """\ ++try: ++ 1 / 0 ++except ZeroDivisionError as e: ++ raise ArithmeticError from e ++""" ++ ++class_decorator = """\ ++@f1(arg) ++@f2 ++class Foo: pass ++""" ++ ++elif1 = """\ ++if cond1: ++ suite1 ++elif cond2: ++ suite2 ++else: ++ suite3 ++""" ++ ++elif2 = """\ ++if cond1: ++ suite1 ++elif cond2: ++ suite2 ++""" ++ ++try_except_finally = """\ ++try: ++ suite1 ++except ex1: ++ suite2 ++except ex2: ++ suite3 ++else: ++ suite4 ++finally: ++ suite5 ++""" ++ ++with_simple = """\ ++with f(): ++ suite1 ++""" ++ ++with_as = """\ ++with f() as x: ++ suite1 ++""" ++ ++with_two_items = """\ ++with f() as x, g() as y: ++ suite1 ++""" ++ ++class ASTTestCase(unittest.TestCase): ++ def assertASTEqual(self, ast1, ast2): ++ self.assertEqual(ast.dump(ast1), ast.dump(ast2)) ++ ++ def check_roundtrip(self, code1, filename="internal"): ++ ast1 = compile(code1, filename, "exec", ast.PyCF_ONLY_AST) ++ unparse_buffer = io.StringIO() ++ unparse.Unparser(ast1, unparse_buffer) ++ code2 = unparse_buffer.getvalue() ++ ast2 = compile(code2, filename, "exec", ast.PyCF_ONLY_AST) ++ self.assertASTEqual(ast1, ast2) ++ ++class UnparseTestCase(ASTTestCase): ++ # Tests for specific bugs found in earlier versions of unparse ++ ++ def test_del_statement(self): ++ self.check_roundtrip("del x, y, z") ++ ++ def test_shifts(self): ++ self.check_roundtrip("45 << 2") ++ self.check_roundtrip("13 >> 7") ++ ++ def test_for_else(self): ++ self.check_roundtrip(for_else) ++ ++ def test_while_else(self): ++ self.check_roundtrip(while_else) ++ ++ def test_unary_parens(self): ++ self.check_roundtrip("(-1)**7") ++ self.check_roundtrip("(-1.)**8") ++ self.check_roundtrip("(-1j)**6") ++ self.check_roundtrip("not True or False") ++ self.check_roundtrip("True or not False") ++ ++ def test_integer_parens(self): ++ self.check_roundtrip("3 .__abs__()") ++ ++ def test_huge_float(self): ++ self.check_roundtrip("1e1000") ++ self.check_roundtrip("-1e1000") ++ self.check_roundtrip("1e1000j") ++ self.check_roundtrip("-1e1000j") ++ ++ def test_min_int(self): ++ self.check_roundtrip(str(-2**31)) ++ self.check_roundtrip(str(-2**63)) ++ ++ def test_imaginary_literals(self): ++ self.check_roundtrip("7j") ++ self.check_roundtrip("-7j") ++ self.check_roundtrip("0j") ++ self.check_roundtrip("-0j") ++ ++ def test_lambda_parentheses(self): ++ self.check_roundtrip("(lambda: int)()") ++ ++ def test_chained_comparisons(self): ++ self.check_roundtrip("1 < 4 <= 5") ++ self.check_roundtrip("a is b is c is not d") ++ ++ def test_function_arguments(self): ++ self.check_roundtrip("def f(): pass") ++ self.check_roundtrip("def f(a): pass") ++ self.check_roundtrip("def f(b = 2): pass") ++ self.check_roundtrip("def f(a, b): pass") ++ self.check_roundtrip("def f(a, b = 2): pass") ++ self.check_roundtrip("def f(a = 5, b = 2): pass") ++ self.check_roundtrip("def f(*, a = 1, b = 2): pass") ++ self.check_roundtrip("def f(*, a = 1, b): pass") ++ self.check_roundtrip("def f(*, a, b = 2): pass") ++ self.check_roundtrip("def f(a, b = None, *, c, **kwds): pass") ++ self.check_roundtrip("def f(a=2, *args, c=5, d, **kwds): pass") ++ self.check_roundtrip("def f(*args, **kwargs): pass") ++ ++ def test_relative_import(self): ++ self.check_roundtrip(relative_import) ++ ++ def test_nonlocal(self): ++ self.check_roundtrip(nonlocal_ex) ++ ++ def test_raise_from(self): ++ self.check_roundtrip(raise_from) ++ ++ def test_bytes(self): ++ self.check_roundtrip("b'123'") ++ ++ def test_annotations(self): ++ self.check_roundtrip("def f(a : int): pass") ++ self.check_roundtrip("def f(a: int = 5): pass") ++ self.check_roundtrip("def f(*args: [int]): pass") ++ self.check_roundtrip("def f(**kwargs: dict): pass") ++ self.check_roundtrip("def f() -> None: pass") ++ ++ def test_set_literal(self): ++ self.check_roundtrip("{'a', 'b', 'c'}") ++ ++ def test_set_comprehension(self): ++ self.check_roundtrip("{x for x in range(5)}") ++ ++ def test_dict_comprehension(self): ++ self.check_roundtrip("{x: x*x for x in range(10)}") ++ ++ def test_class_decorators(self): ++ self.check_roundtrip(class_decorator) ++ ++ def test_class_definition(self): ++ self.check_roundtrip("class A(metaclass=type, *[], **{}): pass") ++ ++ def test_elifs(self): ++ self.check_roundtrip(elif1) ++ self.check_roundtrip(elif2) ++ ++ def test_try_except_finally(self): ++ self.check_roundtrip(try_except_finally) ++ ++ def test_starred_assignment(self): ++ self.check_roundtrip("a, *b, c = seq") ++ self.check_roundtrip("a, (*b, c) = seq") ++ self.check_roundtrip("a, *b[0], c = seq") ++ self.check_roundtrip("a, *(b, c) = seq") ++ ++ def test_with_simple(self): ++ self.check_roundtrip(with_simple) ++ ++ def test_with_as(self): ++ self.check_roundtrip(with_as) ++ ++ def test_with_two_items(self): ++ self.check_roundtrip(with_two_items) ++ ++ ++class DirectoryTestCase(ASTTestCase): ++ """Test roundtrip behaviour on all files in Lib and Lib/test.""" ++ ++ # test directories, relative to the root of the distribution ++ test_directories = 'Lib', os.path.join('Lib', 'test') ++ ++ def test_files(self): ++ # get names of files to test ++ ++ names = [] ++ for d in self.test_directories: ++ test_dir = os.path.join(basepath, d) ++ for n in os.listdir(test_dir): ++ if n.endswith('.py') and not n.startswith('bad'): ++ names.append(os.path.join(test_dir, n)) ++ ++ # Test limited subset of files unless the 'cpu' resource is specified. ++ if not test.support.is_resource_enabled("cpu"): ++ names = random.sample(names, 10) ++ ++ for filename in names: ++ if test.support.verbose: ++ print('Testing %s' % filename) ++ source = read_pyfile(filename) ++ self.check_roundtrip(source) ++ ++ ++if __name__ == '__main__': ++ unittest.main() +diff -r c0e311e010fc Lib/test/test_tracemalloc.py +--- a/Lib/test/test_tracemalloc.py ++++ b/Lib/test/test_tracemalloc.py +@@ -807,6 +807,12 @@ + b'number of frames', + stderr) + ++ def test_pymem_alloc0(self): ++ # Issue #21639: Check that PyMem_Malloc(0) with tracemalloc enabled ++ # does not crash. ++ code = 'import _testcapi; _testcapi.test_pymem_alloc0(); 1' ++ assert_python_ok('-X', 'tracemalloc', '-c', code) ++ + + def test_main(): + support.run_unittest( +diff -r c0e311e010fc Lib/test/test_ttk_guionly.py +--- a/Lib/test/test_ttk_guionly.py ++++ b/Lib/test/test_ttk_guionly.py +@@ -22,13 +22,7 @@ + # assuming ttk is not available + raise unittest.SkipTest("ttk not available: %s" % msg) + +-def test_main(enable_gui=False): +- if enable_gui: +- if support.use_resources is None: +- support.use_resources = ['gui'] +- elif 'gui' not in support.use_resources: +- support.use_resources.append('gui') +- ++def test_main(): + try: + support.run_unittest( + *runtktests.get_tests(text=False, packages=['test_ttk'])) +@@ -36,4 +30,4 @@ + get_tk_root().destroy() + + if __name__ == '__main__': +- test_main(enable_gui=True) ++ test_main() +diff -r c0e311e010fc Lib/test/test_urllib.py +--- a/Lib/test/test_urllib.py ++++ b/Lib/test/test_urllib.py +@@ -7,6 +7,7 @@ + import email.message + import io + import unittest ++from unittest.mock import patch + from test import support + import os + import sys +@@ -89,6 +90,26 @@ + http.client.HTTPConnection = self._connection_class + + ++class FakeFTPMixin(object): ++ def fakeftp(self): ++ class FakeFtpWrapper(object): ++ def __init__(self, user, passwd, host, port, dirs, timeout=None, ++ persistent=True): ++ pass ++ ++ def retrfile(self, file, type): ++ return io.BytesIO(), 0 ++ ++ def close(self): ++ pass ++ ++ self._ftpwrapper_class = urllib.request.ftpwrapper ++ urllib.request.ftpwrapper = FakeFtpWrapper ++ ++ def unfakeftp(self): ++ urllib.request.ftpwrapper = self._ftpwrapper_class ++ ++ + class urlopen_FileTests(unittest.TestCase): + """Test urlopen() opening a temporary file. + +@@ -195,7 +216,7 @@ + self.env.set('NO_PROXY', 'localhost, anotherdomain.com, newdomain.com') + self.assertTrue(urllib.request.proxy_bypass_environment('anotherdomain.com')) + +-class urlopen_HttpTests(unittest.TestCase, FakeHTTPMixin): ++class urlopen_HttpTests(unittest.TestCase, FakeHTTPMixin, FakeFTPMixin): + """Test urlopen() opening a fake http connection.""" + + def check_read(self, ver): +@@ -309,6 +330,15 @@ + self.assertFalse(e.exception.filename) + self.assertTrue(e.exception.reason) + ++ @patch.object(urllib.request, 'MAXFTPCACHE', 0) ++ def test_ftp_cache_pruning(self): ++ self.fakeftp() ++ try: ++ urllib.request.ftpcache['test'] = urllib.request.ftpwrapper('user', 'pass', 'localhost', 21, []) ++ urlopen('ftp://localhost') ++ finally: ++ self.unfakeftp() ++ + + def test_userpass_inurl(self): + self.fakehttp(b"HTTP/1.0 200 OK\r\n\r\nHello!") +diff -r c0e311e010fc Lib/test/test_urllib2.py +--- a/Lib/test/test_urllib2.py ++++ b/Lib/test/test_urllib2.py +@@ -678,7 +678,7 @@ + self.assertEqual(int(headers["Content-length"]), len(data)) + + def test_file(self): +- import email.utils, socket ++ import email.utils + h = urllib.request.FileHandler() + o = h.parent = MockOpener() + +@@ -725,6 +725,7 @@ + for url in [ + "file://localhost:80%s" % urlpath, + "file:///file_does_not_exist.txt", ++ "file://not-a-local-host.com//dir/file.txt", + "file://%s:80%s/%s" % (socket.gethostbyname('localhost'), + os.getcwd(), TESTFN), + "file://somerandomhost.ontheinternet.com%s/%s" % +diff -r c0e311e010fc Lib/test/test_venv.py +--- a/Lib/test/test_venv.py ++++ b/Lib/test/test_venv.py +@@ -203,17 +203,22 @@ + """ + Test upgrading an existing environment directory. + """ +- builder = venv.EnvBuilder(upgrade=True) +- self.run_with_capture(builder.create, self.env_dir) +- self.isdir(self.bindir) +- self.isdir(self.include) +- self.isdir(*self.lib) +- fn = self.get_env_file(self.bindir, self.exe) +- if not os.path.exists(fn): # diagnostics for Windows buildbot failures +- bd = self.get_env_file(self.bindir) +- print('Contents of %r:' % bd) +- print(' %r' % os.listdir(bd)) +- self.assertTrue(os.path.exists(fn), 'File %r should exist.' % fn) ++ # See Issue #21643: the loop needs to run twice to ensure ++ # that everything works on the upgrade (the first run just creates ++ # the venv). ++ for upgrade in (False, True): ++ builder = venv.EnvBuilder(upgrade=upgrade) ++ self.run_with_capture(builder.create, self.env_dir) ++ self.isdir(self.bindir) ++ self.isdir(self.include) ++ self.isdir(*self.lib) ++ fn = self.get_env_file(self.bindir, self.exe) ++ if not os.path.exists(fn): ++ # diagnostics for Windows buildbot failures ++ bd = self.get_env_file(self.bindir) ++ print('Contents of %r:' % bd) ++ print(' %r' % os.listdir(bd)) ++ self.assertTrue(os.path.exists(fn), 'File %r should exist.' % fn) + + def test_isolation(self): + """ +diff -r c0e311e010fc Lib/test/test_winreg.py +--- a/Lib/test/test_winreg.py ++++ b/Lib/test/test_winreg.py +@@ -341,7 +341,7 @@ + def test_queryvalueex_return_value(self): + # Test for Issue #16759, return unsigned int from QueryValueEx. + # Reg2Py, which gets called by QueryValueEx, was returning a value +- # generated by PyLong_FromLong. The implmentation now uses ++ # generated by PyLong_FromLong. The implementation now uses + # PyLong_FromUnsignedLong to match DWORD's size. + try: + with CreateKey(HKEY_CURRENT_USER, test_key_name) as ck: +@@ -354,6 +354,19 @@ + finally: + DeleteKey(HKEY_CURRENT_USER, test_key_name) + ++ def test_setvalueex_crash_with_none_arg(self): ++ # Test for Issue #21151, segfault when None is passed to SetValueEx ++ try: ++ with CreateKey(HKEY_CURRENT_USER, test_key_name) as ck: ++ self.assertNotEqual(ck.handle, 0) ++ test_val = None ++ SetValueEx(ck, "test_name", 0, REG_BINARY, test_val) ++ ret_val, ret_type = QueryValueEx(ck, "test_name") ++ self.assertEqual(ret_type, REG_BINARY) ++ self.assertEqual(ret_val, test_val) ++ finally: ++ DeleteKey(HKEY_CURRENT_USER, test_key_name) ++ + + + @unittest.skipUnless(REMOTE_NAME, "Skipping remote registry tests") +diff -r c0e311e010fc Lib/test/test_zipfile.py +--- a/Lib/test/test_zipfile.py ++++ b/Lib/test/test_zipfile.py +@@ -1290,6 +1290,21 @@ + self.assertRaises(ValueError, + zipfile.ZipInfo, 'seventies', (1979, 1, 1, 0, 0, 0)) + ++ def test_zipfile_with_short_extra_field(self): ++ """If an extra field in the header is less than 4 bytes, skip it.""" ++ zipdata = ( ++ b'PK\x03\x04\x14\x00\x00\x00\x00\x00\x93\x9b\xad@\x8b\x9e' ++ b'\xd9\xd3\x01\x00\x00\x00\x01\x00\x00\x00\x03\x00\x03\x00ab' ++ b'c\x00\x00\x00APK\x01\x02\x14\x03\x14\x00\x00\x00\x00' ++ b'\x00\x93\x9b\xad@\x8b\x9e\xd9\xd3\x01\x00\x00\x00\x01\x00\x00' ++ b'\x00\x03\x00\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\xa4\x81\x00' ++ b'\x00\x00\x00abc\x00\x00PK\x05\x06\x00\x00\x00\x00' ++ b'\x01\x00\x01\x003\x00\x00\x00%\x00\x00\x00\x00\x00' ++ ) ++ with zipfile.ZipFile(io.BytesIO(zipdata), 'r') as zipf: ++ # testzip returns the name of the first corrupt file, or None ++ self.assertIsNone(zipf.testzip()) ++ + def tearDown(self): + unlink(TESTFN) + unlink(TESTFN2) +diff -r c0e311e010fc Lib/tkinter/__init__.py +--- a/Lib/tkinter/__init__.py ++++ b/Lib/tkinter/__init__.py +@@ -191,6 +191,7 @@ + that constrain the type of the value returned from get().""" + _default = "" + _tk = None ++ _tclCommands = None + def __init__(self, master=None, value=None, name=None): + """Construct a variable + +@@ -209,7 +210,7 @@ + global _varnum + if not master: + master = _default_root +- self._master = master ++ self._root = master._root() + self._tk = master.tk + if name: + self._name = name +@@ -222,9 +223,15 @@ + self.initialize(self._default) + def __del__(self): + """Unset the variable in Tcl.""" +- if (self._tk is not None and +- self._tk.getboolean(self._tk.call("info", "exists", self._name))): ++ if self._tk is None: ++ return ++ if self._tk.getboolean(self._tk.call("info", "exists", self._name)): + self._tk.globalunsetvar(self._name) ++ if self._tclCommands is not None: ++ for name in self._tclCommands: ++ #print '- Tkinter: deleted command', name ++ self._tk.deletecommand(name) ++ self._tclCommands = None + def __str__(self): + """Return the name of the variable in Tcl.""" + return self._name +@@ -244,7 +251,20 @@ + + Return the name of the callback. + """ +- cbname = self._master._register(callback) ++ f = CallWrapper(callback, None, self).__call__ ++ cbname = repr(id(f)) ++ try: ++ callback = callback.__func__ ++ except AttributeError: ++ pass ++ try: ++ cbname = cbname + callback.__name__ ++ except AttributeError: ++ pass ++ self._tk.createcommand(cbname, f) ++ if self._tclCommands is None: ++ self._tclCommands = [] ++ self._tclCommands.append(cbname) + self._tk.call("trace", "variable", self._name, mode, cbname) + return cbname + trace = trace_variable +@@ -255,7 +275,11 @@ + CBNAME is the name of the callback returned from trace_variable or trace. + """ + self._tk.call("trace", "vdelete", self._name, mode, cbname) +- self._master.deletecommand(cbname) ++ self._tk.deletecommand(cbname) ++ try: ++ self._tclCommands.remove(cbname) ++ except ValueError: ++ pass + def trace_vinfo(self): + """Return all trace callback information.""" + return [self._tk.split(x) for x in self._tk.splitlist( +@@ -421,7 +445,10 @@ + + _flatten(args) + _flatten(list(kw.items()))) + def tk_menuBar(self, *args): + """Do not use. Needed in Tk 3.6 and earlier.""" +- pass # obsolete since Tk 4.0 ++ # obsolete since Tk 4.0 ++ import warnings ++ warnings.warn('tk_menuBar() does nothing and will be removed in 3.6', ++ DeprecationWarning, stacklevel=2) + def wait_variable(self, name='PY_VAR'): + """Wait until the variable is modified. + +@@ -2586,22 +2613,19 @@ + def activate(self, index): + """Activate item identified by INDEX.""" + self.tk.call(self._w, 'activate', index) +- def bbox(self, *args): ++ def bbox(self, index): + """Return a tuple of X1,Y1,X2,Y2 coordinates for a rectangle +- which encloses the item identified by index in ARGS.""" +- return self._getints( +- self.tk.call((self._w, 'bbox') + args)) or None ++ which encloses the item identified by the given index.""" ++ return self._getints(self.tk.call(self._w, 'bbox', index)) or None + def curselection(self): +- """Return list of indices of currently selected item.""" +- # XXX Ought to apply self._getints()... +- return self.tk.splitlist(self.tk.call( +- self._w, 'curselection')) ++ """Return the indices of currently selected item.""" ++ return self._getints(self.tk.call(self._w, 'curselection')) or () + def delete(self, first, last=None): +- """Delete items from FIRST to LAST (not included).""" ++ """Delete items from FIRST to LAST (included).""" + self.tk.call(self._w, 'delete', first, last) + def get(self, first, last=None): +- """Get list of items from FIRST to LAST (not included).""" +- if last: ++ """Get list of items from FIRST to LAST (included).""" ++ if last is not None: + return self.tk.splitlist(self.tk.call( + self._w, 'get', first, last)) + else: +@@ -2634,7 +2658,7 @@ + self.tk.call(self._w, 'selection', 'anchor', index) + select_anchor = selection_anchor + def selection_clear(self, first, last=None): +- """Clear the selection from FIRST to LAST (not included).""" ++ """Clear the selection from FIRST to LAST (included).""" + self.tk.call(self._w, + 'selection', 'clear', first, last) + select_clear = selection_clear +@@ -2644,7 +2668,7 @@ + self._w, 'selection', 'includes', index)) + select_includes = selection_includes + def selection_set(self, first, last=None): +- """Set the selection from FIRST to LAST (not included) without ++ """Set the selection from FIRST to LAST (included) without + changing the currently selected elements.""" + self.tk.call(self._w, 'selection', 'set', first, last) + select_set = selection_set +@@ -2677,7 +2701,11 @@ + selectcolor, takefocus, tearoff, tearoffcommand, title, type.""" + Widget.__init__(self, master, 'menu', cnf, kw) + def tk_bindForTraversal(self): +- pass # obsolete since Tk 4.0 ++ # obsolete since Tk 4.0 ++ import warnings ++ warnings.warn('tk_bindForTraversal() does nothing and ' ++ 'will be removed in 3.6', ++ DeprecationWarning, stacklevel=2) + def tk_mbPost(self): + self.tk.call('tk_mbPost', self._w) + def tk_mbUnpost(self): +diff -r c0e311e010fc Lib/tkinter/font.py +--- a/Lib/tkinter/font.py ++++ b/Lib/tkinter/font.py +@@ -69,9 +69,10 @@ + **options): + if not root: + root = tkinter._default_root ++ tk = getattr(root, 'tk', root) + if font: + # get actual settings corresponding to the given font +- font = root.tk.splitlist(root.tk.call("font", "actual", font)) ++ font = tk.splitlist(tk.call("font", "actual", font)) + else: + font = self._set(options) + if not name: +@@ -81,20 +82,19 @@ + if exists: + self.delete_font = False + # confirm font exists +- if self.name not in root.tk.call("font", "names"): ++ if self.name not in tk.splitlist(tk.call("font", "names")): + raise tkinter._tkinter.TclError( + "named font %s does not already exist" % (self.name,)) + # if font config info supplied, apply it + if font: +- root.tk.call("font", "configure", self.name, *font) ++ tk.call("font", "configure", self.name, *font) + else: + # create new font (raises TclError if the font exists) +- root.tk.call("font", "create", self.name, *font) ++ tk.call("font", "create", self.name, *font) + self.delete_font = True +- # backlinks! +- self._root = root +- self._split = root.tk.splitlist +- self._call = root.tk.call ++ self._tk = tk ++ self._split = tk.splitlist ++ self._call = tk.call + + def __str__(self): + return self.name +@@ -119,7 +119,7 @@ + + def copy(self): + "Return a distinct copy of the current font" +- return Font(self._root, **self.actual()) ++ return Font(self._tk, **self.actual()) + + def actual(self, option=None, displayof=None): + "Return actual font attributes" +diff -r c0e311e010fc Lib/tkinter/test/runtktests.py +--- a/Lib/tkinter/test/runtktests.py ++++ b/Lib/tkinter/test/runtktests.py +@@ -68,5 +68,4 @@ + yield test + + if __name__ == "__main__": +- test.support.use_resources = ['gui'] + test.support.run_unittest(*get_tests()) +diff -r c0e311e010fc Lib/tkinter/test/test_tkinter/test_images.py +--- /dev/null ++++ b/Lib/tkinter/test/test_tkinter/test_images.py +@@ -0,0 +1,336 @@ ++import unittest ++import tkinter ++from tkinter import ttk ++from test import support ++from tkinter.test.support import requires_tcl ++ ++support.requires('gui') ++ ++ ++class MiscTest(unittest.TestCase): ++ ++ def setUp(self): ++ self.root = ttk.setup_master() ++ ++ def test_image_types(self): ++ image_types = self.root.image_types() ++ self.assertIsInstance(image_types, tuple) ++ self.assertIn('photo', image_types) ++ self.assertIn('bitmap', image_types) ++ ++ def test_image_names(self): ++ image_names = self.root.image_names() ++ self.assertIsInstance(image_names, tuple) ++ ++ ++class BitmapImageTest(unittest.TestCase): ++ ++ @classmethod ++ def setUpClass(cls): ++ cls.testfile = support.findfile('python.xbm', subdir='imghdrdata') ++ ++ def setUp(self): ++ self.root = ttk.setup_master() ++ ++ def test_create_from_file(self): ++ image = tkinter.BitmapImage('::img::test', master=self.root, ++ foreground='yellow', background='blue', ++ file=self.testfile) ++ self.assertEqual(str(image), '::img::test') ++ self.assertEqual(image.type(), 'bitmap') ++ self.assertEqual(image.width(), 16) ++ self.assertEqual(image.height(), 16) ++ self.assertIn('::img::test', self.root.image_names()) ++ del image ++ self.assertNotIn('::img::test', self.root.image_names()) ++ ++ def test_create_from_data(self): ++ with open(self.testfile, 'rb') as f: ++ data = f.read() ++ image = tkinter.BitmapImage('::img::test', master=self.root, ++ foreground='yellow', background='blue', ++ data=data) ++ self.assertEqual(str(image), '::img::test') ++ self.assertEqual(image.type(), 'bitmap') ++ self.assertEqual(image.width(), 16) ++ self.assertEqual(image.height(), 16) ++ self.assertIn('::img::test', self.root.image_names()) ++ del image ++ self.assertNotIn('::img::test', self.root.image_names()) ++ ++ def assertEqualStrList(self, actual, expected): ++ self.assertIsInstance(actual, str) ++ self.assertEqual(self.root.splitlist(actual), expected) ++ ++ def test_configure_data(self): ++ image = tkinter.BitmapImage('::img::test', master=self.root) ++ self.assertEqual(image['data'], '-data {} {} {} {}') ++ with open(self.testfile, 'rb') as f: ++ data = f.read() ++ image.configure(data=data) ++ self.assertEqualStrList(image['data'], ++ ('-data', '', '', '', data.decode('ascii'))) ++ self.assertEqual(image.width(), 16) ++ self.assertEqual(image.height(), 16) ++ ++ self.assertEqual(image['maskdata'], '-maskdata {} {} {} {}') ++ image.configure(maskdata=data) ++ self.assertEqualStrList(image['maskdata'], ++ ('-maskdata', '', '', '', data.decode('ascii'))) ++ ++ def test_configure_file(self): ++ image = tkinter.BitmapImage('::img::test', master=self.root) ++ self.assertEqual(image['file'], '-file {} {} {} {}') ++ image.configure(file=self.testfile) ++ self.assertEqualStrList(image['file'], ++ ('-file', '', '', '',self.testfile)) ++ self.assertEqual(image.width(), 16) ++ self.assertEqual(image.height(), 16) ++ ++ self.assertEqual(image['maskfile'], '-maskfile {} {} {} {}') ++ image.configure(maskfile=self.testfile) ++ self.assertEqualStrList(image['maskfile'], ++ ('-maskfile', '', '', '', self.testfile)) ++ ++ def test_configure_background(self): ++ image = tkinter.BitmapImage('::img::test', master=self.root) ++ self.assertEqual(image['background'], '-background {} {} {} {}') ++ image.configure(background='blue') ++ self.assertEqual(image['background'], '-background {} {} {} blue') ++ ++ def test_configure_foreground(self): ++ image = tkinter.BitmapImage('::img::test', master=self.root) ++ self.assertEqual(image['foreground'], ++ '-foreground {} {} #000000 #000000') ++ image.configure(foreground='yellow') ++ self.assertEqual(image['foreground'], ++ '-foreground {} {} #000000 yellow') ++ ++ ++class PhotoImageTest(unittest.TestCase): ++ ++ @classmethod ++ def setUpClass(cls): ++ cls.testfile = support.findfile('python.gif', subdir='imghdrdata') ++ ++ def setUp(self): ++ self.root = ttk.setup_master() ++ self.wantobjects = self.root.wantobjects() ++ ++ def create(self): ++ return tkinter.PhotoImage('::img::test', master=self.root, ++ file=self.testfile) ++ ++ def colorlist(self, *args): ++ if tkinter.TkVersion >= 8.6 and self.wantobjects: ++ return args ++ else: ++ return tkinter._join(args) ++ ++ def check_create_from_file(self, ext): ++ testfile = support.findfile('python.' + ext, subdir='imghdrdata') ++ image = tkinter.PhotoImage('::img::test', master=self.root, ++ file=testfile) ++ self.assertEqual(str(image), '::img::test') ++ self.assertEqual(image.type(), 'photo') ++ self.assertEqual(image.width(), 16) ++ self.assertEqual(image.height(), 16) ++ self.assertEqual(image['data'], '') ++ self.assertEqual(image['file'], testfile) ++ self.assertIn('::img::test', self.root.image_names()) ++ del image ++ self.assertNotIn('::img::test', self.root.image_names()) ++ ++ def check_create_from_data(self, ext): ++ testfile = support.findfile('python.' + ext, subdir='imghdrdata') ++ with open(testfile, 'rb') as f: ++ data = f.read() ++ image = tkinter.PhotoImage('::img::test', master=self.root, ++ data=data) ++ self.assertEqual(str(image), '::img::test') ++ self.assertEqual(image.type(), 'photo') ++ self.assertEqual(image.width(), 16) ++ self.assertEqual(image.height(), 16) ++ self.assertEqual(image['data'], data if self.wantobjects ++ else data.decode('latin1')) ++ self.assertEqual(image['file'], '') ++ self.assertIn('::img::test', self.root.image_names()) ++ del image ++ self.assertNotIn('::img::test', self.root.image_names()) ++ ++ def test_create_from_ppm_file(self): ++ self.check_create_from_file('ppm') ++ ++ def test_create_from_ppm_data(self): ++ self.check_create_from_data('ppm') ++ ++ def test_create_from_pgm_file(self): ++ self.check_create_from_file('pgm') ++ ++ def test_create_from_pgm_data(self): ++ self.check_create_from_data('pgm') ++ ++ def test_create_from_gif_file(self): ++ self.check_create_from_file('gif') ++ ++ def test_create_from_gif_data(self): ++ self.check_create_from_data('gif') ++ ++ @requires_tcl(8, 6) ++ def test_create_from_png_file(self): ++ self.check_create_from_file('png') ++ ++ @requires_tcl(8, 6) ++ def test_create_from_png_data(self): ++ self.check_create_from_data('png') ++ ++ def test_configure_data(self): ++ image = tkinter.PhotoImage('::img::test', master=self.root) ++ self.assertEqual(image['data'], '') ++ with open(self.testfile, 'rb') as f: ++ data = f.read() ++ image.configure(data=data) ++ self.assertEqual(image['data'], data if self.wantobjects ++ else data.decode('latin1')) ++ self.assertEqual(image.width(), 16) ++ self.assertEqual(image.height(), 16) ++ ++ def test_configure_format(self): ++ image = tkinter.PhotoImage('::img::test', master=self.root) ++ self.assertEqual(image['format'], '') ++ image.configure(file=self.testfile, format='gif') ++ self.assertEqual(image['format'], ('gif',) if self.wantobjects ++ else 'gif') ++ self.assertEqual(image.width(), 16) ++ self.assertEqual(image.height(), 16) ++ ++ def test_configure_file(self): ++ image = tkinter.PhotoImage('::img::test', master=self.root) ++ self.assertEqual(image['file'], '') ++ image.configure(file=self.testfile) ++ self.assertEqual(image['file'], self.testfile) ++ self.assertEqual(image.width(), 16) ++ self.assertEqual(image.height(), 16) ++ ++ def test_configure_gamma(self): ++ image = tkinter.PhotoImage('::img::test', master=self.root) ++ self.assertEqual(image['gamma'], '1.0') ++ image.configure(gamma=2.0) ++ self.assertEqual(image['gamma'], '2.0') ++ ++ def test_configure_width_height(self): ++ image = tkinter.PhotoImage('::img::test', master=self.root) ++ self.assertEqual(image['width'], '0') ++ self.assertEqual(image['height'], '0') ++ image.configure(width=20) ++ image.configure(height=10) ++ self.assertEqual(image['width'], '20') ++ self.assertEqual(image['height'], '10') ++ self.assertEqual(image.width(), 20) ++ self.assertEqual(image.height(), 10) ++ ++ def test_configure_palette(self): ++ image = tkinter.PhotoImage('::img::test', master=self.root) ++ self.assertEqual(image['palette'], '') ++ image.configure(palette=256) ++ self.assertEqual(image['palette'], '256') ++ image.configure(palette='3/4/2') ++ self.assertEqual(image['palette'], '3/4/2') ++ ++ def test_blank(self): ++ image = self.create() ++ image.blank() ++ self.assertEqual(image.width(), 16) ++ self.assertEqual(image.height(), 16) ++ self.assertEqual(image.get(4, 6), self.colorlist(0, 0, 0)) ++ ++ def test_copy(self): ++ image = self.create() ++ image2 = image.copy() ++ self.assertEqual(image2.width(), 16) ++ self.assertEqual(image2.height(), 16) ++ self.assertEqual(image.get(4, 6), image.get(4, 6)) ++ ++ def test_subsample(self): ++ image = self.create() ++ image2 = image.subsample(2, 3) ++ self.assertEqual(image2.width(), 8) ++ self.assertEqual(image2.height(), 6) ++ self.assertEqual(image2.get(2, 2), image.get(4, 6)) ++ ++ image2 = image.subsample(2) ++ self.assertEqual(image2.width(), 8) ++ self.assertEqual(image2.height(), 8) ++ self.assertEqual(image2.get(2, 3), image.get(4, 6)) ++ ++ def test_zoom(self): ++ image = self.create() ++ image2 = image.zoom(2, 3) ++ self.assertEqual(image2.width(), 32) ++ self.assertEqual(image2.height(), 48) ++ self.assertEqual(image2.get(8, 18), image.get(4, 6)) ++ self.assertEqual(image2.get(9, 20), image.get(4, 6)) ++ ++ image2 = image.zoom(2) ++ self.assertEqual(image2.width(), 32) ++ self.assertEqual(image2.height(), 32) ++ self.assertEqual(image2.get(8, 12), image.get(4, 6)) ++ self.assertEqual(image2.get(9, 13), image.get(4, 6)) ++ ++ def test_put(self): ++ image = self.create() ++ image.put('{red green} {blue yellow}', to=(4, 6)) ++ self.assertEqual(image.get(4, 6), self.colorlist(255, 0, 0)) ++ self.assertEqual(image.get(5, 6), ++ self.colorlist(0, 128 if tkinter.TkVersion >= 8.6 ++ else 255, 0)) ++ self.assertEqual(image.get(4, 7), self.colorlist(0, 0, 255)) ++ self.assertEqual(image.get(5, 7), self.colorlist(255, 255, 0)) ++ ++ image.put((('#f00', '#00ff00'), ('#000000fff', '#ffffffff0000'))) ++ self.assertEqual(image.get(0, 0), self.colorlist(255, 0, 0)) ++ self.assertEqual(image.get(1, 0), self.colorlist(0, 255, 0)) ++ self.assertEqual(image.get(0, 1), self.colorlist(0, 0, 255)) ++ self.assertEqual(image.get(1, 1), self.colorlist(255, 255, 0)) ++ ++ def test_get(self): ++ image = self.create() ++ self.assertEqual(image.get(4, 6), self.colorlist(62, 116, 162)) ++ self.assertEqual(image.get(0, 0), self.colorlist(0, 0, 0)) ++ self.assertEqual(image.get(15, 15), self.colorlist(0, 0, 0)) ++ self.assertRaises(tkinter.TclError, image.get, -1, 0) ++ self.assertRaises(tkinter.TclError, image.get, 0, -1) ++ self.assertRaises(tkinter.TclError, image.get, 16, 15) ++ self.assertRaises(tkinter.TclError, image.get, 15, 16) ++ ++ def test_write(self): ++ image = self.create() ++ self.addCleanup(support.unlink, support.TESTFN) ++ ++ image.write(support.TESTFN) ++ image2 = tkinter.PhotoImage('::img::test2', master=self.root, ++ format='ppm', ++ file=support.TESTFN) ++ self.assertEqual(str(image2), '::img::test2') ++ self.assertEqual(image2.type(), 'photo') ++ self.assertEqual(image2.width(), 16) ++ self.assertEqual(image2.height(), 16) ++ self.assertEqual(image2.get(0, 0), image.get(0, 0)) ++ self.assertEqual(image2.get(15, 8), image.get(15, 8)) ++ ++ image.write(support.TESTFN, format='gif', from_coords=(4, 6, 6, 9)) ++ image3 = tkinter.PhotoImage('::img::test3', master=self.root, ++ format='gif', ++ file=support.TESTFN) ++ self.assertEqual(str(image3), '::img::test3') ++ self.assertEqual(image3.type(), 'photo') ++ self.assertEqual(image3.width(), 2) ++ self.assertEqual(image3.height(), 3) ++ self.assertEqual(image3.get(0, 0), image.get(4, 6)) ++ self.assertEqual(image3.get(1, 2), image.get(5, 8)) ++ ++ ++tests_gui = (MiscTest, BitmapImageTest, PhotoImageTest,) ++ ++if __name__ == "__main__": ++ support.run_unittest(*tests_gui) +diff -r c0e311e010fc Lib/tkinter/test/test_tkinter/test_widgets.py +--- a/Lib/tkinter/test/test_tkinter/test_widgets.py ++++ b/Lib/tkinter/test/test_tkinter/test_widgets.py +@@ -1,5 +1,6 @@ + import unittest + import tkinter ++from tkinter import TclError + import os + import sys + from test.support import requires +@@ -466,11 +467,7 @@ + + def test_bbox(self): + widget = self.create() +- bbox = widget.bbox(0) +- self.assertEqual(len(bbox), 4) +- for item in bbox: +- self.assertIsInstance(item, int) +- ++ self.assertIsBoundingBox(widget.bbox(0)) + self.assertRaises(tkinter.TclError, widget.bbox, 'noindex') + self.assertRaises(tkinter.TclError, widget.bbox, None) + self.assertRaises(TypeError, widget.bbox) +@@ -623,11 +620,7 @@ + + def test_bbox(self): + widget = self.create() +- bbox = widget.bbox('1.1') +- self.assertEqual(len(bbox), 4) +- for item in bbox: +- self.assertIsInstance(item, int) +- ++ self.assertIsBoundingBox(widget.bbox('1.1')) + self.assertIsNone(widget.bbox('end')) + self.assertRaises(tkinter.TclError, widget.bbox, 'noindex') + self.assertRaises(tkinter.TclError, widget.bbox, None) +@@ -730,6 +723,101 @@ + widget = self.create() + self.checkEnumParam(widget, 'state', 'disabled', 'normal') + ++ def test_itemconfigure(self): ++ widget = self.create() ++ with self.assertRaisesRegex(TclError, 'item number "0" out of range'): ++ widget.itemconfigure(0) ++ colors = 'red orange yellow green blue white violet'.split() ++ widget.insert('end', *colors) ++ for i, color in enumerate(colors): ++ widget.itemconfigure(i, background=color) ++ with self.assertRaises(TypeError): ++ widget.itemconfigure() ++ with self.assertRaisesRegex(TclError, 'bad listbox index "red"'): ++ widget.itemconfigure('red') ++ self.assertEqual(widget.itemconfigure(0, 'background'), ++ ('background', 'background', 'Background', '', 'red')) ++ self.assertEqual(widget.itemconfigure('end', 'background'), ++ ('background', 'background', 'Background', '', 'violet')) ++ self.assertEqual(widget.itemconfigure('@0,0', 'background'), ++ ('background', 'background', 'Background', '', 'red')) ++ ++ d = widget.itemconfigure(0) ++ self.assertIsInstance(d, dict) ++ for k, v in d.items(): ++ self.assertIn(len(v), (2, 5)) ++ if len(v) == 5: ++ self.assertEqual(v, widget.itemconfigure(0, k)) ++ self.assertEqual(v[4], widget.itemcget(0, k)) ++ ++ def check_itemconfigure(self, name, value): ++ widget = self.create() ++ widget.insert('end', 'a', 'b', 'c', 'd') ++ widget.itemconfigure(0, **{name: value}) ++ self.assertEqual(widget.itemconfigure(0, name)[4], value) ++ self.assertEqual(widget.itemcget(0, name), value) ++ with self.assertRaisesRegex(TclError, 'unknown color name "spam"'): ++ widget.itemconfigure(0, **{name: 'spam'}) ++ ++ def test_itemconfigure_background(self): ++ self.check_itemconfigure('background', '#ff0000') ++ ++ def test_itemconfigure_bg(self): ++ self.check_itemconfigure('bg', '#ff0000') ++ ++ def test_itemconfigure_fg(self): ++ self.check_itemconfigure('fg', '#110022') ++ ++ def test_itemconfigure_foreground(self): ++ self.check_itemconfigure('foreground', '#110022') ++ ++ def test_itemconfigure_selectbackground(self): ++ self.check_itemconfigure('selectbackground', '#110022') ++ ++ def test_itemconfigure_selectforeground(self): ++ self.check_itemconfigure('selectforeground', '#654321') ++ ++ def test_box(self): ++ lb = self.create() ++ lb.insert(0, *('el%d' % i for i in range(8))) ++ lb.pack() ++ self.assertIsBoundingBox(lb.bbox(0)) ++ self.assertIsNone(lb.bbox(-1)) ++ self.assertIsNone(lb.bbox(10)) ++ self.assertRaises(TclError, lb.bbox, 'noindex') ++ self.assertRaises(TclError, lb.bbox, None) ++ self.assertRaises(TypeError, lb.bbox) ++ self.assertRaises(TypeError, lb.bbox, 0, 1) ++ ++ def test_curselection(self): ++ lb = self.create() ++ lb.insert(0, *('el%d' % i for i in range(8))) ++ lb.selection_clear(0, tkinter.END) ++ lb.selection_set(2, 4) ++ lb.selection_set(6) ++ self.assertEqual(lb.curselection(), (2, 3, 4, 6)) ++ self.assertRaises(TypeError, lb.curselection, 0) ++ ++ def test_get(self): ++ lb = self.create() ++ lb.insert(0, *('el%d' % i for i in range(8))) ++ self.assertEqual(lb.get(0), 'el0') ++ self.assertEqual(lb.get(3), 'el3') ++ self.assertEqual(lb.get('end'), 'el7') ++ self.assertEqual(lb.get(8), '') ++ self.assertEqual(lb.get(-1), '') ++ self.assertEqual(lb.get(3, 5), ('el3', 'el4', 'el5')) ++ self.assertEqual(lb.get(5, 'end'), ('el5', 'el6', 'el7')) ++ self.assertEqual(lb.get(5, 0), ()) ++ self.assertEqual(lb.get(0, 0), ('el0',)) ++ self.assertRaises(TclError, lb.get, 'noindex') ++ self.assertRaises(TclError, lb.get, None) ++ self.assertRaises(TypeError, lb.get) ++ self.assertRaises(TclError, lb.get, 'end', 'noindex') ++ self.assertRaises(TypeError, lb.get, 1, 2, 3) ++ self.assertRaises(TclError, lb.get, 2.4) ++ ++ + @add_standard_options(PixelSizeTests, StandardOptionsTests) + class ScaleTest(AbstractWidgetTest, unittest.TestCase): + OPTIONS = ( +@@ -828,6 +916,24 @@ + self.checkEnumParam(widget, 'orient', 'vertical', 'horizontal', + errmsg='bad orientation "{}": must be vertical or horizontal') + ++ def test_activate(self): ++ sb = self.create() ++ for e in ('arrow1', 'slider', 'arrow2'): ++ sb.activate(e) ++ sb.activate('') ++ self.assertRaises(TypeError, sb.activate) ++ self.assertRaises(TypeError, sb.activate, 'arrow1', 'arrow2') ++ ++ def test_set(self): ++ sb = self.create() ++ sb.set(0.2, 0.4) ++ self.assertEqual(sb.get(), (0.2, 0.4)) ++ self.assertRaises(TclError, sb.set, 'abc', 'def') ++ self.assertRaises(TclError, sb.set, 0.6, 'def') ++ self.assertRaises(TclError, sb.set, 0.6, None) ++ self.assertRaises(TclError, sb.set, 0.6) ++ self.assertRaises(TclError, sb.set, 0.6, 0.7, 0.8) ++ + + @add_standard_options(StandardOptionsTests) + class PanedWindowTest(AbstractWidgetTest, unittest.TestCase): +@@ -887,6 +993,105 @@ + self.checkPixelsParam(widget, 'width', 402, 403.4, 404.6, -402, 0, '5i', + conv=noconv) + ++ def create2(self): ++ p = self.create() ++ b = tkinter.Button(p) ++ c = tkinter.Button(p) ++ p.add(b) ++ p.add(c) ++ return p, b, c ++ ++ def test_paneconfigure(self): ++ p, b, c = self.create2() ++ self.assertRaises(TypeError, p.paneconfigure) ++ d = p.paneconfigure(b) ++ self.assertIsInstance(d, dict) ++ for k, v in d.items(): ++ self.assertEqual(len(v), 5) ++ self.assertEqual(v, p.paneconfigure(b, k)) ++ self.assertEqual(v[4], p.panecget(b, k)) ++ ++ def check_paneconfigure(self, p, b, name, value, expected, stringify=False): ++ conv = lambda x: x ++ if not self.wantobjects or stringify: ++ expected = str(expected) ++ if self.wantobjects and stringify: ++ conv = str ++ p.paneconfigure(b, **{name: value}) ++ self.assertEqual(conv(p.paneconfigure(b, name)[4]), expected) ++ self.assertEqual(conv(p.panecget(b, name)), expected) ++ ++ def check_paneconfigure_bad(self, p, b, name, msg): ++ with self.assertRaisesRegex(TclError, msg): ++ p.paneconfigure(b, **{name: 'badValue'}) ++ ++ def test_paneconfigure_after(self): ++ p, b, c = self.create2() ++ self.check_paneconfigure(p, b, 'after', c, str(c)) ++ self.check_paneconfigure_bad(p, b, 'after', ++ 'bad window path name "badValue"') ++ ++ def test_paneconfigure_before(self): ++ p, b, c = self.create2() ++ self.check_paneconfigure(p, b, 'before', c, str(c)) ++ self.check_paneconfigure_bad(p, b, 'before', ++ 'bad window path name "badValue"') ++ ++ def test_paneconfigure_height(self): ++ p, b, c = self.create2() ++ self.check_paneconfigure(p, b, 'height', 10, 10, ++ stringify=tcl_version < (8, 5)) ++ self.check_paneconfigure_bad(p, b, 'height', ++ 'bad screen distance "badValue"') ++ ++ @requires_tcl(8, 5) ++ def test_paneconfigure_hide(self): ++ p, b, c = self.create2() ++ self.check_paneconfigure(p, b, 'hide', False, 0) ++ self.check_paneconfigure_bad(p, b, 'hide', ++ 'expected boolean value but got "badValue"') ++ ++ def test_paneconfigure_minsize(self): ++ p, b, c = self.create2() ++ self.check_paneconfigure(p, b, 'minsize', 10, 10) ++ self.check_paneconfigure_bad(p, b, 'minsize', ++ 'bad screen distance "badValue"') ++ ++ def test_paneconfigure_padx(self): ++ p, b, c = self.create2() ++ self.check_paneconfigure(p, b, 'padx', 1.3, 1) ++ self.check_paneconfigure_bad(p, b, 'padx', ++ 'bad screen distance "badValue"') ++ ++ def test_paneconfigure_pady(self): ++ p, b, c = self.create2() ++ self.check_paneconfigure(p, b, 'pady', 1.3, 1) ++ self.check_paneconfigure_bad(p, b, 'pady', ++ 'bad screen distance "badValue"') ++ ++ def test_paneconfigure_sticky(self): ++ p, b, c = self.create2() ++ self.check_paneconfigure(p, b, 'sticky', 'nsew', 'nesw') ++ self.check_paneconfigure_bad(p, b, 'sticky', ++ 'bad stickyness value "badValue": must ' ++ 'be a string containing zero or more of ' ++ 'n, e, s, and w') ++ ++ @requires_tcl(8, 5) ++ def test_paneconfigure_stretch(self): ++ p, b, c = self.create2() ++ self.check_paneconfigure(p, b, 'stretch', 'alw', 'always') ++ self.check_paneconfigure_bad(p, b, 'stretch', ++ 'bad stretch "badValue": must be ' ++ 'always, first, last, middle, or never') ++ ++ def test_paneconfigure_width(self): ++ p, b, c = self.create2() ++ self.check_paneconfigure(p, b, 'width', 10, 10, ++ stringify=tcl_version < (8, 5)) ++ self.check_paneconfigure_bad(p, b, 'width', ++ 'bad screen distance "badValue"') ++ + + @add_standard_options(StandardOptionsTests) + class MenuTest(AbstractWidgetTest, unittest.TestCase): +@@ -923,6 +1128,39 @@ + self.checkEnumParam(widget, 'type', + 'normal', 'tearoff', 'menubar') + ++ def test_entryconfigure(self): ++ m1 = self.create() ++ m1.add_command(label='test') ++ self.assertRaises(TypeError, m1.entryconfigure) ++ with self.assertRaisesRegex(TclError, 'bad menu entry index "foo"'): ++ m1.entryconfigure('foo') ++ d = m1.entryconfigure(1) ++ self.assertIsInstance(d, dict) ++ for k, v in d.items(): ++ self.assertIsInstance(k, str) ++ self.assertIsInstance(v, tuple) ++ self.assertEqual(len(v), 5) ++ self.assertEqual(v[0], k) ++ self.assertEqual(m1.entrycget(1, k), v[4]) ++ m1.destroy() ++ ++ def test_entryconfigure_label(self): ++ m1 = self.create() ++ m1.add_command(label='test') ++ self.assertEqual(m1.entrycget(1, 'label'), 'test') ++ m1.entryconfigure(1, label='changed') ++ self.assertEqual(m1.entrycget(1, 'label'), 'changed') ++ ++ def test_entryconfigure_variable(self): ++ m1 = self.create() ++ v1 = tkinter.BooleanVar(self.root) ++ v2 = tkinter.BooleanVar(self.root) ++ m1.add_checkbutton(variable=v1, onvalue=True, offvalue=False, ++ label='Nonsense') ++ self.assertEqual(str(m1.entrycget(1, 'variable')), str(v1)) ++ m1.entryconfigure(1, variable=v2) ++ self.assertEqual(str(m1.entrycget(1, 'variable')), str(v2)) ++ + + @add_standard_options(PixelSizeTests, StandardOptionsTests) + class MessageTest(AbstractWidgetTest, unittest.TestCase): +diff -r c0e311e010fc Lib/tkinter/test/test_ttk/test_functions.py +--- a/Lib/tkinter/test/test_ttk/test_functions.py ++++ b/Lib/tkinter/test/test_ttk/test_functions.py +@@ -1,7 +1,19 @@ + # -*- encoding: utf-8 -*- + import unittest ++import tkinter + from tkinter import ttk + ++class MockTkApp: ++ ++ def splitlist(self, arg): ++ if isinstance(arg, tuple): ++ return arg ++ return arg.split(':') ++ ++ def wantobjects(self): ++ return True ++ ++ + class MockTclObj(object): + typename = 'test' + +@@ -352,20 +364,22 @@ + + + def test_list_from_layouttuple(self): ++ tk = MockTkApp() ++ + # empty layout tuple +- self.assertFalse(ttk._list_from_layouttuple(())) ++ self.assertFalse(ttk._list_from_layouttuple(tk, ())) + + # shortest layout tuple +- self.assertEqual(ttk._list_from_layouttuple(('name', )), ++ self.assertEqual(ttk._list_from_layouttuple(tk, ('name', )), + [('name', {})]) + + # not so interesting ltuple + sample_ltuple = ('name', '-option', 'value') +- self.assertEqual(ttk._list_from_layouttuple(sample_ltuple), ++ self.assertEqual(ttk._list_from_layouttuple(tk, sample_ltuple), + [('name', {'option': 'value'})]) + + # empty children +- self.assertEqual(ttk._list_from_layouttuple( ++ self.assertEqual(ttk._list_from_layouttuple(tk, + ('something', '-children', ())), + [('something', {'children': []})] + ) +@@ -378,7 +392,7 @@ + ) + ) + ) +- self.assertEqual(ttk._list_from_layouttuple(ltuple), ++ self.assertEqual(ttk._list_from_layouttuple(tk, ltuple), + [('name', {'option': 'niceone', 'children': + [('otherone', {'otheropt': 'othervalue', 'children': + [('child', {})] +@@ -387,29 +401,35 @@ + ) + + # bad tuples +- self.assertRaises(ValueError, ttk._list_from_layouttuple, ++ self.assertRaises(ValueError, ttk._list_from_layouttuple, tk, + ('name', 'no_minus')) +- self.assertRaises(ValueError, ttk._list_from_layouttuple, ++ self.assertRaises(ValueError, ttk._list_from_layouttuple, tk, + ('name', 'no_minus', 'value')) +- self.assertRaises(ValueError, ttk._list_from_layouttuple, ++ self.assertRaises(ValueError, ttk._list_from_layouttuple, tk, + ('something', '-children')) # no children +- import tkinter +- if not tkinter._default_root or tkinter._default_root.wantobjects(): +- self.assertRaises(ValueError, ttk._list_from_layouttuple, +- ('something', '-children', 'value')) # invalid children + + + def test_val_or_dict(self): +- def func(opt, val=None): ++ def func(res, opt=None, val=None): ++ if opt is None: ++ return res + if val is None: + return "test val" + return (opt, val) + +- options = {'test': None} +- self.assertEqual(ttk._val_or_dict(options, func), "test val") ++ tk = MockTkApp() ++ tk.call = func + +- options = {'test': 3} +- self.assertEqual(ttk._val_or_dict(options, func), options) ++ self.assertEqual(ttk._val_or_dict(tk, {}, '-test:3'), ++ {'test': '3'}) ++ self.assertEqual(ttk._val_or_dict(tk, {}, ('-test', 3)), ++ {'test': 3}) ++ ++ self.assertEqual(ttk._val_or_dict(tk, {'test': None}, 'x:y'), ++ 'test val') ++ ++ self.assertEqual(ttk._val_or_dict(tk, {'test': 3}, 'x:y'), ++ {'test': 3}) + + + def test_convert_stringval(self): +diff -r c0e311e010fc Lib/tkinter/test/test_ttk/test_widgets.py +--- a/Lib/tkinter/test/test_ttk/test_widgets.py ++++ b/Lib/tkinter/test/test_ttk/test_widgets.py +@@ -460,10 +460,7 @@ + + + def test_bbox(self): +- self.assertEqual(len(self.entry.bbox(0)), 4) +- for item in self.entry.bbox(0): +- self.assertIsInstance(item, int) +- ++ self.assertIsBoundingBox(self.entry.bbox(0)) + self.assertRaises(tkinter.TclError, self.entry.bbox, 'noindex') + self.assertRaises(tkinter.TclError, self.entry.bbox, None) + +@@ -1216,12 +1213,7 @@ + self.assertTrue(children) + + bbox = self.tv.bbox(children[0]) +- self.assertEqual(len(bbox), 4) +- self.assertIsInstance(bbox, tuple) +- for item in bbox: +- if not isinstance(item, int): +- self.fail("Invalid bounding box: %s" % bbox) +- break ++ self.assertIsBoundingBox(bbox) + + # compare width in bboxes + self.tv['columns'] = ['test'] +diff -r c0e311e010fc Lib/tkinter/test/widget_tests.py +--- a/Lib/tkinter/test/widget_tests.py ++++ b/Lib/tkinter/test/widget_tests.py +@@ -202,6 +202,16 @@ + def checkVariableParam(self, widget, name, var): + self.checkParam(widget, name, var, conv=str) + ++ def assertIsBoundingBox(self, bbox): ++ self.assertIsNotNone(bbox) ++ self.assertIsInstance(bbox, tuple) ++ if len(bbox) != 4: ++ self.fail('Invalid bounding box: %r' % (bbox,)) ++ for item in bbox: ++ if not isinstance(item, int): ++ self.fail('Invalid bounding box: %r' % (bbox,)) ++ break ++ + + class StandardOptionsTests: + STANDARD_OPTIONS = ( +diff -r c0e311e010fc Lib/tkinter/ttk.py +--- a/Lib/tkinter/ttk.py ++++ b/Lib/tkinter/ttk.py +@@ -272,9 +272,10 @@ + it = iter(nval) + return [_flatten(spec) for spec in zip(it, it)] + +-def _list_from_layouttuple(ltuple): ++def _list_from_layouttuple(tk, ltuple): + """Construct a list from the tuple returned by ttk::layout, this is + somewhat the reverse of _format_layoutlist.""" ++ ltuple = tk.splitlist(ltuple) + res = [] + + indx = 0 +@@ -293,17 +294,14 @@ + indx += 2 + + if opt == 'children': +- if (tkinter._default_root and +- not tkinter._default_root.wantobjects()): +- val = tkinter._default_root.splitlist(val) +- val = _list_from_layouttuple(val) ++ val = _list_from_layouttuple(tk, val) + + opts[opt] = val + + return res + +-def _val_or_dict(options, func, *args): +- """Format options then call func with args and options and return ++def _val_or_dict(tk, options, *args): ++ """Format options then call Tk command with args and options and return + the appropriate result. + + If no option is specified, a dict is returned. If a option is +@@ -311,14 +309,12 @@ + Otherwise, the function just sets the passed options and the caller + shouldn't be expecting a return value anyway.""" + options = _format_optdict(options) +- res = func(*(args + options)) ++ res = tk.call(*(args + options)) + + if len(options) % 2: # option specified without a value, return its value + return res + +- if tkinter._default_root: +- res = tkinter._default_root.splitlist(res) +- return _dict_from_tcltuple(res) ++ return _dict_from_tcltuple(tk.splitlist(res)) + + def _convert_stringval(value): + """Converts a value to, hopefully, a more appropriate Python object.""" +@@ -396,7 +392,7 @@ + a sequence identifying the value for that option.""" + if query_opt is not None: + kw[query_opt] = None +- return _val_or_dict(kw, self.tk.call, self._name, "configure", style) ++ return _val_or_dict(self.tk, kw, self._name, "configure", style) + + + def map(self, style, query_opt=None, **kw): +@@ -411,8 +407,8 @@ + return _list_from_statespec(self.tk.splitlist( + self.tk.call(self._name, "map", style, '-%s' % query_opt))) + +- return _dict_from_tcltuple( +- self.tk.call(self._name, "map", style, *(_format_mapdict(kw)))) ++ return _dict_from_tcltuple(self.tk.splitlist( ++ self.tk.call(self._name, "map", style, *(_format_mapdict(kw))))) + + + def lookup(self, style, option, state=None, default=None): +@@ -466,8 +462,8 @@ + lspec = "null" # could be any other word, but this may make sense + # when calling layout(style) later + +- return _list_from_layouttuple(self.tk.splitlist( +- self.tk.call(self._name, "layout", style, lspec))) ++ return _list_from_layouttuple(self.tk, ++ self.tk.call(self._name, "layout", style, lspec)) + + + def element_create(self, elementname, etype, *args, **kw): +@@ -907,7 +903,7 @@ + options to the corresponding values.""" + if option is not None: + kw[option] = None +- return _val_or_dict(kw, self.tk.call, self._w, "tab", tab_id) ++ return _val_or_dict(self.tk, kw, self._w, "tab", tab_id) + + + def tabs(self): +@@ -984,7 +980,7 @@ + Otherwise, sets the options to the corresponding values.""" + if option is not None: + kw[option] = None +- return _val_or_dict(kw, self.tk.call, self._w, "pane", pane) ++ return _val_or_dict(self.tk, kw, self._w, "pane", pane) + + + def sashpos(self, index, newpos=None): +@@ -1223,7 +1219,7 @@ + Otherwise, sets the options to the corresponding values.""" + if option is not None: + kw[option] = None +- return _val_or_dict(kw, self.tk.call, self._w, "column", column) ++ return _val_or_dict(self.tk, kw, self._w, "column", column) + + + def delete(self, *items): +@@ -1282,7 +1278,7 @@ + if option is not None: + kw[option] = None + +- return _val_or_dict(kw, self.tk.call, self._w, 'heading', column) ++ return _val_or_dict(self.tk, kw, self._w, 'heading', column) + + + def identify(self, component, x, y): +@@ -1361,7 +1357,7 @@ + values as given by kw.""" + if option is not None: + kw[option] = None +- return _val_or_dict(kw, self.tk.call, self._w, "item", item) ++ return _val_or_dict(self.tk, kw, self._w, "item", item) + + + def move(self, item, parent, index): +@@ -1456,7 +1452,7 @@ + values for the given tagname.""" + if option is not None: + kw[option] = None +- return _val_or_dict(kw, self.tk.call, self._w, "tag", "configure", ++ return _val_or_dict(self.tk, kw, self._w, "tag", "configure", + tagname) + + +diff -r c0e311e010fc Lib/turtle.py +--- a/Lib/turtle.py ++++ b/Lib/turtle.py +@@ -140,7 +140,7 @@ + _tg_utilities = ['write_docstringdict', 'done'] + + __all__ = (_tg_classes + _tg_screen_functions + _tg_turtle_functions + +- _tg_utilities) # + _math_functions) ++ _tg_utilities + ['Terminator']) # + _math_functions) + + _alias_list = ['addshape', 'backward', 'bk', 'fd', 'ht', 'lt', 'pd', 'pos', + 'pu', 'rt', 'seth', 'setpos', 'setposition', 'st', +@@ -2594,7 +2594,7 @@ + Example (for a Turtle instance named turtle): + >>> turtle.setundobuffer(42) + """ +- if size is None: ++ if size is None or size <= 0: + self.undobuffer = None + else: + self.undobuffer = Tbuffer(size) +@@ -2945,7 +2945,7 @@ + self._stretchfactor = a11, a22 + self._shearfactor = a12/a22 + self._tilt = alfa +- self._update() ++ self.pen(resizemode="user") + + + def _polytrafo(self, poly): +diff -r c0e311e010fc Lib/turtledemo/__init__.py +--- a/Lib/turtledemo/__init__.py ++++ b/Lib/turtledemo/__init__.py +@@ -0,0 +1,14 @@ ++""" ++ -------------------------------------- ++ About this viewer ++ -------------------------------------- ++ ++ Tiny demo viewer to view turtle graphics example scripts. ++ ++ Quickly and dirtyly assembled by Gregor Lingl. ++ June, 2006 ++ ++ For more information see: turtledemo - Help ++ ++ Have fun! ++""" +diff -r c0e311e010fc Lib/turtledemo/__main__.py +--- a/Lib/turtledemo/__main__.py ++++ b/Lib/turtledemo/__main__.py +@@ -1,12 +1,95 @@ + #!/usr/bin/env python3 ++ ++""" ++ ---------------------------------------------- ++ turtleDemo - Help ++ ---------------------------------------------- ++ ++ This document has two sections: ++ ++ (1) How to use the demo viewer ++ (2) How to add your own demos to the demo repository ++ ++ ++ (1) How to use the demo viewer. ++ ++ Select a demoscript from the example menu. ++ The (syntax coloured) source code appears in the left ++ source code window. IT CANNOT BE EDITED, but ONLY VIEWED! ++ ++ - Press START button to start the demo. ++ - Stop execution by pressing the STOP button. ++ - Clear screen by pressing the CLEAR button. ++ - Restart by pressing the START button again. ++ ++ SPECIAL demos are those which run EVENTDRIVEN. ++ (For example clock.py - or oldTurtleDemo.py which ++ in the end expects a mouse click.): ++ ++ Press START button to start the demo. ++ ++ - Until the EVENTLOOP is entered everything works ++ as in an ordinary demo script. ++ ++ - When the EVENTLOOP is entered, you control the ++ application by using the mouse and/or keys (or it's ++ controlled by some timer events) ++ To stop it you can and must press the STOP button. ++ ++ While the EVENTLOOP is running, the examples menu is disabled. ++ ++ - Only after having pressed the STOP button, you may ++ restart it or choose another example script. ++ ++ * * * * * * * * ++ In some rare situations there may occur interferences/conflicts ++ between events concerning the demo script and those concerning the ++ demo-viewer. (They run in the same process.) Strange behaviour may be ++ the consequence and in the worst case you must close and restart the ++ viewer. ++ * * * * * * * * ++ ++ ++ (2) How to add your own demos to the demo repository ++ ++ - Place the file in the same directory as turtledemo/__main__.py ++ IMPORTANT! When imported, the demo should not modify the system ++ by calling functions in other modules, such as sys, tkinter, or ++ turtle. Global variables should be initialized in main(). ++ ++ - The code must contain a main() function which will ++ be executed by the viewer (see provided example scripts). ++ It may return a string which will be displayed in the Label below ++ the source code window (when execution has finished.) ++ ++ - In order to run mydemo.py by itself, such as during development, ++ add the following at the end of the file: ++ ++ if __name__ == '__main__': ++ main() ++ mainloop() # keep window open ++ ++ python -m turtledemo.mydemo # will then run it ++ ++ - If the demo is EVENT DRIVEN, main must return the string ++ "EVENTLOOP". This informs the demo viewer that the script is ++ still running and must be stopped by the user! ++ ++ If an "EVENTLOOP" demo runs by itself, as with clock, which uses ++ ontimer, or minimal_hanoi, which loops by recursion, then the ++ code should catch the turtle.Terminator exception that will be ++ raised when the user presses the STOP button. (Paint is not such ++ a demo; it only acts in response to mouse clicks and movements.) ++""" + import sys + import os + + from tkinter import * + from idlelib.Percolator import Percolator + from idlelib.ColorDelegator import ColorDelegator +-from idlelib.textView import view_file # TextViewer ++from idlelib.textView import view_text # TextViewer + from importlib import reload ++from turtledemo import __doc__ as about_turtledemo + + import turtle + import time +@@ -27,88 +110,72 @@ + return [entry[:-3] for entry in os.listdir(demo_dir) if + entry.endswith(".py") and entry[0] != '_'] + +-def showDemoHelp(): +- view_file(demo.root, "Help on turtleDemo", +- os.path.join(demo_dir, "demohelp.txt")) +- +-def showAboutDemo(): +- view_file(demo.root, "About turtleDemo", +- os.path.join(demo_dir, "about_turtledemo.txt")) +- +-def showAboutTurtle(): +- view_file(demo.root, "About the new turtle module.", +- os.path.join(demo_dir, "about_turtle.txt")) ++help_entries = ( # (help_label, help_doc) ++ ('Turtledemo help', __doc__), ++ ('About turtledemo', about_turtledemo), ++ ('About turtle module', turtle.__doc__), ++ ) + + class DemoWindow(object): + +- def __init__(self, filename=None): #, root=None): ++ def __init__(self, filename=None): + self.root = root = turtle._root = Tk() ++ root.title('Python turtle-graphics examples') + root.wm_protocol("WM_DELETE_WINDOW", self._destroy) + +- ################# +- self.mBar = Frame(root, relief=RAISED, borderwidth=2) +- self.mBar.pack(fill=X) ++ if sys.platform == 'darwin': ++ import subprocess ++ # Make sure we are the currently activated OS X application ++ # so that our menu bar appears. ++ p = subprocess.Popen( ++ [ ++ 'osascript', ++ '-e', 'tell application "System Events"', ++ '-e', 'set frontmost of the first process whose ' ++ 'unix id is {} to true'.format(os.getpid()), ++ '-e', 'end tell', ++ ], ++ stderr=subprocess.DEVNULL, ++ stdout=subprocess.DEVNULL, ++ ) + +- self.ExamplesBtn = self.makeLoadDemoMenu() +- self.OptionsBtn = self.makeHelpMenu() +- self.mBar.tk_menuBar(self.ExamplesBtn, self.OptionsBtn) #, QuitBtn) ++ root.grid_rowconfigure(0, weight=1) ++ root.grid_columnconfigure(0, weight=1) ++ root.grid_columnconfigure(1, minsize=90, weight=1) ++ root.grid_columnconfigure(2, minsize=90, weight=1) ++ root.grid_columnconfigure(3, minsize=90, weight=1) + +- root.title('Python turtle-graphics examples') +- ################# +- self.left_frame = left_frame = Frame(root) +- self.text_frame = text_frame = Frame(left_frame) +- self.vbar = vbar =Scrollbar(text_frame, name='vbar') +- self.text = text = Text(text_frame, +- name='text', padx=5, wrap='none', +- width=45) +- vbar['command'] = text.yview +- vbar.pack(side=LEFT, fill=Y) +- ##################### +- self.hbar = hbar =Scrollbar(text_frame, name='hbar', orient=HORIZONTAL) +- hbar['command'] = text.xview +- hbar.pack(side=BOTTOM, fill=X) +- ##################### +- text['yscrollcommand'] = vbar.set +- text.config(font=txtfont) +- text.config(xscrollcommand=hbar.set) +- text.pack(side=LEFT, fill=Y, expand=1) +- ##################### +- self.output_lbl = Label(left_frame, height= 1,text=" --- ", bg = "#ddf", +- font = ("Arial", 16, 'normal')) +- self.output_lbl.pack(side=BOTTOM, expand=0, fill=X) +- ##################### +- text_frame.pack(side=LEFT, fill=BOTH, expand=0) +- left_frame.pack(side=LEFT, fill=BOTH, expand=0) +- self.graph_frame = g_frame = Frame(root) ++ self.mBar = Menu(root, relief=RAISED, borderwidth=2) ++ self.mBar.add_cascade(menu=self.makeLoadDemoMenu(self.mBar), ++ label='Examples', underline=0, font=menufont) ++ self.mBar.add_cascade(menu=self.makeHelpMenu(self.mBar), ++ label='Help', underline=0, font=menufont) ++ root['menu'] = self.mBar + +- turtle._Screen._root = g_frame +- turtle._Screen._canvas = turtle.ScrolledCanvas(g_frame, 800, 600, 1000, 800) +- #xturtle.Screen._canvas.pack(expand=1, fill="both") +- self.screen = _s_ = turtle.Screen() +-##### +- turtle.TurtleScreen.__init__(_s_, _s_._canvas) +-##### +- self.scanvas = _s_._canvas +- #xturtle.RawTurtle.canvases = [self.scanvas] +- turtle.RawTurtle.screens = [_s_] ++ pane = PanedWindow(orient=HORIZONTAL, sashwidth=5, ++ sashrelief=SOLID, bg='#ddd') ++ pane.add(self.makeTextFrame(pane)) ++ pane.add(self.makeGraphFrame(pane)) ++ pane.grid(row=0, columnspan=4, sticky='news') + +- self.scanvas.pack(side=TOP, fill=BOTH, expand=1) ++ self.output_lbl = Label(root, height= 1, text=" --- ", bg="#ddf", ++ font=("Arial", 16, 'normal'), borderwidth=2, ++ relief=RIDGE) ++ self.start_btn = Button(root, text=" START ", font=btnfont, ++ fg="white", disabledforeground = "#fed", ++ command=self.startDemo) ++ self.stop_btn = Button(root, text=" STOP ", font=btnfont, ++ fg="white", disabledforeground = "#fed", ++ command=self.stopIt) ++ self.clear_btn = Button(root, text=" CLEAR ", font=btnfont, ++ fg="white", disabledforeground="#fed", ++ command = self.clearCanvas) ++ self.output_lbl.grid(row=1, column=0, sticky='news', padx=(0,5)) ++ self.start_btn.grid(row=1, column=1, sticky='ew') ++ self.stop_btn.grid(row=1, column=2, sticky='ew') ++ self.clear_btn.grid(row=1, column=3, sticky='ew') + +- self.btn_frame = btn_frame = Frame(g_frame, height=100) +- self.start_btn = Button(btn_frame, text=" START ", font=btnfont, fg = "white", +- disabledforeground = "#fed", command=self.startDemo) +- self.start_btn.pack(side=LEFT, fill=X, expand=1) +- self.stop_btn = Button(btn_frame, text=" STOP ", font=btnfont, fg = "white", +- disabledforeground = "#fed", command = self.stopIt) +- self.stop_btn.pack(side=LEFT, fill=X, expand=1) +- self.clear_btn = Button(btn_frame, text=" CLEAR ", font=btnfont, fg = "white", +- disabledforeground = "#fed", command = self.clearCanvas) +- self.clear_btn.pack(side=LEFT, fill=X, expand=1) +- +- self.btn_frame.pack(side=TOP, fill=BOTH, expand=0) +- self.graph_frame.pack(side=TOP, fill=BOTH, expand=1) +- +- Percolator(text).insertfilter(ColorDelegator()) ++ Percolator(self.text).insertfilter(ColorDelegator()) + self.dirty = False + self.exitflag = False + if filename: +@@ -117,70 +184,84 @@ + "Choose example from menu", "black") + self.state = STARTUP + +- def _destroy(self): +- self.root.destroy() +- sys.exit() ++ ++ def onResize(self, event): ++ cwidth = self._canvas.winfo_width() ++ cheight = self._canvas.winfo_height() ++ self._canvas.xview_moveto(0.5*(self.canvwidth-cwidth)/self.canvwidth) ++ self._canvas.yview_moveto(0.5*(self.canvheight-cheight)/self.canvheight) ++ ++ def makeTextFrame(self, root): ++ self.text_frame = text_frame = Frame(root) ++ self.text = text = Text(text_frame, name='text', padx=5, ++ wrap='none', width=45) ++ ++ self.vbar = vbar = Scrollbar(text_frame, name='vbar') ++ vbar['command'] = text.yview ++ vbar.pack(side=LEFT, fill=Y) ++ self.hbar = hbar = Scrollbar(text_frame, name='hbar', orient=HORIZONTAL) ++ hbar['command'] = text.xview ++ hbar.pack(side=BOTTOM, fill=X) ++ ++ text['font'] = txtfont ++ text['yscrollcommand'] = vbar.set ++ text['xscrollcommand'] = hbar.set ++ text.pack(side=LEFT, fill=BOTH, expand=1) ++ return text_frame ++ ++ def makeGraphFrame(self, root): ++ turtle._Screen._root = root ++ self.canvwidth = 1000 ++ self.canvheight = 800 ++ turtle._Screen._canvas = self._canvas = canvas = turtle.ScrolledCanvas( ++ root, 800, 600, self.canvwidth, self.canvheight) ++ canvas.adjustScrolls() ++ canvas._rootwindow.bind('', self.onResize) ++ canvas._canvas['borderwidth'] = 0 ++ ++ self.screen = _s_ = turtle.Screen() ++ turtle.TurtleScreen.__init__(_s_, _s_._canvas) ++ self.scanvas = _s_._canvas ++ turtle.RawTurtle.screens = [_s_] ++ return canvas + + def configGUI(self, menu, start, stop, clear, txt="", color="blue"): +- self.ExamplesBtn.config(state=menu) ++ self.mBar.entryconfigure(0, state=menu) + +- self.start_btn.config(state=start) +- if start == NORMAL: +- self.start_btn.config(bg="#d00") +- else: +- self.start_btn.config(bg="#fca") +- +- self.stop_btn.config(state=stop) +- if stop == NORMAL: +- self.stop_btn.config(bg="#d00") +- else: +- self.stop_btn.config(bg="#fca") +- self.clear_btn.config(state=clear) +- +- self.clear_btn.config(state=clear) +- if clear == NORMAL: +- self.clear_btn.config(bg="#d00") +- else: +- self.clear_btn.config(bg="#fca") +- ++ self.start_btn.config(state=start, ++ bg="#d00" if start == NORMAL else "#fca") ++ self.stop_btn.config(state=stop, ++ bg="#d00" if stop == NORMAL else "#fca") ++ self.clear_btn.config(state=clear, ++ bg="#d00" if clear == NORMAL else"#fca") + self.output_lbl.config(text=txt, fg=color) + +- +- def makeLoadDemoMenu(self): +- CmdBtn = Menubutton(self.mBar, text='Examples', underline=0, font=menufont) +- CmdBtn.pack(side=LEFT, padx="2m") +- CmdBtn.menu = Menu(CmdBtn) ++ def makeLoadDemoMenu(self, master): ++ menu = Menu(master) + + for entry in getExampleEntries(): + def loadexample(x): + def emit(): + self.loadfile(x) + return emit +- CmdBtn.menu.add_command(label=entry, underline=0, +- font=menufont, command=loadexample(entry)) ++ menu.add_command(label=entry, underline=0, ++ font=menufont, command=loadexample(entry)) + +- CmdBtn['menu'] = CmdBtn.menu +- return CmdBtn ++ return menu + +- def makeHelpMenu(self): +- CmdBtn = Menubutton(self.mBar, text='Help', underline=0, font=menufont) +- CmdBtn.pack(side=LEFT, padx='2m') +- CmdBtn.menu = Menu(CmdBtn) ++ def makeHelpMenu(self, master): ++ menu = Menu(master) + +- CmdBtn.menu.add_command(label='About turtle.py', font=menufont, +- command=showAboutTurtle) +- CmdBtn.menu.add_command(label='turtleDemo - Help', font=menufont, +- command=showDemoHelp) +- CmdBtn.menu.add_command(label='About turtleDemo', font=menufont, +- command=showAboutDemo) ++ for help_label, help_file in help_entries: ++ def show(help_label=help_label, help_file=help_file): ++ view_text(self.root, help_label, help_file) ++ menu.add_command(label=help_label, font=menufont, command=show) + +- CmdBtn['menu'] = CmdBtn.menu +- return CmdBtn ++ return menu + + def refreshCanvas(self): + if not self.dirty: return + self.screen.clear() +- #self.screen.mode("standard") + self.dirty=False + + def loadfile(self, filename): +@@ -238,29 +319,16 @@ + self.configGUI(NORMAL, NORMAL, DISABLED, DISABLED, + "STOPPED!", "red") + turtle.TurtleScreen._RUNNING = False +- #print "stopIT: exitflag = True" + else: + turtle.TurtleScreen._RUNNING = False +- #print "stopIt: exitflag = False" ++ ++ def _destroy(self): ++ self.root.destroy() ++ ++ ++def main(): ++ demo = DemoWindow() ++ demo.root.mainloop() + + if __name__ == '__main__': +- demo = DemoWindow() +- RUN = True +- while RUN: +- try: +- #print("ENTERING mainloop") +- demo.root.mainloop() +- except AttributeError: +- #print("AttributeError!- WAIT A MOMENT!") +- time.sleep(0.3) +- print("GOING ON ..") +- demo.ckearCanvas() +- except TypeError: +- demo.screen._delete("all") +- #print("CRASH!!!- WAIT A MOMENT!") +- time.sleep(0.3) +- #print("GOING ON ..") +- demo.clearCanvas() +- except: +- print("BYE!") +- RUN = False ++ main() +diff -r c0e311e010fc Lib/turtledemo/about_turtle.txt +--- a/Lib/turtledemo/about_turtle.txt ++++ /dev/null +@@ -1,76 +0,0 @@ +- +-======================================================== +- A new turtle module for Python +-======================================================== +- +-Turtle graphics is a popular way for introducing programming to +-kids. It was part of the original Logo programming language developed +-by Wally Feurzig and Seymour Papert in 1966. +- +-Imagine a robotic turtle starting at (0, 0) in the x-y plane. After an ``import turtle``, give it +-the command turtle.forward(15), and it moves (on-screen!) 15 pixels in +-the direction it is facing, drawing a line as it moves. Give it the +-command turtle.right(25), and it rotates in-place 25 degrees clockwise. +- +-By combining together these and similar commands, intricate shapes and +-pictures can easily be drawn. +- +------ turtle.py +- +-This module is an extended reimplementation of turtle.py from the +-Python standard distribution up to Python 2.5. (See: http:\\www.python.org) +- +-It tries to keep the merits of turtle.py and to be (nearly) 100% +-compatible with it. This means in the first place to enable the +-learning programmer to use all the commands, classes and methods +-interactively when using the module from within IDLE run with +-the -n switch. +- +-Roughly it has the following features added: +- +-- Better animation of the turtle movements, especially of turning the +- turtle. So the turtles can more easily be used as a visual feedback +- instrument by the (beginning) programmer. +- +-- Different turtle shapes, gif-images as turtle shapes, user defined +- and user controllable turtle shapes, among them compound +- (multicolored) shapes. Turtle shapes can be stgretched and tilted, which +- makes turtles zu very versatile geometrical objects. +- +-- Fine control over turtle movement and screen updates via delay(), +- and enhanced tracer() and speed() methods. +- +-- Aliases for the most commonly used commands, like fd for forward etc., +- following the early Logo traditions. This reduces the boring work of +- typing long sequences of commands, which often occur in a natural way +- when kids try to program fancy pictures on their first encounter with +- turtle graphcis. +- +-- Turtles now have an undo()-method with configurable undo-buffer. +- +-- Some simple commands/methods for creating event driven programs +- (mouse-, key-, timer-events). Especially useful for programming games. +- +-- A scrollable Canvas class. The default scrollable Canvas can be +- extended interactively as needed while playing around with the turtle(s). +- +-- A TurtleScreen class with methods controlling background color or +- background image, window and canvas size and other properties of the +- TurtleScreen. +- +-- There is a method, setworldcoordinates(), to install a user defined +- coordinate-system for the TurtleScreen. +- +-- The implementation uses a 2-vector class named Vec2D, derived from tuple. +- This class is public, so it can be imported by the application programmer, +- which makes certain types of computations very natural and compact. +- +-- Appearance of the TurtleScreen and the Turtles at startup/import can be +- configured by means of a turtle.cfg configuration file. +- The default configuration mimics the appearance of the old turtle module. +- +-- If configured appropriately the module reads in docstrings from a docstring +- dictionary in some different language, supplied separately and replaces +- the english ones by those read in. There is a utility function +- write_docstringdict() to write a dictionary with the original (english) +- docstrings to disc, so it can serve as a template for translations. +diff -r c0e311e010fc Lib/turtledemo/about_turtledemo.txt +--- a/Lib/turtledemo/about_turtledemo.txt ++++ /dev/null +@@ -1,13 +0,0 @@ +- +- -------------------------------------- +- About this viewer +- -------------------------------------- +- +- Tiny demo viewer to view turtle graphics example scripts. +- +- Quickly and dirtyly assembled by Gregor Lingl. +- June, 2006 +- +- For more information see: turtleDemo - Help +- +- Have fun! +diff -r c0e311e010fc Lib/turtledemo/clock.py +--- a/Lib/turtledemo/clock.py ++++ b/Lib/turtledemo/clock.py +@@ -13,8 +13,6 @@ + from turtle import * + from datetime import datetime + +-mode("logo") +- + def jump(distanz, winkel=0): + penup() + right(winkel) +@@ -42,7 +40,6 @@ + hand_form = get_poly() + register_shape(name, hand_form) + +- + def clockface(radius): + reset() + pensize(7) +@@ -83,7 +80,6 @@ + writer.pu() + writer.bk(85) + +- + def wochentag(t): + wochentag = ["Monday", "Tuesday", "Wednesday", + "Thursday", "Friday", "Saturday", "Sunday"] +@@ -102,22 +98,25 @@ + sekunde = t.second + t.microsecond*0.000001 + minute = t.minute + sekunde/60.0 + stunde = t.hour + minute/60.0 +- tracer(False) +- writer.clear() +- writer.home() +- writer.forward(65) +- writer.write(wochentag(t), +- align="center", font=("Courier", 14, "bold")) +- writer.back(150) +- writer.write(datum(t), +- align="center", font=("Courier", 14, "bold")) +- writer.forward(85) +- tracer(True) +- second_hand.setheading(6*sekunde) +- minute_hand.setheading(6*minute) +- hour_hand.setheading(30*stunde) +- tracer(True) +- ontimer(tick, 100) ++ try: ++ tracer(False) # Terminator can occur here ++ writer.clear() ++ writer.home() ++ writer.forward(65) ++ writer.write(wochentag(t), ++ align="center", font=("Courier", 14, "bold")) ++ writer.back(150) ++ writer.write(datum(t), ++ align="center", font=("Courier", 14, "bold")) ++ writer.forward(85) ++ tracer(True) ++ second_hand.setheading(6*sekunde) # or here ++ minute_hand.setheading(6*minute) ++ hour_hand.setheading(30*stunde) ++ tracer(True) ++ ontimer(tick, 100) ++ except Terminator: ++ pass # turtledemo user pressed STOP + + def main(): + tracer(False) +@@ -127,6 +126,7 @@ + return "EVENTLOOP" + + if __name__ == "__main__": ++ mode("logo") + msg = main() + print(msg) + mainloop() +diff -r c0e311e010fc Lib/turtledemo/colormixer.py +--- a/Lib/turtledemo/colormixer.py ++++ b/Lib/turtledemo/colormixer.py +@@ -1,8 +1,6 @@ + # colormixer + + from turtle import Screen, Turtle, mainloop +-import sys +-sys.setrecursionlimit(20000) # overcomes, for now, an instability of Python 3.0 + + class ColorTurtle(Turtle): + +diff -r c0e311e010fc Lib/turtledemo/demohelp.txt +--- a/Lib/turtledemo/demohelp.txt ++++ /dev/null +@@ -1,70 +0,0 @@ +- +- +- ---------------------------------------------- +- +- turtleDemo - Help +- +- ---------------------------------------------- +- +- This document has two sections: +- +- (1) How to use the demo viewer +- (2) How to add your own demos to the demo repository +- +- +- (1) How to use the demo viewer. +- +- Select a demoscript from the example menu. +- The (syntax coloured) source code appears in the left +- source code window. IT CANNOT BE EDITED, but ONLY VIEWED! +- +- - Press START button to start the demo. +- - Stop execution by pressing the STOP button. +- - Clear screen by pressing the CLEAR button. +- - Restart by pressing the START button again. +- +- SPECIAL demos are those which run EVENTDRIVEN. +- (For example clock.py - or oldTurtleDemo.py which +- in the end expects a mouse click.): +- +- Press START button to start the demo. +- +- - Until the EVENTLOOP is entered everything works +- as in an ordinary demo script. +- +- - When the EVENTLOOP is entered, you control the +- application by using the mouse and/or keys (or it's +- controlled by some timer events) +- To stop it you can and must press the STOP button. +- +- While the EVENTLOOP is running, the examples menu is disabled. +- +- - Only after having pressed the STOP button, you may +- restart it or choose another example script. +- +- * * * * * * * * +- In some rare situations there may occur interferences/conflicts +- between events concerning the demo script and those concerning the +- demo-viewer. (They run in the same process.) Strange behaviour may be +- the consequence and in the worst case you must close and restart the +- viewer. +- * * * * * * * * +- +- +- (2) How to add your own demos to the demo repository +- +- - place: same directory as turtledemo/__main__.py +- +- - requirements on source code: +- code must contain a main() function which will +- be executed by the viewer (see provided example scripts) +- main() may return a string which will be displayed +- in the Label below the source code window (when execution +- has finished.) +- +- !! For programs, which are EVENT DRIVEN, main must return +- !! the string "EVENTLOOP". This informs the viewer, that the +- !! script is still running and must be stopped by the user! +- +- +- +diff -r c0e311e010fc Lib/turtledemo/forest.py +--- a/Lib/turtledemo/forest.py ++++ b/Lib/turtledemo/forest.py +@@ -3,12 +3,12 @@ + + tdemo_forest.py + +-Displays a 'forest' of 3 'breadth-first-trees' +-similar to the one from example tree. +-For further remarks see xtx_tree.py ++Displays a 'forest' of 3 breadth-first-trees ++similar to the one in tree. ++For further remarks see tree.py + + This example is a 'breadth-first'-rewrite of +-a Logo program written by Erich Neuwirth. See: ++a Logo program written by Erich Neuwirth. See + http://homepage.univie.ac.at/erich.neuwirth/ + """ + from turtle import Turtle, colormode, tracer, mainloop +@@ -104,6 +104,5 @@ + return "runtime: %.2f sec." % (b-a) + + if __name__ == '__main__': +- msg = main() +- print(msg) ++ main() + mainloop() +diff -r c0e311e010fc Lib/turtledemo/minimal_hanoi.py +--- a/Lib/turtledemo/minimal_hanoi.py ++++ b/Lib/turtledemo/minimal_hanoi.py +@@ -50,9 +50,12 @@ + def play(): + onkey(None,"space") + clear() +- hanoi(6, t1, t2, t3) +- write("press STOP button to exit", +- align="center", font=("Courier", 16, "bold")) ++ try: ++ hanoi(6, t1, t2, t3) ++ write("press STOP button to exit", ++ align="center", font=("Courier", 16, "bold")) ++ except Terminator: ++ pass # turtledemo user pressed STOP + + def main(): + global t1, t2, t3 +diff -r c0e311e010fc Lib/turtledemo/nim.py +--- a/Lib/turtledemo/nim.py ++++ b/Lib/turtledemo/nim.py +@@ -143,7 +143,6 @@ + self.writer.write(msg1, align="center", font=("Courier",14,"bold")) + self.screen.tracer(True) + +- + def setup(self): + self.screen.tracer(False) + for row in range(3): +@@ -181,6 +180,7 @@ + if self.game.state == Nim.OVER: + self.screen.clear() + ++ + class NimController(object): + + def __init__(self, game): +@@ -201,6 +201,7 @@ + self.game.model.notify_move(row, col) + self.BUSY = False + ++ + class Nim(object): + CREATED = 0 + RUNNING = 1 +@@ -213,11 +214,10 @@ + self.controller = NimController(self) + + +-mainscreen = turtle.Screen() +-mainscreen.mode("standard") +-mainscreen.setup(SCREENWIDTH, SCREENHEIGHT) +- + def main(): ++ mainscreen = turtle.Screen() ++ mainscreen.mode("standard") ++ mainscreen.setup(SCREENWIDTH, SCREENHEIGHT) + nim = Nim(mainscreen) + return "EVENTLOOP!" + +diff -r c0e311e010fc Lib/turtledemo/paint.py +--- a/Lib/turtledemo/paint.py ++++ b/Lib/turtledemo/paint.py +@@ -3,11 +3,15 @@ + + tdemo_paint.py + +-A simple eventdriven paint program ++A simple event-driven paint program + +-- use left mouse button to move turtle +-- middle mouse button to change color +-- right mouse button do turn filling on/off ++- left mouse button moves turtle ++- middle mouse button changes color ++- right mouse button toogles betweem pen up ++(no line drawn when the turtle moves) and ++pen down (line is drawn). If pen up follows ++at least two pen-down moves, the polygon that ++includes the starting point is filled. + ------------------------------------------- + Play around by clicking into the canvas + using all three mouse buttons. +diff -r c0e311e010fc Lib/turtledemo/peace.py +--- a/Lib/turtledemo/peace.py ++++ b/Lib/turtledemo/peace.py +@@ -3,14 +3,10 @@ + + tdemo_peace.py + +-A very simple drawing suitable as a beginner's +-programming example. +- +-Uses only commands, which are also available in +-old turtle.py. +- +-Intentionally no variables are used except for the +-colorloop: ++A simple drawing suitable as a beginner's ++programming example. Aside from the ++peacecolors assignment and the for loop, ++it only uses turtle commands. + """ + + from turtle import * +@@ -21,7 +17,7 @@ + "royalblue1", "dodgerblue4") + + reset() +- s = Screen() ++ Screen() + up() + goto(-320,-195) + width(70) +@@ -58,7 +54,7 @@ + up() + + goto(0,300) # vanish if hideturtle() is not available ;-) +- return "Done!!" ++ return "Done!" + + if __name__ == "__main__": + main() +diff -r c0e311e010fc Lib/turtledemo/planet_and_moon.py +--- a/Lib/turtledemo/planet_and_moon.py ++++ b/Lib/turtledemo/planet_and_moon.py +@@ -12,9 +12,9 @@ + Planet has a circular orbit, moon a stable + orbit around the planet. + +-You can hold the movement temporarily by pressing +-the left mouse button with mouse over the +-scrollbar of the canvas. ++You can hold the movement temporarily by ++pressing the left mouse button with the ++mouse over the scrollbar of the canvas. + + """ + from turtle import Shape, Turtle, mainloop, Vec2D as Vec +@@ -108,6 +108,5 @@ + return "Done!" + + if __name__ == '__main__': +- msg = main() +- print(msg) +- #mainloop() ++ main() ++ mainloop() +diff -r c0e311e010fc Lib/turtledemo/tree.py +--- a/Lib/turtledemo/tree.py ++++ b/Lib/turtledemo/tree.py +@@ -11,9 +11,9 @@ + (1) a tree-generator, where the drawing is + quasi the side-effect, whereas the generator + always yields None. +-(2) Turtle-cloning: At each branching point the +-current pen is cloned. So in the end there +-are 1024 turtles. ++(2) Turtle-cloning: At each branching point ++the current pen is cloned. So in the end ++there are 1024 turtles. + """ + from turtle import Turtle, mainloop + from time import clock +diff -r c0e311e010fc Lib/turtledemo/two_canvases.py +--- a/Lib/turtledemo/two_canvases.py ++++ b/Lib/turtledemo/two_canvases.py +@@ -1,52 +1,54 @@ +-#!/usr/bin/env python3 +-## DEMONSTRATES USE OF 2 CANVASES, SO CANNOT BE RUN IN DEMOVIEWER! +-"""turtle example: Using TurtleScreen and RawTurtle +-for drawing on two distinct canvases. ++"""turtledemo.two_canvases ++ ++Use TurtleScreen and RawTurtle to draw on two ++distinct canvases in a separate windows. The ++new window must be separately closed in ++addition to pressing the STOP button. + """ ++ + from turtle import TurtleScreen, RawTurtle, TK + +-root = TK.Tk() +-cv1 = TK.Canvas(root, width=300, height=200, bg="#ddffff") +-cv2 = TK.Canvas(root, width=300, height=200, bg="#ffeeee") +-cv1.pack() +-cv2.pack() ++def main(): ++ root = TK.Tk() ++ cv1 = TK.Canvas(root, width=300, height=200, bg="#ddffff") ++ cv2 = TK.Canvas(root, width=300, height=200, bg="#ffeeee") ++ cv1.pack() ++ cv2.pack() + +-s1 = TurtleScreen(cv1) +-s1.bgcolor(0.85, 0.85, 1) +-s2 = TurtleScreen(cv2) +-s2.bgcolor(1, 0.85, 0.85) ++ s1 = TurtleScreen(cv1) ++ s1.bgcolor(0.85, 0.85, 1) ++ s2 = TurtleScreen(cv2) ++ s2.bgcolor(1, 0.85, 0.85) + +-p = RawTurtle(s1) +-q = RawTurtle(s2) ++ p = RawTurtle(s1) ++ q = RawTurtle(s2) + +-p.color("red", (1, 0.85, 0.85)) +-p.width(3) +-q.color("blue", (0.85, 0.85, 1)) +-q.width(3) ++ p.color("red", (1, 0.85, 0.85)) ++ p.width(3) ++ q.color("blue", (0.85, 0.85, 1)) ++ q.width(3) + +-for t in p,q: +- t.shape("turtle") +- t.lt(36) ++ for t in p,q: ++ t.shape("turtle") ++ t.lt(36) + +-q.lt(180) ++ q.lt(180) + +-for t in p, q: +- t.begin_fill() +-for i in range(5): + for t in p, q: +- t.fd(50) +- t.lt(72) +-for t in p,q: +- t.end_fill() +- t.lt(54) +- t.pu() +- t.bk(50) ++ t.begin_fill() ++ for i in range(5): ++ for t in p, q: ++ t.fd(50) ++ t.lt(72) ++ for t in p,q: ++ t.end_fill() ++ t.lt(54) ++ t.pu() ++ t.bk(50) + +-## Want to get some info? ++ return "EVENTLOOP" + +-#print(s1, s2) +-#print(p, q) +-#print(s1.turtles()) +-#print(s2.turtles()) + +-TK.mainloop() ++if __name__ == '__main__': ++ main() ++ TK.mainloop() # keep window open until user closes it +diff -r c0e311e010fc Lib/unittest/test/test_case.py +--- a/Lib/unittest/test/test_case.py ++++ b/Lib/unittest/test/test_case.py +@@ -14,7 +14,7 @@ + + import unittest + +-from .support import ( ++from unittest.test.support import ( + TestEquality, TestHashing, LoggingResult, LegacyLoggingResult, + ResultWithNoStartTestRunStopTestRun + ) +diff -r c0e311e010fc Lib/unittest/test/test_discovery.py +--- a/Lib/unittest/test/test_discovery.py ++++ b/Lib/unittest/test/test_discovery.py +@@ -6,6 +6,7 @@ + from test import support + + import unittest ++import unittest.test + + + class TestableTestProgram(unittest.TestProgram): +diff -r c0e311e010fc Lib/unittest/test/test_functiontestcase.py +--- a/Lib/unittest/test/test_functiontestcase.py ++++ b/Lib/unittest/test/test_functiontestcase.py +@@ -1,6 +1,6 @@ + import unittest + +-from .support import LoggingResult ++from unittest.test.support import LoggingResult + + + class Test_FunctionTestCase(unittest.TestCase): +diff -r c0e311e010fc Lib/unittest/test/test_program.py +--- a/Lib/unittest/test/test_program.py ++++ b/Lib/unittest/test/test_program.py +@@ -4,6 +4,7 @@ + import sys + from test import support + import unittest ++import unittest.test + + + class Test_TestProgram(unittest.TestCase): +diff -r c0e311e010fc Lib/unittest/test/test_runner.py +--- a/Lib/unittest/test/test_runner.py ++++ b/Lib/unittest/test/test_runner.py +@@ -7,7 +7,8 @@ + import unittest + from unittest.case import _Outcome + +-from .support import LoggingResult, ResultWithNoStartTestRunStopTestRun ++from unittest.test.support import (LoggingResult, ++ ResultWithNoStartTestRunStopTestRun) + + + class TestCleanUp(unittest.TestCase): +diff -r c0e311e010fc Lib/unittest/test/test_skipping.py +--- a/Lib/unittest/test/test_skipping.py ++++ b/Lib/unittest/test/test_skipping.py +@@ -1,6 +1,6 @@ + import unittest + +-from .support import LoggingResult ++from unittest.test.support import LoggingResult + + + class Test_TestSkipping(unittest.TestCase): +diff -r c0e311e010fc Lib/unittest/test/test_suite.py +--- a/Lib/unittest/test/test_suite.py ++++ b/Lib/unittest/test/test_suite.py +@@ -3,7 +3,7 @@ + import gc + import sys + import weakref +-from .support import LoggingResult, TestEquality ++from unittest.test.support import LoggingResult, TestEquality + + + ### Support code for Test_TestSuite +diff -r c0e311e010fc Lib/urllib/request.py +--- a/Lib/urllib/request.py ++++ b/Lib/urllib/request.py +@@ -1315,7 +1315,7 @@ + url = req.selector + if url[:2] == '//' and url[2:3] != '/' and (req.host and + req.host != 'localhost'): +- if not req.host is self.get_names(): ++ if not req.host in self.get_names(): + raise URLError("file:// scheme is supported only on localhost") + else: + return self.open_local_file(req) +@@ -1911,7 +1911,7 @@ + # XXX thread unsafe! + if len(self.ftpcache) > MAXFTPCACHE: + # Prune the cache, rather arbitrarily +- for k in self.ftpcache.keys(): ++ for k in list(self.ftpcache): + if k != key: + v = self.ftpcache[k] + del self.ftpcache[k] +diff -r c0e311e010fc Lib/venv/__init__.py +--- a/Lib/venv/__init__.py ++++ b/Lib/venv/__init__.py +@@ -30,7 +30,6 @@ + import logging + import os + import shutil +-import struct + import subprocess + import sys + import types +@@ -140,11 +139,12 @@ + create_if_needed(path) + create_if_needed(libpath) + # Issue 21197: create lib64 as a symlink to lib on 64-bit non-OS X POSIX +- if ((struct.calcsize('P') == 8) and (os.name == 'posix') and ++ if ((sys.maxsize > 2**32) and (os.name == 'posix') and + (sys.platform != 'darwin')): + p = os.path.join(env_dir, 'lib') + link_path = os.path.join(env_dir, 'lib64') +- os.symlink(p, link_path) ++ if not os.path.exists(link_path): # Issue #21643 ++ os.symlink(p, link_path) + context.bin_path = binpath = os.path.join(env_dir, binname) + context.bin_name = binname + context.env_exe = os.path.join(binpath, exename) +@@ -212,7 +212,11 @@ + for suffix in ('python', 'python3'): + path = os.path.join(binpath, suffix) + if not os.path.exists(path): +- os.symlink(exename, path) ++ # Issue 18807: make copies if ++ # symlinks are not wanted ++ copier(context.env_exe, path) ++ if not os.path.islink(path): ++ os.chmod(path, 0o755) + else: + subdir = 'DLLs' + include = self.include_binary +@@ -234,7 +238,8 @@ + if 'init.tcl' in files: + tcldir = os.path.basename(root) + tcldir = os.path.join(context.env_dir, 'Lib', tcldir) +- os.makedirs(tcldir) ++ if not os.path.exists(tcldir): ++ os.makedirs(tcldir) + src = os.path.join(root, 'init.tcl') + dst = os.path.join(tcldir, 'init.tcl') + shutil.copyfile(src, dst) +diff -r c0e311e010fc Lib/xml/dom/minidom.py +--- a/Lib/xml/dom/minidom.py ++++ b/Lib/xml/dom/minidom.py +@@ -976,7 +976,7 @@ + def _get_nodeValue(self): + return self.data + def _set_nodeValue(self, value): +- self.data = data ++ self.data = value + nodeValue = property(_get_nodeValue, _set_nodeValue) + + # nodeName is an alias for target +diff -r c0e311e010fc Lib/zipfile.py +--- a/Lib/zipfile.py ++++ b/Lib/zipfile.py +@@ -411,7 +411,7 @@ + # Try to decode the extra field. + extra = self.extra + unpack = struct.unpack +- while extra: ++ while len(extra) >= 4: + tp, ln = unpack('= 24: +@@ -1764,18 +1764,7 @@ + sys.exit(1) + + with ZipFile(args[1], 'r') as zf: +- out = args[2] +- for path in zf.namelist(): +- if path.startswith('./'): +- tgt = os.path.join(out, path[2:]) +- else: +- tgt = os.path.join(out, path) +- +- tgtdir = os.path.dirname(tgt) +- if not os.path.exists(tgtdir): +- os.makedirs(tgtdir) +- with open(tgt, 'wb') as fp: +- fp.write(zf.read(path)) ++ zf.extractall(args[2]) + + elif args[0] == '-c': + if len(args) < 3: +diff -r c0e311e010fc Mac/BuildScript/build-installer.py +--- a/Mac/BuildScript/build-installer.py ++++ b/Mac/BuildScript/build-installer.py +@@ -150,17 +150,19 @@ + # $MACOSX_DEPLOYMENT_TARGET -> minimum OS X level + DEPTARGET = '10.3' + +-target_cc_map = { ++def getDeptargetTuple(): ++ return tuple([int(n) for n in DEPTARGET.split('.')[0:2]]) ++ ++def getTargetCompilers(): ++ target_cc_map = { + '10.3': ('gcc-4.0', 'g++-4.0'), + '10.4': ('gcc-4.0', 'g++-4.0'), + '10.5': ('gcc-4.2', 'g++-4.2'), + '10.6': ('gcc-4.2', 'g++-4.2'), +- '10.7': ('clang', 'clang++'), +- '10.8': ('clang', 'clang++'), +- '10.9': ('clang', 'clang++'), +-} ++ } ++ return target_cc_map.get(DEPTARGET, ('clang', 'clang++') ) + +-CC, CXX = target_cc_map[DEPTARGET] ++CC, CXX = getTargetCompilers() + + PYTHON_3 = getVersionTuple() >= (3, 0) + +@@ -193,10 +195,10 @@ + def library_recipes(): + result = [] + +- LT_10_5 = bool(DEPTARGET < '10.5') ++ LT_10_5 = bool(getDeptargetTuple() < (10, 5)) + + # Disable for now +- if False: # if (DEPTARGET > '10.5') and (getVersionTuple() >= (3, 5)): ++ if False: # if (getDeptargetTuple() > (10, 5)) and (getVersionTuple() >= (3, 5)): + result.extend([ + dict( + name="Tcl 8.5.15", +@@ -304,7 +306,7 @@ + ), + ]) + +- if DEPTARGET < '10.5': ++ if getDeptargetTuple() < (10, 5): + result.extend([ + dict( + name="Bzip2 1.0.6", +@@ -458,7 +460,7 @@ + ) + ) + +- if DEPTARGET < '10.4' and not PYTHON_3: ++ if getDeptargetTuple() < (10, 4) and not PYTHON_3: + result.append( + dict( + name="PythonSystemFixes", +@@ -679,7 +681,7 @@ + SDKPATH=os.path.abspath(SDKPATH) + DEPSRC=os.path.abspath(DEPSRC) + +- CC, CXX=target_cc_map[DEPTARGET] ++ CC, CXX = getTargetCompilers() + + print("Settings:") + print(" * Source directory:", SRCDIR) +@@ -985,6 +987,9 @@ + shellQuote(WORKDIR)[1:-1], + shellQuote(WORKDIR)[1:-1])) + ++ print("Running make touch") ++ runCommand("make touch") ++ + print("Running make") + runCommand("make") + +diff -r c0e311e010fc Makefile.pre.in +--- a/Makefile.pre.in ++++ b/Makefile.pre.in +@@ -71,12 +71,17 @@ + BASECFLAGS= @BASECFLAGS@ + BASECPPFLAGS= @BASECPPFLAGS@ + CONFIGURE_CFLAGS= @CFLAGS@ ++# CFLAGS_NODIST is used for building the interpreter and stdlib C extensions. ++# Use it when a compiler flag should _not_ be part of the distutils CFLAGS ++# once Python is installed (Issue #21121). ++CONFIGURE_CFLAGS_NODIST=@CFLAGS_NODIST@ + CONFIGURE_CPPFLAGS= @CPPFLAGS@ + CONFIGURE_LDFLAGS= @LDFLAGS@ + # Avoid assigning CFLAGS, LDFLAGS, etc. so users can use them on the + # command line to append to these values without stomping the pre-set + # values. + PY_CFLAGS= $(BASECFLAGS) $(OPT) $(CONFIGURE_CFLAGS) $(CFLAGS) $(EXTRA_CFLAGS) ++PY_CFLAGS_NODIST=$(CONFIGURE_CFLAGS_NODIST) $(CFLAGS_NODIST) + # Both CPPFLAGS and LDFLAGS need to contain the shell's value for setup.py to + # be able to build extension modules using the directories specified in the + # environment variables +@@ -91,7 +96,7 @@ + # Extra C flags added for building the interpreter object files. + CFLAGSFORSHARED=@CFLAGSFORSHARED@ + # C flags used for building the interpreter object files +-PY_CORE_CFLAGS= $(PY_CFLAGS) $(PY_CPPFLAGS) $(CFLAGSFORSHARED) -DPy_BUILD_CORE ++PY_CORE_CFLAGS= $(PY_CFLAGS) $(PY_CFLAGS_NODIST) $(PY_CPPFLAGS) $(CFLAGSFORSHARED) -DPy_BUILD_CORE + + + # Machine-dependent subdirectories +diff -r c0e311e010fc Misc/ACKS +--- a/Misc/ACKS ++++ b/Misc/ACKS +@@ -29,10 +29,13 @@ + Jyrki Alakuijala + Steve Alexander + Fred Allen ++Jeff Allen + Ray Allen + Billy G. Allie + Kevin Altis ++Skyler Leigh Amador + Joe Amenta ++Rose Ames + A. Amoroso + Mark Anacker + Shashwat Anand +@@ -75,6 +78,7 @@ + Daniel Barclay + Nicolas Bareil + Chris Barker ++Steven Barker + Anton Barkovsky + Nick Barnes + Quentin Barnes +@@ -172,6 +176,7 @@ + Tobias Brink + Richard Brodie + Michael Broghton ++Ammar Brohi + Daniel Brotsky + Jean Brouwers + Gary S. Brown +@@ -195,7 +200,9 @@ + Alastair Burt + Tarn Weisner Burton + Lee Busby ++Katherine Busch + Ralph Butler ++Zach Byrne + Nicolas Cadou + Jp Calderone + Arnaud Calmettes +@@ -232,14 +239,17 @@ + Albert Chin-A-Young + Adal Chiriliuc + Matt Chisholm ++Lita Cho + Anders Chrigström + Tom Christiansen ++Renee Chu + Vadim Chugunov + Mauro Cicognini + David Cinege + Craig Citro + Gilles Civario + Chris Clark ++Diana Clarke + Laurie Clark-Michalek + Mike Clarkson + Andrew Clegg +@@ -305,6 +315,7 @@ + Arnaud Delobelle + Konrad Delong + Erik Demaine ++Martin Dengler + John Dennis + L. Peter Deutsch + Roger Dev +@@ -402,6 +413,7 @@ + Dan Finnie + Nils Fischbeck + Frederik Fix ++Tom Flanagan + Matt Fleming + Hernán Martínez Foffani + Artem Fokin +@@ -409,6 +421,7 @@ + Michael Foord + Amaury Forgeot d'Arc + Doug Fort ++Chris Foster + John Fouhy + Andrew Francis + Stefan Franke +@@ -507,6 +520,7 @@ + Lynda Hardman + Derek Harland + Jason Harper ++David Harrigan + Brian Harring + Jonathan Hartley + Travis B. Hartwell +@@ -537,6 +551,7 @@ + Magnus L. Hetland + Raymond Hettinger + Kevan Heydon ++Wouter van Heyst + Kelsey Hightower + Jason Hildebrand + Richie Hindle +@@ -652,6 +667,7 @@ + Tamito Kajiyama + Jan Kaliszewski + Peter van Kampen ++Jan Kanis + Rafe Kaplan + Jacob Kaplan-Moss + Janne Karila +@@ -746,6 +762,7 @@ + Chris Lawrence + Brian Leair + Mathieu Leduc-Hamel ++Amandine Lee + Antony Lee + Christopher Lee + Inyeol Lee +@@ -817,6 +834,7 @@ + Nick Maclaren + Don MacMillen + Tomasz Maćkowiak ++Wolfgang Maier + Steve Majewski + Marek Majkowski + Grzegorz Makarewicz +@@ -969,6 +987,7 @@ + Tomas Oppelstrup + Jason Orendorff + Douglas Orr ++William Orr + Michele Orrù + Oleg Oshmyan + Denis S. Otkidach +diff -r c0e311e010fc Misc/NEWS +--- a/Misc/NEWS ++++ b/Misc/NEWS +@@ -2,6 +2,344 @@ + Python News + +++++++++++ + ++What's New in Python 3.4.2? ++=========================== ++ ++Release date: XXXX-XX-XX ++ ++Core and Builtins ++----------------- ++ ++- Issue #21669: With the aid of heuristics in SyntaxError.__init__, the ++ parser now attempts to generate more meaningful (or at least more search ++ engine friendly) error messages when "exec" and "print" are used as ++ statements. ++ ++- Issue #21642: If the conditional if-else expression, allow an integer written ++ with no space between itself and the ``else`` keyword (e.g. ``True if 42else ++ False``) to be valid syntax. ++ ++- Issue #21523: Fix over-pessimistic computation of the stack effect of ++ some opcodes in the compiler. This also fixes a quadratic compilation ++ time issue noticeable when compiling code with a large number of "and" ++ and "or" operators. ++ ++Library ++------- ++ ++- Issue #22068: Avoided reference loops with Variables and Fonts in Tkinter. ++ ++- Issue #22165: SimpleHTTPRequestHandler now supports undecodable file names. ++ ++- Issue #20729: Restored the use of lazy iterkeys()/itervalues()/iteritems() ++ in the mailbox module. ++ ++- Issue #21448: Changed FeedParser feed() to avoid O(N**2) behavior when ++ parsing long line. Original patch by Raymond Hettinger. ++ ++- Issue #22184: The functools LRU Cache decorator factory now gives an earlier ++ and clearer error message when the user forgets the required parameters. ++ ++- Issue #17923: glob() patterns ending with a slash no longer match non-dirs on ++ AIX. Based on patch by Delhallt. ++ ++- Issue #21121: Don't force 3rd party C extensions to be built with ++ -Werror=declaration-after-statement. ++ ++- Issue #21975: Fixed crash when using uninitialized sqlite3.Row (in particular ++ when unpickling pickled sqlite3.Row). sqlite3.Row is now initialized in the ++ __new__() method. ++ ++- Issue #21580: Now Tkinter correctly handles bytes arguments passed to Tk. ++ In particular this allows to initialize images from binary data. ++ ++- Issue #17172: Make turtledemo start as active on OS X even when run with ++ subprocess. Patch by Lita Cho. ++ ++- Issue #21704: Fix build error for _multiprocessing when semaphores ++ are not available. Patch by Arfrever Frehtes Taifersar Arahesis. ++ ++- Fix repr(_socket.socket) on Windows 64-bit: don't fail with OverflowError ++ on closed socket. repr(socket.socket) already works fine. ++ ++- Issue #16133: The asynchat.async_chat.handle_read() method now ignores ++ BlockingIOError exceptions. ++ ++- Issue #22044: Fixed premature DECREF in call_tzinfo_method. ++ Patch by Tom Flanagan. ++ ++- Issue #19884: readline: Disable the meta modifier key if stdout is not ++ a terminal to not write the ANSI sequence "\033[1034h" into stdout. This ++ sequence is used on some terminal (ex: TERM=xterm-256color") to enable ++ support of 8 bit characters. ++ ++- Issue #21888: plistlib's load() and loads() now work if the fmt parameter is ++ specified. ++ ++- Issue #21044: tarfile.open() now handles fileobj with an integer 'name' ++ attribute. Based on patch by Antoine Pietri. ++ ++- Issue #21867: Prevent turtle crash due to invalid undo buffer size. ++ ++- Issue #19076: Don't pass the redundant 'file' argument to self.error(). ++ ++- Issue #21942: Fixed source file viewing in pydoc's server mode on Windows. ++ ++- Issue #11259: asynchat.async_chat().set_terminator() now raises a ValueError ++ if the number of received bytes is negative. ++ ++- Issue #12523: asynchat.async_chat.push() now raises a TypeError if it doesn't ++ get a bytes string ++ ++- Issue #21707: Add missing kwonlyargcount argument to ++ ModuleFinder.replace_paths_in_code(). ++ ++- Issue #20639: calling Path.with_suffix('') allows removing the suffix ++ again. Patch by July Tikhonov. ++ ++- Issue #21714: Disallow the construction of invalid paths using ++ Path.with_name(). Original patch by Antony Lee. ++ ++- Issue #21897: Fix a crash with the f_locals attribute with closure ++ variables when frame.clear() has been called. ++ ++- Issue #21151: Fixed a segfault in the winreg module when ``None`` is passed ++ as a ``REG_BINARY`` value to SetValueEx. Patch by John Ehresman. ++ ++- Issue #21090: io.FileIO.readall() does not ignore I/O errors anymore. Before, ++ it ignored I/O errors if at least the first C call read() succeed. ++ ++- Issue #21781: ssl.RAND_add() now supports strings longer than 2 GB. ++ ++- Issue #11453: asyncore: emit a ResourceWarning when an unclosed file_wrapper ++ object is destroyed. The destructor now closes the file if needed. The ++ close() method can now be called twice: the second call does nothing. ++ ++- Issue #21858: Better handling of Python exceptions in the sqlite3 module. ++ ++- Issue #21476: Make sure the email.parser.BytesParser TextIOWrapper is ++ discarded after parsing, so the input file isn't unexpectedly closed. ++ ++- Issue #21729: Used the "with" statement in the dbm.dumb module to ensure ++ files closing. Patch by Claudiu Popa. ++ ++- Issue #21491: socketserver: Fix a race condition in child processes reaping. ++ ++- Issue #21832: Require named tuple inputs to be exact strings. ++ ++- Issue #19145: The times argument for itertools.repeat now handles ++ negative values the same way for keyword arguments as it does for ++ positional arguments. ++ ++- Issue #21812: turtle.shapetransform did not tranform the turtle on the ++ first call. (Issue identified and fixed by Lita Cho.) ++ ++- Issue #21635: The difflib SequenceMatcher.get_matching_blocks() method ++ cache didn't match the actual result. The former was a list of tuples ++ and the latter was a list of named tuples. ++ ++- Issue #21722: The distutils "upload" command now exits with a non-zero ++ return code when uploading fails. Patch by Martin Dengler. ++ ++- Issue #21723: asyncio.Queue: support any type of number (ex: float) for the ++ maximum size. Patch written by Vajrasky Kok. ++ ++- Issue #21326: Add a new is_closed() method to asyncio.BaseEventLoop. ++ run_forever() and run_until_complete() methods of asyncio.BaseEventLoop now ++ raise an exception if the event loop was closed. ++ ++- Issue #21774: Fixed NameError for an incorrect variable reference in the ++ XML Minidom code for creating processing instructions. ++ (Found and fixed by Claudiu Popa.) ++ ++- Issue #21766: Prevent a security hole in CGIHTTPServer by URL unquoting paths ++ before checking for a CGI script at that path. ++ ++- Issue #21310: Fixed possible resource leak in failed open(). ++ ++- Issue #21677: Fixed chaining nonnormalized exceptions in io close() methods. ++ ++- Issue #11709: Fix the pydoc.help function to not fail when sys.stdin is not a ++ valid file. ++ ++- Issue #13223: Fix pydoc.writedoc so that the HTML documentation for methods ++ that use 'self' in the example code is generated correctly. ++ ++- Issue #21463: In urllib.request, fix pruning of the FTP cache. ++ ++- Issue #21618: The subprocess module could fail to close open fds that were ++ inherited by the calling process and already higher than POSIX resource ++ limits would otherwise allow. On systems with a functioning /proc/self/fd ++ or /dev/fd interface the max is now ignored and all fds are closed. ++ ++- Issue #21552: Fixed possible integer overflow of too long string lengths in ++ the tkinter module on 64-bit platforms. ++ ++- Issue #14315: The zipfile module now ignores extra fields in the central ++ directory that are too short to be parsed instead of letting a struct.unpack ++ error bubble up as this "bad data" appears in many real world zip files in ++ the wild and is ignored by other zip tools. ++ ++- Issue #21402: tkinter.ttk now works when default root window is not set. ++ ++- Issue #10203: sqlite3.Row now truly supports sequence protocol. In particulr ++ it supports reverse() and negative indices. Original patch by Claudiu Popa. ++ ++- Issue #18807: If copying (no symlinks) specified for a venv, then the python ++ interpreter aliases (python, python3) are now created by copying rather than ++ symlinking. ++ ++- Issue #14710: pkgutil.get_loader() no longer raises an exception when None is ++ found in sys.modules. ++ ++- Issue #14710: pkgutil.find_loader() no longer raises an exception when a ++ module doesn't exist. ++ ++- Issue #21481: Argparse equality and inequality tests now return ++ NotImplemented when comparing to an unknown type. ++ ++- Issue #8743: Fix interoperability between set objects and the ++ collections.Set() abstract base class. ++ ++- Issue #13355: random.triangular() no longer fails with a ZeroDivisionError ++ when low equals high. ++ ++- Issue #21538: The plistlib module now supports loading of binary plist files ++ when reference or offset size is not a power of two. ++ ++- Issue #21801: Validate that __signature__ is None or an instance of Signature. ++ ++- Issue #21923: Prevent AttributeError in distutils.sysconfig.customize_compiler ++ due to possible uninitialized _config_vars. ++ ++- Issue #21323: Fix http.server to again handle scripts in CGI subdirectories, ++ broken by the fix for security issue #19435. Patch by Zach Byrne. ++ ++Extension Modules ++----------------- ++ ++- Issue #22176: Update the ctypes module's libffi to v3.1. This release ++ adds support for the Linux AArch64 and POWERPC ELF ABIv2 little endian ++ architectures. ++ ++Build ++----- ++ ++- Issue #21958: Define HAVE_ROUND when building with Visual Studio 2013 and ++ above. Patch by Zachary Turner. ++ ++- Issue #15759: "make suspicious", "make linkcheck" and "make doctest" in Doc/ ++ now display special message when and only when there are failures. ++ ++- Issue #17095: Fix Modules/Setup *shared* support. ++ ++- Issue #21811: Anticipated fixes to support OS X versions > 10.9. ++ ++IDLE ++---- ++ ++- Issue #17172: Add the ability to run turtledemo from Idle. ++ Currently, the entry is on the Help menu, but it may move to Run. ++ Patch by Ramchandra Apt and Lita Cho. ++ ++- Issue #21765: Add support for non-ascii identifiers to HyperParser. ++ ++- Issue #21940: Add unittest for WidgetRedirector. Initial patch by Saimadhav ++ Heblikar. ++ ++- Issue #18592: Add unittest for SearchDialogBase. Patch by Phil Webster. ++ ++- Issue #21694: Add unittest for ParenMatch. Patch by Saimadhav Heblikar. ++ ++- Issue #21686: add unittest for HyperParser. Original patch by Saimadhav ++ Heblikar. ++ ++- Issue #12387: Add missing upper(lower)case versions of default Windows key ++ bindings for Idle so Caps Lock does not disable them. Patch by Roger Serwy. ++ ++- Issue #21695: Closing a Find-in-files output window while the search is ++ still in progress no longer closes Idle. ++ ++- Issue #18910: Add unittest for textView. Patch by Phil Webster. ++ ++- Issue #18292: Add unittest for AutoExpand. Patch by Saihadhav Heblikar. ++ ++- Issue #18409: Add unittest for AutoComplete. Patch by Phil Webster. ++ ++Tests ++----- ++ ++- Issue #20746: Fix test_pdb to run in refleak mode (-R). Patch by Xavier ++ de Gaye. ++ ++- Issue #22060: test_ctypes has been somewhat cleaned up and simplified; it ++ now uses unittest test discovery to find its tests. ++ ++- Issue #22104: regrtest.py no longer holds a reference to the suite of tests ++ loaded from test modules that don't define test_main(). ++ ++- Issue #22002: Added ``load_package_tests`` function to test.support and used ++ it to implement/augment test discovery in test_asyncio, test_email, ++ test_importlib, test_json, and test_tools. ++ ++- Issue #21976: Fix test_ssl to accept LibreSSL version strings. Thanks ++ to William Orr. ++ ++- Issue #21918: Converted test_tools from a module to a package containing ++ separate test files for each tested script. ++ ++- Issue #20155: Changed HTTP method names in failing tests in test_httpservers ++ so that packet filtering software (specifically Windows Base Filtering Engine) ++ does not interfere with the transaction semantics expected by the tests. ++ ++- Issue #19493: Refactored the ctypes test package to skip tests explicitly ++ rather than silently. ++ ++- Issue #18492: All resources are now allowed when tests are not run by ++ regrtest.py. ++ ++- Issue #21634: Fix pystone micro-benchmark: use floor division instead of true ++ division to benchmark integers instead of floating point numbers. Set pystone ++ version to 1.2. Patch written by Lennart Regebro. ++ ++- Issue #21605: Added tests for Tkinter images. ++ ++- Issue #21493: Added test for ntpath.expanduser(). Original patch by ++ Claudiu Popa. ++ ++- Issue #19925: Added tests for the spwd module. Original patch by Vajrasky Kok. ++ ++- Issue #21522: Added Tkinter tests for Listbox.itemconfigure(), ++ PanedWindow.paneconfigure(), and Menu.entryconfigure(). ++ ++Documentation ++------------- ++ ++- Issue #21777: The binary sequence methods on bytes and bytearray are now ++ documented explicitly, rather than assuming users will be able to derive ++ the expected behaviour from the behaviour of the corresponding str methods. ++ ++Windows ++------- ++ ++- Issue #21671, #22160, CVE-2014-0224: The bundled version of OpenSSL has been ++ updated to 1.0.1i. ++ ++- Issue #10747: Use versioned labels in the Windows start menu. ++ Patch by Olive Kilburn. ++ ++Tools/Demos ++----------- ++ ++- Issue #22201: Command-line interface of the zipfile module now correctly ++ extracts ZIP files with directory entries. Patch by Ryan Wilson. ++ ++- Issue #21906: Make Tools/scripts/md5sum.py work in Python 3. ++ Patch by Zachary Ware. ++ ++- Issue #21629: Fix Argument Clinic's "--converters" feature. ++ ++ + What's New in Python 3.4.1? + =========================== + +diff -r c0e311e010fc Modules/_ctypes/_ctypes.c +--- a/Modules/_ctypes/_ctypes.c ++++ b/Modules/_ctypes/_ctypes.c +@@ -1080,7 +1080,7 @@ + ptr = view.buf; + if (size > self->b_size) { + PyErr_SetString(PyExc_ValueError, +- "string too long"); ++ "byte string too long"); + goto fail; + } + +@@ -1132,7 +1132,7 @@ + size = PyBytes_GET_SIZE(value); + if (size > self->b_size) { + PyErr_SetString(PyExc_ValueError, +- "string too long"); ++ "byte string too long"); + Py_DECREF(value); + return -1; + } +@@ -1471,7 +1471,7 @@ + Py_INCREF(Py_None); + return Py_None; + } +- if (PyUnicode_Check(value) || PyBytes_Check(value)) { ++ if (PyUnicode_Check(value)) { + PyCArgObject *parg; + struct fielddesc *fd = _ctypes_get_fielddesc("Z"); + +@@ -1623,7 +1623,7 @@ + return (PyObject *)parg; + } + /* XXX struni: remove later */ +-/* string */ ++/* bytes */ + if (PyBytes_Check(value)) { + PyCArgObject *parg; + struct fielddesc *fd = _ctypes_get_fielddesc("z"); +@@ -1640,23 +1640,6 @@ + } + return (PyObject *)parg; + } +-/* bytes */ +- if (PyByteArray_Check(value)) { +- PyCArgObject *parg; +- struct fielddesc *fd = _ctypes_get_fielddesc("z"); +- +- parg = PyCArgObject_new(); +- if (parg == NULL) +- return NULL; +- parg->pffi_type = &ffi_type_pointer; +- parg->tag = 'z'; +- parg->obj = fd->setfunc(&parg->value, value, 0); +- if (parg->obj == NULL) { +- Py_DECREF(parg); +- return NULL; +- } +- return (PyObject *)parg; +- } + /* unicode */ + if (PyUnicode_Check(value)) { + PyCArgObject *parg; +@@ -3218,7 +3201,7 @@ + return *pname ? 1 : 0; + } + PyErr_SetString(PyExc_TypeError, +- "function name must be string or integer"); ++ "function name must be string, bytes object or integer"); + return 0; + } + +diff -r c0e311e010fc Modules/_ctypes/cfield.c +--- a/Modules/_ctypes/cfield.c ++++ b/Modules/_ctypes/cfield.c +@@ -1160,7 +1160,7 @@ + } + error: + PyErr_Format(PyExc_TypeError, +- "one character string expected"); ++ "one character bytes, bytearray or integer expected"); + return NULL; + } + +@@ -1295,7 +1295,7 @@ + Py_INCREF(value); + } else { + PyErr_Format(PyExc_TypeError, +- "expected string, %s found", ++ "expected bytes, %s found", + value->ob_type->tp_name); + return NULL; + } +@@ -1311,7 +1311,7 @@ + ++size; + } else if (size > length) { + PyErr_Format(PyExc_ValueError, +- "string too long (%zd, maximum length %zd)", ++ "bytes too long (%zd, maximum length %zd)", + size, length); + Py_DECREF(value); + return NULL; +diff -r c0e311e010fc Modules/_ctypes/libffi.diff +--- a/Modules/_ctypes/libffi.diff ++++ b/Modules/_ctypes/libffi.diff +@@ -1,8 +1,7 @@ +-diff -r -N -u libffi.orig/autom4te.cache/output.0 libffi/autom4te.cache/output.0 +-diff -r -N -u libffi.orig/configure libffi/configure +---- libffi.orig/configure 2013-03-17 15:37:50.000000000 -0700 +-+++ libffi/configure 2013-03-18 15:11:39.611575163 -0700 +-@@ -13368,6 +13368,10 @@ ++diff -urN libffi-3.1/configure libffi/configure ++--- libffi-3.1/configure 2014-05-19 15:44:03.000000000 +0200 +++++ libffi/configure 2014-08-09 21:51:07.877871443 +0200 ++@@ -17236,6 +17236,10 @@ + fi + ;; + +@@ -13,22 +12,22 @@ + x86_64-*-darwin*) + TARGET=X86_DARWIN; TARGETDIR=x86 + ;; +-@@ -13426,12 +13430,12 @@ ++@@ -17298,12 +17302,12 @@ + ;; + + mips-sgi-irix5.* | mips-sgi-irix6.* | mips*-*-rtems*) + - TARGET=MIPS; TARGETDIR=mips + + TARGET=MIPS_IRIX; TARGETDIR=mips + ;; +- mips*-*-linux* | mips*-*-openbsd*) ++ mips*-*linux* | mips*-*-openbsd*) + # Support 128-bit long double for NewABI. + HAVE_LONG_DOUBLE='defined(__mips64)' + - TARGET=MIPS; TARGETDIR=mips +-+ TARGET=MIPS_IRIX; TARGETDIR=mips +++ TARGET=MIPS_LINUX; TARGETDIR=mips + ;; + +- powerpc*-*-linux* | powerpc-*-sysv*) +-@@ -13491,7 +13495,7 @@ ++ nios2*-linux*) ++@@ -17373,7 +17377,7 @@ + as_fn_error $? "\"libffi has not been ported to $host.\"" "$LINENO" 5 + fi + +@@ -37,7 +36,7 @@ + MIPS_TRUE= + MIPS_FALSE='#' + else +-@@ -14862,6 +14866,12 @@ ++@@ -18814,6 +18818,12 @@ + ac_config_files="$ac_config_files include/Makefile include/ffi.h Makefile testsuite/Makefile man/Makefile libffi.pc" + + +@@ -50,7 +49,7 @@ + cat >confcache <<\_ACEOF + # This file is a shell script that caches the results of configure + # tests run on this system so they can be shared between configure +-@@ -16047,6 +16057,8 @@ ++@@ -20126,6 +20136,8 @@ + "testsuite/Makefile") CONFIG_FILES="$CONFIG_FILES testsuite/Makefile" ;; + "man/Makefile") CONFIG_FILES="$CONFIG_FILES man/Makefile" ;; + "libffi.pc") CONFIG_FILES="$CONFIG_FILES libffi.pc" ;; +@@ -59,9 +58,9 @@ + + *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; + esac +-diff -r -N -u libffi.orig/configure.ac libffi/configure.ac +---- libffi.orig/configure.ac 2013-03-17 15:37:50.000000000 -0700 +-+++ libffi/configure.ac 2013-03-18 15:11:11.392989136 -0700 ++diff -urN libffi-3.1/configure.ac libffi/configure.ac ++--- libffi-3.1/configure.ac 2014-05-11 15:57:49.000000000 +0200 +++++ libffi/configure.ac 2014-08-09 21:51:07.877871443 +0200 + @@ -1,4 +1,7 @@ + dnl Process this with autoconf to create configure + +# +@@ -70,33 +69,32 @@ + + AC_PREREQ(2.68) + +-@@ -146,6 +149,10 @@ +- fi ++@@ -144,6 +147,9 @@ ++ AM_LTLDFLAGS='-no-undefined -bindir "$(bindir)"'; ++ fi + ;; +- + + i*86-*-nto-qnx*) + + TARGET=X86; TARGETDIR=x86 + + ;; +-+ +- x86_64-*-darwin*) ++ i?86-*-darwin*) + TARGET=X86_DARWIN; TARGETDIR=x86 + ;; +-@@ -204,12 +211,12 @@ ++@@ -218,12 +224,12 @@ + ;; + + mips-sgi-irix5.* | mips-sgi-irix6.* | mips*-*-rtems*) + - TARGET=MIPS; TARGETDIR=mips + + TARGET=MIPS_IRIX; TARGETDIR=mips + ;; +- mips*-*-linux* | mips*-*-openbsd*) ++ mips*-*linux* | mips*-*-openbsd*) + # Support 128-bit long double for NewABI. + HAVE_LONG_DOUBLE='defined(__mips64)' + - TARGET=MIPS; TARGETDIR=mips +-+ TARGET=MIPS_IRIX; TARGETDIR=mips +++ TARGET=MIPS_LINUX; TARGETDIR=mips + ;; + +- powerpc*-*-linux* | powerpc-*-sysv*) +-@@ -269,7 +276,7 @@ ++ nios2*-linux*) ++@@ -293,7 +299,7 @@ + AC_MSG_ERROR(["libffi has not been ported to $host."]) + fi + +@@ -105,7 +103,7 @@ + AM_CONDITIONAL(BFIN, test x$TARGET = xBFIN) + AM_CONDITIONAL(SPARC, test x$TARGET = xSPARC) + AM_CONDITIONAL(X86, test x$TARGET = xX86) +-@@ -567,4 +574,8 @@ ++@@ -617,4 +623,8 @@ + + AC_CONFIG_FILES(include/Makefile include/ffi.h Makefile testsuite/Makefile man/Makefile libffi.pc) + +@@ -114,19 +112,19 @@ + +AC_CONFIG_FILES(fficonfig.py) + + + AC_OUTPUT +---- libffi-3.0.11/fficonfig.py.in 1970-01-01 01:00:00.000000000 +0100 +-+++ libffi/fficonfig.py.in 2012-03-15 01:04:27.000000000 +0100 ++diff -urN libffi-3.1/fficonfig.py.in libffi/fficonfig.py.in ++--- libffi-3.1/fficonfig.py.in 1970-01-01 01:00:00.000000000 +0100 +++++ libffi/fficonfig.py.in 2014-08-09 21:43:25.229871827 +0200 + @@ -0,0 +1,35 @@ + +ffi_sources = """ + +src/prep_cif.c + +src/closures.c +-+src/dlmalloc.c + +""".split() + + + +ffi_platforms = { + + 'MIPS_IRIX': ['src/mips/ffi.c', 'src/mips/o32.S', 'src/mips/n32.S'], + + 'MIPS_LINUX': ['src/mips/ffi.c', 'src/mips/o32.S'], +-+ 'X86': ['src/x86/ffi.c', 'src/x86/sysv.S'], +++ 'X86': ['src/x86/ffi.c', 'src/x86/sysv.S', 'src/x86/win32.S'], + + 'X86_FREEBSD': ['src/x86/ffi.c', 'src/x86/freebsd.S'], + + 'X86_WIN32': ['src/x86/ffi.c', 'src/x86/win32.S'], + + 'SPARC': ['src/sparc/ffi.c', 'src/sparc/v8.S', 'src/sparc/v9.S'], +@@ -134,9 +132,10 @@ + + 'IA64': ['src/ia64/ffi.c', 'src/ia64/unix.S'], + + 'M32R': ['src/m32r/sysv.S', 'src/m32r/ffi.c'], + + 'M68K': ['src/m68k/ffi.c', 'src/m68k/sysv.S'], +-+ 'POWERPC': ['src/powerpc/ffi.c', 'src/powerpc/sysv.S', 'src/powerpc/ppc_closure.S', 'src/powerpc/linux64.S', 'src/powerpc/linux64_closure.S'], +++ 'POWERPC': ['src/powerpc/ffi.c', 'src/powerpc/ffi_sysv.c', 'src/powerpc/ffi_linux64.c', 'src/powerpc/sysv.S', 'src/powerpc/ppc_closure.S', 'src/powerpc/linux64.S', 'src/powerpc/linux64_closure.S'], + + 'POWERPC_AIX': ['src/powerpc/ffi_darwin.c', 'src/powerpc/aix.S', 'src/powerpc/aix_closure.S'], + + 'POWERPC_FREEBSD': ['src/powerpc/ffi.c', 'src/powerpc/sysv.S', 'src/powerpc/ppc_closure.S'], +++ 'AARCH64': ['src/aarch64/sysv.S', 'src/aarch64/ffi.c'], + + 'ARM': ['src/arm/sysv.S', 'src/arm/ffi.c'], + + 'LIBFFI_CRIS': ['src/cris/sysv.S', 'src/cris/ffi.c'], + + 'FRV': ['src/frv/eabi.S', 'src/frv/ffi.c'], +@@ -152,9 +151,9 @@ + +ffi_sources += ffi_platforms['@TARGET@'] + + + +ffi_cflags = '@CFLAGS@' +-diff -urN libffi-3.0.11/src/dlmalloc.c libffi/src/dlmalloc.c +---- libffi-3.0.11/src/dlmalloc.c 2012-04-12 04:46:06.000000000 +0200 +-+++ libffi/src/dlmalloc.c 2012-06-26 15:15:58.949547461 +0200 ++diff -urN libffi-3.1/src/dlmalloc.c libffi/src/dlmalloc.c ++--- libffi-3.1/src/dlmalloc.c 2014-04-25 19:45:13.000000000 +0200 +++++ libffi/src/dlmalloc.c 2014-08-09 21:51:07.881871443 +0200 + @@ -457,6 +457,11 @@ + #define LACKS_ERRNO_H + #define MALLOC_FAILURE_ACTION +@@ -167,25 +166,7 @@ + #endif /* WIN32 */ + + #ifdef __OS2__ +-@@ -3393,7 +3393,7 @@ +- *ss = m->seg; /* Push current record */ +- m->seg.base = tbase; +- m->seg.size = tsize; +-- set_segment_flags(&m->seg, mmapped); +-+ (void)set_segment_flags(&m->seg, mmapped); +- m->seg.next = ss; +- +- /* Insert trailing fenceposts */ +-@@ -3553,7 +3553,7 @@ +- if (!is_initialized(m)) { /* first-time initialization */ +- m->seg.base = m->least_addr = tbase; +- m->seg.size = tsize; +-- set_segment_flags(&m->seg, mmap_flag); +-+ (void)set_segment_flags(&m->seg, mmap_flag); +- m->magic = mparams.magic; +- init_bins(m); +- if (is_global(m)) +-@@ -4502,7 +4502,7 @@ ++@@ -4497,7 +4502,7 @@ + char* tbase = (char*)(CALL_MMAP(tsize)); + if (tbase != CMFAIL) { + m = init_user_mstate(tbase, tsize); +@@ -194,7 +175,7 @@ + set_lock(m, locked); + } + } +-@@ -4517,7 +4517,7 @@ ++@@ -4512,7 +4517,7 @@ + if (capacity > msize + TOP_FOOT_SIZE && + capacity < (size_t) -(msize + TOP_FOOT_SIZE + mparams.page_size)) { + m = init_user_mstate((char*)base, capacity); +@@ -203,3 +184,26 @@ + set_lock(m, locked); + } + return (mspace)m; ++diff -urN libffi-3.1/src/arm/ffi.c libffi/src/arm/ffi.c ++--- libffi-3.1/src/arm/ffi.c Sat Aug 09 23:52:34 2014 +0200 +++++ libffi/src/arm/ffi.c Sat Aug 09 23:58:38 2014 +0200 ++@@ -154,9 +154,6 @@ ++ ++ int ffi_prep_args_VFP(char *stack, extended_cif *ecif, float *vfp_space) ++ { ++- // make sure we are using FFI_VFP ++- FFI_ASSERT(ecif->cif->abi == FFI_VFP); ++- ++ register unsigned int i, vi = 0; ++ register void **p_argv; ++ register char *argp, *regp, *eo_regp; ++@@ -165,6 +162,9 @@ ++ char done_with_regs = 0; ++ char is_vfp_type; ++ +++ // make sure we are using FFI_VFP +++ FFI_ASSERT(ecif->cif->abi == FFI_VFP); +++ ++ /* the first 4 words on the stack are used for values passed in core ++ * registers. */ ++ regp = stack; +diff -r c0e311e010fc Modules/_ctypes/libffi/.gitignore +--- a/Modules/_ctypes/libffi/.gitignore ++++ /dev/null +@@ -1,21 +0,0 @@ +-.libs +-.deps +-*.o +-*.lo +-.dirstamp +-*.la +-Makefile +-config.log +-config.status +-*~ +-fficonfig.h +-include/ffi.h +-include/ffitarget.h +-libffi.pc +-libtool +-stamp-h1 +-libffi*gz +-autom4te.cache +-libffi.xcodeproj/xcuserdata +-libffi.xcodeproj/project.xcworkspace +-ios/ +diff -r c0e311e010fc Modules/_ctypes/libffi/.travis.yml +--- a/Modules/_ctypes/libffi/.travis.yml ++++ /dev/null +@@ -1,8 +0,0 @@ +-language: c +-compiler: +- - gcc +- - clang +- +-before_script: sudo apt-get install dejagnu +- +-script: ./configure && make && make check +diff -r c0e311e010fc Modules/_ctypes/libffi/ChangeLog +--- a/Modules/_ctypes/libffi/ChangeLog ++++ b/Modules/_ctypes/libffi/ChangeLog +@@ -1,5509 +1,5105 @@ +-2013-03-17 Anthony Green +- +- * README: Update for 3.0.13. +- * configure.ac: Ditto. +- * configure: Rebuilt. +- * doc/*: Update version. +- +-2013-03-17 Dave Korn +- +- * src/closures.c (is_emutramp_enabled +- [!FFI_MMAP_EXEC_EMUTRAMP_PAX]): Move default definition outside +- enclosing #if scope. +- +-2013-03-17 Anthony Green +- +- * configure.ac: Only modify toolexecdir in certain cases. +- * configure: Rebuilt. +- +-2013-03-16 Gilles Talis +- +- * src/powerpc/ffi.c (ffi_prep_args_SYSV): Don't use +- fparg_count,etc on __NO_FPRS__ targets. +- +-2013-03-16 Alan Hourihane +- +- * src/m68k/sysv.S (epilogue): Don't use extb instruction on +- m680000 machines. +- +-2013-03-16 Alex Gaynor +- +- * src/x86/ffi.c (ffi_prep_cif_machdep): Always align stack. +- +-2013-03-13 Markos Chandras +- +- * configure.ac: Add support for Imagination Technologies Meta. +- * Makefile.am: Likewise. +- * README: Add Imagination Technologies Meta details. +- * src/metag/ffi.c: New. +- * src/metag/ffitarget.h: Likewise. +- * src/metag/sysv.S: Likewise. +- +-2013-02-24 Andreas Schwab +- +- * doc/libffi.texi (Structures): Fix missing category argument of +- @deftp. +- +-2013-02-11 Anthony Green +- +- * configure.ac: Update release number to 3.0.12. +- * configure: Rebuilt. +- * README: Update release info. +- +-2013-02-10 Anthony Green +- +- * README: Add Moxie. +- * src/moxie/ffi.c: Created. +- * src/moxie/eabi.S: Created. +- * src/moxie/ffitarget.h: Created. +- * Makefile.am (nodist_libffi_la_SOURCES): Add Moxie. +- * Makefile.in: Rebuilt. +- * configure.ac: Add Moxie. +- * configure: Rebuilt. +- * testsuite/libffi.call/huge_struct.c: Disable format string +- warnings for moxie*-*-elf tests. +- +-2013-02-10 Anthony Green +- +- * Makefile.am (LTLDFLAGS): Fix reference. +- * Makefile.in: Rebuilt. +- +-2013-02-10 Anthony Green +- +- * README: Update supported platforms. Update test results link. +- +-2013-02-09 Anthony Green +- +- * testsuite/libffi.call/negint.c: Remove forced -O2. +- * testsuite/libffi.call/many2.c (foo): Remove GCCism. +- * testsuite/libffi.call/ffitest.h: Add default PRIuPTR definition. +- +- * src/sparc/v8.S (ffi_closure_v8): Import ancient ulonglong +- closure return type fix developed by Martin v. Löwis for cpython +- fork. +- +-2013-02-08 Andreas Tobler +- +- * src/powerpc/ffi.c (ffi_prep_cif_machdep): Fix small struct +- support. +- * src/powerpc/sysv.S: Ditto. +- +-2013-02-08 Anthony Green +- +- * testsuite/libffi.call/cls_longdouble.c: Remove xfail for +- arm*-*-*. +- +-2013-02-08 Anthony Green +- +- * src/sparc/ffi.c (ffi_prep_closure_loc): Fix cache flushing for GCC. +- +-2013-02-08 Matthias Klose +- +- * man/ffi_prep_cif.3: Clean up for debian linter. +- +-2013-02-08 Peter Bergner +- +- * src/powerpc/ffi.c (ffi_prep_args_SYSV): Account for FP args pushed +- on the stack. +- +-2013-02-08 Anthony Green +- +- * Makefile.am (EXTRA_DIST): Add missing files. +- * testsuite/Makefile.am (EXTRA_DIST): Ditto. +- * Makefile.in: Rebuilt. +- +-2013-02-08 Anthony Green +- +- * configure.ac: Move sparc asm config checks to within functions +- for compatibility with sun tools. +- * configure: Rebuilt. +- * src/sparc/ffi.c (ffi_prep_closure_loc): Flush cache on v9 +- systems. +- * src/sparc/v8.S (ffi_flush_icache): Implement a sparc v9 cache +- flusher. +- +-2013-02-08 Nathan Rossi +- +- * src/microblaze/ffi.c (ffi_closure_call_SYSV): Fix handling of +- small big-endian structures. +- (ffi_prep_args): Ditto. +- +-2013-02-07 Anthony Green +- +- * src/sparc/v8.S (ffi_call_v8): Fix typo from last patch +- (effectively hiding ffi_call_v8). +- +-2013-02-07 Anthony Green +- +- * configure.ac: Update bug reporting address. +- * configure.in: Rebuild. +- +- * src/sparc/v8.S (ffi_flush_icache): Out-of-line cache flusher for +- Sun compiler. +- * src/sparc/ffi.c (ffi_call): Remove warning. +- Call ffi_flush_icache for non-GCC builds. +- (ffi_prep_closure_loc): Use ffi_flush_icache. +- +- * Makefile.am (EXTRA_DIST): Add libtool-ldflags. +- * Makefile.in: Rebuilt. +- * libtool-ldflags: New file. +- +-2013-02-07 Daniel Schepler +- +- * configure.ac: Correctly identify x32 systems as 64-bit. +- * m4/libtool.m4: Remove libtool expr error. +- * aclocal.m4, configure: Rebuilt. +- +-2013-02-07 Anthony Green +- +- * configure.ac: Fix GCC usage test. +- * configure: Rebuilt. +- * README: Mention LLVM/GCC x86_64 issue. +- * testsuite/Makefile.in: Rebuilt. +- +-2013-02-07 Anthony Green +- +- * testsuite/libffi.call/cls_double_va.c (main): Replace // style +- comments with /* */ for xlc compiler. +- * testsuite/libffi.call/stret_large.c (main): Ditto. +- * testsuite/libffi.call/stret_large2.c (main): Ditto. +- * testsuite/libffi.call/nested_struct1.c (main): Ditto. +- * testsuite/libffi.call/huge_struct.c (main): Ditto. +- * testsuite/libffi.call/float_va.c (main): Ditto. +- * testsuite/libffi.call/cls_struct_va1.c (main): Ditto. +- * testsuite/libffi.call/cls_pointer_stack.c (main): Ditto. +- * testsuite/libffi.call/cls_pointer.c (main): Ditto. +- * testsuite/libffi.call/cls_longdouble_va.c (main): Ditto. +- +-2013-02-06 Anthony Green +- +- * man/ffi_prep_cif.3: Clean up for debian lintian checker. +- +-2013-02-06 Anthony Green +- +- * Makefile.am (pkgconfigdir): Add missing pkgconfig install bits. +- * Makefile.in: Rebuild. +- +-2013-02-02 Mark H Weaver +- +- * src/x86/ffi64.c (ffi_call): Sign-extend integer arguments passed +- via general purpose registers. +- +-2013-01-21 Nathan Rossi +- +- * README: Add MicroBlaze details. +- * Makefile.am: Add MicroBlaze support. +- * configure.ac: Likewise. +- * src/microblaze/ffi.c: New. +- * src/microblaze/ffitarget.h: Likewise. +- * src/microblaze/sysv.S: Likewise. +- +-2013-01-21 Nathan Rossi +- * testsuite/libffi.call/return_uc.c: Fixed issue. +- +-2013-01-21 Chris Zankel +- +- * README: Add Xtensa support. +- * Makefile.am: Likewise. +- * configure.ac: Likewise. +- * Makefile.in Regenerate. +- * configure: Likewise. +- * src/prep_cif.c: Handle Xtensa. +- * src/xtensa: New directory. +- * src/xtensa/ffi.c: New file. +- * src/xtensa/ffitarget.h: Ditto. +- * src/xtensa/sysv.S: Ditto. +- +-2013-01-11 Anthony Green +- +- * src/powerpc/ffi_darwin.c (ffi_prep_args): Replace // style +- comments with /* */ for xlc compiler. +- * src/powerpc/aix.S (ffi_call_AIX): Ditto. +- * testsuite/libffi.call/ffitest.h (allocate_mmap): Delete +- deprecated inline function. +- * testsuite/libffi.special/ffitestcxx.h: Ditto. +- * README: Add update for AIX support. +- +-2013-01-11 Anthony Green +- +- * configure.ac: Robustify pc relative reloc check. +- * m4/ax_cc_maxopt.m4: Don't -malign-double. This is an ABI +- changing option for 32-bit x86. +- * aclocal.m4, configure: Rebuilt. +- * README: Update supported target list. +- +-2013-01-10 Anthony Green +- +- * README (tested): Add Compiler column to table. +- +-2013-01-10 Anthony Green +- +- * src/x86/ffi64.c (struct register_args): Make sse array and array +- of unions for sunpro compiler compatibility. +- +-2013-01-10 Anthony Green +- +- * configure.ac: Test target platform size_t size. Handle both 32 +- and 64-bit builds for x86_64-* and i?86-* targets (allowing for +- CFLAG option to change default settings). +- * configure, aclocal.m4: Rebuilt. +- +-2013-01-10 Anthony Green +- +- * testsuite/libffi.special/special.exp: Only run exception +- handling tests when using GNU compiler. +- +- * m4/ax_compiler_vendor.m4: New file. +- * configure.ac: Test for compiler vendor and don't use +- AX_CFLAGS_WARN_ALL with the sun compiler. +- * aclocal.m4, configure: Rebuilt. +- +-2013-01-10 Anthony Green +- +- * include/ffi_common.h: Don't use GCCisms to define types when +- building with the SUNPRO compiler. +- +-2013-01-10 Anthony Green +- +- * configure.ac: Put local.exp in the right place. +- * configure: Rebuilt. +- +- * src/x86/ffi.c: Update comment about regparm function attributes. +- * src/x86/sysv.S (ffi_closure_SYSV): The SUNPRO compiler requires +- that all function arguments be passed on the stack (no regparm +- support). +- +-2013-01-08 Anthony Green +- +- * configure.ac: Generate local.exp. This sets CC_FOR_TARGET +- when we are using the vendor compiler. +- * testsuite/Makefile.am (EXTRA_DEJAGNU_SITE_CONFIG): Point to +- ../local.exp. +- * configure, testsuite/Makefile.in: Rebuilt. +- +- * testsuite/libffi.call/call.exp: Run tests with different +- options, depending on whether or not we are using gcc or the +- vendor compiler. +- * testsuite/lib/libffi.exp (libffi-init): Set using_gcc based on +- whether or not we are building/testing with gcc. +- +-2013-01-08 Anthony Green +- +- * configure.ac: Switch x86 solaris target to X86 by default. +- * configure: Rebuilt. +- +-2013-01-08 Anthony Green +- +- * configure.ac: Fix test for read-only eh_frame. +- * configure: Rebuilt. +- +-2013-01-08 Anthony Green +- +- * src/x86/sysv.S, src/x86/unix64.S: Only emit DWARF unwind info +- when building with the GNU toolchain. +- * testsuite/libffi.call/ffitest.h (CHECK): Fix for Solaris vendor +- compiler. +- +-2013-01-07 Thorsten Glaser +- +- * testsuite/libffi.call/cls_uchar_va.c, +- testsuite/libffi.call/cls_ushort_va.c, +- testsuite/libffi.call/va_1.c: Testsuite fixes. +- +-2013-01-07 Thorsten Glaser +- +- * src/m68k/ffi.c (CIF_FLAGS_SINT8, CIF_FLAGS_SINT16): Define. +- (ffi_prep_cif_machdep): Fix 8-bit and 16-bit signed calls. +- * src/m68k/sysv.S (ffi_call_SYSV, ffi_closure_SYSV): Ditto. +- +-2013-01-04 Anthony Green +- +- * Makefile.am (AM_CFLAGS): Don't automatically add -fexceptions +- and -Wall. This is set in the configure script after testing for +- GCC. +- * Makefile.in: Rebuilt. +- +-2013-01-02 rofl0r +- +- * src/powerpc/ffi.c (ffi_prep_cif_machdep): Fix build error on ppc +- when long double == double. +- +-2013-01-02 Reini Urban +- +- * Makefile.am (libffi_la_LDFLAGS): Add -no-undefined to LDFLAGS +- (required for shared libs on cygwin/mingw). +- * Makefile.in: Rebuilt. +- +-2012-10-31 Alan Modra +- +- * src/powerpc/linux64_closure.S: Add new ABI support. +- * src/powerpc/linux64.S: Likewise. +- +-2012-10-30 Magnus Granberg +- Pavel Labushev +- +- * configure.ac: New options pax_emutramp +- * configure, fficonfig.h.in: Regenerated +- * src/closures.c: New function emutramp_enabled_check() and +- checks. +- +-2012-10-30 Frederick Cheung +- +- * configure.ac: Enable FFI_MAP_EXEC_WRIT for Darwin 12 (mountain +- lion) and future version. +- * configure: Rebuild. +- +-2012-10-30 James Greenhalgh +- Marcus Shawcroft +- +- * README: Add details of aarch64 port. +- * src/aarch64/ffi.c: New. +- * src/aarch64/ffitarget.h: Likewise. +- * src/aarch64/sysv.S: Likewise. +- * Makefile.am: Support aarch64. +- * configure.ac: Support aarch64. +- * Makefile.in, configure: Rebuilt. +- +-2012-10-30 James Greenhalgh +- Marcus Shawcroft +- +- * testsuite/lib/libffi.exp: Add support for aarch64. +- * testsuite/libffi.call/cls_struct_va1.c: New. +- * testsuite/libffi.call/cls_uchar_va.c: Likewise. +- * testsuite/libffi.call/cls_uint_va.c: Likewise. +- * testsuite/libffi.call/cls_ulong_va.c: Likewise. +- * testsuite/libffi.call/cls_ushort_va.c: Likewise. +- * testsuite/libffi.call/nested_struct11.c: Likewise. +- * testsuite/libffi.call/uninitialized.c: Likewise. +- * testsuite/libffi.call/va_1.c: Likewise. +- * testsuite/libffi.call/va_struct1.c: Likewise. +- * testsuite/libffi.call/va_struct2.c: Likewise. +- * testsuite/libffi.call/va_struct3.c: Likewise. +- +-2012-10-12 Walter Lee +- +- * Makefile.am: Add TILE-Gx/TILEPro support. +- * configure.ac: Likewise. +- * Makefile.in: Regenerate. +- * configure: Likewise. +- * src/prep_cif.c (ffi_prep_cif_core): Handle TILE-Gx/TILEPro. +- * src/tile: New directory. +- * src/tile/ffi.c: New file. +- * src/tile/ffitarget.h: Ditto. +- * src/tile/tile.S: Ditto. +- +-2012-10-12 Matthias Klose +- +- * generate-osx-source-and-headers.py: Normalize whitespace. +- +-2012-09-14 David Edelsohn +- +- * configure: Regenerated. +- +-2012-08-26 Andrew Pinski +- +- PR libffi/53014 +- * src/mips/ffi.c (ffi_prep_closure_loc): Allow n32 with soft-float and n64 with +- soft-float. +- +-2012-08-08 Uros Bizjak +- +- * src/s390/ffi.c (ffi_prep_closure_loc): Don't ASSERT ABI test, +- just return FFI_BAD_ABI when things are wrong. +- +-2012-07-18 H.J. Lu +- +- PR libffi/53982 +- PR libffi/53973 +- * src/x86/ffitarget.h: Check __ILP32__ instead of __LP64__ for x32. +- (FFI_SIZEOF_JAVA_RAW): Defined to 4 for x32. +- +-2012-05-16 H.J. Lu +- +- * configure: Regenerated. +- +-2012-05-05 Nicolas Lelong +- +- * libffi.xcodeproj/project.pbxproj: Fixes. +- * README: Update for iOS builds. +- +-2012-04-23 Alexandre Keunecke I. de Mendonca +- +- * configure.ac: Add Blackfin/sysv support +- * Makefile.am: Add Blackfin/sysv support +- * src/bfin/ffi.c: Add Blackfin/sysv support +- * src/bfin/ffitarget.h: Add Blackfin/sysv support +- +-2012-04-11 Anthony Green +- +- * Makefile.am (EXTRA_DIST): Add new script. +- * Makefile.in: Rebuilt. +- +-2012-04-11 Zachary Waldowski +- +- * generate-ios-source-and-headers.py, +- libffi.xcodeproj/project.pbxproj: Support a Mac static library via +- Xcode. Set iOS compatibility to 4.0. Move iOS trampoline +- generation into an Xcode "run script" phase. Include both as +- Xcode build scripts. Don't always regenerate config files. +- +-2012-04-10 Anthony Green +- +- * src/powerpc/ffi_darwin.c (ffi_prep_args): Add missing semicolon. +- +-2012-04-06 Anthony Green +- +- * Makefile.am (EXTRA_DIST): Add new iOS/xcode files. +- * Makefile.in: Rebuilt. +- +-2012-04-06 Mike Lewis +- +- * generate-ios-source-and-headers.py: New file. +- * libffi.xcodeproj/project.pbxproj: New file. +- * README: Update instructions on building iOS binary. +- * build-ios.sh: Delete. +- +-2012-04-06 Anthony Green +- +- * src/x86/ffi64.c (UINT128): Define differently for Intel and GNU +- compilers, then use it. +- +-2012-04-06 H.J. Lu +- +- * m4/libtool.m4 (_LT_ENABLE_LOCK): Support x32. +- +-2012-04-06 Anthony Green +- +- * testsuite/Makefile.am (EXTRA_DIST): Add missing test cases. +- * testsuite/Makefile.in: Rebuilt. +- +-2012-04-05 Zachary Waldowski +- +- * include/ffi.h.in: Add missing trampoline table fields. +- * src/arm/sysv.S: Fix ENTRY definition, and wrap symbol references +- in CNAME. +- * src/x86/ffi.c: Wrap Windows specific code in ifdefs. +- +-2012-04-02 Peter Bergner +- +- * src/powerpc/ffi.c (ffi_prep_args_SYSV): Declare double_tmp. +- Silence casting pointer to integer of different size warning. +- Delete goto to previously deleted label. +- (ffi_call): Silence possibly undefined warning. +- (ffi_closure_helper_SYSV): Declare variable type. +- +-2012-04-02 Peter Rosin +- +- * src/x86/win32.S (ffi_call_win32): Sign/zero extend the return +- value in the Intel version as is already done for the AT&T version. +- (ffi_closure_SYSV): Likewise. +- (ffi_closure_raw_SYSV): Likewise. +- (ffi_closure_STDCALL): Likewise. +- +-2012-03-29 Peter Rosin +- +- * src/x86/win32.S (ffi_closure_raw_THISCALL): Unify the frame +- generation, fix the ENDP label and remove the surplus third arg +- from the 'lea' insn. +- +-2012-03-29 Peter Rosin +- +- * src/x86/win32.S (ffi_closure_raw_SYSV): Make the 'stubraw' label +- visible outside the PROC, so that ffi_closure_raw_THISCALL can see +- it. Also instruct the assembler to add a frame to the function. +- +-2012-03-23 Peter Rosin +- +- * Makefile.am (AM_CPPFLAGS): Add -DFFI_BUILDING. +- * Makefile.in: Rebuilt. +- * include/ffi.h.in [MSVC]: Add __declspec(dllimport) decorations +- to all data exports, when compiling libffi clients using MSVC. +- +-2012-03-29 Peter Rosin +- +- * src/x86/ffitarget.h (ffi_abi): Add new ABI FFI_MS_CDECL and +- make it the default for MSVC. +- (FFI_TYPE_MS_STRUCT): New structure return convention. +- * src/x86/ffi.c (ffi_prep_cif_machdep): Tweak the structure +- return convention for FFI_MS_CDECL to be FFI_TYPE_MS_STRUCT +- instead of an ordinary FFI_TYPE_STRUCT. +- (ffi_prep_args): Treat FFI_TYPE_MS_STRUCT as FFI_TYPE_STRUCT. +- (ffi_call): Likewise. +- (ffi_prep_incoming_args_SYSV): Likewise. +- (ffi_raw_call): Likewise. +- (ffi_prep_closure_loc): Treat FFI_MS_CDECL as FFI_SYSV. +- * src/x86/win32.S (ffi_closure_SYSV): For FFI_TYPE_MS_STRUCT, +- return a pointer to the result structure in eax and don't pop +- that pointer from the stack, the caller takes care of it. +- (ffi_call_win32): Treat FFI_TYPE_MS_STRUCT as FFI_TYPE_STRUCT. +- (ffi_closure_raw_SYSV): Likewise. +- +-2012-03-22 Peter Rosin +- +- * testsuite/libffi.call/closure_stdcall.c [MSVC]: Add inline +- assembly version with Intel syntax. +- * testsuite/libffi.call/closure_thiscall.c [MSVC]: Likewise. +- +-2012-03-23 Peter Rosin +- +- * testsuite/libffi.call/ffitest.h: Provide abstration of +- __attribute__((fastcall)) in the form of a __FASTCALL__ +- define. Define it to __fastcall for MSVC. +- * testsuite/libffi.call/fastthis1_win32.c: Use the above. +- * testsuite/libffi.call/fastthis2_win32.c: Likewise. +- * testsuite/libffi.call/fastthis3_win32.c: Likewise. +- * testsuite/libffi.call/strlen2_win32.c: Likewise. +- * testsuite/libffi.call/struct1_win32.c: Likewise. +- * testsuite/libffi.call/struct2_win32.c: Likewise. +- +-2012-03-22 Peter Rosin +- +- * src/x86/win32.S [MSVC] (ffi_closure_THISCALL): Remove the manual +- frame on function entry, MASM adds one automatically. +- +-2012-03-22 Peter Rosin +- +- * testsuite/libffi.call/ffitest.h [MSVC]: Add kludge for missing +- bits in the MSVC headers. +- +-2012-03-22 Peter Rosin +- +- * testsuite/libffi.call/cls_12byte.c: Adjust to the C89 style +- with no declarations after statements. +- * testsuite/libffi.call/cls_16byte.c: Likewise. +- * testsuite/libffi.call/cls_18byte.c: Likewise. +- * testsuite/libffi.call/cls_19byte.c: Likewise. +- * testsuite/libffi.call/cls_1_1byte.c: Likewise. +- * testsuite/libffi.call/cls_20byte.c: Likewise. +- * testsuite/libffi.call/cls_20byte1.c: Likewise. +- * testsuite/libffi.call/cls_24byte.c: Likewise. +- * testsuite/libffi.call/cls_2byte.c: Likewise. +- * testsuite/libffi.call/cls_3_1byte.c: Likewise. +- * testsuite/libffi.call/cls_3byte1.c: Likewise. +- * testsuite/libffi.call/cls_3byte2.c: Likewise. +- * testsuite/libffi.call/cls_4_1byte.c: Likewise. +- * testsuite/libffi.call/cls_4byte.c: Likewise. +- * testsuite/libffi.call/cls_5_1_byte.c: Likewise. +- * testsuite/libffi.call/cls_5byte.c: Likewise. +- * testsuite/libffi.call/cls_64byte.c: Likewise. +- * testsuite/libffi.call/cls_6_1_byte.c: Likewise. +- * testsuite/libffi.call/cls_6byte.c: Likewise. +- * testsuite/libffi.call/cls_7_1_byte.c: Likewise. +- * testsuite/libffi.call/cls_7byte.c: Likewise. +- * testsuite/libffi.call/cls_8byte.c: Likewise. +- * testsuite/libffi.call/cls_9byte1.c: Likewise. +- * testsuite/libffi.call/cls_9byte2.c: Likewise. +- * testsuite/libffi.call/cls_align_double.c: Likewise. +- * testsuite/libffi.call/cls_align_float.c: Likewise. +- * testsuite/libffi.call/cls_align_longdouble.c: Likewise. +- * testsuite/libffi.call/cls_align_longdouble_split.c: Likewise. +- * testsuite/libffi.call/cls_align_longdouble_split2.c: Likewise. +- * testsuite/libffi.call/cls_align_pointer.c: Likewise. +- * testsuite/libffi.call/cls_align_sint16.c: Likewise. +- * testsuite/libffi.call/cls_align_sint32.c: Likewise. +- * testsuite/libffi.call/cls_align_sint64.c: Likewise. +- * testsuite/libffi.call/cls_align_uint16.c: Likewise. +- * testsuite/libffi.call/cls_align_uint32.c: Likewise. +- * testsuite/libffi.call/cls_align_uint64.c: Likewise. +- * testsuite/libffi.call/cls_dbls_struct.c: Likewise. +- * testsuite/libffi.call/cls_pointer_stack.c: Likewise. +- * testsuite/libffi.call/err_bad_typedef.c: Likewise. +- * testsuite/libffi.call/huge_struct.c: Likewise. +- * testsuite/libffi.call/nested_struct.c: Likewise. +- * testsuite/libffi.call/nested_struct1.c: Likewise. +- * testsuite/libffi.call/nested_struct10.c: Likewise. +- * testsuite/libffi.call/nested_struct2.c: Likewise. +- * testsuite/libffi.call/nested_struct3.c: Likewise. +- * testsuite/libffi.call/nested_struct4.c: Likewise. +- * testsuite/libffi.call/nested_struct5.c: Likewise. +- * testsuite/libffi.call/nested_struct6.c: Likewise. +- * testsuite/libffi.call/nested_struct7.c: Likewise. +- * testsuite/libffi.call/nested_struct8.c: Likewise. +- * testsuite/libffi.call/nested_struct9.c: Likewise. +- * testsuite/libffi.call/stret_large.c: Likewise. +- * testsuite/libffi.call/stret_large2.c: Likewise. +- * testsuite/libffi.call/stret_medium.c: Likewise. +- * testsuite/libffi.call/stret_medium2.c: Likewise. +- * testsuite/libffi.call/struct1.c: Likewise. +- * testsuite/libffi.call/struct1_win32.c: Likewise. +- * testsuite/libffi.call/struct2.c: Likewise. +- * testsuite/libffi.call/struct2_win32.c: Likewise. +- * testsuite/libffi.call/struct3.c: Likewise. +- * testsuite/libffi.call/struct4.c: Likewise. +- * testsuite/libffi.call/struct5.c: Likewise. +- * testsuite/libffi.call/struct6.c: Likewise. +- * testsuite/libffi.call/struct7.c: Likewise. +- * testsuite/libffi.call/struct8.c: Likewise. +- * testsuite/libffi.call/struct9.c: Likewise. +- * testsuite/libffi.call/testclosure.c: Likewise. +- +-2012-03-21 Peter Rosin +- +- * testsuite/libffi.call/float_va.c (float_va_fn): Use %f when +- printing doubles (%lf is for long doubles). +- (main): Likewise. +- +-2012-03-21 Peter Rosin +- +- * testsuite/lib/target-libpath.exp [*-*-cygwin*, *-*-mingw*] +- (set_ld_library_path_env_vars): Add the library search dir to PATH +- (and save PATH for later). +- (restore_ld_library_path_env_vars): Restore PATH. +- +-2012-03-21 Peter Rosin +- +- * testsuite/lib/target-libpath.exp [*-*-cygwin*, *-*-mingw*] +- (set_ld_library_path_env_vars): Add the library search dir to PATH +- (and save PATH for later). +- (restore_ld_library_path_env_vars): Restore PATH. +- +-2012-03-20 Peter Rosin +- +- * testsuite/libffi.call/strlen2_win32.c (main): Remove bug. +- * src/x86/win32.S [MSVC] (ffi_closure_SYSV): Make the 'stub' label +- visible outside the PROC, so that ffi_closure_THISCALL can see it. +- +-2012-03-20 Peter Rosin +- +- * testsuite/libffi.call/strlen2_win32.c (main): Remove bug. +- * src/x86/win32.S [MSVC] (ffi_closure_SYSV): Make the 'stub' label +- visible outside the PROC, so that ffi_closure_THISCALL can see it. +- +-2012-03-19 Alan Hourihane +- +- * src/m68k/ffi.c: Add MINT support. +- * src/m68k/sysv.S: Ditto. +- +-2012-03-06 Chung-Lin Tang +- +- * src/arm/ffi.c (ffi_call): Add __ARM_EABI__ guard around call to +- ffi_call_VFP(). +- (ffi_prep_closure_loc): Add __ARM_EABI__ guard around use of +- ffi_closure_VFP. +- * src/arm/sysv.S: Add __ARM_EABI__ guard around VFP code. +- +-2012-03-19 chennam +- +- * src/powerpc/ffi_darwin.c (ffi_prep_closure_loc): Fix AIX closure +- support. +- +-2012-03-13 Kaz Kojima +- +- * src/sh/ffi.c (ffi_prep_closure_loc): Don't ASSERT ABI test, +- just return FFI_BAD_ABI when things are wrong. +- * src/sh64/ffi.c (ffi_prep_closure_loc): Ditto. +- +-2012-03-09 David Edelsohn +- +- * src/powerpc/aix_closure.S (ffi_closure_ASM): Adjust for Darwin64 +- change to return value of ffi_closure_helper_DARWIN and load type +- from return type. +- +-2012-03-03 H.J. Lu +- +- * src/x86/ffi64.c (ffi_call): Cast the return value to unsigned +- long. +- (ffi_prep_closure_loc): Cast to 64bit address in trampoline. +- (ffi_closure_unix64_inner): Cast return pointer to unsigned long +- first. +- +- * src/x86/ffitarget.h (FFI_SIZEOF_ARG): Defined to 8 for x32. +- (ffi_arg): Set to unsigned long long for x32. +- (ffi_sarg): Set to long long for x32. +- +-2012-03-03 H.J. Lu +- +- * src/prep_cif.c (ffi_prep_cif_core): Properly check bad ABI. +- +-2012-03-03 Andoni Morales Alastruey +- +- * configure.ac: Add -no-undefined for both 32- and 64-bit x86 +- windows-like hosts. +- * configure: Rebuilt. +- +-2012-02-27 Mikael Pettersson +- +- PR libffi/52223 +- * Makefile.am (FLAGS_TO_PASS): Define. +- * Makefile.in: Regenerate. +- +-2012-02-23 Anthony Green +- +- * src/*/ffitarget.h: Ensure that users never include ffitarget.h +- directly. +- +-2012-02-23 Kai Tietz +- +- PR libffi/52221 +- * src/x86/ffi.c (ffi_closure_raw_THISCALL): New +- prototype. +- (ffi_prep_raw_closure_loc): Use ffi_closure_raw_THISCALL for +- thiscall-convention. +- (ffi_raw_call): Use ffi_prep_args_raw. +- * src/x86/win32.S (ffi_closure_raw_THISCALL): Add +- implementation for stub. +- +-2012-02-10 Kai Tietz +- +- * configure.ac (AM_LTLDFLAGS): Add -no-undefine for x64 +- windows target. +- * configure: Regenerated. +- +-2012-02-08 Kai Tietz +- +- * src/prep_cif.c (ffi_prep_cif): Allow for X86_WIN32 +- also FFI_THISCALL. +- * src/x86/ffi.c (ffi_closure_THISCALL): Add prototype. +- (FFI_INIT_TRAMPOLINE_THISCALL): New trampoline code. +- (ffi_prep_closure_loc): Add FFI_THISCALL support. +- * src/x86/ffitarget.h (FFI_TRAMPOLINE_SIZE): Adjust size. +- * src/x86/win32.S (ffi_closure_THISCALL): New closure code +- for thiscall-calling convention. +- * testsuite/libffi.call/closure_thiscall.c: New test. +- +-2012-01-28 Kai Tietz +- +- * src/libffi/src/x86/ffi.c (ffi_call_win32): Add new +- argument to prototype for specify calling-convention. +- (ffi_call): Add support for stdcall/thiscall convention. +- (ffi_prep_args): Likewise. +- (ffi_raw_call): Likewise. +- * src/x86/ffitarget.h (ffi_abi): Add FFI_THISCALL and +- FFI_FASTCALL. +- * src/x86/win32.S (_ffi_call_win32): Add support for +- fastcall/thiscall calling-convention calls. +- * testsuite/libffi.call/fastthis1_win32.c: New test. +- * testsuite/libffi.call/fastthis2_win32.c: New test. +- * testsuite/libffi.call/fastthis3_win32.c: New test. +- * testsuite/libffi.call/strlen2_win32.c: New test. +- * testsuite/libffi.call/many2_win32.c: New test. +- * testsuite/libffi.call/struct1_win32.c: New test. +- * testsuite/libffi.call/struct2_win32.c: New test. +- +-2012-01-23 Uros Bizjak +- +- * src/alpha/ffi.c (ffi_prep_closure_loc): Check for bad ABI. +- +-2012-01-23 Anthony Green +- Chris Young +- +- * configure.ac: Add Amiga support. +- * configure: Rebuilt. +- +-2012-01-23 Dmitry Nadezhin +- +- * include/ffi_common.h (LIKELY, UNLIKELY): Fix definitions. +- +-2012-01-23 Andreas Schwab +- +- * src/m68k/sysv.S (ffi_call_SYSV): Properly test for plain +- mc68000. Test for __HAVE_68881__ in addition to __MC68881__. +- +-2012-01-19 Jakub Jelinek +- +- PR rtl-optimization/48496 +- * src/ia64/ffi.c (ffi_call): Fix up aliasing violations. +- +-2012-01-09 Rainer Orth +- +- * configure.ac (i?86-*-*): Set TARGET to X86_64. +- * configure: Regenerate. +- +-2011-12-07 Andrew Pinski +- +- PR libffi/50051 +- * src/mips/n32.S: Add ".set mips4". +- +-2011-11-21 Andreas Tobler +- +- * configure: Regenerate. +- +-2011-11-12 David Gilbert +- +- * doc/libffi.texi, include/ffi.h.in, include/ffi_common.h, +- man/Makefile.am, man/ffi.3, man/ffi_prep_cif.3, +- man/ffi_prep_cif_var.3, src/arm/ffi.c, src/arm/ffitarget.h, +- src/cris/ffi.c, src/prep_cif.c, +- testsuite/libffi.call/cls_double_va.c, +- testsuite/libffi.call/cls_longdouble_va.c, +- testsuite/libffi.call/float_va.c: Many changes to support variadic +- function calls. +- +-2011-11-12 Kyle Moffett +- +- * src/powerpc/ffi.c, src/powerpc/ffitarget.h, +- src/powerpc/ppc_closure.S, src/powerpc/sysv.S: Many changes for +- softfloat powerpc variants. +- +-2011-11-12 Petr Salinger +- +- * configure.ac (FFI_EXEC_TRAMPOLINE_TABLE): Fix kfreebsd support. +- * configure: Rebuilt. +- +-2011-11-12 Timothy Wall +- +- * src/arm/ffi.c (ffi_prep_args, ffi_prep_incoming_args_SYSV): Max +- alignment of 4 for wince on ARM. +- +-2011-11-12 Kyle Moffett +- Anthony Green +- +- * src/ppc/sysv.S, src/ppc/ffi.c: Remove use of ppc string +- instructions (not available on some cores, like the PPC440). +- +-2011-11-12 Kimura Wataru +- +- * m4/ax_enable_builddir: Change from string comparison to numeric +- comparison for wc output. +- * configure.ac: Enable FFI_MMAP_EXEC_WRIT for darwin11 aka Mac OS +- X 10.7. +- * configure: Rebuilt. +- +-2011-11-12 Anthony Green +- +- * Makefile.am (AM_CCASFLAGS): Add -g option to build assembly +- files with debug info. +- * Makefile.in: Rebuilt. +- +-2011-11-12 Jasper Lievisse Adriaanse +- +- * README: Update list of supported OpenBSD systems. +- +-2011-11-12 Anthony Green +- +- * libtool-version: Update. +- * Makefile.am (nodist_libffi_la_SOURCES): Add src/debug.c if +- FFI_DEBUG. +- (libffi_la_SOURCES): Remove src/debug.c +- (EXTRA_DIST): Add src/debug.c +- * Makefile.in: Rebuilt. +- * README: Update for 3.0.11. +- +-2011-11-10 Richard Henderson +- +- * configure.ac (GCC_AS_CFI_PSEUDO_OP): Use it instead of inline check. +- * configure, aclocal.m4: Rebuild. +- +-2011-09-04 Iain Sandoe +- +- PR libffi/49594 +- * src/powerpc/darwin_closure.S (stubs): Make the stub binding +- helper reference track the architecture pointer size. +- +-2011-08-25 Andrew Haley +- +- * src/arm/ffi.c (FFI_INIT_TRAMPOLINE): Remove hard-coded assembly +- instructions. +- * src/arm/sysv.S (ffi_arm_trampoline): Put them here instead. +- +-2011-07-11 Andrew Haley +- +- * src/arm/ffi.c (FFI_INIT_TRAMPOLINE): Clear icache. +- +-2011-06-29 Rainer Orth +- +- * testsuite/libffi.call/cls_double_va.c: Move PR number to comment. +- * testsuite/libffi.call/cls_longdouble_va.c: Likewise. +- +-2011-06-29 Rainer Orth +- +- PR libffi/46660 +- * testsuite/libffi.call/cls_double_va.c: xfail dg-output on +- mips-sgi-irix6*. +- * testsuite/libffi.call/cls_longdouble_va.c: Likewise. +- +-2011-06-14 Rainer Orth +- +- * testsuite/libffi.call/huge_struct.c (test_large_fn): Use PRIu8, +- PRId8 instead of %hhu, %hhd. +- * testsuite/libffi.call/ffitest.h [__alpha__ && __osf__] (PRId8, +- PRIu8): Define. +- [__sgi__] (PRId8, PRIu8): Define. +- +-2011-04-29 Rainer Orth +- +- * src/alpha/osf.S (UA_SI, FDE_ENCODING, FDE_ENCODE, FDE_ARANGE): +- Define. +- Use them to handle ELF vs. ECOFF differences. +- [__osf__] (_GLOBAL__F_ffi_call_osf): Define. +- +-2011-03-30 Timothy Wall +- +- * src/powerpc/darwin.S: Fix unknown FDE encoding. +- * src/powerpc/darwin_closure.S: ditto. +- +-2011-02-25 Anthony Green +- +- * src/powerpc/ffi.c (ffi_prep_closure_loc): Allow for more +- 32-bit ABIs. +- +-2011-02-15 Anthony Green +- +- * m4/ax_cc_maxopt.m4: Don't -malign-double or use -ffast-math. +- * configure: Rebuilt. +- +-2011-02-13 Ralf Wildenhues +- +- * configure: Regenerate. +- +-2011-02-13 Anthony Green +- +- * include/ffi_common.h (UNLIKELY, LIKELY): Define. +- * src/x86/ffi64.c (UNLIKELY, LIKELY): Remove definition. +- * src/prep_cif.c (UNLIKELY, LIKELY): Remove definition. +- +- * src/prep_cif.c (initialize_aggregate): Convert assertion into +- FFI_BAD_TYPEDEF return. Initialize arg size and alignment to 0. +- +- * src/pa/ffi.c (ffi_prep_closure_loc): Don't ASSERT ABI test, +- just return FFI_BAD_ABI when things are wrong. +- * src/arm/ffi.c (ffi_prep_closure_loc): Ditto. +- * src/powerpc/ffi.c (ffi_prep_closure_loc): Ditto. +- * src/mips/ffi.c (ffi_prep_closure_loc): Ditto. +- * src/ia64/ffi.c (ffi_prep_closure_loc): Ditto. +- * src/avr32/ffi.c (ffi_prep_closure_loc): Ditto. +- +-2011-02-11 Anthony Green +- +- * src/sparc/ffi.c (ffi_prep_closure_loc): Don't ASSERT ABI test, +- just return FFI_BAD_ABI when things are wrong. +- +-2012-02-11 Eric Botcazou +- +- * src/sparc/v9.S (STACKFRAME): Bump to 176. +- +-2011-02-09 Stuart Shelton +- +- http://bugs.gentoo.org/show_bug.cgi?id=286911 +- * src/mips/ffitarget.h: Clean up error messages. +- * src/java_raw_api.c (ffi_java_translate_args): Cast raw arg to +- ffi_raw*. +- * include/ffi.h.in: Add pragma for SGI compiler. +- +-2011-02-09 Anthony Green +- +- * configure.ac: Add powerpc64-*-darwin* support. +- +-2011-02-09 Anthony Green +- +- * README: Mention Interix. +- +-2011-02-09 Jonathan Callen +- +- * configure.ac: Add Interix to win32/cygwin/mingw case. +- * configure: Ditto. +- * src/closures.c: Treat Interix like Cygwin, instead of as a +- generic win32. +- +-2011-02-09 Anthony Green +- +- * testsuite/libffi.call/err_bad_typedef.c: Remove xfail. +- * testsuite/libffi.call/err_bad_abi.c: Remove xfail. +- * src/x86/ffi64.c (UNLIKELY, LIKELY): Define. +- (ffi_prep_closure_loc): Check for bad ABI. +- * src/prep_cif.c (UNLIKELY, LIKELY): Define. +- (initialize_aggregate): Check for bad types. +- +-2011-02-09 Landon Fuller +- +- * Makefile.am (EXTRA_DIST): Add build-ios.sh, src/arm/gentramp.sh, +- src/arm/trampoline.S. +- (nodist_libffi_la_SOURCES): Add src/arc/trampoline.S. +- * configure.ac (FFI_EXEC_TRAMPOLINE_TABLE): Define. +- * src/arm/ffi.c (ffi_trampoline_table) +- (ffi_closure_trampoline_table_page, ffi_trampoline_table_entry) +- (FFI_TRAMPOLINE_CODELOC_CONFIG, FFI_TRAMPOLINE_CONFIG_PAGE_OFFSET) +- (FFI_TRAMPOLINE_COUNT, ffi_trampoline_lock, ffi_trampoline_tables) +- (ffi_trampoline_table_alloc, ffi_closure_alloc, ffi_closure_free): +- Define for FFI_EXEC_TRAMPOLINE_TABLE case (iOS). +- (ffi_prep_closure_loc): Handl FFI_EXEC_TRAMPOLINE_TABLE case +- separately. +- * src/arm/sysv.S: Handle Apple iOS host. +- * src/closures.c: Handle FFI_EXEC_TRAMPOLINE_TABLE case. +- * build-ios.sh: New file. +- * fficonfig.h.in, configure, Makefile.in: Rebuilt. +- * README: Mention ARM iOS. +- +-2011-02-08 Oren Held +- +- * src/dlmalloc.c (_STRUCT_MALLINFO): Define in order to avoid +- redefinition of mallinfo on HP-UX. +- +-2011-02-08 Ginn Chen +- +- * src/sparc/ffi.c (ffi_call): Make compatible with Solaris Studio +- aggregate return ABI. Flush cache. +- (ffi_prep_closure_loc): Flush cache. +- +-2011-02-11 Anthony Green +- +- From Tom Honermann : +- * src/powerpc/aix.S (ffi_call_AIX): Support for xlc toolchain on +- AIX. Declare .ffi_prep_args. Insert nops after branch +- instructions so that the AIX linker can insert TOC reload +- instructions. +- * src/powerpc/aix_closure.S: Declare .ffi_closure_helper_DARWIN. +- +-2011-02-08 Ed +- +- * src/powerpc/asm.h: Fix grammar nit in comment. +- +-2011-02-08 Uli Link +- +- * include/ffi.h.in (FFI_64_BIT_MAX): Define and use. +- +-2011-02-09 Rainer Orth +- +- PR libffi/46661 +- * testsuite/libffi.call/cls_pointer.c (main): Cast void * to +- uintptr_t first. +- * testsuite/libffi.call/cls_pointer_stack.c (main): Likewise. +- +-2011-02-08 Rafael Avila de Espindola +- +- * configure.ac: Fix x86 test for pc related relocs. +- * configure: Rebuilt. +- +-2011-02-07 Joel Sherrill +- +- * libffi/src/m68k/ffi.c: Add RTEMS support for cache flushing. +- Handle case when CPU variant does not have long double support. +- * libffi/src/m68k/sysv.S: Add support for mc68000, Coldfire, +- and cores with soft floating point. +- +-2011-02-07 Joel Sherrill +- +- * configure.ac: Add mips*-*-rtems* support. +- * configure: Regenerate. +- * src/mips/ffitarget.h: Ensure needed constants are available +- for targets which do not have sgidefs.h. +- +-2011-01-26 Dave Korn +- +- PR target/40125 +- * configure.ac (AM_LTLDFLAGS): Add -bindir option for windows DLLs. +- * configure: Regenerate. +- +-2010-12-18 Iain Sandoe +- +- PR libffi/29152 +- PR libffi/42378 +- * src/powerpc/darwin_closure.S: Provide Darwin64 implementation, +- update comments. +- * src/powerpc/ffitarget.h (POWERPC_DARWIN64): New, +- (FFI_TRAMPOLINE_SIZE): Update for Darwin64. +- * src/powerpc/darwin.S: Provide Darwin64 implementation, +- update comments. +- * src/powerpc/ffi_darwin.c: Likewise. +- +-2010-12-06 Rainer Orth +- +- * configure.ac (libffi_cv_as_ascii_pseudo_op): Use double +- backslashes. +- (libffi_cv_as_string_pseudo_op): Likewise. +- * configure: Regenerate. +- +-2010-12-03 Chung-Lin Tang +- +- * src/arm/sysv.S (ffi_closure_SYSV): Add UNWIND to .pad directive. +- (ffi_closure_VFP): Same. +- (ffi_call_VFP): Move down to before ffi_closure_VFP. Add '.fpu vfp' +- directive. +- +-2010-12-01 Rainer Orth +- +- * testsuite/libffi.call/ffitest.h [__sgi] (PRId64, PRIu64): Define. +- (PRIuPTR): Define. +- +-2010-11-29 Richard Henderson +- Rainer Orth +- +- * src/x86/sysv.S (FDE_ENCODING, FDE_ENCODE): Define. +- (.eh_frame): Use FDE_ENCODING. +- (.LASFDE1, .LASFDE2, LASFDE3): Simplify with FDE_ENCODE. +- +-2010-11-22 Jacek Caban +- +- * configure.ac: Check for symbol underscores on mingw-w64. +- * configure: Rebuilt. +- * src/x86/win64.S: Correctly access extern symbols in respect to +- underscores. +- +-2010-11-15 Rainer Orth +- +- * testsuite/lib/libffi-dg.exp: Rename ... +- * testsuite/lib/libffi.exp: ... to this. +- * libffi/testsuite/libffi.call/call.exp: Don't load libffi-dg.exp. +- * libffi/testsuite/libffi.special/special.exp: Likewise. +- +-2010-10-28 Chung-Lin Tang +- +- * src/arm/ffi.c (ffi_prep_args): Add VFP register argument handling +- code, new parameter, and return value. Update comments. +- (ffi_prep_cif_machdep): Add case for VFP struct return values. Add +- call to layout_vfp_args(). +- (ffi_call_SYSV): Update declaration. +- (ffi_call_VFP): New declaration. +- (ffi_call): Add VFP struct return conditions. Call ffi_call_VFP() +- when ABI is FFI_VFP. +- (ffi_closure_VFP): New declaration. +- (ffi_closure_SYSV_inner): Add new vfp_args parameter, update call to +- ffi_prep_incoming_args_SYSV(). +- (ffi_prep_incoming_args_SYSV): Update parameters. Add VFP argument +- case handling. +- (ffi_prep_closure_loc): Pass ffi_closure_VFP to trampoline +- construction under VFP hard-float. +- (rec_vfp_type_p): New function. +- (vfp_type_p): Same. +- (place_vfp_arg): Same. +- (layout_vfp_args): Same. +- * src/arm/ffitarget.h (ffi_abi): Add FFI_VFP. Define FFI_DEFAULT_ABI +- based on __ARM_PCS_VFP. +- (FFI_EXTRA_CIF_FIELDS): Define for adding VFP hard-float specific +- fields. +- (FFI_TYPE_STRUCT_VFP_FLOAT): Define internally used type code. +- (FFI_TYPE_STRUCT_VFP_DOUBLE): Same. +- * src/arm/sysv.S (ffi_call_SYSV): Change call of ffi_prep_args() to +- direct call. Move function pointer load upwards. +- (ffi_call_VFP): New function. +- (ffi_closure_VFP): Same. +- +- * testsuite/lib/libffi-dg.exp (check-flags): New function. +- (dg-skip-if): New function. +- * testsuite/libffi.call/cls_double_va.c: Skip if target is arm*-*-* +- and compiler options include -mfloat-abi=hard. +- * testsuite/libffi.call/cls_longdouble_va.c: Same. +- +-2010-10-01 Jakub Jelinek +- +- PR libffi/45677 +- * src/x86/ffi64.c (ffi_prep_cif_machdep): Ensure cif->bytes is +- a multiple of 8. +- * testsuite/libffi.call/many2.c: New test. +- +-2010-08-20 Mark Wielaard +- +- * src/closures.c (open_temp_exec_file_mnt): Check if getmntent_r +- returns NULL. +- +-2010-08-09 Andreas Tobler +- +- * configure.ac: Add target powerpc64-*-freebsd*. +- * configure: Regenerate. +- * testsuite/libffi.call/cls_align_longdouble_split.c: Pass +- -mlong-double-128 only to linux targets. +- * testsuite/libffi.call/cls_align_longdouble_split2.c: Likewise. +- * testsuite/libffi.call/cls_longdouble.c: Likewise. +- * testsuite/libffi.call/huge_struct.c: Likewise. +- +-2010-08-05 Dan Witte +- +- * Makefile.am: Pass FFI_DEBUG define to msvcc.sh for linking to the +- debug CRT when --enable-debug is given. +- * configure.ac: Define it. +- * msvcc.sh: Translate -g and -DFFI_DEBUG appropriately. +- +-2010-08-04 Dan Witte +- +- * src/x86/ffitarget.h: Add X86_ANY define for all x86/x86_64 +- platforms. +- * src/x86/ffi.c: Remove redundant ifdef checks. +- * src/prep_cif.c: Push stack space computation into src/x86/ffi.c +- for X86_ANY so return value space doesn't get added twice. +- +-2010-08-03 Neil Rashbrooke +- +- * msvcc.sh: Don't pass -safeseh to ml64 because behavior is buggy. +- +-2010-07-22 Dan Witte +- +- * src/*/ffitarget.h: Make FFI_LAST_ABI one past the last valid ABI. +- * src/prep_cif.c: Fix ABI assertion. +- * src/cris/ffi.c: Ditto. +- +-2010-07-10 Evan Phoenix +- +- * src/closures.c (selinux_enabled_check): Fix strncmp usage bug. +- +-2010-07-07 Dan Horák +- +- * include/ffi.h.in: Protect #define with #ifndef. +- * src/powerpc/ffitarget.h: Ditto. +- * src/s390/ffitarget.h: Ditto. +- * src/sparc/ffitarget.h: Ditto. +- +-2010-07-07 Neil Roberts +- +- * src/x86/sysv.S (ffi_call_SYSV): Align the stack pointer to +- 16-bytes. +- +-2010-07-02 Jakub Jelinek +- +- * Makefile.am (AM_MAKEFLAGS): Pass also mandir to submakes. +- * Makefile.in: Regenerated. +- +-2010-05-19 Rainer Orth +- +- * configure.ac (libffi_cv_as_x86_pcrel): Check for illegal in as +- output, too. +- (libffi_cv_as_ascii_pseudo_op): Check for .ascii. +- (libffi_cv_as_string_pseudo_op): Check for .string. +- * configure: Regenerate. +- * fficonfig.h.in: Regenerate. +- * src/x86/sysv.S (.eh_frame): Use .ascii, .string or error. +- +-2010-05-11 Dan Witte +- +- * doc/libffi.tex: Document previous change. +- +-2010-05-11 Makoto Kato +- +- * src/x86/ffi.c (ffi_call): Don't copy structs passed by value. +- +-2010-05-05 Michael Kohler +- +- * src/dlmalloc.c (dlfree): Fix spelling. +- * src/ia64/ffi.c (ffi_prep_cif_machdep): Ditto. +- * configure.ac: Ditto. +- * configure: Rebuilt. +- +-2010-04-13 Dan Witte +- +- * msvcc.sh: Build with -W3 instead of -Wall. +- * src/powerpc/ffi_darwin.c: Remove build warnings. +- * src/x86/ffi.c: Ditto. +- * src/x86/ffitarget.h: Ditto. +- +-2010-04-12 Dan Witte +- Walter Meinl +- +- * configure.ac: Add OS/2 support. +- * configure: Rebuilt. +- * src/closures.c: Ditto. +- * src/dlmalloc.c: Ditto. +- * src/x86/win32.S: Ditto. +- +-2010-04-07 Jakub Jelinek +- +- * testsuite/libffi.call/err_bad_abi.c: Remove unused args variable. +- +-2010-04-02 Ralf Wildenhues +- +- * Makefile.in: Regenerate. +- * aclocal.m4: Regenerate. +- * include/Makefile.in: Regenerate. +- * man/Makefile.in: Regenerate. +- * testsuite/Makefile.in: Regenerate. +- +-2010-03-30 Dan Witte +- +- * msvcc.sh: Disable build warnings. +- * README (tested): Clarify windows build procedure. +- +-2010-03-15 Rainer Orth +- +- * configure.ac (libffi_cv_as_x86_64_unwind_section_type): New test. +- * configure: Regenerate. +- * fficonfig.h.in: Regenerate. +- * libffi/src/x86/unix64.S (.eh_frame) +- [HAVE_AS_X86_64_UNWIND_SECTION_TYPE]: Use @unwind section type. +- +-2010-03-14 Matthias Klose +- +- * src/x86/ffi64.c: Fix typo in comment. +- * src/x86/ffi.c: Use /* ... */ comment style. +- +-2010-02-24 Rainer Orth +- +- * doc/libffi.texi (The Closure API): Fix typo. +- * doc/libffi.info: Remove. +- +-2010-02-15 Matthias Klose +- +- * src/arm/sysv.S (__ARM_ARCH__): Define for processor +- __ARM_ARCH_7EM__. +- +-2010-01-15 Anthony Green +- +- * README: Add notes on building with Microsoft Visual C++. +- +-2010-01-15 Daniel Witte +- +- * msvcc.sh: New file. +- +- * src/x86/win32.S: Port assembly routines to MSVC and #ifdef. +- * src/x86/ffi.c: Tweak function declaration and remove excess +- parens. +- * include/ffi.h.in: Add __declspec(align(8)) to typedef struct +- ffi_closure. +- +- * src/x86/ffi.c: Merge ffi_call_SYSV and ffi_call_STDCALL into new +- function ffi_call_win32 on X86_WIN32. +- * src/x86/win32.S (ffi_call_SYSV): Rename to ffi_call_win32. +- (ffi_call_STDCALL): Remove. +- +- * src/prep_cif.c (ffi_prep_cif): Move stack space allocation code +- to ffi_prep_cif_machdep for x86. +- * src/x86/ffi.c (ffi_prep_cif_machdep): To here. +- +-2010-01-15 Oliver Kiddle +- +- * src/x86/ffitarget.h (ffi_abi): Check for __i386 and __amd64 for +- Sun Studio compiler compatibility. +- +-2010-01-12 Conrad Irwin +- +- * doc/libffi.texi: Add closure example. +- +-2010-01-07 Rainer Orth +- +- PR libffi/40701 +- * testsuite/libffi.call/ffitest.h [__alpha__ && __osf__] (PRIdLL, +- PRIuLL, PRId64, PRIu64, PRIuPTR): Define. +- * testsuite/libffi.call/cls_align_sint64.c: Add -Wno-format on +- alpha*-dec-osf*. +- * testsuite/libffi.call/cls_align_uint64.c: Likewise. +- * testsuite/libffi.call/cls_ulonglong.c: Likewise. +- * testsuite/libffi.call/return_ll1.c: Likewise. +- * testsuite/libffi.call/stret_medium2.c: Likewise. +- * testsuite/libffi.special/ffitestcxx.h (allocate_mmap): Cast +- MAP_FAILED to char *. +- +-2010-01-06 Rainer Orth +- +- * src/mips/n32.S: Use .abicalls and .eh_frame with __GNUC__. +- +-2009-12-31 Anthony Green +- +- * README: Update for libffi 3.0.9. +- +-2009-12-27 Matthias Klose +- +- * configure.ac (HAVE_LONG_DOUBLE): Define for mips when +- appropriate. +- * configure: Rebuilt. +- +-2009-12-26 Anthony Green +- +- * testsuite/libffi.call/cls_longdouble_va.c: Mark as xfail for +- avr32*-*-*. +- * testsuite/libffi.call/cls_double_va.c: Ditto. +- +-2009-12-26 Andreas Tobler +- +- * testsuite/libffi.call/ffitest.h: Conditionally include stdint.h +- and inttypes.h. +- * testsuite/libffi.special/unwindtest.cc: Ditto. +- +-2009-12-26 Andreas Tobler +- +- * configure.ac: Add amd64-*-openbsd*. +- * configure: Rebuilt. +- * testsuite/lib/libffi-dg.exp (libffi_target_compile): Link +- openbsd programs with -lpthread. +- +-2009-12-26 Anthony Green +- +- * testsuite/libffi.call/cls_double_va.c, +- testsuite/libffi.call/cls_longdouble.c, +- testsuite/libffi.call/cls_longdouble_va.c, +- testsuite/libffi.call/cls_pointer.c, +- testsuite/libffi.call/cls_pointer_stack.c: Remove xfail for +- mips*-*-* and arm*-*-*. +- * testsuite/libffi.call/cls_align_longdouble_split.c, +- testsuite/libffi.call/cls_align_longdouble_split2.c, +- testsuite/libffi.call/stret_medium2.c, +- testsuite/libffi.call/stret_medium.c, +- testsuite/libffi.call/stret_large.c, +- testsuite/libffi.call/stret_large2.c: Remove xfail for arm*-*-*. +- +-2009-12-31 Kay Tietz +- +- * testsuite/libffi.call/ffitest.h, +- testsuite/libffi.special/ffitestcxx.h (PRIdLL, PRuLL): Fix +- definitions. +- +-2009-12-31 Carlo Bramini +- +- * configure.ac (AM_LTLDFLAGS): Define for windows hosts. +- * Makefile.am (libffi_la_LDFLAGS): Add AM_LTLDFLAGS. +- * configure: Rebuilt. +- * Makefile.in: Rebuilt. +- +-2009-12-31 Anthony Green +- Blake Chaffin. +- +- * testsuite/libffi.call/huge_struct.c: New test case from Blake +- Chaffin @ Apple. +- +-2009-12-28 David Edelsohn +- +- * src/powerpc/ffi_darwin.c (ffi_prep_args): Copy abi and nargs to +- local variables. +- (aix_adjust_aggregate_sizes): New function. +- (ffi_prep_cif_machdep): Call it. +- +-2009-12-26 Andreas Tobler +- +- * configure.ac: Define FFI_MMAP_EXEC_WRIT for the given targets. +- * configure: Regenerate. +- * fficonfig.h.in: Likewise. +- * src/closures.c: Remove the FFI_MMAP_EXEC_WRIT definition for +- Solaris/x86. +- +-2009-12-26 Andreas Schwab +- +- * src/powerpc/ffi.c (ffi_prep_args_SYSV): Advance intarg_count +- when a float arguments is passed in memory. +- (ffi_closure_helper_SYSV): Mark general registers as used up when +- a 64bit or soft-float long double argument is passed in memory. +- +-2009-12-25 Matthias Klose +- +- * man/ffi_call.3: Fix #include in examples. +- * doc/libffi.texi: Add dircategory. +- +-2009-12-25 Frank Everdij +- +- * include/ffi.h.in: Placed '__GNUC__' ifdef around +- '__attribute__((aligned(8)))' in ffi_closure, fixes compile for +- IRIX MIPSPro c99. +- * include/ffi_common.h: Added '__sgi' define to non +- '__attribute__((__mode__()))' integer typedefs. +- * src/mips/ffi.c (ffi_call, ffi_closure_mips_inner_O32, +- ffi_closure_mips_inner_N32): Added 'defined(_MIPSEB)' to BE check. +- (ffi_closure_mips_inner_O32, ffi_closure_mips_inner_N32): Added +- FFI_LONGDOUBLE support and alignment(N32 only). +- * src/mips/ffitarget.h: Corrected '#include ' for IRIX and +- fixed non '__attribute__((__mode__()))' integer typedefs. +- * src/mips/n32.S: Put '#ifdef linux' around '.abicalls' and '.eh_frame' +- since they are Linux/GNU Assembler specific. +- +-2009-12-25 Bradley Smith +- +- * configure.ac, Makefile.am, src/avr32/ffi.c, +- src/avr32/ffitarget.h, +- src/avr32/sysv.S: Add AVR32 port. +- * configure, Makefile.in: Rebuilt. +- +-2009-12-21 Andreas Tobler +- +- * configure.ac: Make i?86 build on FreeBSD and OpenBSD. +- * configure: Regenerate. +- +-2009-12-15 John David Anglin +- +- * testsuite/libffi.call/ffitest.h: Define PRIuPTR on PA HP-UX. +- +-2009-12-13 John David Anglin +- +- * src/pa/ffi.c (ffi_closure_inner_pa32): Handle FFI_TYPE_LONGDOUBLE +- type on HP-UX. +- +-2012-02-13 Kai Tietz +- +- PR libffi/52221 +- * src/x86/ffi.c (ffi_prep_raw_closure_loc): Add thiscall +- support for X86_WIN32. +- (FFI_INIT_TRAMPOLINE_THISCALL): Fix displacement. +- +-2009-12-11 Eric Botcazou +- +- * src/sparc/ffi.c (ffi_closure_sparc_inner_v9): Properly align 'long +- double' arguments. +- +-2009-12-11 Eric Botcazou +- +- * testsuite/libffi.call/ffitest.h: Define PRIuPTR on Solaris < 10. +- +-2009-12-10 Rainer Orth +- +- PR libffi/40700 +- * src/closures.c [X86_64 && __sun__ && __svr4__] +- (FFI_MMAP_EXEC_WRIT): Define. +- +-2009-12-08 David Daney +- +- * testsuite/libffi.call/stret_medium.c: Remove xfail for mips*-*-* +- * testsuite/libffi.call/cls_align_longdouble_split2.c: Same. +- * testsuite/libffi.call/stret_large.c: Same. +- * testsuite/libffi.call/cls_align_longdouble_split.c: Same. +- * testsuite/libffi.call/stret_large2.c: Same. +- * testsuite/libffi.call/stret_medium2.c: Same. +- +-2009-12-07 David Edelsohn +- +- * src/powerpc/aix_closure.S (libffi_closure_ASM): Fix tablejump +- typo. +- +-2009-12-05 David Edelsohn +- +- * src/powerpc/aix.S: Update AIX32 code to be consistent with AIX64 +- code. +- * src/powerpc/aix_closure.S: Same. +- +-2009-12-05 Ralf Wildenhues +- +- * Makefile.in: Regenerate. +- * configure: Regenerate. +- * include/Makefile.in: Regenerate. +- * man/Makefile.in: Regenerate. +- * testsuite/Makefile.in: Regenerate. +- +-2009-12-04 David Edelsohn +- +- * src/powerpc/aix_closure.S: Reorganize 64-bit code to match +- linux64_closure.S. +- +-2009-12-04 Uros Bizjak +- +- PR libffi/41908 +- * src/x86/ffi64.c (classify_argument): Update from +- gcc/config/i386/i386.c. +- (ffi_closure_unix64_inner): Do not use the address of two consecutive +- SSE registers directly. +- * testsuite/libffi.call/cls_dbls_struct.c (main): Remove xfail +- for x86_64 linux targets. +- +-2009-12-04 David Edelsohn +- +- * src/powerpc/ffi_darwin.c (ffi_closure_helper_DARWIN): Increment +- pfr for long double split between fpr13 and stack. +- +-2009-12-03 David Edelsohn +- +- * src/powerpc/ffi_darwin.c (ffi_prep_args): Increment next_arg and +- fparg_count twice for long double. +- +-2009-12-03 David Edelsohn +- +- PR libffi/42243 +- * src/powerpc/ffi_darwin.c (ffi_prep_args): Remove extra parentheses. +- +-2009-12-03 Uros Bizjak +- +- * testsuite/libffi.call/cls_longdouble_va.c (main): Fix format string. +- Remove xfails for x86 linux targets. +- +-2009-12-02 David Edelsohn +- +- * src/powerpc/ffi_darwin.c (ffi_prep_args): Fix typo in INT64 +- case. +- +-2009-12-01 David Edelsohn +- +- * src/powerpc/aix.S (ffi_call_AIX): Convert to more standard +- register usage. Call ffi_prep_args directly. Add long double +- return value support. +- * src/powerpc/ffi_darwin.c (ffi_prep_args): Double arg increment +- applies to FFI_TYPE_DOUBLE. Correct fpr_base increment typo. +- Separate FFI_TYPE_SINT32 and FFI_TYPE_UINT32 cases. +- (ffi_prep_cif_machdep): Only 16 byte stack alignment in 64 bit +- mode. +- (ffi_closure_helper_DARWIN): Remove nf and ng counters. Move temp +- into case. +- * src/powerpc/aix_closure.S: Maintain 16 byte stack alignment. +- Allocate result area between params and FPRs. +- +-2009-11-30 David Edelsohn +- +- PR target/35484 +- * src/powerpc/ffitarget.h (POWERPC64): Define for PPC64 Linux and +- AIX64. +- * src/powerpc/aix.S: Implement AIX64 version. +- * src/powerpc/aix_closure.S: Implement AIX64 version. +- (ffi_closure_ASM): Use extsb, lha and displament addresses. +- * src/powerpc/ffi_darwin.c (ffi_prep_args): Implement AIX64 +- support. +- (ffi_prep_cif_machdep): Same. +- (ffi_call): Same. +- (ffi_closure_helper_DARWIN): Same. +- +-2009-11-02 Andreas Tobler +- +- PR libffi/41908 +- * testsuite/libffi.call/testclosure.c: New test. +- +-2009-09-28 Kai Tietz +- +- * src/x86/win64.S (_ffi_call_win64 stack): Remove for gnu +- assembly version use of ___chkstk. +- +-2009-09-23 Matthias Klose +- +- PR libffi/40242, PR libffi/41443 +- * src/arm/sysv.S (__ARM_ARCH__): Define for processors +- __ARM_ARCH_6T2__, __ARM_ARCH_6M__, __ARM_ARCH_7__, +- __ARM_ARCH_7A__, __ARM_ARCH_7R__, __ARM_ARCH_7M__. +- Change the conditionals to __SOFTFP__ || __ARM_EABI__ +- for -mfloat-abi=softfp to work. +- +-2009-09-17 Loren J. Rittle +- +- PR testsuite/32843 (strikes again) +- * src/x86/ffi.c (ffi_prep_cif_machdep): Add X86_FREEBSD to +- enable proper extension on char and short. +- +-2009-09-15 David Daney +- +- * src/java_raw_api.c (ffi_java_raw_to_rvalue): Remove special +- handling for FFI_TYPE_POINTER. +- * src/mips/ffitarget.h (FFI_TYPE_STRUCT_D_SOFT, +- FFI_TYPE_STRUCT_F_SOFT, FFI_TYPE_STRUCT_DD_SOFT, +- FFI_TYPE_STRUCT_FF_SOFT, FFI_TYPE_STRUCT_FD_SOFT, +- FFI_TYPE_STRUCT_DF_SOFT, FFI_TYPE_STRUCT_SOFT): New defines. +- (FFI_N32_SOFT_FLOAT, FFI_N64_SOFT_FLOAT): New ffi_abi enumerations. +- (enum ffi_abi): Set FFI_DEFAULT_ABI for soft-float. +- * src/mips/n32.S (ffi_call_N32): Add handling for soft-float +- structure and pointer returns. +- (ffi_closure_N32): Add handling for pointer returns. +- * src/mips/ffi.c (ffi_prep_args, calc_n32_struct_flags, +- calc_n32_return_struct_flags): Handle soft-float. +- (ffi_prep_cif_machdep): Handle soft-float, fix pointer handling. +- (ffi_call_N32): Declare proper argument types. +- (ffi_call, copy_struct_N32, ffi_closure_mips_inner_N32): Handle +- soft-float. +- +-2009-08-24 Ralf Wildenhues +- +- * configure.ac (AC_PREREQ): Bump to 2.64. +- +-2009-08-22 Ralf Wildenhues +- +- * Makefile.am (install-html, install-pdf): Remove. +- * Makefile.in: Regenerate. +- +- * Makefile.in: Regenerate. +- * aclocal.m4: Regenerate. +- * configure: Regenerate. +- * fficonfig.h.in: Regenerate. +- * include/Makefile.in: Regenerate. +- * man/Makefile.in: Regenerate. +- * testsuite/Makefile.in: Regenerate. +- +-2011-08-22 Jasper Lievisse Adriaanse +- +- * configure.ac: Add OpenBSD/hppa and OpenBSD/powerpc support. +- * configure: Rebuilt. +- +-2009-07-30 Ralf Wildenhues +- +- * configure.ac (_AC_ARG_VAR_PRECIOUS): Use m4_rename_force. +- +-2009-07-24 Dave Korn +- +- PR libffi/40807 +- * src/x86/ffi.c (ffi_prep_cif_machdep): Also use sign/zero-extending +- return types for X86_WIN32. +- * src/x86/win32.S (_ffi_call_SYSV): Handle omitted return types. +- (_ffi_call_STDCALL, _ffi_closure_SYSV, _ffi_closure_raw_SYSV, +- _ffi_closure_STDCALL): Likewise. +- +- * src/closures.c (is_selinux_enabled): Define to const 0 for Cygwin. +- (dlmmap, dlmunmap): Also use these functions on Cygwin. +- +-2009-07-11 Richard Sandiford +- +- PR testsuite/40699 +- PR testsuite/40707 +- PR testsuite/40709 +- * testsuite/lib/libffi-dg.exp: Revert 2009-07-02, 2009-07-01 and +- 2009-06-30 commits. +- +-2009-07-01 Richard Sandiford +- +- * testsuite/lib/libffi-dg.exp (libffi-init): Set ld_library_path +- to "" before adding paths. (This reinstates an assignment that +- was removed by my 2009-06-30 commit, but changes the initial +- value from "." to "".) +- +-2009-07-01 H.J. Lu +- +- PR testsuite/40601 +- * testsuite/lib/libffi-dg.exp (libffi-init): Properly set +- gccdir. Adjust ld_library_path for gcc only if gccdir isn't +- empty. +- +-2009-06-30 Richard Sandiford +- +- * testsuite/lib/libffi-dg.exp (libffi-init): Don't add "." +- to ld_library_path. Use add_path. Add just find_libgcc_s +- to ld_library_path, not every libgcc multilib directory. +- +-2009-06-16 Wim Lewis +- +- * src/powerpc/ffi.c: Avoid clobbering cr3 and cr4, which are +- supposed to be callee-saved. +- * src/powerpc/sysv.S (small_struct_return_value): Fix overrun of +- return buffer for odd-size structs. +- +-2009-06-16 Andreas Tobler +- +- PR libffi/40444 +- * testsuite/lib/libffi-dg.exp (libffi_target_compile): Add +- allow_stack_execute for Darwin. +- +-2009-06-16 Andrew Haley +- +- * configure.ac (TARGETDIR): Add missing blank lines. +- * configure: Regenerate. +- +-2009-06-16 Andrew Haley +- +- * testsuite/libffi.call/cls_align_sint64.c, +- testsuite/libffi.call/cls_align_uint64.c, +- testsuite/libffi.call/cls_longdouble_va.c, +- testsuite/libffi.call/cls_ulonglong.c, +- testsuite/libffi.call/return_ll1.c, +- testsuite/libffi.call/stret_medium2.c: Fix printf format +- specifiers. +- * testsuite/libffi.call/ffitest.h, +- testsuite/libffi.special/ffitestcxx.h (PRIdLL, PRIuLL): Define. +- +-2009-06-15 Andrew Haley +- +- * testsuite/libffi.call/err_bad_typedef.c: xfail everywhere. +- * testsuite/libffi.call/err_bad_abi.c: Likewise. +- +-2009-06-12 Andrew Haley +- +- * Makefile.am: Remove info_TEXINFOS. +- +-2009-06-12 Andrew Haley +- +- * ChangeLog.libffi: testsuite/libffi.call/cls_align_sint64.c, +- testsuite/libffi.call/cls_align_uint64.c, +- testsuite/libffi.call/cls_ulonglong.c, +- testsuite/libffi.call/return_ll1.c, +- testsuite/libffi.call/stret_medium2.c: Fix printf format +- specifiers. +- testsuite/libffi.special/unwindtest.cc: include stdint.h. +- +-2009-06-11 Timothy Wall +- +- * Makefile.am, +- configure.ac, +- include/ffi.h.in, +- include/ffi_common.h, +- src/closures.c, +- src/dlmalloc.c, +- src/x86/ffi.c, +- src/x86/ffitarget.h, +- src/x86/win64.S (new), +- README: Added win64 support (mingw or MSVC) +- * Makefile.in, +- include/Makefile.in, +- man/Makefile.in, +- testsuite/Makefile.in, +- configure, +- aclocal.m4: Regenerated +- * ltcf-c.sh: properly escape cygwin/w32 path +- * man/ffi_call.3: Clarify size requirements for return value. +- * src/x86/ffi64.c: Fix filename in comment. +- * src/x86/win32.S: Remove unused extern. +- +- * testsuite/libffi.call/closure_fn0.c, +- testsuite/libffi.call/closure_fn1.c, +- testsuite/libffi.call/closure_fn2.c, +- testsuite/libffi.call/closure_fn3.c, +- testsuite/libffi.call/closure_fn4.c, +- testsuite/libffi.call/closure_fn5.c, +- testsuite/libffi.call/closure_fn6.c, +- testsuite/libffi.call/closure_stdcall.c, +- testsuite/libffi.call/cls_12byte.c, +- testsuite/libffi.call/cls_16byte.c, +- testsuite/libffi.call/cls_18byte.c, +- testsuite/libffi.call/cls_19byte.c, +- testsuite/libffi.call/cls_1_1byte.c, +- testsuite/libffi.call/cls_20byte.c, +- testsuite/libffi.call/cls_20byte1.c, +- testsuite/libffi.call/cls_24byte.c, +- testsuite/libffi.call/cls_2byte.c, +- testsuite/libffi.call/cls_3_1byte.c, +- testsuite/libffi.call/cls_3byte1.c, +- testsuite/libffi.call/cls_3byte2.c, +- testsuite/libffi.call/cls_4_1byte.c, +- testsuite/libffi.call/cls_4byte.c, +- testsuite/libffi.call/cls_5_1_byte.c, +- testsuite/libffi.call/cls_5byte.c, +- testsuite/libffi.call/cls_64byte.c, +- testsuite/libffi.call/cls_6_1_byte.c, +- testsuite/libffi.call/cls_6byte.c, +- testsuite/libffi.call/cls_7_1_byte.c, +- testsuite/libffi.call/cls_7byte.c, +- testsuite/libffi.call/cls_8byte.c, +- testsuite/libffi.call/cls_9byte1.c, +- testsuite/libffi.call/cls_9byte2.c, +- testsuite/libffi.call/cls_align_double.c, +- testsuite/libffi.call/cls_align_float.c, +- testsuite/libffi.call/cls_align_longdouble.c, +- testsuite/libffi.call/cls_align_longdouble_split.c, +- testsuite/libffi.call/cls_align_longdouble_split2.c, +- testsuite/libffi.call/cls_align_pointer.c, +- testsuite/libffi.call/cls_align_sint16.c, +- testsuite/libffi.call/cls_align_sint32.c, +- testsuite/libffi.call/cls_align_sint64.c, +- testsuite/libffi.call/cls_align_uint16.c, +- testsuite/libffi.call/cls_align_uint32.c, +- testsuite/libffi.call/cls_align_uint64.c, +- testsuite/libffi.call/cls_dbls_struct.c, +- testsuite/libffi.call/cls_double.c, +- testsuite/libffi.call/cls_double_va.c, +- testsuite/libffi.call/cls_float.c, +- testsuite/libffi.call/cls_longdouble.c, +- testsuite/libffi.call/cls_longdouble_va.c, +- testsuite/libffi.call/cls_multi_schar.c, +- testsuite/libffi.call/cls_multi_sshort.c, +- testsuite/libffi.call/cls_multi_sshortchar.c, +- testsuite/libffi.call/cls_multi_uchar.c, +- testsuite/libffi.call/cls_multi_ushort.c, +- testsuite/libffi.call/cls_multi_ushortchar.c, +- testsuite/libffi.call/cls_pointer.c, +- testsuite/libffi.call/cls_pointer_stack.c, +- testsuite/libffi.call/cls_schar.c, +- testsuite/libffi.call/cls_sint.c, +- testsuite/libffi.call/cls_sshort.c, +- testsuite/libffi.call/cls_uchar.c, +- testsuite/libffi.call/cls_uint.c, +- testsuite/libffi.call/cls_ulonglong.c, +- testsuite/libffi.call/cls_ushort.c, +- testsuite/libffi.call/err_bad_abi.c, +- testsuite/libffi.call/err_bad_typedef.c, +- testsuite/libffi.call/float2.c, +- testsuite/libffi.call/huge_struct.c, +- testsuite/libffi.call/nested_struct.c, +- testsuite/libffi.call/nested_struct1.c, +- testsuite/libffi.call/nested_struct10.c, +- testsuite/libffi.call/nested_struct2.c, +- testsuite/libffi.call/nested_struct3.c, +- testsuite/libffi.call/nested_struct4.c, +- testsuite/libffi.call/nested_struct5.c, +- testsuite/libffi.call/nested_struct6.c, +- testsuite/libffi.call/nested_struct7.c, +- testsuite/libffi.call/nested_struct8.c, +- testsuite/libffi.call/nested_struct9.c, +- testsuite/libffi.call/problem1.c, +- testsuite/libffi.call/return_ldl.c, +- testsuite/libffi.call/return_ll1.c, +- testsuite/libffi.call/stret_large.c, +- testsuite/libffi.call/stret_large2.c, +- testsuite/libffi.call/stret_medium.c, +- testsuite/libffi.call/stret_medium2.c, +- testsuite/libffi.special/unwindtest.cc: use ffi_closure_alloc instead +- of checking for MMAP. Use intptr_t instead of long casts. +- +-2009-06-11 Kaz Kojima +- +- * testsuite/libffi.call/cls_longdouble_va.c: Add xfail sh*-*-linux-*. +- * testsuite/libffi.call/err_bad_abi.c: Add xfail sh*-*-*. +- * testsuite/libffi.call/err_bad_typedef.c: Likewise. +- +-2009-06-09 Andrew Haley +- +- * src/x86/freebsd.S: Add missing file. +- +-2009-06-08 Andrew Haley +- +- Import from libffi 3.0.8: +- +- * doc/libffi.texi: New file. +- * doc/libffi.info: Likewise. +- * doc/stamp-vti: Likewise. +- * man/Makefile.am: New file. +- * man/ffi_call.3: New file. +- +- * Makefile.am (EXTRA_DIST): Add src/x86/darwin64.S, +- src/dlmalloc.c. +- (nodist_libffi_la_SOURCES): Add X86_FREEBSD. +- +- * configure.ac: Bump version to 3.0.8. +- parisc*-*-linux*: Add. +- i386-*-freebsd* | i386-*-openbsd*: Add. +- powerpc-*-beos*: Add. +- AM_CONDITIONAL X86_FREEBSD: Add. +- AC_CONFIG_FILES: Add man/Makefile. +- +- * include/ffi.h.in (FFI_FN): Change void (*)() to void (*)(void). +- +-2009-06-08 Andrew Haley +- +- * README: Import from libffi 3.0.8. +- +-2009-06-08 Andrew Haley +- +- * testsuite/libffi.call/err_bad_abi.c: Add xfails. +- * testsuite/libffi.call/cls_longdouble_va.c: Add xfails. +- * testsuite/libffi.call/cls_dbls_struct.c: Add xfail x86_64-*-linux-*. +- * testsuite/libffi.call/err_bad_typedef.c: Add xfails. +- +- * testsuite/libffi.call/stret_medium2.c: Add __UNUSED__ to args. +- * testsuite/libffi.call/stret_medium.c: Likewise. +- * testsuite/libffi.call/stret_large2.c: Likewise. +- * testsuite/libffi.call/stret_large.c: Likewise. +- +-2008-12-26 Timothy Wall +- +- * testsuite/libffi.call/cls_longdouble.c, +- testsuite/libffi.call/cls_longdouble_va.c, +- testsuite/libffi.call/cls_align_longdouble.c, +- testsuite/libffi.call/cls_align_longdouble_split.c, +- testsuite/libffi.call/cls_align_longdouble_split2.c: mark expected +- failures on x86_64 cygwin/mingw. +- +-2008-12-22 Timothy Wall +- +- * testsuite/libffi.call/closure_fn0.c, +- testsuite/libffi.call/closure_fn1.c, +- testsuite/libffi.call/closure_fn2.c, +- testsuite/libffi.call/closure_fn3.c, +- testsuite/libffi.call/closure_fn4.c, +- testsuite/libffi.call/closure_fn5.c, +- testsuite/libffi.call/closure_fn6.c, +- testsuite/libffi.call/closure_loc_fn0.c, +- testsuite/libffi.call/closure_stdcall.c, +- testsuite/libffi.call/cls_align_pointer.c, +- testsuite/libffi.call/cls_pointer.c, +- testsuite/libffi.call/cls_pointer_stack.c: use portable cast from +- pointer to integer (intptr_t). +- * testsuite/libffi.call/cls_longdouble.c: disable for win64. +- +-2008-07-24 Anthony Green +- +- * testsuite/libffi.call/cls_dbls_struct.c, +- testsuite/libffi.call/cls_double_va.c, +- testsuite/libffi.call/cls_longdouble.c, +- testsuite/libffi.call/cls_longdouble_va.c, +- testsuite/libffi.call/cls_pointer.c, +- testsuite/libffi.call/cls_pointer_stack.c, +- testsuite/libffi.call/err_bad_abi.c: Clean up failures from +- compiler warnings. +- +-2008-03-04 Anthony Green +- Blake Chaffin +- hos@tamanegi.org +- +- * testsuite/libffi.call/cls_align_longdouble_split2.c +- testsuite/libffi.call/cls_align_longdouble_split.c +- testsuite/libffi.call/cls_dbls_struct.c +- testsuite/libffi.call/cls_double_va.c +- testsuite/libffi.call/cls_longdouble.c +- testsuite/libffi.call/cls_longdouble_va.c +- testsuite/libffi.call/cls_pointer.c +- testsuite/libffi.call/cls_pointer_stack.c +- testsuite/libffi.call/err_bad_abi.c +- testsuite/libffi.call/err_bad_typedef.c +- testsuite/libffi.call/stret_large2.c +- testsuite/libffi.call/stret_large.c +- testsuite/libffi.call/stret_medium2.c +- testsuite/libffi.call/stret_medium.c: New tests from Apple. +- +-2009-06-05 Andrew Haley +- +- * src/x86/ffitarget.h, src/x86/ffi.c: Merge stdcall changes from +- libffi. +- +-2009-06-04 Andrew Haley +- +- * src/x86/ffitarget.h, src/x86/win32.S, src/x86/ffi.c: Back out +- stdcall changes. +- +-2008-02-26 Anthony Green +- Thomas Heller +- +- * src/x86/ffi.c (ffi_closure_SYSV_inner): Change C++ comment to C +- comment. +- +-2008-02-03 Timothy Wall +- +- * src/x86/ffi.c (FFI_INIT_TRAMPOLINE_STDCALL): Calculate jump return +- offset based on code pointer, not data pointer. +- +-2008-01-31 Timothy Wall +- +- * testsuite/libffi.call/closure_stdcall.c: Add test for stdcall +- closures. +- * src/x86/ffitarget.h: Increase size of trampoline for stdcall +- closures. +- * src/x86/win32.S: Add assembly for stdcall closure. +- * src/x86/ffi.c: Initialize stdcall closure trampoline. +- +-2009-06-04 Andrew Haley +- +- * include/ffi.h.in: Change void (*)() to void (*)(void). +- * src/x86/ffi.c: Likewise. +- +-2009-06-04 Andrew Haley +- +- * src/powerpc/ppc_closure.S: Insert licence header. +- * src/powerpc/linux64_closure.S: Likewise. +- * src/m68k/sysv.S: Likewise. +- +- * src/sh64/ffi.c: Change void (*)() to void (*)(void). +- * src/powerpc/ffi.c: Likewise. +- * src/powerpc/ffi_darwin.c: Likewise. +- * src/m32r/ffi.c: Likewise. +- * src/sh64/ffi.c: Likewise. +- * src/x86/ffi64.c: Likewise. +- * src/alpha/ffi.c: Likewise. +- * src/alpha/osf.S: Likewise. +- * src/frv/ffi.c: Likewise. +- * src/s390/ffi.c: Likewise. +- * src/pa/ffi.c: Likewise. +- * src/pa/hpux32.S: Likewise. +- * src/ia64/unix.S: Likewise. +- * src/ia64/ffi.c: Likewise. +- * src/sparc/ffi.c: Likewise. +- * src/mips/ffi.c: Likewise. +- * src/sh/ffi.c: Likewise. +- +-2008-02-15 David Daney +- +- * src/mips/ffi.c (USE__BUILTIN___CLEAR_CACHE): +- Define (conditionally), and use it to include cachectl.h. +- (ffi_prep_closure_loc): Fix cache flushing. +- * src/mips/ffitarget.h (_ABIN32, _ABI64, _ABIO32): Define. +- +-2009-06-04 Andrew Haley +- +- include/ffi.h.in, +- src/arm/ffitarget.h, +- src/arm/ffi.c, +- src/arm/sysv.S, +- src/powerpc/ffitarget.h, +- src/closures.c, +- src/sh64/ffitarget.h, +- src/sh64/ffi.c, +- src/sh64/sysv.S, +- src/types.c, +- src/x86/ffi64.c, +- src/x86/ffitarget.h, +- src/x86/win32.S, +- src/x86/darwin.S, +- src/x86/ffi.c, +- src/x86/sysv.S, +- src/x86/unix64.S, +- src/alpha/ffitarget.h, +- src/alpha/ffi.c, +- src/alpha/osf.S, +- src/m68k/ffitarget.h, +- src/frv/ffitarget.h, +- src/frv/ffi.c, +- src/s390/ffitarget.h, +- src/s390/sysv.S, +- src/cris/ffitarget.h, +- src/pa/linux.S, +- src/pa/ffitarget.h, +- src/pa/ffi.c, +- src/raw_api.c, +- src/ia64/ffitarget.h, +- src/ia64/unix.S, +- src/ia64/ffi.c, +- src/ia64/ia64_flags.h, +- src/java_raw_api.c, +- src/debug.c, +- src/sparc/v9.S, +- src/sparc/ffitarget.h, +- src/sparc/ffi.c, +- src/sparc/v8.S, +- src/mips/ffitarget.h, +- src/mips/n32.S, +- src/mips/o32.S, +- src/mips/ffi.c, +- src/prep_cif.c, +- src/sh/ffitarget.h, +- src/sh/ffi.c, +- src/sh/sysv.S: Update license text. +- +-2009-05-22 Dave Korn +- +- * src/x86/win32.S (_ffi_closure_STDCALL): New function. +- (.eh_frame): Add FDE for it. +- +-2009-05-22 Dave Korn +- +- * configure.ac: Also check if assembler supports pc-relative +- relocs on X86_WIN32 targets. +- * configure: Regenerate. +- * src/x86/win32.S (ffi_prep_args): Declare extern, not global. +- (_ffi_call_SYSV): Add missing function type symbol .def and +- add EH markup labels. +- (_ffi_call_STDCALL): Likewise. +- (_ffi_closure_SYSV): Likewise. +- (_ffi_closure_raw_SYSV): Likewise. +- (.eh_frame): Add hand-crafted EH data. +- +-2009-04-09 Jakub Jelinek +- +- * testsuite/lib/libffi-dg.exp: Change copyright header to refer to +- version 3 of the GNU General Public License and to point readers +- at the COPYING3 file and the FSF's license web page. +- * testsuite/libffi.call/call.exp: Likewise. +- * testsuite/libffi.special/special.exp: Likewise. +- +-2009-03-01 Ralf Wildenhues +- +- * configure: Regenerate. +- +-2008-12-18 Rainer Orth +- +- PR libffi/26048 +- * configure.ac (HAVE_AS_X86_PCREL): New test. +- * configure: Regenerate. +- * fficonfig.h.in: Regenerate. +- * src/x86/sysv.S [!FFI_NO_RAW_API]: Precalculate +- RAW_CLOSURE_CIF_OFFSET, RAW_CLOSURE_FUN_OFFSET, +- RAW_CLOSURE_USER_DATA_OFFSET for the Solaris 10/x86 assembler. +- (.eh_frame): Only use SYMBOL-. iff HAVE_AS_X86_PCREL. +- * src/x86/unix64.S (.Lstore_table): Move to .text section. +- (.Lload_table): Likewise. +- (.eh_frame): Only use SYMBOL-. iff HAVE_AS_X86_PCREL. +- +-2008-12-18 Ralf Wildenhues +- +- * configure: Regenerate. +- +-2008-11-21 Eric Botcazou +- +- * src/sparc/ffi.c (ffi_prep_cif_machdep): Add support for +- signed/unsigned int8/16 return values. +- * src/sparc/v8.S (ffi_call_v8): Likewise. +- (ffi_closure_v8): Likewise. +- +-2008-09-26 Peter O'Gorman +- Steve Ellcey +- +- * configure: Regenerate for new libtool. +- * Makefile.in: Ditto. +- * include/Makefile.in: Ditto. +- * aclocal.m4: Ditto. +- +-2008-08-25 Andreas Tobler +- +- * src/powerpc/ffitarget.h (ffi_abi): Add FFI_LINUX and +- FFI_LINUX_SOFT_FLOAT to the POWERPC_FREEBSD enum. +- Add note about flag bits used for FFI_SYSV_TYPE_SMALL_STRUCT. +- Adjust copyright notice. +- * src/powerpc/ffi.c: Add two new flags to indicate if we have one +- register or two register to use for FFI_SYSV structs. +- (ffi_prep_cif_machdep): Pass the right register flag introduced above. +- (ffi_closure_helper_SYSV): Fix the return type for +- FFI_SYSV_TYPE_SMALL_STRUCT. Comment. +- Adjust copyright notice. +- +-2008-07-16 Kaz Kojima +- +- * src/sh/ffi.c (ffi_prep_closure_loc): Turn INSN into an unsigned +- int. +- +-2008-06-17 Ralf Wildenhues +- +- * configure: Regenerate. +- * include/Makefile.in: Regenerate. +- * testsuite/Makefile.in: Regenerate. +- +-2008-06-07 Joseph Myers +- +- * configure.ac (parisc*-*-linux*, powerpc-*-sysv*, +- powerpc-*-beos*): Remove. +- * configure: Regenerate. +- +-2008-05-09 Julian Brown +- +- * Makefile.am (LTLDFLAGS): New. +- (libffi_la_LDFLAGS): Use above. +- * Makefile.in: Regenerate. +- +-2008-04-18 Paolo Bonzini +- +- PR bootstrap/35457 +- * aclocal.m4: Regenerate. +- * configure: Regenerate. +- +-2008-03-26 Kaz Kojima +- +- * src/sh/sysv.S: Add .note.GNU-stack on Linux. +- * src/sh64/sysv.S: Likewise. +- +-2008-03-26 Daniel Jacobowitz +- +- * src/arm/sysv.S: Fix ARM comment marker. +- +-2008-03-26 Jakub Jelinek +- +- * src/alpha/osf.S: Add .note.GNU-stack on Linux. +- * src/s390/sysv.S: Likewise. +- * src/powerpc/ppc_closure.S: Likewise. +- * src/powerpc/sysv.S: Likewise. +- * src/x86/unix64.S: Likewise. +- * src/x86/sysv.S: Likewise. +- * src/sparc/v8.S: Likewise. +- * src/sparc/v9.S: Likewise. +- * src/m68k/sysv.S: Likewise. +- * src/arm/sysv.S: Likewise. +- +-2008-03-16 Ralf Wildenhues +- +- * aclocal.m4: Regenerate. +- * configure: Likewise. +- * Makefile.in: Likewise. +- * include/Makefile.in: Likewise. +- * testsuite/Makefile.in: Likewise. +- +-2008-02-12 Bjoern Koenig +- Andreas Tobler +- +- * configure.ac: Add amd64-*-freebsd* target. +- * configure: Regenerate. +- +-2008-01-30 H.J. Lu +- +- PR libffi/34612 +- * src/x86/sysv.S (ffi_closure_SYSV): Pop 4 byte from stack when +- returning struct. +- +- * testsuite/libffi.call/call.exp: Add "-O2 -fomit-frame-pointer" +- tests. +- +-2008-01-24 David Edelsohn +- +- * configure: Regenerate. +- +-2008-01-06 Andreas Tobler +- +- * src/x86/ffi.c (ffi_prep_cif_machdep): Fix thinko. +- +-2008-01-05 Andreas Tobler +- +- PR testsuite/32843 +- * src/x86/ffi.c (ffi_prep_cif_machdep): Add code for +- signed/unsigned int8/16 for X86_DARWIN. +- Updated copyright info. +- Handle one and two byte structs with special cif->flags. +- * src/x86/ffitarget.h: Add special types for one and two byte structs. +- Updated copyright info. +- * src/x86/darwin.S (ffi_call_SYSV): Rewrite to use a jump table like +- sysv.S +- Remove code to pop args from the stack after call. +- Special-case signed/unsigned for int8/16, one and two byte structs. +- (ffi_closure_raw_SYSV): Handle FFI_TYPE_UINT8, +- FFI_TYPE_SINT8, FFI_TYPE_UINT16, FFI_TYPE_SINT16, FFI_TYPE_UINT32, +- FFI_TYPE_SINT32. +- Updated copyright info. +- +-2007-12-08 David Daney +- +- * src/mips/n32.S (ffi_call_N32): Replace dadd with ADDU, dsub with +- SUBU, add with ADDU and use smaller code sequences. +- +-2007-12-07 David Daney +- +- * src/mips/ffi.c (ffi_prep_cif_machdep): Handle long double return +- type. +- +-2007-12-06 David Daney +- +- * include/ffi.h.in (FFI_SIZEOF_JAVA_RAW): Define if not already +- defined. +- (ffi_java_raw): New typedef. +- (ffi_java_raw_call, ffi_java_ptrarray_to_raw, +- ffi_java_raw_to_ptrarray): Change parameter types from ffi_raw to +- ffi_java_raw. +- (ffi_java_raw_closure) : Same. +- (ffi_prep_java_raw_closure, ffi_prep_java_raw_closure_loc): Change +- parameter types. +- * src/java_raw_api.c (ffi_java_raw_size): Replace FFI_SIZEOF_ARG with +- FFI_SIZEOF_JAVA_RAW. +- (ffi_java_raw_to_ptrarray): Change type of raw to ffi_java_raw. +- Replace FFI_SIZEOF_ARG with FFI_SIZEOF_JAVA_RAW. Use +- sizeof(ffi_java_raw) for alignment calculations. +- (ffi_java_ptrarray_to_raw): Same. +- (ffi_java_rvalue_to_raw): Add special handling for FFI_TYPE_POINTER +- if FFI_SIZEOF_JAVA_RAW == 4. +- (ffi_java_raw_to_rvalue): Same. +- (ffi_java_raw_call): Change type of raw to ffi_java_raw. +- (ffi_java_translate_args): Same. +- (ffi_prep_java_raw_closure_loc, ffi_prep_java_raw_closure): Change +- parameter types. +- * src/mips/ffitarget.h (FFI_SIZEOF_JAVA_RAW): Define for N32 ABI. +- +-2007-12-06 David Daney +- +- * src/mips/n32.S (ffi_closure_N32): Use 64-bit add instruction on +- pointer values. +- +-2007-12-01 Andreas Tobler +- +- PR libffi/31937 +- * src/powerpc/ffitarget.h: Introduce new ABI FFI_LINUX_SOFT_FLOAT. +- Add local FFI_TYPE_UINT128 to handle soft-float long-double-128. +- * src/powerpc/ffi.c: Distinguish between __NO_FPRS__ and not and +- set the NUM_FPR_ARG_REGISTERS according to. +- Add support for potential soft-float support under hard-float +- architecture. +- (ffi_prep_args_SYSV): Set NUM_FPR_ARG_REGISTERS to 0 in case of +- FFI_LINUX_SOFT_FLOAT, handle float, doubles and long-doubles according +- to the FFI_LINUX_SOFT_FLOAT ABI. +- (ffi_prep_cif_machdep): Likewise. +- (ffi_closure_helper_SYSV): Likewise. +- * src/powerpc/ppc_closure.S: Make sure not to store float/double +- on archs where __NO_FPRS__ is true. +- Add FFI_TYPE_UINT128 support. +- * src/powerpc/sysv.S: Add support for soft-float long-double-128. +- Adjust copyright notice. +- +-2007-11-25 Andreas Tobler +- +- * src/closures.c: Move defintion of MAYBE_UNUSED from here to ... +- * include/ffi_common.h: ... here. +- Update copyright. +- +-2007-11-17 Andreas Tobler +- +- * src/powerpc/sysv.S: Load correct cr to compare if we have long double. +- * src/powerpc/linux64.S: Likewise. +- * src/powerpc/ffi.c: Add a comment to show which part goes into cr6. +- * testsuite/libffi.call/return_ldl.c: New test. +- +-2007-09-04 +- +- * src/arm/sysv.S (UNWIND): New. +- (Whole file): Conditionally compile unwinder directives. +- * src/arm/sysv.S: Add unwinder directives. +- +- * src/arm/ffi.c (ffi_prep_args): Align structs by at least 4 bytes. +- Only treat r0 as a struct address if we're actually returning a +- struct by address. +- Only copy the bytes that are actually within a struct. +- (ffi_prep_cif_machdep): A Composite Type not larger than 4 bytes +- is returned in r0, not passed by address. +- (ffi_call): Allocate a word-sized temporary for the case where +- a composite is returned in r0. +- (ffi_prep_incoming_args_SYSV): Align as necessary. +- +-2007-08-05 Steven Newbury +- +- * src/arm/ffi.c (FFI_INIT_TRAMPOLINE): Use __clear_cache instead of +- directly using the sys_cacheflush syscall. +- +-2007-07-27 Andrew Haley +- +- * src/arm/sysv.S (ffi_closure_SYSV): Add soft-float. +- +-2007-09-03 Maciej W. Rozycki +- +- * Makefile.am: Unify MIPS_IRIX and MIPS_LINUX into MIPS. +- * configure.ac: Likewise. +- * Makefile.in: Regenerate. +- * include/Makefile.in: Likewise. +- * testsuite/Makefile.in: Likewise. +- * configure: Likewise. +- +-2007-08-24 David Daney +- +- * testsuite/libffi.call/return_sl.c: New test. +- +-2007-08-10 David Daney +- +- * testsuite/libffi.call/cls_multi_ushort.c, +- testsuite/libffi.call/cls_align_uint16.c, +- testsuite/libffi.call/nested_struct1.c, +- testsuite/libffi.call/nested_struct3.c, +- testsuite/libffi.call/cls_7_1_byte.c, +- testsuite/libffi.call/nested_struct5.c, +- testsuite/libffi.call/cls_double.c, +- testsuite/libffi.call/nested_struct7.c, +- testsuite/libffi.call/cls_sint.c, +- testsuite/libffi.call/nested_struct9.c, +- testsuite/libffi.call/cls_20byte1.c, +- testsuite/libffi.call/cls_multi_sshortchar.c, +- testsuite/libffi.call/cls_align_sint64.c, +- testsuite/libffi.call/cls_3byte2.c, +- testsuite/libffi.call/cls_multi_schar.c, +- testsuite/libffi.call/cls_multi_uchar.c, +- testsuite/libffi.call/cls_19byte.c, +- testsuite/libffi.call/cls_9byte1.c, +- testsuite/libffi.call/cls_align_float.c, +- testsuite/libffi.call/closure_fn1.c, +- testsuite/libffi.call/problem1.c, +- testsuite/libffi.call/closure_fn3.c, +- testsuite/libffi.call/cls_sshort.c, +- testsuite/libffi.call/closure_fn5.c, +- testsuite/libffi.call/cls_align_double.c, +- testsuite/libffi.call/nested_struct.c, +- testsuite/libffi.call/cls_2byte.c, +- testsuite/libffi.call/nested_struct10.c, +- testsuite/libffi.call/cls_4byte.c, +- testsuite/libffi.call/cls_6byte.c, +- testsuite/libffi.call/cls_8byte.c, +- testsuite/libffi.call/cls_multi_sshort.c, +- testsuite/libffi.call/cls_align_sint16.c, +- testsuite/libffi.call/cls_align_uint32.c, +- testsuite/libffi.call/cls_20byte.c, +- testsuite/libffi.call/cls_float.c, +- testsuite/libffi.call/nested_struct2.c, +- testsuite/libffi.call/cls_5_1_byte.c, +- testsuite/libffi.call/nested_struct4.c, +- testsuite/libffi.call/cls_24byte.c, +- testsuite/libffi.call/nested_struct6.c, +- testsuite/libffi.call/cls_64byte.c, +- testsuite/libffi.call/nested_struct8.c, +- testsuite/libffi.call/cls_uint.c, +- testsuite/libffi.call/cls_multi_ushortchar.c, +- testsuite/libffi.call/cls_schar.c, +- testsuite/libffi.call/cls_uchar.c, +- testsuite/libffi.call/cls_align_uint64.c, +- testsuite/libffi.call/cls_ulonglong.c, +- testsuite/libffi.call/cls_align_longdouble.c, +- testsuite/libffi.call/cls_1_1byte.c, +- testsuite/libffi.call/cls_12byte.c, +- testsuite/libffi.call/cls_3_1byte.c, +- testsuite/libffi.call/cls_3byte1.c, +- testsuite/libffi.call/cls_4_1byte.c, +- testsuite/libffi.call/cls_6_1_byte.c, +- testsuite/libffi.call/cls_16byte.c, +- testsuite/libffi.call/cls_18byte.c, +- testsuite/libffi.call/closure_fn0.c, +- testsuite/libffi.call/cls_9byte2.c, +- testsuite/libffi.call/closure_fn2.c, +- testsuite/libffi.call/closure_fn4.c, +- testsuite/libffi.call/cls_ushort.c, +- testsuite/libffi.call/closure_fn6.c, +- testsuite/libffi.call/cls_5byte.c, +- testsuite/libffi.call/cls_align_pointer.c, +- testsuite/libffi.call/cls_7byte.c, +- testsuite/libffi.call/cls_align_sint32.c, +- testsuite/libffi.special/unwindtest_ffi_call.cc, +- testsuite/libffi.special/unwindtest.cc: Remove xfail for mips64*-*-*. +- +-2007-08-10 David Daney +- +- PR libffi/28313 +- * configure.ac: Don't treat mips64 as a special case. +- * Makefile.am (nodist_libffi_la_SOURCES): Add n32.S. +- * configure: Regenerate +- * Makefile.in: Ditto. +- * fficonfig.h.in: Ditto. +- * src/mips/ffitarget.h (REG_L, REG_S, SUBU, ADDU, SRL, LI): Indent. +- (LA, EH_FRAME_ALIGN, FDE_ADDR_BYTES): New preprocessor macros. +- (FFI_DEFAULT_ABI): Set for n64 case. +- (FFI_CLOSURES, FFI_TRAMPOLINE_SIZE): Define for n32 and n64 cases. +- * src/mips/n32.S (ffi_call_N32): Add debug macros and labels for FDE. +- (ffi_closure_N32): New function. +- (.eh_frame): New section +- * src/mips/o32.S: Clean up comments. +- (ffi_closure_O32): Pass ffi_closure parameter in $12. +- * src/mips/ffi.c: Use FFI_MIPS_N32 instead of +- _MIPS_SIM == _ABIN32 throughout. +- (FFI_MIPS_STOP_HERE): New, use in place of +- ffi_stop_here. +- (ffi_prep_args): Use unsigned long to hold pointer values. Rewrite +- to support n32/n64 ABIs. +- (calc_n32_struct_flags): Rewrite. +- (calc_n32_return_struct_flags): Remove unused variable. Reverse +- position of flag bits. +- (ffi_prep_cif_machdep): Rewrite n32 portion. +- (ffi_call): Enable for n64. Add special handling for small structure +- return values. +- (ffi_prep_closure_loc): Add n32 and n64 support. +- (ffi_closure_mips_inner_O32): Add cast to silence warning. +- (copy_struct_N32, ffi_closure_mips_inner_N32): New functions. +- +-2007-08-08 David Daney +- +- * testsuite/libffi.call/ffitest.h (ffi_type_mylong): Remove definition. +- * testsuite/libffi.call/cls_align_uint16.c (main): Use correct type +- specifiers. +- * testsuite/libffi.call/nested_struct1.c (main): Ditto. +- * testsuite/libffi.call/cls_sint.c (main): Ditto. +- * testsuite/libffi.call/nested_struct9.c (main): Ditto. +- * testsuite/libffi.call/cls_20byte1.c (main): Ditto. +- * testsuite/libffi.call/cls_9byte1.c (main): Ditto. +- * testsuite/libffi.call/closure_fn1.c (main): Ditto. +- * testsuite/libffi.call/closure_fn3.c (main): Ditto. +- * testsuite/libffi.call/return_dbl2.c (main): Ditto. +- * testsuite/libffi.call/cls_sshort.c (main): Ditto. +- * testsuite/libffi.call/return_fl3.c (main): Ditto. +- * testsuite/libffi.call/closure_fn5.c (main): Ditto. +- * testsuite/libffi.call/nested_struct.c (main): Ditto. +- * testsuite/libffi.call/nested_struct10.c (main): Ditto. +- * testsuite/libffi.call/return_ll1.c (main): Ditto. +- * testsuite/libffi.call/cls_8byte.c (main): Ditto. +- * testsuite/libffi.call/cls_align_uint32.c (main): Ditto. +- * testsuite/libffi.call/cls_align_sint16.c (main): Ditto. +- * testsuite/libffi.call/cls_20byte.c (main): Ditto. +- * testsuite/libffi.call/nested_struct2.c (main): Ditto. +- * testsuite/libffi.call/cls_24byte.c (main): Ditto. +- * testsuite/libffi.call/nested_struct6.c (main): Ditto. +- * testsuite/libffi.call/cls_uint.c (main): Ditto. +- * testsuite/libffi.call/cls_12byte.c (main): Ditto. +- * testsuite/libffi.call/cls_16byte.c (main): Ditto. +- * testsuite/libffi.call/closure_fn0.c (main): Ditto. +- * testsuite/libffi.call/cls_9byte2.c (main): Ditto. +- * testsuite/libffi.call/closure_fn2.c (main): Ditto. +- * testsuite/libffi.call/return_dbl1.c (main): Ditto. +- * testsuite/libffi.call/closure_fn4.c (main): Ditto. +- * testsuite/libffi.call/closure_fn6.c (main): Ditto. +- * testsuite/libffi.call/cls_align_sint32.c (main): Ditto. +- +-2007-08-07 Andrew Haley +- +- * src/x86/sysv.S (ffi_closure_raw_SYSV): Fix typo in previous +- checkin. +- +-2007-08-06 Andrew Haley +- +- PR testsuite/32843 +- * src/x86/sysv.S (ffi_closure_raw_SYSV): Handle FFI_TYPE_UINT8, +- FFI_TYPE_SINT8, FFI_TYPE_UINT16, FFI_TYPE_SINT16, FFI_TYPE_UINT32, +- FFI_TYPE_SINT32. +- +-2007-08-02 David Daney +- +- * testsuite/libffi.call/return_ul.c (main): Define return type as +- ffi_arg. Use proper printf conversion specifier. +- +-2007-07-30 Andrew Haley +- +- PR testsuite/32843 +- * src/x86/ffi.c (ffi_prep_cif_machdep): in x86 case, add code for +- signed/unsigned int8/16. +- * src/x86/sysv.S (ffi_call_SYSV): Rewrite to: +- Use a jump table. +- Remove code to pop args from the stack after call. +- Special-case signed/unsigned int8/16. +- * testsuite/libffi.call/return_sc.c (main): Revert. +- +-2007-07-26 Richard Guenther +- +- PR testsuite/32843 +- * testsuite/libffi.call/return_sc.c (main): Verify call +- result as signed char, not ffi_arg. +- +-2007-07-16 Rainer Orth +- +- * configure.ac (i?86-*-solaris2.1[0-9]): Set TARGET to X86_64. +- * configure: Regenerate. +- +-2007-07-11 David Daney +- +- * src/mips/ffi.c: Don't include sys/cachectl.h. +- (ffi_prep_closure_loc): Use __builtin___clear_cache() instead of +- cacheflush(). +- +-2007-05-18 Aurelien Jarno +- +- * src/arm/ffi.c (ffi_prep_closure_loc): Renamed and ajusted +- from (ffi_prep_closure): ... this. +- (FFI_INIT_TRAMPOLINE): Adjust. +- +-2005-12-31 Phil Blundell +- +- * src/arm/ffi.c (ffi_prep_incoming_args_SYSV, +- ffi_closure_SYSV_inner, ffi_prep_closure): New, add closure support. +- * src/arm/sysv.S(ffi_closure_SYSV): Likewise. +- * src/arm/ffitarget.h (FFI_TRAMPOLINE_SIZE): Likewise. +- (FFI_CLOSURES): Enable closure support. +- +-2007-07-03 Andrew Haley +- +- * testsuite/libffi.call/cls_multi_ushort.c, +- testsuite/libffi.call/cls_align_uint16.c, +- testsuite/libffi.call/nested_struct1.c, +- testsuite/libffi.call/nested_struct3.c, +- testsuite/libffi.call/cls_7_1_byte.c, +- testsuite/libffi.call/cls_double.c, +- testsuite/libffi.call/nested_struct5.c, +- testsuite/libffi.call/nested_struct7.c, +- testsuite/libffi.call/cls_sint.c, +- testsuite/libffi.call/nested_struct9.c, +- testsuite/libffi.call/cls_20byte1.c, +- testsuite/libffi.call/cls_multi_sshortchar.c, +- testsuite/libffi.call/cls_align_sint64.c, +- testsuite/libffi.call/cls_3byte2.c, +- testsuite/libffi.call/cls_multi_schar.c, +- testsuite/libffi.call/cls_multi_uchar.c, +- testsuite/libffi.call/cls_19byte.c, +- testsuite/libffi.call/cls_9byte1.c, +- testsuite/libffi.call/cls_align_float.c, +- testsuite/libffi.call/closure_fn1.c, +- testsuite/libffi.call/problem1.c, +- testsuite/libffi.call/closure_fn3.c, +- testsuite/libffi.call/cls_sshort.c, +- testsuite/libffi.call/closure_fn5.c, +- testsuite/libffi.call/cls_align_double.c, +- testsuite/libffi.call/cls_2byte.c, +- testsuite/libffi.call/nested_struct.c, +- testsuite/libffi.call/nested_struct10.c, +- testsuite/libffi.call/cls_4byte.c, +- testsuite/libffi.call/cls_6byte.c, +- testsuite/libffi.call/cls_8byte.c, +- testsuite/libffi.call/cls_multi_sshort.c, +- testsuite/libffi.call/cls_align_uint32.c, +- testsuite/libffi.call/cls_align_sint16.c, +- testsuite/libffi.call/cls_float.c, +- testsuite/libffi.call/cls_20byte.c, +- testsuite/libffi.call/cls_5_1_byte.c, +- testsuite/libffi.call/nested_struct2.c, +- testsuite/libffi.call/cls_24byte.c, +- testsuite/libffi.call/nested_struct4.c, +- testsuite/libffi.call/nested_struct6.c, +- testsuite/libffi.call/cls_64byte.c, +- testsuite/libffi.call/nested_struct8.c, +- testsuite/libffi.call/cls_uint.c, +- testsuite/libffi.call/cls_multi_ushortchar.c, +- testsuite/libffi.call/cls_schar.c, +- testsuite/libffi.call/cls_uchar.c, +- testsuite/libffi.call/cls_align_uint64.c, +- testsuite/libffi.call/cls_ulonglong.c, +- testsuite/libffi.call/cls_align_longdouble.c, +- testsuite/libffi.call/cls_1_1byte.c, +- testsuite/libffi.call/cls_12byte.c, +- testsuite/libffi.call/cls_3_1byte.c, +- testsuite/libffi.call/cls_3byte1.c, +- testsuite/libffi.call/cls_4_1byte.c, +- testsuite/libffi.call/cls_6_1_byte.c, +- testsuite/libffi.call/cls_16byte.c, +- testsuite/libffi.call/cls_18byte.c, +- testsuite/libffi.call/closure_fn0.c, +- testsuite/libffi.call/cls_9byte2.c, +- testsuite/libffi.call/closure_fn2.c, +- testsuite/libffi.call/closure_fn4.c, +- testsuite/libffi.call/cls_ushort.c, +- testsuite/libffi.call/closure_fn6.c, +- testsuite/libffi.call/cls_5byte.c, +- testsuite/libffi.call/cls_align_pointer.c, +- testsuite/libffi.call/cls_7byte.c, +- testsuite/libffi.call/cls_align_sint32.c, +- testsuite/libffi.special/unwindtest_ffi_call.cc, +- testsuite/libffi.special/unwindtest.cc: Enable for ARM. +- +-2007-07-05 H.J. Lu +- +- * aclocal.m4: Regenerated. +- +-2007-06-02 Paolo Bonzini +- +- * configure: Regenerate. +- +-2007-05-23 Steve Ellcey +- +- * Makefile.in: Regenerate. +- * configure: Regenerate. +- * aclocal.m4: Regenerate. +- * include/Makefile.in: Regenerate. +- * testsuite/Makefile.in: Regenerate. +- +-2007-05-10 Roman Zippel +- +- * src/m68k/ffi.c (ffi_prep_incoming_args_SYSV, +- ffi_closure_SYSV_inner,ffi_prep_closure): New, add closure support. +- * src/m68k/sysv.S(ffi_closure_SYSV,ffi_closure_struct_SYSV): Likewise. +- * src/m68k/ffitarget.h (FFI_TRAMPOLINE_SIZE): Likewise. +- (FFI_CLOSURES): Enable closure support. +- +-2007-05-10 Roman Zippel +- +- * configure.ac (HAVE_AS_CFI_PSEUDO_OP): New test. +- * configure: Regenerate. +- * fficonfig.h.in: Regenerate. +- * src/m68k/sysv.S (CFI_STARTPROC,CFI_ENDPROC, +- CFI_OFFSET,CFI_DEF_CFA): New macros. +- (ffi_call_SYSV): Add callframe annotation. +- +-2007-05-10 Roman Zippel +- +- * src/m68k/ffi.c (ffi_prep_args,ffi_prep_cif_machdep): Fix +- numerous test suite failures. +- * src/m68k/sysv.S (ffi_call_SYSV): Likewise. +- +-2007-04-11 Paolo Bonzini +- +- * Makefile.am (EXTRA_DIST): Bring up to date. +- * Makefile.in: Regenerate. +- * src/frv/eabi.S: Remove RCS keyword. +- +-2007-04-06 Richard Henderson +- +- * configure.ac: Tidy target case. +- (HAVE_LONG_DOUBLE): Allow the target to override. +- * configure: Regenerate. +- * include/ffi.h.in: Don't define ffi_type_foo if +- LIBFFI_HIDE_BASIC_TYPES is defined. +- (ffi_type_longdouble): If not HAVE_LONG_DOUBLE, define +- to ffi_type_double. +- * types.c (LIBFFI_HIDE_BASIC_TYPES): Define. +- (FFI_TYPEDEF, ffi_type_void): Mark the data const. +- (ffi_type_longdouble): Special case for Alpha. Don't define +- if long double == double. +- +- * src/alpha/ffi.c (FFI_TYPE_LONGDOUBLE): Assert unique value. +- (ffi_prep_cif_machdep): Handle it as the 128-bit type. +- (ffi_call, ffi_closure_osf_inner): Likewise. +- (ffi_closure_osf_inner): Likewise. Mark hidden. +- (ffi_call_osf, ffi_closure_osf): Mark hidden. +- * src/alpha/ffitarget.h (FFI_LAST_ABI): Tidy definition. +- * src/alpha/osf.S (ffi_call_osf, ffi_closure_osf): Mark hidden. +- (load_table): Handle 128-bit long double. +- +- * testsuite/libffi.call/float4.c: Add -mieee for alpha. +- +-2007-04-06 Tom Tromey +- +- PR libffi/31491: +- * README: Fixed bug in example. +- +-2007-04-03 Jakub Jelinek +- +- * src/closures.c: Include sys/statfs.h. +- (_GNU_SOURCE): Define on Linux. +- (FFI_MMAP_EXEC_SELINUX): Define. +- (selinux_enabled): New variable. +- (selinux_enabled_check): New function. +- (is_selinux_enabled): Define. +- (dlmmap): Use it. +- +-2007-03-24 Uros Bizjak +- +- * testsuite/libffi.call/return_fl2.c (return_fl): Mark as static. +- Use 'volatile float sum' to create sum of floats to avoid false +- negative due to excess precision on ix86 targets. +- (main): Ditto. +- +-2007-03-08 Alexandre Oliva +- +- * src/powerpc/ffi.c (flush_icache): Fix left-over from previous +- patch. +- (ffi_prep_closure_loc): Remove unneeded casts. Add needed ones. +- +-2007-03-07 Alexandre Oliva +- +- * include/ffi.h.in (ffi_closure_alloc, ffi_closure_free): New. +- (ffi_prep_closure_loc): New. +- (ffi_prep_raw_closure_loc): New. +- (ffi_prep_java_raw_closure_loc): New. +- * src/closures.c: New file. +- * src/dlmalloc.c [FFI_MMAP_EXEC_WRIT] (struct malloc_segment): +- Replace sflags with exec_offset. +- [FFI_MMAP_EXEC_WRIT] (mmap_exec_offset, add_segment_exec_offset, +- sub_segment_exec_offset): New macros. +- (get_segment_flags, set_segment_flags, check_segment_merge): New +- macros. +- (is_mmapped_segment, is_extern_segment): Use get_segment_flags. +- (add_segment, sys_alloc, create_mspace, create_mspace_with_base, +- destroy_mspace): Use new macros. +- (sys_alloc): Silence warning. +- * Makefile.am (libffi_la_SOURCES): Add src/closures.c. +- * Makefile.in: Rebuilt. +- * src/prep_cif [FFI_CLOSURES] (ffi_prep_closure): Implement in +- terms of ffi_prep_closure_loc. +- * src/raw_api.c (ffi_prep_raw_closure_loc): Renamed and adjusted +- from... +- (ffi_prep_raw_closure): ... this. Re-implement in terms of the +- renamed version. +- * src/java_raw_api (ffi_prep_java_raw_closure_loc): Renamed and +- adjusted from... +- (ffi_prep_java_raw_closure): ... this. Re-implement in terms of +- the renamed version. +- * src/alpha/ffi.c (ffi_prep_closure_loc): Renamed from +- (ffi_prep_closure): ... this. +- * src/pa/ffi.c: Likewise. +- * src/cris/ffi.c: Likewise. Adjust. +- * src/frv/ffi.c: Likewise. +- * src/ia64/ffi.c: Likewise. +- * src/mips/ffi.c: Likewise. +- * src/powerpc/ffi_darwin.c: Likewise. +- * src/s390/ffi.c: Likewise. +- * src/sh/ffi.c: Likewise. +- * src/sh64/ffi.c: Likewise. +- * src/sparc/ffi.c: Likewise. +- * src/x86/ffi64.c: Likewise. +- * src/x86/ffi.c: Likewise. +- (FFI_INIT_TRAMPOLINE): Adjust. +- (ffi_prep_raw_closure_loc): Renamed and adjusted from... +- (ffi_prep_raw_closure): ... this. +- * src/powerpc/ffi.c (ffi_prep_closure_loc): Renamed from +- (ffi_prep_closure): ... this. +- (flush_icache): Adjust. +- +-2007-03-07 Alexandre Oliva +- +- * src/dlmalloc.c: New file, imported version 2.8.3 of Doug +- Lea's malloc. +- +-2007-03-01 Brooks Moses +- +- * Makefile.am: Add dummy install-pdf target. +- * Makefile.in: Regenerate +- +-2007-02-13 Andreas Krebbel +- +- * src/s390/ffi.c (ffi_prep_args, ffi_prep_cif_machdep, +- ffi_closure_helper_SYSV): Add long double handling. +- +-2007-02-02 Jakub Jelinek +- +- * src/powerpc/linux64.S (ffi_call_LINUX64): Move restore of r2 +- immediately after bctrl instruction. +- +-2007-01-18 Alexandre Oliva +- +- * Makefile.am (all-recursive, install-recursive, +- mostlyclean-recursive, clean-recursive, distclean-recursive, +- maintainer-clean-recursive): Add missing targets. +- * Makefile.in: Rebuilt. +- +-2006-12-14 Andreas Tobler +- +- * configure.ac: Add TARGET for x86_64-*-darwin*. +- * Makefile.am (nodist_libffi_la_SOURCES): Add rules for 64-bit sources +- for X86_DARWIN. +- * src/x86/ffitarget.h: Set trampoline size for x86_64-*-darwin*. +- * src/x86/darwin64.S: New file for x86_64-*-darwin* support. +- * configure: Regenerate. +- * Makefile.in: Regenerate. +- * include/Makefile.in: Regenerate. +- * testsuite/Makefile.in: Regenerate. +- * testsuite/libffi.special/unwindtest_ffi_call.cc: New test case for +- ffi_call only. +- +-2006-12-13 Andreas Tobler +- +- * aclocal.m4: Regenerate with aclocal -I .. as written in the +- Makefile.am. +- +-2006-10-31 Geoffrey Keating +- +- * src/powerpc/ffi_darwin.c (darwin_adjust_aggregate_sizes): New. +- (ffi_prep_cif_machdep): Call darwin_adjust_aggregate_sizes for +- Darwin. +- * testsuite/libffi.call/nested_struct4.c: Remove Darwin XFAIL. +- * testsuite/libffi.call/nested_struct6.c: Remove Darwin XFAIL. +- +-2006-10-10 Paolo Bonzini +- Sandro Tolaini +- +- * configure.ac [i*86-*-darwin*]: Set X86_DARWIN symbol and +- conditional. +- * configure: Regenerated. +- * Makefile.am (nodist_libffi_la_SOURCES) [X86_DARWIN]: New case. +- (EXTRA_DIST): Add src/x86/darwin.S. +- * Makefile.in: Regenerated. +- * include/Makefile.in: Regenerated. +- * testsuite/Makefile.in: Regenerated. +- +- * src/x86/ffi.c (ffi_prep_cif_machdep) [X86_DARWIN]: Treat like +- X86_WIN32, and additionally align stack to 16 bytes. +- * src/x86/darwin.S: New, based on sysv.S. +- * src/prep_cif.c (ffi_prep_cif) [X86_DARWIN]: Align > 8-byte structs. +- +-2006-09-12 David Daney +- +- PR libffi/23935 +- * include/Makefile.am: Install both ffi.h and ffitarget.h in +- $(libdir)/gcc/$(target_alias)/$(gcc_version)/include. +- * aclocal.m4: Regenerated for automake 1.9.6. +- * Makefile.in: Regenerated. +- * include/Makefile.in: Regenerated. +- * testsuite/Makefile.in: Regenerated. +- +-2006-08-17 Andreas Tobler +- +- * include/ffi_common.h (struct): Revert accidental commit. +- +-2006-08-15 Andreas Tobler +- +- * include/ffi_common.h: Remove lint directives. +- * include/ffi.h.in: Likewise. +- +-2006-07-25 Torsten Schoenfeld +- +- * include/ffi.h.in (ffi_type_ulong, ffi_type_slong): Define correctly +- for 32-bit architectures. +- * testsuite/libffi.call/return_ul.c: New test case. +- +-2006-07-19 David Daney +- +- * testsuite/libffi.call/closure_fn6.c: Remove xfail for mips, +- xfail remains for mips64. +- +-2006-05-23 Carlos O'Donell +- +- * Makefile.am: Add install-html target. Add install-html to .PHONY +- * Makefile.in: Regenerate. +- * aclocal.m4: Regenerate. +- * include/Makefile.in: Regenerate. +- * testsuite/Makefile.in: Regenerate. +- +-2006-05-18 John David Anglin +- +- * pa/ffi.c (ffi_prep_args_pa32): Load floating point arguments from +- stack slot. +- +-2006-04-22 Andreas Tobler +- +- * README: Remove notice about 'Crazy Comments'. +- * src/debug.c: Remove lint directives. Cleanup white spaces. +- * src/java_raw_api.c: Likewise. +- * src/prep_cif.c: Likewise. +- * src/raw_api.c: Likewise. +- * src/ffitest.c: Delete. No longer needed, all test cases migrated +- to the testsuite. +- * src/arm/ffi.c: Remove lint directives. +- * src/m32r/ffi.c: Likewise. +- * src/pa/ffi.c: Likewise. +- * src/powerpc/ffi.c: Likewise. +- * src/powerpc/ffi_darwin.c: Likewise. +- * src/sh/ffi.c: Likewise. +- * src/sh64/ffi.c: Likewise. +- * src/x86/ffi.c: Likewise. +- * testsuite/libffi.call/float2.c: Likewise. +- * testsuite/libffi.call/promotion.c: Likewise. +- * testsuite/libffi.call/struct1.c: Likewise. +- +-2006-04-13 Andreas Tobler +- +- * src/pa/hpux32.S: Correct unwind offset calculation for +- ffi_closure_pa32. +- * src/pa/linux.S: Likewise. +- +-2006-04-12 James E Wilson +- +- PR libgcj/26483 +- * src/ia64/ffi.c (stf_spill, ldf_fill): Rewrite as macros. +- (hfa_type_load): Call stf_spill. +- (hfa_type_store): Call ldf_fill. +- (ffi_call): Adjust calls to above routines. Add local temps for +- macro result. +- +-2006-04-10 Matthias Klose +- +- * testsuite/lib/libffi-dg.exp (libffi-init): Recognize multilib +- directory names containing underscores. +- +-2006-04-07 James E Wilson +- +- * testsuite/libffi.call/float4.c: New testcase. +- +-2006-04-05 John David Anglin +- Andreas Tobler +- +- * Makefile.am: Add PA_HPUX port. +- * Makefile.in: Regenerate. +- * include/Makefile.in: Likewise. +- * testsuite/Makefile.in: Likewise. +- * configure.ac: Add PA_HPUX rules. +- * configure: Regenerate. +- * src/pa/ffitarget.h: Rename linux target to PA_LINUX. +- Add PA_HPUX and PA64_HPUX. +- Rename FFI_LINUX ABI to FFI_PA32 ABI. +- (FFI_TRAMPOLINE_SIZE): Define for 32-bit HP-UX targets. +- (FFI_TYPE_SMALL_STRUCT2): Define. +- (FFI_TYPE_SMALL_STRUCT4): Likewise. +- (FFI_TYPE_SMALL_STRUCT8): Likewise. +- (FFI_TYPE_SMALL_STRUCT3): Redefine. +- (FFI_TYPE_SMALL_STRUCT5): Likewise. +- (FFI_TYPE_SMALL_STRUCT6): Likewise. +- (FFI_TYPE_SMALL_STRUCT7): Likewise. +- * src/pa/ffi.c (ROUND_DOWN): Delete. +- (fldw, fstw, fldd, fstd): Use '__asm__'. +- (ffi_struct_type): Add support for FFI_TYPE_SMALL_STRUCT2, +- FFI_TYPE_SMALL_STRUCT4 and FFI_TYPE_SMALL_STRUCT8. +- (ffi_prep_args_LINUX): Rename to ffi_prep_args_pa32. Update comment. +- Simplify incrementing of stack slot variable. Change type of local +- 'n' to unsigned int. +- (ffi_size_stack_LINUX): Rename to ffi_size_stack_pa32. Handle long +- double on PA_HPUX. +- (ffi_prep_cif_machdep): Likewise. +- (ffi_call): Likewise. +- (ffi_closure_inner_LINUX): Rename to ffi_closure_inner_pa32. Change +- return type to ffi_status. Simplify incrementing of stack slot +- variable. Only copy floating point argument registers when PA_LINUX +- is true. Reformat debug statement. +- Add support for FFI_TYPE_SMALL_STRUCT2, FFI_TYPE_SMALL_STRUCT4 and +- FFI_TYPE_SMALL_STRUCT8. +- (ffi_closure_LINUX): Rename to ffi_closure_pa32. Add 'extern' to +- declaration. +- (ffi_prep_closure): Make linux trampoline conditional on PA_LINUX. +- Add nops to cache flush. Add trampoline for PA_HPUX. +- * src/pa/hpux32.S: New file. +- * src/pa/linux.S (ffi_call_LINUX): Rename to ffi_call_pa32. Rename +- ffi_prep_args_LINUX to ffi_prep_args_pa32. +- Localize labels. Add support for 2, 4 and 8-byte small structs. Handle +- unaligned destinations in 3, 5, 6 and 7-byte small structs. Order +- argument type checks so that common argument types appear first. +- (ffi_closure_LINUX): Rename to ffi_closure_pa32. Rename +- ffi_closure_inner_LINUX to ffi_closure_inner_pa32. +- +-2006-03-24 Alan Modra +- +- * src/powerpc/ffitarget.h (enum ffi_abi): Add FFI_LINUX. Default +- for 32-bit using IBM extended double format. Fix FFI_LAST_ABI. +- * src/powerpc/ffi.c (ffi_prep_args_SYSV): Handle linux variant of +- FFI_TYPE_LONGDOUBLE. +- (ffi_prep_args64): Assert using IBM extended double. +- (ffi_prep_cif_machdep): Don't munge FFI_TYPE_LONGDOUBLE type. +- Handle FFI_LINUX FFI_TYPE_LONGDOUBLE return and args. +- (ffi_call): Handle FFI_LINUX. +- (ffi_closure_helper_SYSV): Non FFI_LINUX long double return needs +- gpr3 return pointer as for struct return. Handle FFI_LINUX +- FFI_TYPE_LONGDOUBLE return and args. Don't increment "nf" +- unnecessarily. +- * src/powerpc/ppc_closure.S (ffi_closure_SYSV): Load both f1 and f2 +- for FFI_TYPE_LONGDOUBLE. Move epilogue insns into case table. +- Don't use r6 as pointer to results, instead use sp offset. Don't +- make a special call to load lr with case table address, instead +- use offset from previous call. +- * src/powerpc/sysv.S (ffi_call_SYSV): Save long double return. +- * src/powerpc/linux64.S (ffi_call_LINUX64): Simplify long double +- return. +- +-2006-03-15 Kaz Kojima +- +- * src/sh64/ffi.c (ffi_prep_cif_machdep): Handle float arguments +- passed with FP registers correctly. +- (ffi_closure_helper_SYSV): Likewise. +- * src/sh64/sysv.S: Likewise. +- +-2006-03-01 Andreas Tobler +- +- * testsuite/libffi.special/unwindtest.cc (closure_test_fn): Mark cif, +- args and userdata unused. +- (closure_test_fn1): Mark cif and userdata unused. +- (main): Remove unused res. +- +-2006-02-28 Andreas Tobler +- +- * testsuite/libffi.call/call.exp: Adjust FSF address. Add test runs for +- -O2, -O3, -Os and the warning flags -W -Wall. +- * testsuite/libffi.special/special.exp: Likewise. +- * testsuite/libffi.call/ffitest.h: Add an __UNUSED__ macro to mark +- unused parameter unused for gcc or else do nothing. +- * testsuite/libffi.special/ffitestcxx.h: Likewise. +- * testsuite/libffi.call/cls_12byte.c (cls_struct_12byte_gn): Mark cif +- and userdata unused. +- * testsuite/libffi.call/cls_16byte.c (cls_struct_16byte_gn): Likewise. +- * testsuite/libffi.call/cls_18byte.c (cls_struct_18byte_gn): Likewise. +- * testsuite/libffi.call/cls_19byte.c (cls_struct_19byte_gn): Likewise. +- * testsuite/libffi.call/cls_1_1byte.c (cls_struct_1_1byte_gn): Likewise. +- * testsuite/libffi.call/cls_20byte.c (cls_struct_20byte_gn): Likewise. +- * testsuite/libffi.call/cls_20byte1.c (cls_struct_20byte_gn): Likewise. +- * testsuite/libffi.call/cls_24byte.c (cls_struct_24byte_gn): Likewise. +- * testsuite/libffi.call/cls_2byte.c (cls_struct_2byte_gn): Likewise. +- * testsuite/libffi.call/cls_3_1byte.c (cls_struct_3_1byte_gn): Likewise. +- * testsuite/libffi.call/cls_3byte1.c (cls_struct_3byte_gn): Likewise. +- * testsuite/libffi.call/cls_3byte2.c (cls_struct_3byte_gn1): Likewise. +- * testsuite/libffi.call/cls_4_1byte.c (cls_struct_4_1byte_gn): Likewise. +- * testsuite/libffi.call/cls_4byte.c (cls_struct_4byte_gn): Likewise. +- * testsuite/libffi.call/cls_5_1_byte.c (cls_struct_5byte_gn): Likewise. +- * testsuite/libffi.call/cls_5byte.c (cls_struct_5byte_gn): Likewise. +- * testsuite/libffi.call/cls_64byte.c (cls_struct_64byte_gn): Likewise. +- * testsuite/libffi.call/cls_6_1_byte.c (cls_struct_6byte_gn): Likewise. +- * testsuite/libffi.call/cls_6byte.c (cls_struct_6byte_gn): Likewise. +- * testsuite/libffi.call/cls_7_1_byte.c (cls_struct_7byte_gn): Likewise. +- * testsuite/libffi.call/cls_7byte.c (cls_struct_7byte_gn): Likewise. +- * testsuite/libffi.call/cls_8byte.c (cls_struct_8byte_gn): Likewise. +- * testsuite/libffi.call/cls_9byte1.c (cls_struct_9byte_gn): Likewise. +- * testsuite/libffi.call/cls_9byte2.c (cls_struct_9byte_gn): Likewise. +- * testsuite/libffi.call/cls_align_double.c (cls_struct_align_gn): +- Likewise. +- * testsuite/libffi.call/cls_align_float.c (cls_struct_align_gn): +- Likewise. +- * testsuite/libffi.call/cls_align_longdouble.c (cls_struct_align_gn): +- Likewise. +- * testsuite/libffi.call/cls_align_pointer.c (cls_struct_align_fn): Cast +- void* to avoid compiler warning. +- (main): Likewise. +- (cls_struct_align_gn): Mark cif and userdata unused. +- * testsuite/libffi.call/cls_align_sint16.c (cls_struct_align_gn): +- Likewise. +- * testsuite/libffi.call/cls_align_sint32.c (cls_struct_align_gn): +- Likewise. +- * testsuite/libffi.call/cls_align_sint64.c (cls_struct_align_gn): +- Likewise. +- * testsuite/libffi.call/cls_align_uint16.c (cls_struct_align_gn): +- Likewise. +- * testsuite/libffi.call/cls_align_uint32.c (cls_struct_align_gn): +- Likewise. +- * testsuite/libffi.call/cls_double.c (cls_ret_double_fn): Likewise. +- * testsuite/libffi.call/cls_float.c (cls_ret_float_fn): Likewise. +- * testsuite/libffi.call/cls_multi_schar.c (test_func_gn): Mark cif and +- data unused. +- (main): Cast res_call to silence gcc. +- * testsuite/libffi.call/cls_multi_sshort.c (test_func_gn): Mark cif and +- data unused. +- (main): Cast res_call to silence gcc. +- * testsuite/libffi.call/cls_multi_sshortchar.c (test_func_gn): Mark cif +- and data unused. +- (main): Cast res_call to silence gcc. +- * testsuite/libffi.call/cls_multi_uchar.c (test_func_gn): Mark cif and +- data unused. +- (main): Cast res_call to silence gcc. +- * testsuite/libffi.call/cls_multi_ushort.c (test_func_gn): Mark cif and +- data unused. +- (main): Cast res_call to silence gcc. +- * testsuite/libffi.call/cls_multi_ushortchar.c (test_func_gn): Mark cif +- and data unused. +- (main): Cast res_call to silence gcc. +- * testsuite/libffi.call/cls_schar.c (cls_ret_schar_fn): Mark cif and +- userdata unused. +- (cls_ret_schar_fn): Cast printf parameter to silence gcc. +- * testsuite/libffi.call/cls_sint.c (cls_ret_sint_fn): Mark cif and +- userdata unused. +- (cls_ret_sint_fn): Cast printf parameter to silence gcc. +- * testsuite/libffi.call/cls_sshort.c (cls_ret_sshort_fn): Mark cif and +- userdata unused. +- (cls_ret_sshort_fn): Cast printf parameter to silence gcc. +- * testsuite/libffi.call/cls_uchar.c (cls_ret_uchar_fn): Mark cif and +- userdata unused. +- (cls_ret_uchar_fn): Cast printf parameter to silence gcc. +- * testsuite/libffi.call/cls_uint.c (cls_ret_uint_fn): Mark cif and +- userdata unused. +- (cls_ret_uint_fn): Cast printf parameter to silence gcc. +- * testsuite/libffi.call/cls_ulonglong.c (cls_ret_ulonglong_fn): Mark cif +- and userdata unused. +- * testsuite/libffi.call/cls_ushort.c (cls_ret_ushort_fn): Mark cif and +- userdata unused. +- (cls_ret_ushort_fn): Cast printf parameter to silence gcc. +- * testsuite/libffi.call/float.c (floating): Remove unused parameter e. +- * testsuite/libffi.call/float1.c (main): Remove unused variable i. +- Cleanup white spaces. +- * testsuite/libffi.call/negint.c (checking): Remove unused variable i. +- * testsuite/libffi.call/nested_struct.c (cls_struct_combined_gn): Mark +- cif and userdata unused. +- * testsuite/libffi.call/nested_struct1.c (cls_struct_combined_gn): +- Likewise. +- * testsuite/libffi.call/nested_struct10.c (B_gn): Likewise. +- * testsuite/libffi.call/nested_struct2.c (B_fn): Adjust printf +- formatters to silence gcc. +- (B_gn): Mark cif and userdata unused. +- * testsuite/libffi.call/nested_struct3.c (B_gn): Mark cif and userdata +- unused. +- * testsuite/libffi.call/nested_struct4.c: Mention related PR. +- (B_gn): Mark cif and userdata unused. +- * testsuite/libffi.call/nested_struct5.c (B_gn): Mark cif and userdata +- unused. +- * testsuite/libffi.call/nested_struct6.c: Mention related PR. +- (B_gn): Mark cif and userdata unused. +- * testsuite/libffi.call/nested_struct7.c (B_gn): Mark cif and userdata +- unused. +- * testsuite/libffi.call/nested_struct8.c (B_gn): Likewise. +- * testsuite/libffi.call/nested_struct9.c (B_gn): Likewise. +- * testsuite/libffi.call/problem1.c (stub): Likewise. +- * testsuite/libffi.call/pyobjc-tc.c (main): Cast the result to silence +- gcc. +- * testsuite/libffi.call/return_fl2.c (return_fl): Add the note mentioned +- in the last commit for this test case in the test case itself. +- * testsuite/libffi.call/closure_fn0.c (closure_test_fn0): Mark cif as +- unused. +- * testsuite/libffi.call/closure_fn1.c (closure_test_fn1): Likewise. +- * testsuite/libffi.call/closure_fn2.c (closure_test_fn2): Likewise. +- * testsuite/libffi.call/closure_fn3.c (closure_test_fn3): Likewise. +- * testsuite/libffi.call/closure_fn4.c (closure_test_fn0): Likewise. +- * testsuite/libffi.call/closure_fn5.c (closure_test_fn5): Likewise. +- * testsuite/libffi.call/closure_fn6.c (closure_test_fn0): Likewise. +- +-2006-02-22 Kaz Kojima +- +- * src/sh/sysv.S: Fix register numbers in the FDE for +- ffi_closure_SYSV. +- +-2006-02-20 Andreas Tobler +- +- * testsuite/libffi.call/return_fl2.c (return_fl): Remove static +- declaration to avoid a false negative on ix86. See PR323. +- +-2006-02-18 Kaz Kojima +- +- * src/sh/ffi.c (ffi_closure_helper_SYSV): Remove unused variable +- and cast integer to void * if needed. Update the pointer to +- the FP register saved area correctly. +- +-2006-02-17 Andreas Tobler +- +- * testsuite/libffi.call/nested_struct6.c: XFAIL this test until PR25630 +- is fixed. +- * testsuite/libffi.call/nested_struct4.c: Likewise. +- +-2006-02-16 Andreas Tobler +- +- * testsuite/libffi.call/return_dbl.c: New test case. +- * testsuite/libffi.call/return_dbl1.c: Likewise. +- * testsuite/libffi.call/return_dbl2.c: Likewise. +- * testsuite/libffi.call/return_fl.c: Likewise. +- * testsuite/libffi.call/return_fl1.c: Likewise. +- * testsuite/libffi.call/return_fl2.c: Likewise. +- * testsuite/libffi.call/return_fl3.c: Likewise. +- * testsuite/libffi.call/closure_fn6.c: Likewise. +- +- * testsuite/libffi.call/nested_struct2.c: Remove ffi_type_mylong +- definition. +- * testsuite/libffi.call/ffitest.h: Add ffi_type_mylong definition +- here to be used by other test cases too. +- +- * testsuite/libffi.call/nested_struct10.c: New test case. +- * testsuite/libffi.call/nested_struct9.c: Likewise. +- * testsuite/libffi.call/nested_struct8.c: Likewise. +- * testsuite/libffi.call/nested_struct7.c: Likewise. +- * testsuite/libffi.call/nested_struct6.c: Likewise. +- * testsuite/libffi.call/nested_struct5.c: Likewise. +- * testsuite/libffi.call/nested_struct4.c: Likewise. +- +-2006-01-21 Andreas Tobler +- +- * configure.ac: Enable libffi for sparc64-*-freebsd*. +- * configure: Rebuilt. +- +-2006-01-18 Jakub Jelinek +- +- * src/powerpc/sysv.S (smst_two_register): Don't call __ashldi3, +- instead do the shifting inline. +- * src/powerpc/ppc_closure.S (ffi_closure_SYSV): Don't compute %r5 +- shift count unconditionally. Simplify load sequences for 1, 2, 3, 4 +- and 8 byte structs, for the remaining struct sizes don't call +- __lshrdi3, instead do the shifting inline. +- +-2005-12-07 Thiemo Seufer +- +- * src/mips/ffitarget.h: Remove obsolete sgidefs.h include. Add +- missing parentheses. +- * src/mips/o32.S (ffi_call_O32): Code formatting. Define +- and use A3_OFF, FP_OFF, RA_OFF. Micro-optimizations. +- (ffi_closure_O32): Likewise, but with newly defined A3_OFF2, +- A2_OFF2, A1_OFF2, A0_OFF2, RA_OFF2, FP_OFF2, S0_OFF2, GP_OFF2, +- V1_OFF2, V0_OFF2, FA_1_1_OFF2, FA_1_0_OFF2, FA_0_1_OFF2, +- FA_0_0_OFF2. +- * src/mips/ffi.c (ffi_prep_args): Code formatting. Fix +- endianness bugs. +- (ffi_prep_closure): Improve trampoline instruction scheduling. +- (ffi_closure_mips_inner_O32): Fix endianness bugs. +- +-2005-12-03 Alan Modra +- +- * src/powerpc/ffi.c: Formatting. +- (ffi_prep_args_SYSV): Avoid possible aliasing problems by using unions. +- (ffi_prep_args64): Likewise. +- +-2005-09-30 Geoffrey Keating +- +- * testsuite/lib/libffi-dg.exp (libffi_target_compile): For +- darwin, use -shared-libgcc not -lgcc_s, and explain why. +- +-2005-09-26 Tom Tromey +- +- * testsuite/libffi.call/float1.c (value_type): New typedef. +- (CANARY): New define. +- (main): Check for result buffer overflow. +- * src/powerpc/linux64.S: Handle linux64 long double returns. +- * src/powerpc/ffi.c (FLAG_RETURNS_128BITS): New constant. +- (ffi_prep_cif_machdep): Handle linux64 long double returns. +- +-2005-08-25 Alan Modra +- +- PR target/23404 +- * src/powerpc/ffi.c (ffi_prep_args_SYSV): Correct placement of stack +- homed fp args. +- (ffi_status ffi_prep_cif_machdep): Correct stack sizing for same. +- +-2005-08-11 Jakub Jelinek +- +- * configure.ac (HAVE_HIDDEN_VISIBILITY_ATTRIBUTE): New test. +- (AH_BOTTOM): Add FFI_HIDDEN definition. +- * configure: Rebuilt. +- * fficonfig.h.in: Rebuilt. +- * src/powerpc/ffi.c (hidden): Remove. +- (ffi_closure_LINUX64, ffi_prep_args64, ffi_call_LINUX64, +- ffi_closure_helper_LINUX64): Use FFI_HIDDEN instead of hidden. +- * src/powerpc/linux64_closure.S (ffi_closure_LINUX64, +- .ffi_closure_LINUX64): Use FFI_HIDDEN instead of .hidden. +- * src/x86/ffi.c (ffi_closure_SYSV, ffi_closure_raw_SYSV): Remove, +- add FFI_HIDDEN to its prototype. +- (ffi_closure_SYSV_inner): New. +- * src/x86/sysv.S (ffi_closure_SYSV, ffi_closure_raw_SYSV): New. +- * src/x86/win32.S (ffi_closure_SYSV, ffi_closure_raw_SYSV): New. +- +-2005-08-10 Alfred M. Szmidt +- +- PR libffi/21819: +- * configure: Rebuilt. +- * configure.ac: Handle i*86-*-gnu*. +- +-2005-08-09 Jakub Jelinek +- +- * src/powerpc/ppc_closure.S (ffi_closure_SYSV): Use +- DW_CFA_offset_extended_sf rather than +- DW_CFA_GNU_negative_offset_extended. +- * src/powerpc/sysv.S (ffi_call_SYSV): Likewise. +- +-2005-07-22 SUGIOKA Toshinobu +- +- * src/sh/sysv.S (ffi_call_SYSV): Stop argument popping correctly +- on sh3. +- (ffi_closure_SYSV): Change the stack layout for sh3 struct argument. +- * src/sh/ffi.c (ffi_prep_args): Fix sh3 argument copy, when it is +- partially on register. +- (ffi_closure_helper_SYSV): Likewise. +- (ffi_prep_cif_machdep): Don't set too many cif->flags. +- +-2005-07-20 Kaz Kojima +- +- * src/sh/ffi.c (ffi_call): Handle small structures correctly. +- Remove empty line. +- * src/sh64/ffi.c (simple_type): Remove. +- (return_type): Handle small structures correctly. +- (ffi_prep_args): Likewise. +- (ffi_call): Likewise. +- (ffi_closure_helper_SYSV): Likewise. +- * src/sh64/sysv.S (ffi_call_SYSV): Handle 1, 2 and 4-byte return. +- Emit position independent code if PIC and remove wrong datalabel +- prefixes from EH data. +- +-2005-07-19 Andreas Tobler +- +- * Makefile.am (nodist_libffi_la_SOURCES): Add POWERPC_FREEBSD. +- * Makefile.in: Regenerate. +- * include/Makefile.in: Likewise. +- * testsuite/Makefile.in: Likewise. +- * configure.ac: Add POWERPC_FREEBSD rules. +- * configure: Regenerate. +- * src/powerpc/ffitarget.h: Add POWERPC_FREEBSD rules. +- (FFI_SYSV_TYPE_SMALL_STRUCT): Define. +- * src/powerpc/ffi.c: Add flags to handle small structure returns +- in ffi_call_SYSV. +- (ffi_prep_cif_machdep): Handle small structures for SYSV 4 ABI. +- Aka FFI_SYSV. +- (ffi_closure_helper_SYSV): Likewise. +- * src/powerpc/ppc_closure.S: Add return types for small structures. +- * src/powerpc/sysv.S: Add bits to handle small structures for +- final SYSV 4 ABI. +- +-2005-07-10 Andreas Tobler +- +- * testsuite/libffi.call/cls_5_1_byte.c: New test file. +- * testsuite/libffi.call/cls_6_1_byte.c: Likewise. +- * testsuite/libffi.call/cls_7_1_byte.c: Likewise. +- +-2005-07-05 Randolph Chung +- +- * src/pa/ffi.c (ffi_struct_type): Rename FFI_TYPE_SMALL_STRUCT1 +- as FFI_TYPE_SMALL_STRUCT3. Break out handling for 5-7 byte +- structures. Kill compilation warnings. +- (ffi_closure_inner_LINUX): Print return values as hex in debug +- message. Rename FFI_TYPE_SMALL_STRUCT1 as FFI_TYPE_SMALL_STRUCT3. +- Properly handle 5-7 byte structure returns. +- * src/pa/ffitarget.h (FFI_TYPE_SMALL_STRUCT1) +- (FFI_TYPE_SMALL_STRUCT2): Remove. +- (FFI_TYPE_SMALL_STRUCT3, FFI_TYPE_SMALL_STRUCT5) +- (FFI_TYPE_SMALL_STRUCT6, FFI_TYPE_SMALL_STRUCT7): Define. +- * src/pa/linux.S: Mark source file as using PA1.1 assembly. +- (checksmst1, checksmst2): Remove. +- (checksmst3): Optimize handling of 3-byte struct returns. +- (checksmst567): Properly handle 5-7 byte struct returns. +- +-2005-06-15 Rainer Orth +- +- PR libgcj/21943 +- * src/mips/n32.S: Enforce PIC code. +- * src/mips/o32.S: Likewise. +- +-2005-06-15 Rainer Orth +- +- * configure.ac: Treat i*86-*-solaris2.10 and up as X86_64. +- * configure: Regenerate. +- +-2005-06-01 Alan Modra +- +- * src/powerpc/ppc_closure.S (ffi_closure_SYSV): Don't use JUMPTARGET +- to call ffi_closure_helper_SYSV. Append @local instead. +- * src/powerpc/sysv.S (ffi_call_SYSV): Likewise for ffi_prep_args_SYSV. +- +-2005-05-17 Kelley Cook +- +- * configure.ac: Use AC_C_BIGENDIAN instead of AC_C_BIGENDIAN_CROSS. +- Use AC_CHECK_SIZEOF instead of AC_COMPILE_CHECK_SIZEOF. +- * Makefile.am (ACLOCAL_AMFLAGS): Remove -I ../config. +- * aclocal.m4, configure, fficonfig.h.in, Makefile.in, +- include/Makefile.in, testsuite/Makefile.in: Regenerate. +- +-2005-05-09 Mike Stump +- +- * configure: Regenerate. +- +-2005-05-08 Richard Henderson +- +- PR libffi/21285 +- * src/alpha/osf.S: Update unwind into to match code. +- +-2005-05-04 Andreas Degert +- Richard Henderson +- +- * src/x86/ffi64.c (ffi_prep_cif_machdep): Save sse-used flag in +- bit 11 of flags. +- (ffi_call): Mask return type field. Pass ssecount to ffi_call_unix64. +- (ffi_prep_closure): Set carry bit if sse-used flag set. +- * src/x86/unix64.S (ffi_call_unix64): Add ssecount argument. +- Only load sse registers if ssecount non-zero. +- (ffi_closure_unix64): Only save sse registers if carry set on entry. +- +-2005-04-29 Ralf Corsepius +- +- * configure.ac: Add i*86-*-rtems*, sparc*-*-rtems*, +- powerpc-*rtems*, arm*-*-rtems*, sh-*-rtems*. +- * configure: Regenerate. +- +-2005-04-20 Hans-Peter Nilsson +- +- * testsuite/lib/libffi-dg.exp (libffi-dg-test-1): In regsub use, +- have Tcl8.3-compatible intermediate variable. +- +-2005-04-18 Simon Posnjak +- Hans-Peter Nilsson +- +- * Makefile.am: Add CRIS support. +- * configure.ac: Likewise. +- * Makefile.in, configure, testsuite/Makefile.in, +- include/Makefile.in: Regenerate. +- * src/cris: New directory. +- * src/cris/ffi.c, src/cris/sysv.S, src/cris/ffitarget.h: New files. +- * src/prep_cif.c (ffi_prep_cif): Wrap in #ifndef __CRIS__. +- +- * testsuite/lib/libffi-dg.exp (libffi-dg-test-1): Replace \n with +- \r?\n in output tests. +- +-2005-04-12 Mike Stump +- +- * configure: Regenerate. +- +-2005-03-30 Hans Boehm +- +- * src/ia64/ffitarget.h (ffi_arg): Use long long instead of DI. +- +-2005-03-30 Steve Ellcey +- +- * src/ia64/ffitarget.h (ffi_arg) ADD DI attribute. +- (ffi_sarg) Ditto. +- * src/ia64/unix.S (ffi_closure_unix): Extend gp +- to 64 bits in ILP32 mode. +- Load 64 bits even for short data. +- +-2005-03-23 Mike Stump +- +- * src/powerpc/darwin.S: Update for -m64 multilib. +- * src/powerpc/darwin_closure.S: Likewise. +- +-2005-03-21 Zack Weinberg +- +- * configure.ac: Do not invoke TL_AC_GCC_VERSION. +- Do not set tool_include_dir. +- * aclocal.m4, configure, Makefile.in, testsuite/Makefile.in: +- Regenerate. +- * include/Makefile.am: Set gcc_version and toollibffidir. +- * include/Makefile.in: Regenerate. +- +-2005-02-22 Andrew Haley +- +- * src/powerpc/ffi.c (ffi_prep_cif_machdep): Bump alignment to +- odd-numbered register pairs for 64-bit integer types. +- +-2005-02-23 Andreas Tobler +- +- PR libffi/20104 +- * testsuite/libffi.call/return_ll1.c: New test case. +- +-2005-02-11 Janis Johnson +- +- * testsuite/libffi.call/cls_align_longdouble.c: Remove dg-options. +- * testsuite/libffi.call/float.c: Ditto. +- * testsuite/libffi.call/float2.c: Ditto. +- * testsuite/libffi.call/float3.c: Ditto. +- +-2005-02-08 Andreas Tobler +- +- * src/frv/ffitarget.h: Remove PPC stuff which does not belong to frv. +- +-2005-01-12 Eric Botcazou +- +- * testsuite/libffi.special/special.exp (cxx_options): Add +- -shared-libgcc. +- +-2004-12-31 Richard Henderson +- +- * src/types.c (FFI_AGGREGATE_TYPEDEF): Remove. +- (FFI_TYPEDEF): Rename from FFI_INTEGRAL_TYPEDEF. Replace size and +- offset parameters with a type parameter; deduce size and structure +- alignment. Update all users. +- +-2004-12-31 Richard Henderson +- +- * src/types.c (FFI_TYPE_POINTER): Define with sizeof. +- (FFI_TYPE_LONGDOUBLE): Fix for ia64. +- * src/ia64/ffitarget.h (struct ffi_ia64_trampoline_struct): Move +- into ffi_prep_closure. +- * src/ia64/ia64_flags.h, src/ia64/ffi.c, src/ia64/unix.S: Rewrite +- from scratch. +- +-2004-12-27 Richard Henderson +- +- * src/x86/unix64.S: Fix typo in unwind info. +- +-2004-12-25 Richard Henderson +- +- * src/x86/ffi64.c (struct register_args): Rename from stackLayout. +- (enum x86_64_reg_class): Add X86_64_COMPLEX_X87_CLASS. +- (merge_classes): Check for it. +- (SSE_CLASS_P): New. +- (classify_argument): Pass byte_offset by value; perform all updates +- inside struct case. +- (examine_argument): Add classes argument; handle +- X86_64_COMPLEX_X87_CLASS. +- (ffi_prep_args): Merge into ... +- (ffi_call): ... here. Share stack frame with ffi_call_unix64. +- (ffi_prep_cif_machdep): Setup cif->flags for proper structure return. +- (ffi_fill_return_value): Remove. +- (ffi_prep_closure): Remove dead assert. +- (ffi_closure_unix64_inner): Rename from ffi_closure_UNIX64_inner. +- Rewrite to use struct register_args instead of va_list. Create +- flags for handling structure returns. +- * src/x86/unix64.S: Remove dead strings. +- (ffi_call_unix64): Rename from ffi_call_UNIX64. Rewrite to share +- stack frame with ffi_call. Handle structure returns properly. +- (float2sse, floatfloat2sse, double2sse): Remove. +- (sse2float, sse2double, sse2floatfloat): Remove. +- (ffi_closure_unix64): Rename from ffi_closure_UNIX64. Rewrite +- to handle structure returns properly. +- +-2004-12-08 David Edelsohn +- +- * Makefile.am (AM_MAKEFLAGS): Remove duplicate LIBCFLAGS and +- PICFLAG. +- * Makefile.in: Regenerated. +- +-2004-12-02 Richard Sandiford +- +- * configure.ac: Use TL_AC_GCC_VERSION to set gcc_version. +- * configure, aclocal.m4, Makefile.in: Regenerate. +- * include/Makefile.in, testsuite/Makefile.in: Regenerate. +- +-2004-11-29 Kelley Cook +- +- * configure: Regenerate for libtool change. +- +-2004-11-25 Kelley Cook +- +- * configure: Regenerate for libtool reversion. +- +-2004-11-24 Kelley Cook +- +- * configure: Regenerate for libtool change. +- +-2004-11-23 John David Anglin +- +- * testsuite/lib/libffi-dg.exp: Use new procs in target-libpath.exp. +- +-2004-11-23 Richard Sandiford +- +- * src/mips/o32.S (ffi_call_O32, ffi_closure_O32): Use jalr instead +- of jal. Use an absolute encoding for the frame information. +- +-2004-11-23 Kelley Cook +- +- * Makefile.am: Remove no-dependencies. Add ACLOCAL_AMFLAGS. +- * acinclude.m4: Delete logic for sincludes. +- * aclocal.m4, Makefile.in, configure: Regenerate. +- * include/Makefile: Likewise. +- * testsuite/Makefile: Likewise. +- +-2004-11-22 Eric Botcazou +- +- * src/sparc/ffi.c (ffi_prep_closure): Align doubles and 64-bit integers +- on a 8-byte boundary. +- * src/sparc/v8.S (ffi_closure_v8): Reserve frame space for arguments. +- +-2004-10-27 Richard Earnshaw +- +- * src/arm/ffi.c (ffi_prep_cif_machdep): Handle functions that return +- long long values. Round stack allocation to a multiple of 8 bytes +- for ATPCS compatibility. +- * src/arm/sysv.S (ffi_call_SYSV): Rework to avoid use of APCS register +- names. Handle returning long long types. Add Thumb and interworking +- support. Improve soft-float code. +- +-2004-10-27 Richard Earnshaw +- +- * testsuite/lib/libffi-db.exp (load_gcc_lib): New function. +- (libffi_exit): New function. +- (libffi_init): Build the testglue wrapper if needed. +- +-2004-10-25 Eric Botcazou +- +- PR other/18138 +- * testsuite/lib/libffi-dg.exp: Accept more than one multilib libgcc. +- +-2004-10-25 Kazuhiro Inaoka +- +- * src/m32r/libffitarget.h (FFI_CLOSURES): Set to 0. +- +-2004-10-20 Kaz Kojima +- +- * src/sh/sysv.S (ffi_call_SYSV): Don't align for double data. +- * testsuite/libffi.call/float3.c: New test case. +- +-2004-10-18 Kaz Kojima +- +- * src/sh/ffi.c (ffi_prep_closure): Set T bit in trampoline for +- the function returning a structure pointed with R2. +- * src/sh/sysv.S (ffi_closure_SYSV): Use R2 as the pointer to +- the structure return value if T bit set. Emit position +- independent code and EH data if PIC. +- +-2004-10-13 Kazuhiro Inaoka +- +- * Makefile.am: Add m32r support. +- * configure.ac: Likewise. +- * Makefile.in: Regenerate. +- * confiugre: Regenerate. +- * src/types.c: Add m32r port to FFI_INTERNAL_TYPEDEF +- (uint64, sint64, double, longdouble) +- * src/m32r: New directory. +- * src/m32r/ffi.c: New file. +- * src/m32r/sysv.S: Likewise. +- * src/m32r/ffitarget.h: Likewise. +- +-2004-10-02 Kaz Kojima +- +- * testsuite/libffi.call/negint.c: New test case. +- +-2004-09-14 H.J. Lu +- +- PR libgcj/17465 +- * testsuite/lib/libffi-dg.exp: Don't use global ld_library_path. +- Set up LD_LIBRARY_PATH, SHLIB_PATH, LD_LIBRARYN32_PATH, +- LD_LIBRARY64_PATH, LD_LIBRARY_PATH_32, LD_LIBRARY_PATH_64 and +- DYLD_LIBRARY_PATH. +- +-2004-09-05 Andreas Tobler +- +- * testsuite/libffi.call/many_win32.c: Remove whitespaces. +- * testsuite/libffi.call/promotion.c: Likewise. +- * testsuite/libffi.call/return_ll.c: Remove unused var. Cleanup +- whitespaces. +- * testsuite/libffi.call/return_sc.c: Likewise. +- * testsuite/libffi.call/return_uc.c: Likewise. +- +-2004-09-05 Andreas Tobler +- +- * src/powerpc/darwin.S: Fix comments and identation. +- * src/powerpc/darwin_closure.S: Likewise. +- +-2004-09-02 Andreas Tobler +- +- * src/powerpc/ffi_darwin.c: Add flag for longdouble return values. +- (ffi_prep_args): Handle longdouble arguments. +- (ffi_prep_cif_machdep): Set flags for longdouble. Calculate space for +- longdouble. +- (ffi_closure_helper_DARWIN): Add closure handling for longdouble. +- * src/powerpc/darwin.S (_ffi_call_DARWIN): Add handling of longdouble +- values. +- * src/powerpc/darwin_closure.S (_ffi_closure_ASM): Likewise. +- * src/types.c: Defined longdouble size and alignment for darwin. +- +-2004-09-02 Andreas Tobler +- +- * src/powerpc/aix.S: Remove whitespaces. +- * src/powerpc/aix_closure.S: Likewise. +- * src/powerpc/asm.h: Likewise. +- * src/powerpc/ffi.c: Likewise. +- * src/powerpc/ffitarget.h: Likewise. +- * src/powerpc/linux64.S: Likewise. +- * src/powerpc/linux64_closure.S: Likewise. +- * src/powerpc/ppc_closure.S: Likewise. +- * src/powerpc/sysv.S: Likewise. +- +-2004-08-30 Anthony Green +- +- * Makefile.am: Add frv support. +- * Makefile.in, testsuite/Makefile.in: Rebuilt. +- * configure.ac: Read configure.host. +- * configure.in: Read configure.host. +- * configure.host: New file. frv-elf needs libgloss. +- * include/ffi.h.in: Force ffi_closure to have a nice big (8) +- alignment. This is needed to frv and shouldn't harm the others. +- * include/ffi_common.h (ALIGN_DOWN): New macro. +- * src/frv/ffi.c, src/frv/ffitarget.h, src/frv/eabi.S: New files. +- +-2004-08-24 David Daney +- +- * testsuite/libffi.call/closure_fn0.c: Xfail mips64* instead of mips*. +- * testsuite/libffi.call/closure_fn1.c: Likewise. +- * testsuite/libffi.call/closure_fn2.c Likewise. +- * testsuite/libffi.call/closure_fn3.c: Likewise. +- * testsuite/libffi.call/closure_fn4.c: Likewise. +- * testsuite/libffi.call/closure_fn5.c: Likewise. +- * testsuite/libffi.call/cls_18byte.c: Likewise. +- * testsuite/libffi.call/cls_19byte.c: Likewise. +- * testsuite/libffi.call/cls_1_1byte.c: Likewise. +- * testsuite/libffi.call/cls_20byte.c: Likewise. +- * testsuite/libffi.call/cls_20byte1.c: Likewise. +- * testsuite/libffi.call/cls_24byte.c: Likewise. +- * testsuite/libffi.call/cls_2byte.c: Likewise. +- * testsuite/libffi.call/cls_3_1byte.c: Likewise. +- * testsuite/libffi.call/cls_3byte1.c: Likewise. +- * testsuite/libffi.call/cls_3byte2.c: Likewise. +- * testsuite/libffi.call/cls_4_1byte.c: Likewise. +- * testsuite/libffi.call/cls_4byte.c: Likewise. +- * testsuite/libffi.call/cls_64byte.c: Likewise. +- * testsuite/libffi.call/cls_6byte.c: Likewise. +- * testsuite/libffi.call/cls_7byte.c: Likewise. +- * testsuite/libffi.call/cls_8byte.c: Likewise. +- * testsuite/libffi.call/cls_9byte1.c: Likewise. +- * testsuite/libffi.call/cls_9byte2.c: Likewise. +- * testsuite/libffi.call/cls_align_double.c: Likewise. +- * testsuite/libffi.call/cls_align_float.c: Likewise. +- * testsuite/libffi.call/cls_align_longdouble.c: Likewise. +- * testsuite/libffi.call/cls_align_pointer.c: Likewise. +- * testsuite/libffi.call/cls_align_sint16.c: Likewise. +- * testsuite/libffi.call/cls_align_sint32.c: Likewise. +- * testsuite/libffi.call/cls_align_sint64.c: Likewise. +- * testsuite/libffi.call/cls_align_uint16.c: Likewise. +- * testsuite/libffi.call/cls_align_uint32.c: Likewise. +- * testsuite/libffi.call/cls_align_uint64.c: Likewise. +- * testsuite/libffi.call/cls_double.c: Likewise. +- * testsuite/libffi.call/cls_float.c: Likewise. +- * testsuite/libffi.call/cls_multi_schar.c: Likewise. +- * testsuite/libffi.call/cls_multi_sshort.c: Likewise. +- * testsuite/libffi.call/cls_multi_sshortchar.c: Likewise. +- * testsuite/libffi.call/cls_multi_uchar.c: Likewise. +- * testsuite/libffi.call/cls_multi_ushort.c: Likewise. +- * testsuite/libffi.call/cls_multi_ushortchar.c: Likewise. +- * testsuite/libffi.call/cls_schar.c: Likewise. +- * testsuite/libffi.call/cls_sint.c: Likewise. +- * testsuite/libffi.call/cls_sshort.c: Likewise. +- * testsuite/libffi.call/cls_uchar.c: Likewise. +- * testsuite/libffi.call/cls_uint.c: Likewise. +- * testsuite/libffi.call/cls_ulonglong.c: Likewise. +- * testsuite/libffi.call/cls_ushort.c: Likewise. +- * testsuite/libffi.call/nested_struct.c: Likewise. +- * testsuite/libffi.call/nested_struct1.c: Likewise. +- * testsuite/libffi.call/nested_struct2.c: Likewise. +- * testsuite/libffi.call/nested_struct3.c: Likewise. +- * testsuite/libffi.call/problem1.c: Likewise. +- * testsuite/libffi.special/unwindtest.cc: Likewise. +- * testsuite/libffi.call/cls_12byte.c: Likewise and set return value +- to zero. +- * testsuite/libffi.call/cls_16byte.c: Likewise. +- * testsuite/libffi.call/cls_5byte.c: Likewise. +- +-2004-08-23 David Daney +- +- PR libgcj/13141 +- * src/mips/ffitarget.h (FFI_O32_SOFT_FLOAT): New ABI. +- * src/mips/ffi.c (ffi_prep_args): Fix alignment calculation. +- (ffi_prep_cif_machdep): Handle FFI_O32_SOFT_FLOAT floating point +- parameters and return types. +- (ffi_call): Handle FFI_O32_SOFT_FLOAT ABI. +- (ffi_prep_closure): Ditto. +- (ffi_closure_mips_inner_O32): Handle FFI_O32_SOFT_FLOAT ABI, fix +- alignment calculations. +- * src/mips/o32.S (ffi_closure_O32): Don't use floating point +- instructions if FFI_O32_SOFT_FLOAT, make stack frame ABI compliant. +- +-2004-08-14 Casey Marshall +- +- * src/mips/ffi.c (ffi_pref_cif_machdep): set `cif->flags' to +- contain `FFI_TYPE_UINT64' as return type for any 64-bit +- integer (O32 ABI only). +- (ffi_prep_closure): new function. +- (ffi_closure_mips_inner_O32): new function. +- * src/mips/ffitarget.h: Define `FFI_CLOSURES' and +- `FFI_TRAMPOLINE_SIZE' appropriately if the ABI is o32. +- * src/mips/o32.S (ffi_call_O32): add labels for .eh_frame. Return +- 64 bit integers correctly. +- (ffi_closure_O32): new function. +- Added DWARF-2 unwind info for both functions. +- +-2004-08-10 Andrew Haley +- +- * src/x86/ffi64.c (ffi_prep_args ): 8-align all stack arguments. +- +-2004-08-01 Robert Millan +- +- * configure.ac: Detect knetbsd-gnu and kfreebsd-gnu. +- * configure: Regenerate. +- +-2004-07-30 Maciej W. Rozycki +- +- * acinclude.m4 (AC_FUNC_MMAP_BLACKLIST): Check for +- and mmap() explicitly instead of relying on preset autoconf cache +- variables. +- * aclocal.m4: Regenerate. +- * configure: Regenerate. +- +-2004-07-11 Ulrich Weigand +- +- * src/s390/ffi.c (ffi_prep_args): Fix C aliasing violation. +- (ffi_check_float_struct): Remove unused prototype. +- +-2004-06-30 Geoffrey Keating +- +- * src/powerpc/ffi_darwin.c (flush_icache): ';' is a comment +- character on Darwin, use '\n\t' instead. +- +-2004-06-26 Matthias Klose +- +- * libtool-version: Fix typo in revision/age. +- +-2004-06-17 Matthias Klose +- +- * libtool-version: New. +- * Makefile.am (libffi_la_LDFLAGS): Use -version-info for soname. +- * Makefile.in: Regenerate. +- +-2004-06-15 Paolo Bonzini +- +- * Makefile.am: Remove useless multilib rules. +- * Makefile.in: Regenerate. +- * aclocal.m4: Regenerate with automake 1.8.5. +- * configure.ac: Remove useless multilib configury. +- * configure: Regenerate. +- +-2004-06-15 Paolo Bonzini +- +- * .cvsignore: New file. +- +-2004-06-10 Jakub Jelinek +- +- * src/ia64/unix.S (ffi_call_unix): Insert group barrier break +- fp_done. +- (ffi_closure_UNIX): Fix f14/f15 adjustment if FLOAT_SZ is ever +- changed from 8. +- +-2004-06-06 Sean McNeil +- +- * configure.ac: Add x86_64-*-freebsd* support. +- * configure: Regenerate. +- +-2004-04-26 Joe Buck +- +- Bug 15093 +- * configure.ac: Test for existence of mmap and sys/mman.h before +- checking blacklist. Fix suggested by Jim Wilson. +- * configure: Regenerate. +- +-2004-04-26 Matt Austern +- +- * src/powerpc/darwin.S: Go through a non-lazy pointer for initial +- FDE location. +- * src/powerpc/darwin_closure.S: Likewise. +- +-2004-04-24 Andreas Tobler +- +- * testsuite/libffi.call/cls_multi_schar.c (main): Fix initialization +- error. Reported by Thomas Heller . +- * testsuite/libffi.call/cls_multi_sshort.c (main): Likewise. +- * testsuite/libffi.call/cls_multi_ushort.c (main): Likewise. +- +-2004-03-20 Matthias Klose +- +- * src/pa/linux.S: Fix typo. +- +-2004-03-19 Matthias Klose +- +- * Makefile.am: Update. +- * Makefile.in: Regenerate. +- * src/pa/ffi.h.in: Remove. +- * src/pa/ffitarget.h: New file. +- +-2004-02-10 Randolph Chung +- +- * Makefile.am: Add PA support. +- * Makefile.in: Regenerate. +- * include/Makefile.in: Regenerate. +- * configure.ac: Add PA target. +- * configure: Regenerate. +- * src/pa/ffi.c: New file. +- * src/pa/ffi.h.in: Add PA support. +- * src/pa/linux.S: New file. +- * prep_cif.c: Add PA support. +- +-2004-03-16 Hosaka Yuji +- +- * src/types.c: Fix alignment size of X86_WIN32 case int64 and +- double. +- * src/x86/ffi.c (ffi_prep_args): Replace ecif->cif->rtype->type +- with ecif->cif->flags. +- (ffi_call, ffi_prep_incoming_args_SYSV): Replace cif->rtype->type +- with cif->flags. +- (ffi_prep_cif_machdep): Add X86_WIN32 struct case. +- (ffi_closure_SYSV): Add 1 or 2-bytes struct case for X86_WIN32. +- * src/x86/win32.S (retstruct1b, retstruct2b, sc_retstruct1b, +- sc_retstruct2b): Add for 1 or 2-bytes struct case. +- +-2004-03-15 Kelley Cook +- +- * configure.in: Rename file to ... +- * configure.ac: ... this. +- * fficonfig.h.in: Regenerate. +- * Makefile.in: Regenerate. +- * include/Makefile.in: Regenerate. +- * testsuite/Makefile.in: Regenerate. +- +-2004-03-12 Matt Austern +- +- * src/powerpc/darwin.S: Fix EH information so it corresponds to +- changes in EH format resulting from addition of linkonce support. +- * src/powerpc/darwin_closure.S: Likewise. +- +-2004-03-11 Andreas Tobler +- Paolo Bonzini +- +- * Makefile.am (AUTOMAKE_OPTIONS): Set them. +- Remove VPATH. Remove rules for object files. Remove multilib support. +- (AM_CCASFLAGS): Add. +- * configure.in (AC_CONFIG_HEADERS): Relace AM_CONFIG_HEADER. +- (AC_PREREQ): Bump version to 2.59. +- (AC_INIT): Fill with version info and bug address. +- (ORIGINAL_LD_FOR_MULTILIBS): Remove. +- (AM_ENABLE_MULTILIB): Use this instead of AC_ARG_ENABLE. +- De-precious CC so that the right flags are passed down to multilibs. +- (AC_MSG_ERROR): Replace obsolete macro AC_ERROR. +- (AC_CONFIG_FILES): Replace obsolete macro AC_LINK_FILES. +- (AC_OUTPUT): Reorganize the output with AC_CONFIG_COMMANDS. +- * configure: Rebuilt. +- * aclocal.m4: Likewise. +- * Makefile.in, include/Makefile.in, testsuite/Makefile.in: Likewise. +- * fficonfig.h.in: Likewise. +- +-2004-03-11 Andreas Schwab +- +- * src/ia64/ffi.c (ffi_prep_incoming_args_UNIX): Get floating point +- arguments from fp registers only for the first 8 parameter slots. +- Don't convert a float parameter when passed in memory. +- +-2004-03-09 Hans-Peter Nilsson +- +- * configure: Regenerate for config/accross.m4 correction. +- +-2004-02-25 Matt Kraai +- +- * src/powerpc/ffi.c (ffi_prep_args_SYSV): Change +- ecif->cif->bytes to bytes. +- (ffi_prep_cif_machdep): Add braces around nested if statement. +- +-2004-02-09 Alan Modra +- +- * src/types.c (pointer): POWERPC64 has 8 byte pointers. +- +- * src/powerpc/ffi.c (ffi_prep_args64): Correct long double handling. +- (ffi_closure_helper_LINUX64): Fix typo. +- * testsuite/libffi.call/cls_align_longdouble.c: Pass -mlong-double-128 +- for powerpc64-*-*. +- * testsuite/libffi.call/float.c: Likewise. +- * testsuite/libffi.call/float2.c: Likewise. +- +-2004-02-08 Alan Modra +- +- * src/powerpc/ffi.c (ffi_prep_cif_machdep ): Correct +- long double function return and long double arg handling. +- (ffi_closure_helper_LINUX64): Formatting. Delete unused "ng" var. +- Use "end_pfr" instead of "nf". Correct long double handling. +- Localise "temp". +- * src/powerpc/linux64.S (ffi_call_LINUX64): Save f2 long double +- return value. +- * src/powerpc/linux64_closure.S (ffi_closure_LINUX64): Allocate +- space for long double return value. Adjust stack frame and offsets. +- Load f2 long double return. +- +-2004-02-07 Alan Modra +- +- * src/types.c: Use 16 byte long double for POWERPC64. +- +-2004-01-25 Eric Botcazou +- +- * src/sparc/ffi.c (ffi_prep_args_v9): Shift the parameter array +- when the structure return address is passed in %o0. +- (ffi_V9_return_struct): Rename into ffi_v9_layout_struct. +- (ffi_v9_layout_struct): Align the field following a nested structure +- on a word boundary. Use memmove instead of memcpy. +- (ffi_call): Update call to ffi_V9_return_struct. +- (ffi_prep_closure): Define 'ctx' only for V8. +- (ffi_closure_sparc_inner): Clone into ffi_closure_sparc_inner_v8 +- and ffi_closure_sparc_inner_v9. +- (ffi_closure_sparc_inner_v8): Return long doubles by reference. +- Always skip the structure return address. For structures and long +- doubles, copy the argument directly. +- (ffi_closure_sparc_inner_v9): Skip the structure return address only +- if required. Shift the maximum floating-point slot accordingly. For +- big structures, copy the argument directly; otherwise, left-justify the +- argument and call ffi_v9_layout_struct to lay out the structure on +- the stack. +- * src/sparc/v8.S: Undef STACKFRAME before defining it. +- (ffi_closure_v8): Pass the structure return address. Update call to +- ffi_closure_sparc_inner_v8. Short-circuit FFI_TYPE_INT handling. +- Skip the 'unimp' insn when returning long doubles and structures. +- * src/sparc/v9.S: Undef STACKFRAME before defining it. +- (ffi_closure_v9): Increase the frame size by 2 words. Short-circuit +- FFI_TYPE_INT handling. Load structures both in integers and +- floating-point registers on return. +- * README: Update status of the SPARC port. +- +-2004-01-24 Andreas Tobler +- +- * testsuite/libffi.call/pyobjc-tc.c (main): Treat result value +- as of type ffi_arg. +- * testsuite/libffi.call/struct3.c (main): Fix CHECK. +- +-2004-01-22 Ulrich Weigand +- +- * testsuite/libffi.call/cls_uint.c (cls_ret_uint_fn): Treat result +- value as of type ffi_arg, not unsigned int. +- +-2004-01-21 Michael Ritzert +- +- * ffi64.c (ffi_prep_args): Cast the RHS of an assignment instead +- of the LHS. +- +-2004-01-12 Andreas Tobler +- +- * testsuite/lib/libffi-dg.exp: Set LD_LIBRARY_PATH_32 for +- Solaris. +- +-2004-01-08 Rainer Orth +- +- * testsuite/libffi.call/ffitest.h (allocate_mmap): Cast MAP_FAILED +- to void *. +- +-2003-12-10 Richard Henderson +- +- * testsuite/libffi.call/cls_align_pointer.c: Cast pointers to +- size_t instead of int. +- +-2003-12-04 Hosaka Yuji +- +- * testsuite/libffi.call/many_win32.c: Include . +- * testsuite/libffi.call/many_win32.c (main): Replace variable +- int i with unsigned long ul. +- +- * testsuite/libffi.call/cls_align_uint64.c: New test case. +- * testsuite/libffi.call/cls_align_sint64.c: Likewise. +- * testsuite/libffi.call/cls_align_uint32.c: Likewise. +- * testsuite/libffi.call/cls_align_sint32.c: Likewise. +- * testsuite/libffi.call/cls_align_uint16.c: Likewise. +- * testsuite/libffi.call/cls_align_sint16.c: Likewise. +- * testsuite/libffi.call/cls_align_float.c: Likewise. +- * testsuite/libffi.call/cls_align_double.c: Likewise. +- * testsuite/libffi.call/cls_align_longdouble.c: Likewise. +- * testsuite/libffi.call/cls_align_pointer.c: Likewise. +- +-2003-12-02 Hosaka Yuji +- +- PR other/13221 +- * src/x86/ffi.c (ffi_prep_args, ffi_prep_incoming_args_SYSV): +- Align arguments to 32 bits. +- +-2003-12-01 Andreas Tobler +- +- PR other/13221 +- * testsuite/libffi.call/cls_multi_sshort.c: New test case. +- * testsuite/libffi.call/cls_multi_sshortchar.c: Likewise. +- * testsuite/libffi.call/cls_multi_uchar.c: Likewise. +- * testsuite/libffi.call/cls_multi_schar.c: Likewise. +- * testsuite/libffi.call/cls_multi_ushortchar.c: Likewise. +- * testsuite/libffi.call/cls_multi_ushort.c: Likewise. +- +- * testsuite/libffi.special/unwindtest.cc: Cosmetics. +- +-2003-11-26 Kaveh R. Ghazi +- +- * testsuite/libffi.call/ffitest.h: Include . +- * testsuite/libffi.special/ffitestcxx.h: Likewise. +- +-2003-11-22 Andreas Tobler +- +- * Makefile.in: Rebuilt. +- * configure: Likewise. +- * testsuite/libffi.special/unwindtest.cc: Convert the mmap to +- the right type. +- +-2003-11-21 Andreas Jaeger +- Andreas Tobler +- +- * acinclude.m4: Add AC_FUNC_MMAP_BLACKLIST. +- * configure.in: Call AC_FUNC_MMAP_BLACKLIST. +- * Makefile.in: Rebuilt. +- * aclocal.m4: Likewise. +- * configure: Likewise. +- * fficonfig.h.in: Likewise. +- * testsuite/lib/libffi-dg.exp: Add include dir. +- * testsuite/libffi.call/ffitest.h: Add MMAP definitions. +- * testsuite/libffi.special/ffitestcxx.h: Likewise. +- * testsuite/libffi.call/closure_fn0.c: Use MMAP functionality +- for ffi_closure if available. +- * testsuite/libffi.call/closure_fn1.c: Likewise. +- * testsuite/libffi.call/closure_fn2.c: Likewise. +- * testsuite/libffi.call/closure_fn3.c: Likewise. +- * testsuite/libffi.call/closure_fn4.c: Likewise. +- * testsuite/libffi.call/closure_fn5.c: Likewise. +- * testsuite/libffi.call/cls_12byte.c: Likewise. +- * testsuite/libffi.call/cls_16byte.c: Likewise. +- * testsuite/libffi.call/cls_18byte.c: Likewise. +- * testsuite/libffi.call/cls_19byte.c: Likewise. +- * testsuite/libffi.call/cls_1_1byte.c: Likewise. +- * testsuite/libffi.call/cls_20byte.c: Likewise. +- * testsuite/libffi.call/cls_20byte1.c: Likewise. +- * testsuite/libffi.call/cls_24byte.c: Likewise. +- * testsuite/libffi.call/cls_2byte.c: Likewise. +- * testsuite/libffi.call/cls_3_1byte.c: Likewise. +- * testsuite/libffi.call/cls_3byte1.c: Likewise. +- * testsuite/libffi.call/cls_3byte2.c: Likewise. +- * testsuite/libffi.call/cls_4_1byte.c: Likewise. +- * testsuite/libffi.call/cls_4byte.c: Likewise. +- * testsuite/libffi.call/cls_5byte.c: Likewise. +- * testsuite/libffi.call/cls_64byte.c: Likewise. +- * testsuite/libffi.call/cls_6byte.c: Likewise. +- * testsuite/libffi.call/cls_7byte.c: Likewise. +- * testsuite/libffi.call/cls_8byte.c: Likewise. +- * testsuite/libffi.call/cls_9byte1.c: Likewise. +- * testsuite/libffi.call/cls_9byte2.c: Likewise. +- * testsuite/libffi.call/cls_double.c: Likewise. +- * testsuite/libffi.call/cls_float.c: Likewise. +- * testsuite/libffi.call/cls_schar.c: Likewise. +- * testsuite/libffi.call/cls_sint.c: Likewise. +- * testsuite/libffi.call/cls_sshort.c: Likewise. +- * testsuite/libffi.call/cls_uchar.c: Likewise. +- * testsuite/libffi.call/cls_uint.c: Likewise. +- * testsuite/libffi.call/cls_ulonglong.c: Likewise. +- * testsuite/libffi.call/cls_ushort.c: Likewise. +- * testsuite/libffi.call/nested_struct.c: Likewise. +- * testsuite/libffi.call/nested_struct1.c: Likewise. +- * testsuite/libffi.call/nested_struct2.c: Likewise. +- * testsuite/libffi.call/nested_struct3.c: Likewise. +- * testsuite/libffi.call/problem1.c: Likewise. +- * testsuite/libffi.special/unwindtest.cc: Likewise. +- +-2003-11-20 Andreas Tobler +- +- * testsuite/lib/libffi-dg.exp: Make the -lgcc_s conditional. +- +-2003-11-19 Andreas Tobler +- +- * testsuite/lib/libffi-dg.exp: Add DYLD_LIBRARY_PATH for darwin. +- Add -lgcc_s to additional flags. +- +-2003-11-12 Andreas Tobler +- +- * configure.in, include/Makefile.am: PR libgcj/11147, install +- the ffitarget.h header file in a gcc versioned and target +- dependent place. +- * configure: Regenerated. +- * Makefile.in, include/Makefile.in: Likewise. +- * testsuite/Makefile.in: Likewise. +- +-2003-11-09 Andreas Tobler +- +- * testsuite/libffi.call/closure_fn0.c: Print result and check +- with dg-output to make debugging easier. +- * testsuite/libffi.call/closure_fn1.c: Likewise. +- * testsuite/libffi.call/closure_fn2.c: Likewise. +- * testsuite/libffi.call/closure_fn3.c: Likewise. +- * testsuite/libffi.call/closure_fn4.c: Likewise. +- * testsuite/libffi.call/closure_fn5.c: Likewise. +- * testsuite/libffi.call/cls_12byte.c: Likewise. +- * testsuite/libffi.call/cls_16byte.c: Likewise. +- * testsuite/libffi.call/cls_18byte.c: Likewise. +- * testsuite/libffi.call/cls_19byte.c: Likewise. +- * testsuite/libffi.call/cls_1_1byte.c: Likewise. +- * testsuite/libffi.call/cls_20byte.c: Likewise. +- * testsuite/libffi.call/cls_20byte1.c: Likewise. +- * testsuite/libffi.call/cls_24byte.c: Likewise. +- * testsuite/libffi.call/cls_2byte.c: Likewise. +- * testsuite/libffi.call/cls_3_1byte.c: Likewise. +- * testsuite/libffi.call/cls_3byte1.c: Likewise. +- * testsuite/libffi.call/cls_3byte2.c: Likewise. +- * testsuite/libffi.call/cls_4_1byte.c: Likewise. +- * testsuite/libffi.call/cls_4byte.c: Likewise. +- * testsuite/libffi.call/cls_5byte.c: Likewise. +- * testsuite/libffi.call/cls_64byte.c: Likewise. +- * testsuite/libffi.call/cls_6byte.c: Likewise. +- * testsuite/libffi.call/cls_7byte.c: Likewise. +- * testsuite/libffi.call/cls_8byte.c: Likewise. +- * testsuite/libffi.call/cls_9byte1.c: Likewise. +- * testsuite/libffi.call/cls_9byte2.c: Likewise. +- * testsuite/libffi.call/cls_double.c: Likewise. +- * testsuite/libffi.call/cls_float.c: Likewise. +- * testsuite/libffi.call/cls_schar.c: Likewise. +- * testsuite/libffi.call/cls_sint.c: Likewise. +- * testsuite/libffi.call/cls_sshort.c: Likewise. +- * testsuite/libffi.call/cls_uchar.c: Likewise. +- * testsuite/libffi.call/cls_uint.c: Likewise. +- * testsuite/libffi.call/cls_ulonglong.c: Likewise. +- * testsuite/libffi.call/cls_ushort.c: Likewise. +- * testsuite/libffi.call/problem1.c: Likewise. +- +- * testsuite/libffi.special/unwindtest.cc: Make ffi_closure +- static. +- +-2003-11-08 Andreas Tobler +- +- * testsuite/libffi.call/cls_9byte2.c: New test case. +- * testsuite/libffi.call/cls_9byte1.c: Likewise. +- * testsuite/libffi.call/cls_64byte.c: Likewise. +- * testsuite/libffi.call/cls_20byte1.c: Likewise. +- * testsuite/libffi.call/cls_19byte.c: Likewise. +- * testsuite/libffi.call/cls_18byte.c: Likewise. +- * testsuite/libffi.call/closure_fn4.c: Likewise. +- * testsuite/libffi.call/closure_fn5.c: Likewise. +- * testsuite/libffi.call/cls_schar.c: Likewise. +- * testsuite/libffi.call/cls_sint.c: Likewise. +- * testsuite/libffi.call/cls_sshort.c: Likewise. +- * testsuite/libffi.call/nested_struct2.c: Likewise. +- * testsuite/libffi.call/nested_struct3.c: Likewise. +- +-2003-11-08 Andreas Tobler +- +- * testsuite/libffi.call/cls_double.c: Do a check on the result. +- * testsuite/libffi.call/cls_uchar.c: Likewise. +- * testsuite/libffi.call/cls_uint.c: Likewise. +- * testsuite/libffi.call/cls_ulonglong.c: Likewise. +- * testsuite/libffi.call/cls_ushort.c: Likewise. +- * testsuite/libffi.call/return_sc.c: Cleanup whitespaces. +- +-2003-11-06 Andreas Tobler +- +- * src/prep_cif.c (ffi_prep_cif): Move the validity check after +- the initialization. +- +-2003-10-23 Andreas Tobler +- +- * src/java_raw_api.c (ffi_java_ptrarray_to_raw): Replace +- FFI_ASSERT(FALSE) with FFI_ASSERT(0). +- +-2003-10-22 David Daney +- +- * src/mips/ffitarget.h: Replace undefined UINT32 and friends with +- __attribute__((__mode__(__SI__))) and friends. +- +-2003-10-22 Andreas Schwab +- +- * src/ia64/ffi.c: Replace FALSE/TRUE with false/true. +- +-2003-10-21 Andreas Tobler +- +- * configure.in: AC_LINK_FILES(ffitarget.h). +- * configure: Regenerate. +- * Makefile.in: Likewise. +- * include/Makefile.in: Likewise. +- * testsuite/Makefile.in: Likewise. +- * fficonfig.h.in: Likewise. +- +-2003-10-21 Paolo Bonzini +- Richard Henderson +- +- Avoid that ffi.h includes fficonfig.h. +- +- * Makefile.am (EXTRA_DIST): Include ffitarget.h files +- (TARGET_SRC_MIPS_GCC): Renamed to TARGET_SRC_MIPS_IRIX. +- (TARGET_SRC_MIPS_SGI): Removed. +- (MIPS_GCC): Renamed to TARGET_SRC_MIPS_IRIX. +- (MIPS_SGI): Removed. +- (CLEANFILES): Removed. +- (mostlyclean-am, clean-am, mostlyclean-sub, clean-sub): New +- targets. +- * acconfig.h: Removed. +- * configure.in: Compute sizeofs only for double and long double. +- Use them to define and subst HAVE_LONG_DOUBLE. Include comments +- into AC_DEFINE instead of using acconfig.h. Create +- include/ffitarget.h instead of include/fficonfig.h. Rename +- MIPS_GCC to MIPS_IRIX, drop MIPS_SGI since we are in gcc's tree. +- AC_DEFINE EH_FRAME_FLAGS. +- * include/Makefile.am (DISTCLEANFILES): New automake macro. +- (hack_DATA): Add ffitarget.h. +- * include/ffi.h.in: Remove all system specific definitions. +- Declare raw API even if it is not installed, why bother? +- Use limits.h instead of SIZEOF_* to define ffi_type_*. Do +- not define EH_FRAME_FLAGS, it is in fficonfig.h now. Include +- ffitarget.h instead of fficonfig.h. Remove ALIGN macro. +- (UINT_ARG, INT_ARG): Removed, use ffi_arg and ffi_sarg instead. +- * include/ffi_common.h (bool): Do not define. +- (ffi_assert): Accept failed assertion. +- (ffi_type_test): Return void and accept file/line. +- (FFI_ASSERT): Pass stringized failed assertion. +- (FFI_ASSERT_AT): New macro. +- (FFI_ASSERT_VALID_TYPE): New macro. +- (UINT8, SINT8, UINT16, SINT16, UINT32, SINT32, +- UINT64, SINT64): Define here with gcc's __attribute__ macro +- instead of in ffi.h +- (FLOAT32, ALIGN): Define here instead of in ffi.h +- * include/ffi-mips.h: Removed. Its content moved to +- src/mips/ffitarget.h after separating assembly and C sections. +- * src/alpha/ffi.c, src/alpha/ffi.c, src/java_raw_api.c +- src/prep_cif.c, src/raw_api.c, src/ia64/ffi.c, +- src/mips/ffi.c, src/mips/n32.S, src/mips/o32.S, +- src/mips/ffitarget.h, src/sparc/ffi.c, src/x86/ffi64.c: +- SIZEOF_ARG -> FFI_SIZEOF_ARG. +- * src/ia64/ffi.c: Include stdbool.h (provided by GCC 2.95+). +- * src/debug.c (ffi_assert): Accept stringized failed assertion. +- (ffi_type_test): Rewritten. +- * src/prep-cif.c (initialize_aggregate, ffi_prep_cif): Call +- FFI_ASSERT_VALID_TYPE. +- * src/alpha/ffitarget.h, src/arm/ffitarget.h, +- src/ia64/ffitarget.h, src/m68k/ffitarget.h, +- src/mips/ffitarget.h, src/powerpc/ffitarget.h, +- src/s390/ffitarget.h, src/sh/ffitarget.h, +- src/sh64/ffitarget.h, src/sparc/ffitarget.h, +- src/x86/ffitarget.h: New files. +- * src/alpha/osf.S, src/arm/sysv.S, src/ia64/unix.S, +- src/m68k/sysv.S, src/mips/n32.S, src/mips/o32.S, +- src/powerpc/aix.S, src/powerpc/darwin.S, +- src/powerpc/ffi_darwin.c, src/powerpc/linux64.S, +- src/powerpc/linux64_closure.S, src/powerpc/ppc_closure.S, +- src/powerpc/sysv.S, src/s390/sysv.S, src/sh/sysv.S, +- src/sh64/sysv.S, src/sparc/v8.S, src/sparc/v9.S, +- src/x86/sysv.S, src/x86/unix64.S, src/x86/win32.S: +- include fficonfig.h +- +-2003-10-20 Rainer Orth +- +- * src/mips/ffi.c: Use _ABIN32, _ABIO32 instead of external +- _MIPS_SIM_NABI32, _MIPS_SIM_ABI32. +- +-2003-10-19 Andreas Tobler +- +- * src/powerpc/ffi_darwin.c (ffi_prep_args): Declare bytes again. +- Used when FFI_DEBUG = 1. +- +-2003-10-14 Alan Modra +- +- * src/types.c (double, longdouble): Default POWERPC64 to 8 byte size +- and align. +- +-2003-10-06 Rainer Orth +- +- * include/ffi_mips.h: Define FFI_MIPS_N32 for N32/N64 ABIs, +- FFI_MIPS_O32 for O32 ABI. +- +-2003-10-01 Andreas Tobler +- +- * testsuite/lib/libffi-dg.exp: Set LD_LIBRARY_PATH_64 for +- SPARC64. Cleanup whitespaces. +- +-2003-09-19 Andreas Tobler +- +- * testsuite/libffi.call/closure_fn0.c: Xfail mips, arm, +- strongarm, xscale. Cleanup whitespaces. +- * testsuite/libffi.call/closure_fn1.c: Likewise. +- * testsuite/libffi.call/closure_fn2.c: Likewise. +- * testsuite/libffi.call/closure_fn3.c: Likewise. +- * testsuite/libffi.call/cls_12byte.c: Likewise. +- * testsuite/libffi.call/cls_16byte.c: Likewise. +- * testsuite/libffi.call/cls_1_1byte.c: Likewise. +- * testsuite/libffi.call/cls_20byte.c: Likewise. +- * testsuite/libffi.call/cls_24byte.c: Likewise. +- * testsuite/libffi.call/cls_2byte.c: Likewise. +- * testsuite/libffi.call/cls_3_1byte.c: Likewise. +- * testsuite/libffi.call/cls_3byte1.c: Likewise. +- * testsuite/libffi.call/cls_3byte2.c: Likewise. +- * testsuite/libffi.call/cls_4_1byte.c: Likewise. +- * testsuite/libffi.call/cls_4byte.c: Likewise. +- * testsuite/libffi.call/cls_5byte.c: Likewise. +- * testsuite/libffi.call/cls_6byte.c: Likewise. +- * testsuite/libffi.call/cls_7byte.c: Likewise. +- * testsuite/libffi.call/cls_8byte.c: Likewise. +- * testsuite/libffi.call/cls_double.c: Likewise. +- * testsuite/libffi.call/cls_float.c: Likewise. +- * testsuite/libffi.call/cls_uchar.c: Likewise. +- * testsuite/libffi.call/cls_uint.c: Likewise. +- * testsuite/libffi.call/cls_ulonglong.c: Likewise. +- * testsuite/libffi.call/cls_ushort.c: Likewise. +- * testsuite/libffi.call/nested_struct.c: Likewise. +- * testsuite/libffi.call/nested_struct1.c: Likewise. +- * testsuite/libffi.call/problem1.c: Likewise. +- * testsuite/libffi.special/unwindtest.cc: Likewise. +- * testsuite/libffi.call/pyobjc-tc.c: Cleanup whitespaces. +- +-2003-09-18 David Edelsohn +- +- * src/powerpc/aix.S: Cleanup whitespaces. +- * src/powerpc/aix_closure.S: Likewise. +- +-2003-09-18 Andreas Tobler +- +- * src/powerpc/darwin.S: Cleanup whitespaces, comment formatting. +- * src/powerpc/darwin_closure.S: Likewise. +- * src/powerpc/ffi_darwin.c: Likewise. +- +-2003-09-18 Andreas Tobler +- David Edelsohn +- +- * src/types.c (double): Add AIX and Darwin to the right TYPEDEF. +- * src/powerpc/aix_closure.S: Remove the pointer to the outgoing +- parameter stack. +- * src/powerpc/darwin_closure.S: Likewise. +- * src/powerpc/ffi_darwin.c (ffi_prep_args): Handle structures +- according to the Darwin/AIX ABI. +- (ffi_prep_cif_machdep): Likewise. +- (ffi_closure_helper_DARWIN): Likewise. +- Remove the outgoing parameter stack logic. Simplify the evaluation +- of the different CASE types. +- (ffi_prep_clousure): Avoid the casts on lvalues. Change the branch +- statement in the trampoline code. +- +-2003-09-18 Kaz Kojima +- +- * src/sh/ffi.c (ffi_prep_args): Take account into the alignement +- for the register size. +- (ffi_closure_helper_SYSV): Handle the structure return value +- address correctly. +- (ffi_closure_helper_SYSV): Return the appropriate type when +- the registers are used for the structure return value. +- * src/sh/sysv.S (ffi_closure_SYSV): Fix the stack layout for +- the 64-bit return value. Update copyright years. +- +-2003-09-17 Rainer Orth +- +- * testsuite/lib/libffi-dg.exp (libffi_target_compile): Search in +- srcdir for ffi_mips.h. +- +-2003-09-12 Alan Modra +- +- * src/prep_cif.c (initialize_aggregate): Include tail padding in +- structure size. +- * src/powerpc/linux64_closure.S (ffi_closure_LINUX64): Correct +- placement of float result. +- * testsuite/libffi.special/unwindtest.cc (closure_test_fn1): Correct +- cast of "resp" for big-endian 64 bit machines. +- +-2003-09-11 Alan Modra +- +- * src/types.c (double, longdouble): Merge identical SH and ARM +- typedefs, and add POWERPC64. +- * src/powerpc/ffi.c (ffi_prep_args64): Correct next_arg calc for +- struct split over gpr and rest. +- (ffi_prep_cif_machdep): Correct intarg_count for structures. +- * src/powerpc/linux64.S (ffi_call_LINUX64): Fix gpr offsets. +- +-2003-09-09 Andreas Tobler +- +- * src/powerpc/ffi.c (ffi_closure_helper_SYSV) Handle struct +- passing correctly. +- +-2003-09-09 Alan Modra +- +- * configure: Regenerate. +- +-2003-09-04 Andreas Tobler +- +- * Makefile.am: Remove build rules for ffitest. +- * Makefile.in: Rebuilt. +- +-2003-09-04 Andreas Tobler +- +- * src/java_raw_api.c: Include to fix compiler warning +- about implicit declaration of abort(). +- +-2003-09-04 Andreas Tobler +- +- * Makefile.am: Add dejagnu test framework. Fixes PR other/11411. +- * Makefile.in: Rebuilt. +- * configure.in: Add dejagnu test framework. +- * configure: Rebuilt. +- +- * testsuite/Makefile.am: New file. +- * testsuite/Makefile.in: Built +- * testsuite/lib/libffi-dg.exp: New file. +- * testsuite/config/default.exp: Likewise. +- * testsuite/libffi.call/call.exp: Likewise. +- * testsuite/libffi.call/ffitest.h: Likewise. +- * testsuite/libffi.call/closure_fn0.c: Likewise. +- * testsuite/libffi.call/closure_fn1.c: Likewise. +- * testsuite/libffi.call/closure_fn2.c: Likewise. +- * testsuite/libffi.call/closure_fn3.c: Likewise. +- * testsuite/libffi.call/cls_1_1byte.c: Likewise. +- * testsuite/libffi.call/cls_3_1byte.c: Likewise. +- * testsuite/libffi.call/cls_4_1byte.c: Likewise. +- * testsuite/libffi.call/cls_2byte.c: Likewise. +- * testsuite/libffi.call/cls_3byte1.c: Likewise. +- * testsuite/libffi.call/cls_3byte2.c: Likewise. +- * testsuite/libffi.call/cls_4byte.c: Likewise. +- * testsuite/libffi.call/cls_5byte.c: Likewise. +- * testsuite/libffi.call/cls_6byte.c: Likewise. +- * testsuite/libffi.call/cls_7byte.c: Likewise. +- * testsuite/libffi.call/cls_8byte.c: Likewise. +- * testsuite/libffi.call/cls_12byte.c: Likewise. +- * testsuite/libffi.call/cls_16byte.c: Likewise. +- * testsuite/libffi.call/cls_20byte.c: Likewise. +- * testsuite/libffi.call/cls_24byte.c: Likewise. +- * testsuite/libffi.call/cls_double.c: Likewise. +- * testsuite/libffi.call/cls_float.c: Likewise. +- * testsuite/libffi.call/cls_uchar.c: Likewise. +- * testsuite/libffi.call/cls_uint.c: Likewise. +- * testsuite/libffi.call/cls_ulonglong.c: Likewise. +- * testsuite/libffi.call/cls_ushort.c: Likewise. +- * testsuite/libffi.call/float.c: Likewise. +- * testsuite/libffi.call/float1.c: Likewise. +- * testsuite/libffi.call/float2.c: Likewise. +- * testsuite/libffi.call/many.c: Likewise. +- * testsuite/libffi.call/many_win32.c: Likewise. +- * testsuite/libffi.call/nested_struct.c: Likewise. +- * testsuite/libffi.call/nested_struct1.c: Likewise. +- * testsuite/libffi.call/pyobjc-tc.c: Likewise. +- * testsuite/libffi.call/problem1.c: Likewise. +- * testsuite/libffi.call/promotion.c: Likewise. +- * testsuite/libffi.call/return_ll.c: Likewise. +- * testsuite/libffi.call/return_sc.c: Likewise. +- * testsuite/libffi.call/return_uc.c: Likewise. +- * testsuite/libffi.call/strlen.c: Likewise. +- * testsuite/libffi.call/strlen_win32.c: Likewise. +- * testsuite/libffi.call/struct1.c: Likewise. +- * testsuite/libffi.call/struct2.c: Likewise. +- * testsuite/libffi.call/struct3.c: Likewise. +- * testsuite/libffi.call/struct4.c: Likewise. +- * testsuite/libffi.call/struct5.c: Likewise. +- * testsuite/libffi.call/struct6.c: Likewise. +- * testsuite/libffi.call/struct7.c: Likewise. +- * testsuite/libffi.call/struct8.c: Likewise. +- * testsuite/libffi.call/struct9.c: Likewise. +- * testsuite/libffi.special/special.exp: New file. +- * testsuite/libffi.special/ffitestcxx.h: Likewise. +- * testsuite/libffi.special/unwindtest.cc: Likewise. +- +- +-2003-08-13 Kaz Kojima +- +- * src/sh/ffi.c (OFS_INT16): Set 0 for little endian case. Update +- copyright years. +- +-2003-08-02 Alan Modra +- +- * src/powerpc/ffi.c (ffi_prep_args64): Modify for changed gcc +- structure passing. +- (ffi_closure_helper_LINUX64): Likewise. +- * src/powerpc/linux64.S: Remove code writing to parm save area. +- * src/powerpc/linux64_closure.S (ffi_closure_LINUX64): Use return +- address in lr from ffi_closure_helper_LINUX64 call to calculate +- table address. Optimize function tail. +- +-2003-07-28 Andreas Tobler +- +- * src/sparc/ffi.c: Handle all floating point registers. +- * src/sparc/v9.S: Likewise. Fixes second part of PR target/11410. +- +-2003-07-11 Gerald Pfeifer +- +- * README: Note that libffi is not part of GCC. Update the project +- URL and status. +- +-2003-06-19 Franz Sirl +- +- * src/powerpc/ppc_closure.S: Include ffi.h. +- +-2003-06-13 Rainer Orth +- +- * src/x86/sysv.S: Avoid gas-only .uleb128/.sleb128 directives. +- Use C style comments. +- +-2003-06-13 Kaz Kojima +- +- * Makefile.am: Add SHmedia support. Fix a typo of SH support. +- * Makefile.in: Regenerate. +- * configure.in (sh64-*-linux*, sh5*-*-linux*): Add target. +- * configure: Regenerate. +- * include/ffi.h.in: Add SHmedia support. +- * src/sh64/ffi.c: New file. +- * src/sh64/sysv.S: New file. +- +-2003-05-16 Jakub Jelinek +- +- * configure.in (HAVE_RO_EH_FRAME): Check whether .eh_frame section +- should be read-only. +- * configure: Rebuilt. +- * fficonfig.h.in: Rebuilt. +- * include/ffi.h.in (EH_FRAME_FLAGS): Define. +- * src/alpha/osf.S: Use EH_FRAME_FLAGS. +- * src/powerpc/linux64.S: Likewise. +- * src/powerpc/linux64_closure.S: Likewise. Include ffi.h. +- * src/powerpc/sysv.S: Use EH_FRAME_FLAGS. Use pcrel encoding +- if -fpic/-fPIC/-mrelocatable. +- * src/powerpc/powerpc_closure.S: Likewise. +- * src/sparc/v8.S: If HAVE_RO_EH_FRAME is defined, don't include +- #write in .eh_frame flags. +- * src/sparc/v9.S: Likewise. +- * src/x86/unix64.S: Use EH_FRAME_FLAGS. +- * src/x86/sysv.S: Likewise. Use pcrel encoding if -fpic/-fPIC. +- * src/s390/sysv.S: Use EH_FRAME_FLAGS. Include ffi.h. +- +-2003-05-07 Jeff Sturm +- +- Fixes PR bootstrap/10656 +- * configure.in (HAVE_AS_REGISTER_PSEUDO_OP): Test assembler +- support for .register pseudo-op. +- * src/sparc/v8.S: Use it. +- * fficonfig.h.in: Rebuilt. +- * configure: Rebuilt. +- +-2003-04-18 Jakub Jelinek +- +- * include/ffi.h.in (POWERPC64): Define if 64-bit. +- (enum ffi_abi): Add FFI_LINUX64 on POWERPC. +- Make it the default on POWERPC64. +- (FFI_TRAMPOLINE_SIZE): Define to 24 on POWERPC64. +- * configure.in: Change powerpc-*-linux* into powerpc*-*-linux*. +- * configure: Rebuilt. +- * src/powerpc/ffi.c (hidden): Define. +- (ffi_prep_args_SYSV): Renamed from +- ffi_prep_args. Cast pointers to unsigned long to shut up warnings. +- (NUM_GPR_ARG_REGISTERS64, NUM_FPR_ARG_REGISTERS64, +- ASM_NEEDS_REGISTERS64): New. +- (ffi_prep_args64): New function. +- (ffi_prep_cif_machdep): Handle FFI_LINUX64 ABI. +- (ffi_call): Likewise. +- (ffi_prep_closure): Likewise. +- (flush_icache): Surround by #ifndef POWERPC64. +- (ffi_dblfl): New union type. +- (ffi_closure_helper_SYSV): Use it to avoid aliasing problems. +- (ffi_closure_helper_LINUX64): New function. +- * src/powerpc/ppc_closure.S: Surround whole file by #ifndef +- __powerpc64__. +- * src/powerpc/sysv.S: Likewise. +- (ffi_call_SYSV): Rename ffi_prep_args to ffi_prep_args_SYSV. +- * src/powerpc/linux64.S: New file. +- * src/powerpc/linux64_closure.S: New file. +- * Makefile.am (EXTRA_DIST): Add src/powerpc/linux64.S and +- src/powerpc/linux64_closure.S. +- (TARGET_SRC_POWERPC): Likewise. +- +- * src/ffitest.c (closure_test_fn, closure_test_fn1, closure_test_fn2, +- closure_test_fn3): Fix result printing on big-endian 64-bit +- machines. +- (main): Print tst2_arg instead of uninitialized tst2_result. +- +- * src/ffitest.c (main): Hide what closure pointer really points to +- from the compiler. +- +-2003-04-16 Richard Earnshaw +- +- * configure.in (arm-*-netbsdelf*): Add configuration. +- (configure): Regenerated. +- +-2003-04-04 Loren J. Rittle +- +- * include/Makefile.in: Regenerate. +- +-2003-03-21 Zdenek Dvorak +- +- * libffi/include/ffi.h.in: Define X86 instead of X86_64 in 32 +- bit mode. +- * libffi/src/x86/ffi.c (ffi_closure_SYSV, ffi_closure_raw_SYSV): +- Receive closure pointer through parameter, read args using +- __builtin_dwarf_cfa. +- (FFI_INIT_TRAMPOLINE): Send closure reference through eax. +- +-2003-03-12 Andreas Schwab +- +- * configure.in: Avoid trailing /. in toolexeclibdir. +- * configure: Rebuilt. +- +-2003-03-03 Andreas Tobler +- +- * src/powerpc/darwin_closure.S: Recode to fit dynamic libraries. +- +-2003-02-06 Andreas Tobler +- +- * libffi/src/powerpc/darwin_closure.S: +- Fix alignement bug, allocate 8 bytes for the result. +- * libffi/src/powerpc/aix_closure.S: +- Likewise. +- * libffi/src/powerpc/ffi_darwin.c: +- Update stackframe description for aix/darwin_closure.S. +- +-2003-02-06 Jakub Jelinek +- +- * src/s390/ffi.c (ffi_closure_helper_SYSV): Add hidden visibility +- attribute. +- +-2003-01-31 Christian Cornelssen , +- Andreas Schwab +- +- * configure.in: Adjust command to source config-ml.in to account +- for changes to the libffi_basedir definition. +- (libffi_basedir): Remove ${srcdir} from value and include trailing +- slash if nonempty. +- +- * configure: Regenerate. +- +-2003-01-29 Franz Sirl +- +- * src/powerpc/ppc_closure.S: Recode to fit shared libs. +- +-2003-01-28 Andrew Haley +- +- * include/ffi.h.in: Enable FFI_CLOSURES for x86_64. +- * src/x86/ffi64.c (ffi_prep_closure): New. +- (ffi_closure_UNIX64_inner): New. +- * src/x86/unix64.S (ffi_closure_UNIX64): New. +- +-2003-01-27 Alexandre Oliva +- +- * configure.in (toolexecdir, toolexeclibdir): Set and AC_SUBST. +- Remove USE_LIBDIR conditional. +- * Makefile.am (toolexecdir, toolexeclibdir): Don't override. +- * Makefile.in, configure: Rebuilt. +- +-2003-01027 David Edelsohn +- +- * Makefile.am (TARGET_SRC_POWERPC_AIX): Fix typo. +- * Makefile.in: Regenerate. +- +-2003-01-22 Andrew Haley +- +- * src/powerpc/darwin.S (_ffi_call_AIX): Add Augmentation size to +- unwind info. +- +-2003-01-21 Andreas Tobler +- +- * src/powerpc/darwin.S: Add unwind info. +- * src/powerpc/darwin_closure.S: Likewise. +- +-2003-01-14 Andrew Haley +- +- * src/x86/ffi64.c (ffi_prep_args): Check for void retval. +- (ffi_prep_cif_machdep): Likewise. +- * src/x86/unix64.S: Add unwind info. +- +-2003-01-14 Andreas Jaeger +- +- * src/ffitest.c (main): Only use ffi_closures if those are +- supported. +- +-2003-01-13 Andreas Tobler +- +- * libffi/src/ffitest.c +- add closure testcases +- +-2003-01-13 Kevin B. Hendricks +- +- * libffi/src/powerpc/ffi.c +- fix alignment bug for float (4 byte aligned iso 8 byte) +- +-2003-01-09 Geoffrey Keating +- +- * src/powerpc/ffi_darwin.c: Remove RCS version string. +- * src/powerpc/darwin.S: Remove RCS version string. +- +-2003-01-03 Jeff Sturm +- +- * include/ffi.h.in: Add closure defines for SPARC, SPARC64. +- * src/ffitest.c (main): Use static storage for closure. +- * src/sparc/ffi.c (ffi_prep_closure, ffi_closure_sparc_inner): New. +- * src/sparc/v8.S (ffi_closure_v8): New. +- * src/sparc/v9.S (ffi_closure_v9): New. +- +-2002-11-10 Ranjit Mathew +- +- * include/ffi.h.in: Added FFI_STDCALL ffi_type +- enumeration for X86_WIN32. +- * src/x86/win32.S: Added ffi_call_STDCALL function +- definition. +- * src/x86/ffi.c (ffi_call/ffi_raw_call): Added +- switch cases for recognising FFI_STDCALL and +- calling ffi_call_STDCALL if target is X86_WIN32. +- * src/ffitest.c (my_stdcall_strlen/stdcall_many): +- stdcall versions of the "my_strlen" and "many" +- test functions (for X86_WIN32). +- Added test cases to test stdcall invocation using +- these functions. +- +-2002-12-02 Kaz Kojima +- +- * src/sh/sysv.S: Add DWARF2 unwind info. +- +-2002-11-27 Ulrich Weigand +- +- * src/s390/sysv.S (.eh_frame section): Make section read-only. +- +-2002-11-26 Jim Wilson +- +- * src/types.c (FFI_TYPE_POINTER): Has size 8 on IA64. +- +-2002-11-23 H.J. Lu +- +- * acinclude.m4: Add dummy AM_PROG_LIBTOOL. +- Include ../config/accross.m4. +- * aclocal.m4; Rebuild. +- * configure: Likewise. +- +-2002-11-15 Ulrich Weigand +- +- * src/s390/sysv.S (.eh_frame section): Adapt to pcrel FDE encoding. +- +-2002-11-11 DJ Delorie +- +- * configure.in: Look for common files in the right place. +- +-2002-10-08 Ulrich Weigand +- +- * src/java_raw_api.c (ffi_java_raw_to_ptrarray): Interpret +- raw data as _Jv_word values, not ffi_raw. +- (ffi_java_ptrarray_to_raw): Likewise. +- (ffi_java_rvalue_to_raw): New function. +- (ffi_java_raw_call): Call it. +- (ffi_java_raw_to_rvalue): New function. +- (ffi_java_translate_args): Call it. +- * src/ffitest.c (closure_test_fn): Interpret return value +- as ffi_arg, not int. +- * src/s390/ffi.c (ffi_prep_cif_machdep): Add missing +- FFI_TYPE_POINTER case. +- (ffi_closure_helper_SYSV): Likewise. Also, assume return +- values extended to word size. +- +-2002-10-02 Andreas Jaeger +- +- * src/x86/ffi64.c (ffi_prep_cif_machdep): Remove debug output. +- +-2002-10-01 Bo Thorsen +- +- * include/ffi.h.in: Fix i386 win32 compilation. +- +-2002-09-30 Ulrich Weigand +- +- * configure.in: Add s390x-*-linux-* target. +- * configure: Regenerate. +- * include/ffi.h.in: Define S390X for s390x targets. +- (FFI_CLOSURES): Define for s390/s390x. +- (FFI_TRAMPOLINE_SIZE): Likewise. +- (FFI_NATIVE_RAW_API): Likewise. +- * src/prep_cif.c (ffi_prep_cif): Do not compute stack space for s390. +- * src/types.c (FFI_TYPE_POINTER): Use 8-byte pointers on s390x. +- * src/s390/ffi.c: Major rework of existing code. Add support for +- s390x targets. Add closure support. +- * src/s390/sysv.S: Likewise. +- +-2002-09-29 Richard Earnshaw +- +- * src/arm/sysv.S: Fix typo. +- +-2002-09-28 Richard Earnshaw +- +- * src/arm/sysv.S: If we don't have machine/asm.h and the pre-processor +- has defined __USER_LABEL_PREFIX__, then use it in CNAME. +- (ffi_call_SYSV): Handle soft-float. +- +-2002-09-27 Bo Thorsen +- +- * include/ffi.h.in: Fix multilib x86-64 support. +- +-2002-09-22 Kaveh R. Ghazi +- +- * Makefile.am (all-multi): Fix multilib parallel build. +- +-2002-07-19 Kaz Kojima +- +- * configure.in (sh[34]*-*-linux*): Add brackets. +- * configure: Regenerate. +- +-2002-07-18 Kaz Kojima +- +- * Makefile.am: Add SH support. +- * Makefile.in: Regenerate. +- * configure.in (sh-*-linux*, sh[34]*-*-linux*): Add target. +- * configure: Regenerate. +- * include/ffi.h.in: Add SH support. +- * src/sh/ffi.c: New file. +- * src/sh/sysv.S: New file. +- * src/types.c: Add SH support. +- +-2002-07-16 Bo Thorsen +- +- * src/x86/ffi64.c: New file that adds x86-64 support. +- * src/x86/unix64.S: New file that handles argument setup for +- x86-64. +- * src/x86/sysv.S: Don't use this on x86-64. +- * src/x86/ffi.c: Don't use this on x86-64. +- Remove unused vars. +- * src/prep_cif.c (ffi_prep_cif): Don't do stack size calculation +- for x86-64. +- * src/ffitest.c (struct6): New test that tests a special case in +- the x86-64 ABI. +- (struct7): Likewise. +- (struct8): Likewise. +- (struct9): Likewise. +- (closure_test_fn): Silence warning about this when it's not used. +- (main): Add the new tests. +- (main): Fix a couple of wrong casts and silence some compiler warnings. +- * include/ffi.h.in: Add x86-64 ABI definition. +- * fficonfig.h.in: Regenerate. +- * Makefile.am: Add x86-64 support. +- * configure.in: Likewise. +- * Makefile.in: Regenerate. +- * configure: Likewise. +- +-2002-06-24 Bo Thorsen +- +- * src/types.c: Merge settings for similar architectures. +- Add x86-64 sizes and alignments. +- +-2002-06-23 Bo Thorsen +- +- * src/arm/ffi.c (ffi_prep_args): Remove unused vars. +- * src/sparc/ffi.c (ffi_prep_args_v8): Likewise. +- * src/mips/ffi.c (ffi_prep_args): Likewise. +- * src/m68k/ffi.c (ffi_prep_args): Likewise. +- +-2002-07-18 H.J. Lu (hjl@gnu.org) +- +- * Makefile.am (TARGET_SRC_MIPS_LINUX): New. +- (libffi_la_SOURCES): Support MIPS_LINUX. +- (libffi_convenience_la_SOURCES): Likewise. +- * Makefile.in: Regenerated. +- +- * configure.in (mips64*-*): Skip. +- (mips*-*-linux*): New. +- * configure: Regenerated. +- +- * src/mips/ffi.c: Include . +- +-2002-06-06 Ulrich Weigand +- +- * src/s390/sysv.S: Save/restore %r6. Add DWARF-2 unwind info. +- +-2002-05-27 Roger Sayle +- +- * src/x86/ffi.c (ffi_prep_args): Remove reference to avn. +- +-2002-05-27 Bo Thorsen +- +- * src/x86/ffi.c (ffi_prep_args): Remove unused variable and +- fix formatting. +- +-2002-05-13 Andreas Tobler +- +- * src/powerpc/ffi_darwin.c (ffi_prep_closure): Declare fd at +- beginning of function (for older apple cc). +- +-2002-05-08 Alexandre Oliva +- +- * configure.in (ORIGINAL_LD_FOR_MULTILIBS): Preserve LD at +- script entry, and set LD to it when configuring multilibs. +- * configure: Rebuilt. +- +-2002-05-05 Jason Thorpe +- +- * configure.in (sparc64-*-netbsd*): Add target. +- (sparc-*-netbsdelf*): Likewise. +- * configure: Regenerate. +- +-2002-04-28 David S. Miller +- +- * configure.in, configure: Fix SPARC test in previous change. +- +-2002-04-29 Gerhard Tonn +- +- * Makefile.am: Add Linux for S/390 support. +- * Makefile.in: Regenerate. +- * configure.in: Add Linux for S/390 support. +- * configure: Regenerate. +- * include/ffi.h.in: Add Linux for S/390 support. +- * src/s390/ffi.c: New file from libffi CVS tree. +- * src/s390/sysv.S: New file from libffi CVS tree. +- +-2002-04-28 Jakub Jelinek +- +- * configure.in (HAVE_AS_SPARC_UA_PCREL): Check for working +- %r_disp32(). +- * src/sparc/v8.S: Use it. +- * src/sparc/v9.S: Likewise. +- * fficonfig.h.in: Rebuilt. +- * configure: Rebuilt. +- +-2002-04-08 Hans Boehm +- +- * src/java_raw_api.c (ffi_java_raw_size): Handle FFI_TYPE_DOUBLE +- correctly. +- * src/ia64/unix.S: Add unwind information. Fix comments. +- Save sp in a way that's compatible with unwind info. +- (ffi_call_unix): Correctly restore sp in all cases. +- * src/ia64/ffi.c: Add, fix comments. +- +-2002-04-08 Jakub Jelinek +- +- * src/sparc/v8.S: Make .eh_frame dependent on target word size. +- +-2002-04-06 Jason Thorpe +- +- * configure.in (alpha*-*-netbsd*): Add target. +- * configure: Regenerate. +- +-2002-04-04 Jeff Sturm +- +- * src/sparc/v8.S: Add unwind info. +- * src/sparc/v9.S: Likewise. +- +-2002-03-30 Krister Walfridsson +- +- * configure.in: Enable i*86-*-netbsdelf*. +- * configure: Rebuilt. +- +-2002-03-29 David Billinghurst +- +- PR other/2620 +- * src/mips/n32.s: Delete +- * src/mips/o32.s: Delete +- +-2002-03-21 Loren J. Rittle +- +- * configure.in: Enable alpha*-*-freebsd*. +- * configure: Rebuilt. +- +-2002-03-17 Bryce McKinlay +- +- * Makefile.am: libfficonvenience -> libffi_convenience. +- * Makefile.in: Rebuilt. +- +- * Makefile.am: Define ffitest_OBJECTS. +- * Makefile.in: Rebuilt. +- +-2002-03-07 Andreas Tobler +- David Edelsohn +- +- * Makefile.am (EXTRA_DIST): Add Darwin and AIX closure files. +- (TARGET_SRC_POWERPC_AIX): Add aix_closure.S. +- (TARGET_SRC_POWERPC_DARWIN): Add darwin_closure.S. +- * Makefile.in: Regenerate. +- * include/ffi.h.in: Add AIX and Darwin closure definitions. +- * src/powerpc/ffi_darwin.c (ffi_prep_closure): New function. +- (flush_icache, flush_range): New functions. +- (ffi_closure_helper_DARWIN): New function. +- * src/powerpc/aix_closure.S: New file. +- * src/powerpc/darwin_closure.S: New file. +- +-2002-02-24 Jeff Sturm +- +- * include/ffi.h.in: Add typedef for ffi_arg. +- * src/ffitest.c (main): Declare rint with ffi_arg. +- +-2002-02-21 Andreas Tobler +- +- * src/powerpc/ffi_darwin.c (ffi_prep_args): Skip appropriate +- number of GPRs for floating-point arguments. +- +-2002-01-31 Anthony Green +- +- * configure: Rebuilt. +- * configure.in: Replace CHECK_SIZEOF and endian tests with +- cross-compiler friendly macros. +- * aclocal.m4 (AC_COMPILE_CHECK_SIZEOF, AC_C_BIGENDIAN_CROSS): New +- macros. +- +-2002-01-18 David Edelsohn +- +- * src/powerpc/darwin.S (_ffi_call_AIX): New. +- * src/powerpc/aix.S (ffi_call_DARWIN): New. +- +-2002-01-17 David Edelsohn +- +- * Makefile.am (EXTRA_DIST): Add Darwin and AIX files. +- (TARGET_SRC_POWERPC_AIX): New. +- (POWERPC_AIX): New stanza. +- * Makefile.in: Regenerate. +- * configure.in: Add AIX case. +- * configure: Regenerate. +- * include/ffi.h.in (ffi_abi): Add FFI_AIX. +- * src/powerpc/ffi_darwin.c (ffi_status): Use "long" to scale frame +- size. Fix "long double" support. +- (ffi_call): Add FFI_AIX case. +- * src/powerpc/aix.S: New. +- +-2001-10-09 John Hornkvist +- +- Implement Darwin PowerPC ABI. +- * configure.in: Handle powerpc-*-darwin*. +- * Makefile.am: Set source files for POWERPC_DARWIN. +- * configure: Rebuilt. +- * Makefile.in: Rebuilt. +- * include/ffi.h.in: Define FFI_DARWIN and FFI_DEFAULT_ABI for +- POWERPC_DARWIN. +- * src/powerpc/darwin.S: New file. +- * src/powerpc/ffi_darwin.c: New file. +- +-2001-10-07 Joseph S. Myers +- +- * src/x86/ffi.c: Fix spelling error of "separate" as "seperate". +- +-2001-07-16 Rainer Orth +- +- * src/x86/sysv.S: Avoid gas-only .balign directive. +- Use C style comments. +- +-2001-07-16 Rainer Orth +- +- * src/alpha/ffi.c (ffi_prep_closure): Avoid gas-only mnemonic. +- Fixes PR bootstrap/3563. +- +-2001-06-26 Rainer Orth +- +- * src/alpha/osf.S (ffi_closure_osf): Use .rdata for ECOFF. +- +-2001-06-25 Rainer Orth +- +- * configure.in: Recognize sparc*-sun-* host. +- * configure: Regenerate. +- +-2001-06-06 Andrew Haley +- +- * src/alpha/osf.S (__FRAME_BEGIN__): Conditionalize for ELF. +- +-2001-06-03 Andrew Haley +- +- * src/alpha/osf.S: Add unwind info. +- * src/powerpc/sysv.S: Add unwind info. +- * src/powerpc/ppc_closure.S: Likewise. +- +-2000-05-31 Jeff Sturm +- +- * configure.in: Fix AC_ARG_ENABLE usage. +- * configure: Rebuilt. +- +-2001-05-06 Bryce McKinlay +- +- * configure.in: Remove warning about beta code. +- * configure: Rebuilt. +- +-2001-04-25 Hans Boehm +- +- * src/ia64/unix.S: Restore stack pointer when returning from +- ffi_closure_UNIX. +- * src/ia64/ffi.c: Fix typo in comment. +- +-2001-04-18 Jim Wilson +- +- * src/ia64/unix.S: Delete unnecessary increment and decrement of loc2 +- to eliminate RAW DV. +- +-2001-04-12 Bryce McKinlay +- +- * Makefile.am: Make a libtool convenience library. +- * Makefile.in: Rebuilt. +- +-2001-03-29 Bryce McKinlay +- +- * configure.in: Use different syntax for subdirectory creation. +- * configure: Rebuilt. +- +-2001-03-27 Jon Beniston +- +- * configure.in: Added X86_WIN32 target (Win32, CygWin, MingW). +- * configure: Rebuilt. +- * Makefile.am: Added X86_WIN32 target support. +- * Makefile.in: Rebuilt. +- +- * include/ffi.h.in: Added X86_WIN32 target support. +- +- * src/ffitest.c: Doesn't run structure tests for X86_WIN32 targets. +- * src/types.c: Added X86_WIN32 target support. +- +- * src/x86/win32.S: New file. Based on sysv.S, but with EH +- stuff removed and made to work with CygWin's gas. +- +-2001-03-26 Bryce McKinlay +- +- * configure.in: Make target subdirectory in build dir. +- * Makefile.am: Override suffix based rules to specify correct output +- subdirectory. +- * Makefile.in: Rebuilt. +- * configure: Rebuilt. +- +-2001-03-23 Kevin B Hendricks +- +- * src/powerpc/ppc_closure.S: New file. +- * src/powerpc/ffi.c (ffi_prep_args): Fixed ABI compatibility bug +- involving long long and register pairs. +- (ffi_prep_closure): New function. +- (flush_icache): Likewise. +- (ffi_closure_helper_SYSV): Likewise. +- * include/ffi.h.in (FFI_CLOSURES): Define on PPC. +- (FFI_TRAMPOLINE_SIZE): Likewise. +- (FFI_NATIVE_RAW_API): Likewise. +- * Makefile.in: Rebuilt. +- * Makefile.am (EXTRA_DIST): Added src/powerpc/ppc_closure.S. +- (TARGET_SRC_POWERPC): Likewise. +- +-2001-03-19 Tom Tromey +- +- * Makefile.in: Rebuilt. +- * Makefile.am (ffitest_LDFLAGS): New macro. +- +-2001-03-02 Nick Clifton +- +- * include/ffi.h.in: Remove RCS ident string. +- * include/ffi_mips.h: Remove RCS ident string. +- * src/debug.c: Remove RCS ident string. +- * src/ffitest.c: Remove RCS ident string. +- * src/prep_cif.c: Remove RCS ident string. +- * src/types.c: Remove RCS ident string. +- * src/alpha/ffi.c: Remove RCS ident string. +- * src/alpha/osf.S: Remove RCS ident string. +- * src/arm/ffi.c: Remove RCS ident string. +- * src/arm/sysv.S: Remove RCS ident string. +- * src/mips/ffi.c: Remove RCS ident string. +- * src/mips/n32.S: Remove RCS ident string. +- * src/mips/o32.S: Remove RCS ident string. +- * src/sparc/ffi.c: Remove RCS ident string. +- * src/sparc/v8.S: Remove RCS ident string. +- * src/sparc/v9.S: Remove RCS ident string. +- * src/x86/ffi.c: Remove RCS ident string. +- * src/x86/sysv.S: Remove RCS ident string. +- +-2001-02-08 Joseph S. Myers +- +- * include/ffi.h.in: Change sourceware.cygnus.com references to +- gcc.gnu.org. +- +-2000-12-09 Richard Henderson +- +- * src/alpha/ffi.c (ffi_call): Simplify struct return test. +- (ffi_closure_osf_inner): Index rather than increment avalue +- and arg_types. Give ffi_closure_osf the raw return value type. +- * src/alpha/osf.S (ffi_closure_osf): Handle return value type +- promotion. +- +-2000-12-07 Richard Henderson +- +- * src/raw_api.c (ffi_translate_args): Fix typo. +- (ffi_prep_closure): Likewise. +- +- * include/ffi.h.in [ALPHA]: Define FFI_CLOSURES and +- FFI_TRAMPOLINE_SIZE. +- * src/alpha/ffi.c (ffi_prep_cif_machdep): Adjust minimal +- cif->bytes for new ffi_call_osf implementation. +- (ffi_prep_args): Absorb into ... +- (ffi_call): ... here. Do all stack allocation here and +- avoid a callback function. +- (ffi_prep_closure, ffi_closure_osf_inner): New. +- * src/alpha/osf.S (ffi_call_osf): Reimplement with no callback. +- (ffi_closure_osf): New. +- +-2000-09-10 Alexandre Oliva +- +- * config.guess, config.sub, install-sh: Removed. +- * ltconfig, ltmain.sh, missing, mkinstalldirs: Likewise. +- * Makefile.in: Rebuilt. +- +- * acinclude.m4: Include libtool macros from the top level. +- * aclocal.m4, configure: Rebuilt. +- +-2000-08-22 Alexandre Oliva +- +- * configure.in [i*86-*-freebsd*] (TARGET, TARGETDIR): Set. +- * configure: Rebuilt. +- +-2000-05-11 Scott Bambrough +- +- * libffi/src/arm/sysv.S (ffi_call_SYSV): Doubles are not saved to +- memory correctly. Use conditional instructions, not branches where +- possible. +- +-2000-05-04 Tom Tromey +- +- * configure: Rebuilt. +- * configure.in: Match `arm*-*-linux-*'. +- From Chris Dornan . +- +-2000-04-28 Jakub Jelinek +- +- * Makefile.am (SUBDIRS): Define. +- (AM_MAKEFLAGS): Likewise. +- (Multilib support.): Add section. +- * Makefile.in: Rebuilt. +- * ltconfig (extra_compiler_flags, extra_compiler_flags_value): +- New variables. Set for gcc using -print-multi-lib. Export them +- to libtool. +- (sparc64-*-linux-gnu*): Use libsuff 64 for search paths. +- * ltmain.sh (B|b|V): Don't throw away gcc's -B, -b and -V options +- for -shared links. +- (extra_compiler_flags_value, extra_compiler_flags): Check these +- for extra compiler options which need to be passed down in +- compiler_flags. +- +-2000-04-16 Anthony Green +- +- * configure: Rebuilt. +- * configure.in: Change i*86-pc-linux* to i*86-*-linux*. +- +-2000-04-14 Jakub Jelinek +- +- * include/ffi.h.in (SPARC64): Define for 64bit SPARC builds. +- Set SPARC FFI_DEFAULT_ABI based on SPARC64 define. +- * src/sparc/ffi.c (ffi_prep_args_v8): Renamed from ffi_prep_args. +- Replace all void * sizeofs with sizeof(int). +- Only compare type with FFI_TYPE_LONGDOUBLE if LONGDOUBLE is +- different than DOUBLE. +- Remove FFI_TYPE_SINT32 and FFI_TYPE_UINT32 cases (handled elsewhere). +- (ffi_prep_args_v9): New function. +- (ffi_prep_cif_machdep): Handle V9 ABI and long long on V8. +- (ffi_V9_return_struct): New function. +- (ffi_call): Handle FFI_V9 ABI from 64bit code and FFI_V8 ABI from +- 32bit code (not yet cross-arch calls). +- * src/sparc/v8.S: Add struct return delay nop. +- Handle long long. +- * src/sparc/v9.S: New file. +- * src/prep_cif.c (ffi_prep_cif): Return structure pointer +- is used on sparc64 only for structures larger than 32 bytes. +- Pass by reference for structures is done for structure arguments +- larger than 16 bytes. +- * src/ffitest.c (main): Use 64bit rint on sparc64. +- Run long long tests on sparc. +- * src/types.c (FFI_TYPE_POINTER): Pointer is 64bit on alpha and +- sparc64. +- (FFI_TYPE_LONGDOUBLE): long double is 128 bit aligned to 128 bits +- on sparc64. +- * configure.in (sparc-*-linux*): New supported target. +- (sparc64-*-linux*): Likewise. +- * configure: Rebuilt. +- * Makefile.am: Add v9.S to SPARC files. +- * Makefile.in: Likewise. +- (LINK): Surround $(CCLD) into double quotes, so that multilib +- compiles work correctly. +- +-2000-04-04 Alexandre Petit-Bianco +- +- * configure: Rebuilt. +- * configure.in: (i*86-*-solaris*): New libffi target. Patch +- proposed by Bryce McKinlay. +- +-2000-03-20 Tom Tromey +- +- * Makefile.in: Hand edit for java_raw_api.lo. +- +-2000-03-08 Bryce McKinlay +- +- * config.guess, config.sub: Update from the gcc tree. +- Fix for PR libgcj/168. +- +-2000-03-03 Tom Tromey +- +- * Makefile.in: Fixed ia64 by hand. +- +- * configure: Rebuilt. +- * configure.in (--enable-multilib): New option. +- (libffi_basedir): New subst. +- (AC_OUTPUT): Added multilib code. +- +-2000-03-02 Tom Tromey +- +- * Makefile.in: Rebuilt. +- * Makefile.am (TARGET_SRC_IA64): Use `ia64', not `alpha', as +- directory name. +- +-2000-02-25 Hans Boehm +- +- * src/ia64/ffi.c, src/ia64/ia64_flags.h, src/ia64/unix.S: New +- files. +- * src/raw_api.c (ffi_translate_args): Fixed typo in argument +- list. +- (ffi_prep_raw_closure): Use ffi_translate_args, not +- ffi_closure_translate. +- * src/java_raw_api.c: New file. +- * src/ffitest.c (closure_test_fn): New function. +- (main): Define `rint' as long long on IA64. Added new test when +- FFI_CLOSURES is defined. +- * include/ffi.h.in (ALIGN): Use size_t, not unsigned. +- (ffi_abi): Recognize IA64. +- (ffi_raw): Added `flt' field. +- Added "Java raw API" code. +- * configure.in: Recognize ia64. +- * Makefile.am (TARGET_SRC_IA64): New macro. +- (libffi_la_common_SOURCES): Added java_raw_api.c. +- (libffi_la_SOURCES): Define in IA64 case. +- +-2000-01-04 Tom Tromey +- +- * Makefile.in: Rebuilt with newer automake. +- +-1999-12-31 Tom Tromey +- +- * Makefile.am (INCLUDES): Added -I$(top_srcdir)/src. +- +-1999-09-01 Tom Tromey +- +- * include/ffi.h.in: Removed PACKAGE and VERSION defines and +- undefs. +- * fficonfig.h.in: Rebuilt. +- * configure: Rebuilt. +- * configure.in: Pass 3rd argument to AM_INIT_AUTOMAKE. +- Use AM_PROG_LIBTOOL (automake 1.4 compatibility). +- * acconfig.h: Don't #undef PACKAGE or VERSION. +- +-1999-08-09 Anthony Green +- +- * include/ffi.h.in: Try to work around messy header problem +- with PACKAGE and VERSION. +- +- * configure: Rebuilt. +- * configure.in: Change version to 2.00-beta. +- +- * fficonfig.h.in: Rebuilt. +- * acconfig.h (FFI_NO_STRUCTS, FFI_NO_RAW_API): Define. +- +- * src/x86/ffi.c (ffi_raw_call): Rename. +- +-1999-08-02 Kresten Krab Thorup +- +- * src/x86/ffi.c (ffi_closure_SYSV): New function. +- (ffi_prep_incoming_args_SYSV): Ditto. +- (ffi_prep_closure): Ditto. +- (ffi_closure_raw_SYSV): Ditto. +- (ffi_prep_raw_closure): More ditto. +- (ffi_call_raw): Final ditto. +- +- * include/ffi.h.in: Add definitions for closure and raw API. +- +- * src/x86/ffi.c (ffi_prep_cif_machdep): Added case for +- FFI_TYPE_UINT64. +- +- * Makefile.am (libffi_la_common_SOURCES): Added raw_api.c +- +- * src/raw_api.c: New file. +- +- * include/ffi.h.in (ffi_raw): New type. +- (UINT_ARG, SINT_ARG): New defines. +- (ffi_closure, ffi_raw_closure): New types. +- (ffi_prep_closure, ffi_prep_raw_closure): New declarations. +- +- * configure.in: Add check for endianness and sizeof void*. +- +- * src/x86/sysv.S (ffi_call_SYSV): Call fixup routine via argument, +- instead of directly. +- +- * configure: Rebuilt. +- +-Thu Jul 8 14:28:42 1999 Anthony Green +- +- * configure.in: Add x86 and powerpc BeOS configurations. +- From Makoto Kato . +- +-1999-05-09 Anthony Green +- +- * configure.in: Add warning about this being beta code. +- Remove src/Makefile.am from the picture. +- * configure: Rebuilt. +- +- * Makefile.am: Move logic from src/Makefile.am. Add changes +- to support libffi as a target library. +- * Makefile.in: Rebuilt. +- +- * aclocal.m4, config.guess, config.sub, ltconfig, ltmain.sh: +- Upgraded to new autoconf, automake, libtool. +- +- * README: Tweaks. +- +- * LICENSE: Update copyright date. +- +- * src/Makefile.am, src/Makefile.in: Removed. +- +-1998-11-29 Anthony Green +- +- * include/ChangeLog: Removed. +- * src/ChangeLog: Removed. +- * src/mips/ChangeLog: Removed. +- * src/sparc/ChangeLog: Remboved. +- * src/x86/ChangeLog: Removed. +- +- * ChangeLog.v1: Created. ++commit 0403f332b1f478696c30d3d8a0e2f6eef24aaf88 ++Author: Anthony Green ++Date: Mon May 19 09:41:32 2014 -0400 ++ ++ Update date. Annoucing 3.1 today. ++ ++commit 94ac0c168ee7b115409121d88b25a4979446c8da ++Author: Anthony Green ++Date: Mon May 19 09:37:21 2014 -0400 ++ ++ Increment libtool library revision number ++ ++commit 57465744b6e1295d7202de5a7734df589518f1c8 ++Author: Anthony Green ++Date: Sun May 11 10:30:22 2014 -0400 ++ ++ Update to version 3.1 ++ ++commit 0c2251a42df5108b6d9ebe5fe1cf83d0bcdf660e ++Author: Anthony Green ++Date: Sun May 11 10:22:30 2014 -0400 ++ ++ Support versions of git older than 1.8.5 ++ ++commit 70c303cb88e23aaee91c87c56b108c50ab4f3c2f ++Author: Anthony Green ++Date: Sun May 11 09:56:40 2014 -0400 ++ ++ Fix testsuite for GCC 4.9.0 ++ ++commit 52b3457093ed19b2a7c5fcf243c4014c90ce6225 ++Author: Magnus Granberg ++Date: Sun May 11 09:55:28 2014 -0400 ++ ++ Check /proc/self/status for PaX status. ++ ++commit 7ba4c5d72aa440a4b21fb57e999e67c5957761da ++Author: Dominik Vogt ++Date: Sun May 11 09:52:47 2014 -0400 ++ ++ Use to get correct dir ++ ++commit 31e0d4ecff6dc2a6c75a066ee099b52a43f6ba27 ++Merge: 1c0e9a7 99909eb ++Author: Anthony Green ++Date: Wed Apr 23 19:24:47 2014 -0400 ++ ++ Merge pull request #119 from joshtriplett/fastcall-fastball ++ ++ src/x86/win32.S: Define ffi_closure_FASTCALL in the MASM section, too ++ ++commit 99909eb6184b62408d88b6b4e7ab38e84e6d0bf3 ++Author: Josh Triplett ++Date: Tue Apr 22 21:17:52 2014 -0700 ++ ++ src/x86/win32.S: Define ffi_closure_FASTCALL in the MASM section, too ++ ++commit 1c0e9a7297ced15413c2d2d5d35f6c650c4b46c9 ++Merge: 93a24f2 d369522 ++Author: Anthony Green ++Date: Mon Apr 21 12:41:56 2014 -0400 ++ ++ Merge pull request #101 from joshtriplett/fastcall-closures ++ ++ Support closures for fastcall ++ ++commit d36952273d4fafbda91ecc205fc0824f7cc65e70 ++Author: Josh Triplett ++Date: Sun Apr 20 12:03:25 2014 -0700 ++ ++ Support fastcall closures ++ ++ libffi on 32-bit x86 now supports closures for all supported ABIs. ++ Thus, rewrite the last remaining duplicated-by-ABI test (closure_stdcall ++ and closure_thiscall) to use the generic ABI_NUM/ABI_ATTR mechanism. ++ ++commit 93a24f216bcdd1018b976d697179c6d49004015a ++Merge: dd11a04 2349fec ++Author: Anthony Green ++Date: Sat Apr 12 19:38:07 2014 -0400 ++ ++ Merge pull request #80 from ueno/devel ++ ++ Fix typo in doc ++ ++commit dd11a04061cb49ce1d702545693c24eb1267d648 ++Merge: 8fa2812 03ca880 ++Author: Anthony Green ++Date: Sat Apr 12 19:37:21 2014 -0400 ++ ++ Merge pull request #86 from joshtriplett/testsuite-CC-CXX ++ ++ testsuite ignores CC parameter supplied to configure or make ++ ++commit 8fa2812355e685a42abf9a62fbc674d616b2edee ++Merge: 8a58e6b 419503f ++Author: Anthony Green ++Date: Sat Apr 12 19:32:08 2014 -0400 ++ ++ Merge pull request #116 from frida/fix/darwin-aarch64-variadic ++ ++ Fix handling of variadic calls on Darwin/AArch64 ++ ++commit 8a58e6b7805b736def197b8baf8e465a2a3f6913 ++Merge: 30b77c5 a539f7f ++Author: Anthony Green ++Date: Sat Apr 12 19:30:18 2014 -0400 ++ ++ Merge pull request #115 from frida/fix/darwin-aarch64-alignment ++ ++ Fix alignment of AArch64 assembler functions ++ ++commit 30b77c56f95c63ecd83399aafdbad7b07330f2fd ++Merge: dc33cb3 3e2b84d ++Author: Anthony Green ++Date: Sat Apr 12 19:29:13 2014 -0400 ++ ++ Merge pull request #117 from frida/fix/windows-regression ++ ++ Fix Windows regression ++ ++commit 3e2b84d295531720917bf46afc532fc6d877e3ec ++Author: Ole André Vadla Ravnås ++Date: Sat Apr 12 01:04:04 2014 +0200 ++ ++ Fix Windows regression ++ ++ Introduced by b5fed601948237037513a9b7f967c8fc6c9ff1f6. ++ ++commit 419503f409c321fe31ff59d963ef34bb913420d0 ++Author: Ole André Vadla Ravnås ++Date: Sun Apr 6 20:54:13 2014 +0200 ++ ++ Fix handling of variadic calls on Darwin/AArch64 ++ ++commit a539f7ffd6783aa11353d13265520e453c565fb4 ++Author: Ole André Vadla Ravnås ++Date: Sun Apr 6 20:53:02 2014 +0200 ++ ++ Fix alignment of AArch64 assembler functions ++ ++commit dc33cb3c998da521a960385c1269c3aef552f69f ++Merge: c860a99 b5fed60 ++Author: Anthony Green ++Date: Sat Apr 5 23:41:22 2014 -0400 ++ ++ Merge pull request #114 from joshtriplett/bounce-on-a-tiny-trampoline ++ ++ Fix ABI on 32-bit non-Windows x86: go back to trampoline size 10 ++ ++commit b5fed601948237037513a9b7f967c8fc6c9ff1f6 ++Author: Josh Triplett ++Date: Sat Apr 5 17:33:42 2014 -0700 ++ ++ Fix ABI on 32-bit non-Windows x86: go back to trampoline size 10 ++ ++ The trampoline size is part of the ABI, so it cannot change. Move the ++ logic from the stdcall and thiscall trampolines to the functions they ++ call, to reduce them both to 10 bytes. ++ ++ This drops the previously added support for raw THISCALL closures on ++ non-Windows. (Non-raw THISCALL closures still work.) ++ ++commit 03ca880081b22efab09ba72268270f83017d3d7b ++Author: Josh Triplett ++Date: Thu Mar 27 08:44:34 2014 -0700 ++ ++ README: Note the testsuite changes to respect $CC and $CXX ++ ++commit d74df8c5d8c6722ecb908da98c86cc8e2c755b84 ++Author: Josh Triplett ++Date: Thu Mar 27 00:44:12 2014 -0700 ++ ++ README: Update Windows example to set both CC and CXX ++ ++commit 7d698125b1f05173f3656a89755a2eb58813b002 ++Author: Josh Triplett ++Date: Wed Mar 26 23:17:56 2014 -0700 ++ ++ Use the proper C++ compiler to run C++ tests ++ ++ Running the C compiler with -shared-libgcc -lstdc++ does not work on ++ non-GCC compilers. ++ ++commit fa5e88f170cb37c7b2b9bb015c8c5b854ffd8a3e ++Author: Josh Triplett ++Date: Wed Mar 26 23:53:57 2014 -0700 ++ ++ .travis.yml: Make the build command more readable by splitting at && ++ ++ "script" can contain multiple commands to run in sequence. ++ ++commit 0c3824702d3d59d37f8c177d646303f546187683 ++Author: Josh Triplett ++Date: Wed Mar 26 14:51:32 2014 -0700 ++ ++ Always set CC_FOR_TARGET for dejagnu, to make the testsuite respect $CC ++ ++ This fixes cross-compilation and compilation with CC="gcc -m32". ++ ++commit 9946a92af31b30cb7760150d1f8ca6c11b01aeea ++Author: Josh Triplett ++Date: Wed Mar 26 20:18:58 2014 -0700 ++ ++ Stop looking for expect and runtest above top_builddir ++ ++ Users wishing to test hand-compiled versions of expect and runtest can ++ easily enough put them in their path or set EXPECT and RUNTEST ++ themselves. ++ ++commit acb202325215058639234efb7af1f04c1c8a1f44 ++Author: Josh Triplett ++Date: Wed Mar 26 20:18:41 2014 -0700 ++ ++ Stop setting an empty AM_RUNTESTFLAGS ++ ++commit c860a992fef5d7cd7bb0975b1632d17a9fafe007 ++Author: Anthony Green ++Date: Tue Mar 25 17:02:51 2014 -0400 ++ ++ Upgrade version to 3.1-rc1 ++ ++commit 9837073e6203048a162a226798c5d252600219ed ++Author: Anthony Green ++Date: Tue Mar 25 16:24:14 2014 -0400 ++ ++ Update copyright date and clean up README notes. ++ ++commit 18d3baa9f597b026675baa1b4e5a5eeef7577a08 ++Merge: afee537 f0c8a31 ++Author: Anthony Green ++Date: Tue Mar 25 16:12:53 2014 -0400 ++ ++ Merge pull request #108 from joshtriplett/freebsd ++ ++ [3.1 blocker] Fix FreeBSD support ++ ++commit afee53738a995e23bd2f89fd0f7b30b380566106 ++Merge: 7d24785 b2d610e ++Author: Anthony Green ++Date: Tue Mar 25 16:12:35 2014 -0400 ++ ++ Merge pull request #106 from joshtriplett/darwin-award ++ ++ [3.1 blocker] Update OS X build system to include win32.S on 32-bit ++ ++commit 7d2478568ed9f03cbf57627f449a2d2cf4d1571c ++Merge: beab5f3 56be47f ++Author: Anthony Green ++Date: Tue Mar 25 16:12:17 2014 -0400 ++ ++ Merge pull request #110 from joshtriplett/w64 ++ ++ Fix 64-bit Windows support ++ ++commit beab5f334d9ec5b8b91d1cc727d1029b40358e7e ++Merge: 28fb197 ef5890e ++Author: Anthony Green ++Date: Tue Mar 25 16:07:47 2014 -0400 ++ ++ Merge pull request #105 from joshtriplett/win32-relocations ++ ++ [3.1 blocker] win32.S needs to handle relocations/GOT ++ ++commit f0c8a31577172104049283f0a80c723084a5bd77 ++Author: Josh Triplett ++Date: Mon Mar 24 22:14:26 2014 -0700 ++ ++ Compile win32.S on FreeBSD ++ ++commit b2d610e028b5ce48d1ad7e5d0debc9c321d891b2 ++Author: Josh Triplett ++Date: Fri Mar 21 11:10:13 2014 -0700 ++ ++ Compile win32.S on 32-bit Darwin as well ++ ++commit be50b87a490e794362cb4a27ada2fbaab202adb8 ++Author: Josh Triplett ++Date: Mon Mar 24 21:44:13 2014 -0700 ++ ++ Always use configure to detect whether global symbols need underscores ++ ++ 64-bit Windows already used this check; make it universal, and use it in ++ place of an ifdef on X86_WIN32, to handle non-Windows platforms that use ++ the underscore, such as Darwin. ++ ++commit 56be47f87629e31afbcb0774aa65735f539ee972 ++Author: Josh Triplett ++Date: Mon Mar 24 21:24:53 2014 -0700 ++ ++ Fix a warning on 64-bit Windows ++ ++ When sizeof(size_t) != sizeof(unsigned), adding a size_t to cif->bytes ++ produces a "possible loss of data" warning. However, the size_t in ++ question refers to the size of a single parameter. Use a cast to avoid ++ the warning. ++ ++commit 48a8eda74aad8a21b6f26df5df08fe64c043d208 ++Author: Josh Triplett ++Date: Mon Mar 24 21:21:12 2014 -0700 ++ ++ Avoid referencing undefined ABIs on 64-bit Windows builds ++ ++ 64-bit Windows does not have FFI_STDCALL, FFI_THISCALL, or FFI_FASTCALL. ++ ++commit f0f4138f90345d7d67dfa6783a7e1c7cc30d3c6f ++Author: Josh Triplett ++Date: Sat Mar 22 10:00:53 2014 -0700 ++ ++ win32.S: Add handling for position-independent code on Darwin ++ ++ Newer versions of Darwin generate the necessary stub functions ++ automatically and just need a call instruction, but accomodating older ++ versions as well requires adding the stub. ++ ++commit ef5890ebafb7cd2fbf9acf161edb55fe1382871c ++Author: Josh Triplett ++Date: Fri Mar 21 11:01:39 2014 -0700 ++ ++ win32.S: Use shifting for multiplication rather than repeated addition ++ ++ The jump table code added a register to itself twice to multiply by 4; ++ shift the register left by 2 instead. ++ ++commit 4fca48901e7e4f53bf490ed22607b2d2d8f4bfcc ++Author: Josh Triplett ++Date: Fri Mar 21 11:00:41 2014 -0700 ++ ++ win32.S: Make the jump tables position-independent ++ ++ Now that non-Windows platforms include win32.S, it needs to support ++ building as position-independent code. This fixes build failures on ++ target platforms that do not allow text relocations. ++ ++commit 2087dcf736274286f76c69d3988fb6d7cc4fd0f5 ++Author: Josh Triplett ++Date: Fri Mar 21 10:57:06 2014 -0700 ++ ++ win32.S: Make calls to ffi_closure_SYSV_inner position-independent ++ ++ Now that non-Windows platforms include win32.S, it needs to support ++ building as position-independent code. This fixes one source of build ++ failures on target platforms that do not allow text relocations. ++ ++commit 28fb197079cf1d11da4eef7c8c243ab05590c528 ++Merge: c697472 c3dd0a1 ++Author: Anthony Green ++Date: Tue Mar 18 12:19:36 2014 -0400 ++ ++ Merge pull request #107 from rvandermeulen/msvcc ++ ++ Various compatibility fixes and improvements to msvcc.sh. ++ ++commit c3dd0a1a0245fc174361a70876e88ae24285f861 ++Author: Ryan VanderMeulen ++Date: Tue Mar 18 12:09:45 2014 -0400 ++ ++ Various compatibility fixes and improvements to msvcc.sh. ++ ++ * Don't try to mix incompatible optimization flags in debug builds. ++ * Workaround ax_cc_maxopt.m4 not supporting MSVC and change -O3 to -O2. ++ * Fix MSVC warning by properly passing linker flags to compiler. ++ * Make msvcc.sh return 1 if invalid command line options are used rather than silently eating them. ++ * Add more comments. ++ ++commit c697472fccfbb5b87b007c053cda9ef014b346b9 ++Merge: 83fd2bc e48918e ++Author: Anthony Green ++Date: Mon Mar 17 00:32:42 2014 -0400 ++ ++ Merge pull request #102 from joshtriplett/test-generic ++ ++ Add ABIs to the test matrix; unify many bits of the testsuite ++ ++commit e48918ecf876bc85d040fc50a232059c566553a8 ++Author: Josh Triplett ++Date: Sun Mar 16 20:29:27 2014 -0700 ++ ++ testsuite: Add ABIs to the test matrix; unify tests across ABIs ++ ++ This eliminates all the *_win32.c tests in favor of the tests they were ++ branched from, and expands test coverage to run many more tests on ++ stdcall, thiscall, and fastcall. ++ ++ This same mechanism also supports testing any other target that has ++ multiple ABIs. ++ ++commit 4d4d368e5a55d9443c4c53b1b70d58ab6d8c941c ++Author: Josh Triplett ++Date: Sun Mar 16 17:02:05 2014 -0700 ++ ++ testsuite: Replace ffitestcxx.h with ffitest.h ++ ++ ffitest.h contains a superset of the functionality of ffitestcxx.h; ++ make the C++ tests include ffitest.h instead, and remove ffitestcxx.h. ++ ++commit 3f97cf3413c46caf2a79f32ac9cda4620972c2d7 ++Author: Josh Triplett ++Date: Sun Mar 16 16:53:42 2014 -0700 ++ ++ testsuite: Unify the C and C++ testsuites ++ ++ These two testsuites differ only in the source file glob and a couple of ++ additional compiler options; unify the remaining bits. ++ ++commit 0d9cce8edb937bbe771a6cdd25f671edf06d2128 ++Author: Josh Triplett ++Date: Sun Mar 16 16:22:58 2014 -0700 ++ ++ testsuite: ffitest.h: Parenthesize the CHECK macro ++ ++commit 5695ec1444c5323e48fe4314f8c8f027625e67df ++Author: Josh Triplett ++Date: Sun Mar 16 16:04:58 2014 -0700 ++ ++ testsuite: Factor out a function to run a matrix of tests ++ ++ This commons up code from libffi.call/call.exp and ++ libffi.special/special.exp, unifies the optimization option matrix ++ between the two, and makes it easier to add more axes to the matrix ++ in the future. ++ ++commit dfdb02cc869855d3b68571e5f7aa77ae8c9d254a ++Author: Josh Triplett ++Date: Sun Mar 16 15:26:26 2014 -0700 ++ ++ testsuite: Introduce a __THISCALL__ compiler-specific macro ++ ++commit 83fd2bce0456224483435d4b764063f4513fd464 ++Merge: 3658a07 06ff924 ++Author: Anthony Green ++Date: Sun Mar 16 22:03:29 2014 -0400 ++ ++ Merge pull request #99 from joshtriplett/gitignore ++ ++ .gitignore: Ignore more generated files ++ ++commit 3658a0700a50d37a2fdba04fd9d79ad2f706d9f5 ++Merge: d948d0a 46c5d3c ++Author: Anthony Green ++Date: Sun Mar 16 21:37:42 2014 -0400 ++ ++ Merge pull request #100 from rvandermeulen/bug-756740 ++ ++ Change double quotes in Makefile.am to single quotes. ++ ++commit 46c5d3c30fdc2b43c076ad955078d7c5f1e75b37 ++Author: Ryan VanderMeulen ++Date: Sun Mar 16 21:16:08 2014 -0400 ++ ++ Change double quotes in Makefile.am to single quotes. ++ ++ This was originally done in PR #84, except the change was made to Makefile.in instead of Makefile.am and was therefore reverted the next time the files were regenerated. ++ ++commit 06ff924215a2f9739efa2c059dc595bc4ec1c851 ++Author: Josh Triplett ++Date: Sun Mar 16 16:19:46 2014 -0700 ++ ++ .gitignore: Ignore more generated files ++ ++ The build process generates doc/libffi.info and fficonfig.h.in, so add ++ them to .gitignore. ++ ++commit bad8948346e9b8813023a0cc78a3b6eb8d9c14c6 ++Author: Josh Triplett ++Date: Sun Mar 16 15:16:18 2014 -0700 ++ ++ testsuite: Introduce a __STDCALL__ compiler-specific macro ++ ++ Several tests want to use stdcall, which differs in syntax by compiler, ++ so introduce a macro for it in ffitest.h. ++ ++commit 98a793fa36a4ab3ba24d059cb80a2891cdb940e1 ++Author: Josh Triplett ++Date: Sun Mar 16 15:20:36 2014 -0700 ++ ++ testsuite: Common up the ifdef blocks for compiler-specific macros ++ ++commit d948d0a729c934b0224749338a3ba0a2c8f51c45 ++Merge: b61b472 a86bd31 ++Author: Anthony Green ++Date: Sun Mar 16 10:53:48 2014 -0400 ++ ++ Merge pull request #98 from joshtriplett/unconfigure.host ++ ++ Merge configure.host into configure.ac ++ ++commit a86bd318e2424d879d784ee7b29d6536d7a17c18 ++Author: Josh Triplett ++Date: Sun Mar 16 06:58:59 2014 -0700 ++ ++ Merge configure.host into configure.ac ++ ++ configure.host only has a single entry, and shows no signs of needing ++ more added. ++ ++commit b61b472bd0647006d6685238721002017f1d119c ++Author: Anthony Green ++Date: Sun Mar 16 09:45:55 2014 -0400 ++ ++ Update version to 3.1-rc0. Clean up README. ++ ++commit 7a64e7dbba54e6e9f69954adfb943be1856ff928 ++Merge: 11a5c5c eef2e02 ++Author: Anthony Green ++Date: Sun Mar 16 09:39:08 2014 -0400 ++ ++ Merge pull request #97 from joshtriplett/remove-more-generated-files ++ ++ Remove more generated files ++ ++commit 11a5c5c39f5861011f6c5ddf795da3a32b5f0082 ++Merge: 9a62a21 1c68c07 ++Author: Anthony Green ++Date: Sun Mar 16 09:38:47 2014 -0400 ++ ++ Merge pull request #96 from joshtriplett/sawing-changelogs ++ ++ Generate ChangeLog from git in make dist; remove it from version control ++ ++commit eef2e02a13d7d1c8145d47a64467f654406a3548 ++Author: Josh Triplett ++Date: Sun Mar 16 06:26:03 2014 -0700 ++ ++ doc: Remove autogenerated info file and stamp ++ ++commit 9fb403d3c5d9643e0f561cab6d4a07b1e54907ff ++Author: Josh Triplett ++Date: Sun Mar 16 06:25:52 2014 -0700 ++ ++ fficonfig.h.in: Remove, configure generates it ++ ++commit 1c68c07217fda78a779778c1480fedef7a58d5b4 ++Author: Josh Triplett ++Date: Sun Mar 16 06:11:58 2014 -0700 ++ ++ Generate ChangeLog from git in make dist ++ ++ Archive the existing ChangeLog to ChangeLog.libffi-3.1 ++ ++commit c65ed55e655711e008282edbdd82ce95d008b4f6 ++Author: Josh Triplett ++Date: Sun Mar 16 05:52:00 2014 -0700 ++ ++ ChangeLog.v1: Fix typo in explanatory header. ++ ++commit 9a62a21f5c3a8e1da463229f3170c8ab3031d920 ++Author: Anthony Green ++Date: Sun Mar 16 09:03:57 2014 -0400 ++ ++ Add missing ChangeLog entry. Clean up some entries. ++ ++commit 9bc704c58cb7a049d867837e3a11e2e31886ec66 ++Merge: 694447a e892e58 ++Author: Anthony Green ++Date: Sun Mar 16 08:41:00 2014 -0400 ++ ++ Merge pull request #95 from joshtriplett/news ++ ++ README: Update news for 3.0.14 ++ ++commit e892e581d1838a06c18c7ecd50ebd79915cff92b ++Author: Josh Triplett ++Date: Sun Mar 16 05:38:24 2014 -0700 ++ ++ README: Update news for 3.0.14 ++ ++commit 694447aa29deadd571efb4e9a26ee3f68ede1493 ++Merge: fdc87f3 45a6c21 ++Author: Anthony Green ++Date: Sun Mar 16 08:32:05 2014 -0400 ++ ++ Merge pull request #93 from joshtriplett/travis-dist ++ ++ Make Travis check "make dist" ++ ++commit 45a6c21efa944b520842e631dc54919b04884744 ++Author: Josh Triplett ++Date: Sun Mar 16 05:29:08 2014 -0700 ++ ++ .travis.yml: Test "make dist" too. ++ ++commit fdc87f3b2ea37b58a4a9ae6c35083f544909fe3c ++Merge: 7412b83 e1911f7 ++Author: Anthony Green ++Date: Sun Mar 16 08:05:51 2014 -0400 ++ ++ Merge pull request #85 from joshtriplett/stdcall ++ ++ stdcall support on Linux ++ ++commit e1911f78df113ca58738b66089a070d4cf747de7 ++Author: Josh Triplett ++Date: Sun Mar 16 03:25:53 2014 -0700 ++ ++ Add support for stdcall, thiscall, and fastcall on non-Windows x86-32 ++ ++ Linux supports the stdcall calling convention, either via functions ++ explicitly declared with the stdcall attribute, or via code compiled ++ with -mrtd which effectively makes stdcall the default. ++ ++ This introduces FFI_STDCALL, FFI_THISCALL, and FFI_FASTCALL on ++ non-Windows x86-32 platforms, as non-default calling conventions. ++ ++commit 7412b838d543aae4fa925862bd5702d3dacbc29a ++Merge: c0cc5fd 9531d05 ++Author: Anthony Green ++Date: Sun Mar 16 07:58:16 2014 -0400 ++ ++ Merge pull request #90 from joshtriplett/win32-unifdef ++ ++ prep_cif.c: Remove unnecessary ifdef for X86_WIN32 ++ ++commit c0cc5fdaa237b67e86f22d2f6e13f3b42d9aae33 ++Merge: 98b5296 b3a5da0 ++Author: Anthony Green ++Date: Sun Mar 16 07:57:59 2014 -0400 ++ ++ Merge pull request #89 from joshtriplett/travis32 ++ ++ .travis.yml: Test on both 32-bit and 64-bit ++ ++commit 9531d05f64c2a674e0197158ffad68d69f177bd0 ++Author: Josh Triplett ++Date: Sun Mar 16 01:50:02 2014 -0700 ++ ++ prep_cif.c: Remove unnecessary ifdef for X86_WIN32 ++ ++ ffi_prep_cif_core had a special case for X86_WIN32, checking for ++ FFI_THISCALL in addition to the FFI_FIRST_ABI-to-FFI_LAST_ABI range ++ before returning FFI_BAD_ABI. However, on X86_WIN32, FFI_THISCALL ++ already falls in that range, making the special case unnecessary. ++ Remove it. ++ ++commit b3a5da068abd2f2983d9e67adbf41b0e0f34e37f ++Author: Josh Triplett ++Date: Sat Mar 15 23:27:56 2014 -0700 ++ ++ .travis.yml: Test on both 32-bit and 64-bit ++ ++commit 98b52960485a261399f081915f36063de3854a5f ++Merge: 134ce4c f6dd184 ++Author: Anthony Green ++Date: Sun Mar 16 07:51:33 2014 -0400 ++ ++ Merge pull request #94 from joshtriplett/esp-extra-stackery-perception ++ ++ ChangeLog: Document testsuite changes to remove fragile stack pointer checks ++ ++commit f6dd1845434dd53e22129becdfa092c082df307c ++Author: Josh Triplett ++Date: Sun Mar 16 04:49:36 2014 -0700 ++ ++ ChangeLog: Document testsuite changes to remove fragile stack pointer checks ++ ++commit 134ce4c0266bf994f07518fc534de53f1d3c8de8 ++Merge: 2680e9e 9c27932 ++Author: Anthony Green ++Date: Sun Mar 16 07:47:17 2014 -0400 ++ ++ Merge pull request #91 from joshtriplett/esp-extra-stackery-perception ++ ++ testsuite: Remove fragile stack pointer checks ++ ++commit 9c279328ee12fc869adff63ca81f1230977bd42b ++Author: Josh Triplett ++Date: Sun Mar 16 02:31:19 2014 -0700 ++ ++ testsuite: Remove fragile stack pointer checks ++ ++ testsuite/libffi.call/closure_stdcall.c and ++ testsuite/libffi.call/closure_thiscall.c include inline assembly to save ++ the stack pointer before and after the call, and compare the values. ++ However, compilers can and do leave the stack in different states for ++ these two pieces of inline assembly, such as by saving a temporary value ++ on the stack across the call; observed with gcc -Os, and verified as ++ spurious through careful inspection of disassembly. ++ ++commit 2680e9ea9b4c87ea8042a61e551bd667493d4bd3 ++Merge: 071eab3 82f8cb2 ++Author: Anthony Green ++Date: Sun Mar 16 07:44:08 2014 -0400 ++ ++ Merge pull request #88 from joshtriplett/such-precision-many-fail-wow ++ ++ testsuite/libffi.call/many.c: Avoid spurious failure due to excess precision ++ ++commit 82f8cb24a1d976db35ae31a4b86cec8926da327d ++Author: Josh Triplett ++Date: Sun Mar 16 04:27:32 2014 -0700 ++ ++ ChangeLog: Document many.c and many_win32.c changes to avoid spurious failures ++ ++commit 88d562a8b5912e99306063fe3bc289bab6ca6ebe ++Author: Josh Triplett ++Date: Sat Mar 15 22:08:19 2014 -0700 ++ ++ testsuite/libffi.call/many_win32.c: Avoid spurious failure due to excess precision ++ ++ The test case testsuite/libffi.call/many_win32.c can spuriously fail due ++ to excess floating-point precision. Instrumenting it with some printf ++ calls shows differences well above FLT_EPSILON. (Note when ++ instrumenting it that multiple computations of the difference, such as ++ one in a print and another in the conditional, may produce different ++ results.) ++ ++ Rather than complicating the test suite with architecture-specific flags ++ to avoid excess precision, just simplify the floating-point computation ++ to avoid a dependency on potential excess precision. ++ ++commit c00a49ecd165b2d06c1c9b249d212dc843fa116f ++Author: Josh Triplett ++Date: Sat Mar 15 22:08:19 2014 -0700 ++ ++ testsuite/libffi.call/many.c: Avoid spurious failure due to excess precision ++ ++ The test case testsuite/libffi.call/many.c can spuriously fail due to ++ excess floating-point precision. Instrumenting it with some printf ++ calls shows differences well above FLT_EPSILON. (Note when ++ instrumenting it that multiple computations of the difference, such as ++ one in a print and another in the conditional, may produce different ++ results.) ++ ++ Rather than complicating the test suite with architecture-specific flags ++ to avoid excess precision, just simplify the floating-point computation ++ to avoid a dependency on potential excess precision. ++ ++commit 071eab32a7f9fbbef46c0d8f37d9985bc9cceb37 ++Merge: 2228c7a 2f44952 ++Author: Anthony Green ++Date: Sun Mar 16 07:36:52 2014 -0400 ++ ++ Merge pull request #92 from joshtriplett/autogen ++ ++ Re-add libtool-ldflags ++ ++commit 2f44952c95765c1486fad66f57235f8d459a9748 ++Author: Josh Triplett ++Date: Sun Mar 16 04:35:12 2014 -0700 ++ ++ Re-add libtool-ldflags ++ ++commit 2228c7ab190f3c529b9018495467b841fa21cba2 ++Merge: 76d19d0 35634db ++Author: Anthony Green ++Date: Sun Mar 16 07:25:18 2014 -0400 ++ ++ Merge pull request #87 from joshtriplett/autogen ++ ++ Remove autogenerated files from the repository ++ ++commit 35634dbceaac0a1544f7385addc01d21ef1ef6a8 ++Author: Josh Triplett ++Date: Sat Mar 15 18:11:16 2014 -0700 ++ ++ Remove autogenerated files from the repository ++ ++ Add an autogen.sh to regenerate them. ++ ++commit 76d19d004e36e99d261ee78261e2f52cea5e4ab1 ++Merge: c86d9b6 a1a6f71 ++Author: Anthony Green ++Date: Fri Mar 14 16:54:31 2014 -0400 ++ ++ Ensure the linker supports @unwind sections in libffi. ++ ++commit c86d9b6cc6e16ee262844a33b40441374400758c ++Merge: 4efb7db f8cdf11 ++Author: Anthony Green ++Date: Fri Mar 14 16:51:20 2014 -0400 ++ ++ Fix merge ++ ++commit 4efb7dbfd9427c478a948cd0d464210123db8de8 ++Merge: 634a475 18eb81d ++Author: Anthony Green ++Date: Fri Mar 14 16:47:57 2014 -0400 ++ ++ Merge pull request #81 from rvandermeulen/bug-756740 ++ ++ Allow building for mipsel with Android NDK r8. ++ ++commit a1a6f71bfe4199293043b2e4cfb4c8d3cb1112f9 ++Author: Ryan VanderMeulen ++Date: Mon Mar 10 15:12:47 2014 -0400 ++ ++ Remove stray hunk that shouldn't have been included in this patch. ++ ++commit f8cdf11467181f2a9a6b7e748167569aa58e3a81 ++Author: Ryan VanderMeulen ++Date: Mon Mar 10 15:04:58 2014 -0400 ++ ++ Replace double quotes with single quotes in Makefile.in to improve compatibility between some versions of MSYS and gmake. From Mozilla bug 943728. ++ https://bugzilla.mozilla.org/show_bug.cgi?id=943728 ++ ++commit dfa3738732e1bc3a7f4130395ae4bab55fcebb99 ++Author: Ryan VanderMeulen ++Date: Mon Mar 10 14:53:48 2014 -0400 ++ ++ Ensure the linker supports @unwind sections in libffi. From Mozilla bug 756740. ++ https://bugzilla.mozilla.org/show_bug.cgi?id=778414 ++ ++ Also tracked as issue #42. ++ https://github.com/atgreen/libffi/issues/42 ++ ++commit 18eb81d032f29d645d0498ba92bddfd651f009ae ++Author: Ryan VanderMeulen ++Date: Mon Mar 10 14:43:37 2014 -0400 ++ ++ Allow building for mipsel with Android NDK r8. From Mozilla bug 756740. ++ https://bugzilla.mozilla.org/show_bug.cgi?id=756740 ++ ++commit 2349fec9a818fb52fd2f294bcbc7b3156cd113de ++Author: Daiki Ueno ++Date: Wed Mar 5 17:53:02 2014 +0900 ++ ++ Fix typo in doc ++ ++commit 634a475eaf1bee31c09f7d519e31c13b64cd24df ++Author: Anthony Green ++Date: Sat Mar 1 18:37:29 2014 -0500 ++ ++ Update Makefile for new darwin scripts ++ ++commit c7b67e874bb89859f9a07d1cf9606052b6c0dcc1 ++Author: Anthony Green ++Date: Sat Mar 1 18:34:18 2014 -0500 ++ ++ Add README note ++ ++commit a04e30ba3dc303133d459c1ac273ceefe4d49b32 ++Author: Anthony Green ++Date: Fri Feb 28 17:20:59 2014 -0500 ++ ++ Add missing -DFFI_DEBUG flag ++ ++commit 934dc1b5c8d6a9e727bedc72342831eb7d62c35f ++Merge: 11d7aa9 67fbef3 ++Author: Anthony Green ++Date: Fri Feb 28 01:10:17 2014 -0500 ++ ++ Merge branch 'master' of github.com:/atgreen/libffi ++ ++commit 11d7aa9d7a4bbe642944edc0f07cf96db9b270b6 ++Merge: b40aeda 3b44d41 ++Author: Anthony Green ++Date: Fri Feb 28 01:06:48 2014 -0500 ++ ++ Merge pull request #46 from makotokato/android-clang ++ ++ Fix build failure when using clang for Android ++ ++commit 67fbef3b56ff0ef88f9b1a7fe48cb77222fa6cec ++Merge: b40aeda 3b44d41 ++Author: Anthony Green ++Date: Fri Feb 28 01:06:48 2014 -0500 ++ ++ Merge pull request #46 from makotokato/android-clang ++ ++ Fix build failure when using clang for Android ++ ++commit b40aeda31a74d95a37c723b6243aabac466e67c4 ++Merge: 20698ab 53ceaf1 ++Author: Anthony Green ++Date: Fri Feb 28 01:01:29 2014 -0500 ++ ++ Merge branch 'master' of github.com:/atgreen/libffi ++ ++commit 53ceaf14c5eeb16ba09745f0ca87cca367d41a90 ++Merge: 860fe66 cc9b518 ++Author: Anthony Green ++Date: Fri Feb 28 01:01:02 2014 -0500 ++ ++ Merge pull request #40 from wojdyr/master ++ ++ Correct the -L flag in libffi.pc.in ++ ++commit 20698abc6a00092fd7fd3e434a3a29dc0f048f1e ++Merge: 64bd069 1a0b01e ++Author: Anthony Green ++Date: Fri Feb 28 00:56:27 2014 -0500 ++ ++ Merge pull request #66 from ppizarro/master ++ ++ BlackFin fixes - Fatal error when calling a function defined in a shared library from within the function called by FFI ++ ++commit 860fe6646f5ae603e99a8d1d722ddddba8b75769 ++Merge: 64bd069 1a0b01e ++Author: Anthony Green ++Date: Fri Feb 28 00:56:27 2014 -0500 ++ ++ Merge pull request #66 from ppizarro/master ++ ++ BlackFin fixes - Fatal error when calling a function defined in a shared library from within the function called by FFI ++ ++commit 64bd06990a7accf72271516a2110b86cdccd8df4 ++Author: Anthony Green ++Date: Fri Feb 28 00:52:56 2014 -0500 ++ ++ Add ChangeLog entry for Josh's change ++ ++commit edf29c5169b06fcfc241445e152e325bc3c50e0e ++Merge: 33c9954 3998d26 ++Author: Anthony Green ++Date: Fri Feb 28 00:50:25 2014 -0500 ++ ++ Merge pull request #75 from joshtriplett/longdouble ++ ++ Fix build error on x86 without distinct long double ++ ++commit 33c9954f2eec539011a0f93270aaf013318837ae ++Author: Anthony Green ++Date: Fri Feb 28 00:38:41 2014 -0500 ++ ++ Rebuilt with new libtool ++ ++commit 926b6989fbd08488b9105943293353d45ac527e0 ++Merge: 5a88c85 cc82051 ++Author: Anthony Green ++Date: Fri Feb 28 00:26:57 2014 -0500 ++ ++ Merge branch 'master' of github.com:/atgreen/libffi ++ ++ Conflicts: ++ ChangeLog ++ ++commit 5a88c85fde304052bed1581ed0b6452ac2c68838 ++Author: Anthony Green ++Date: Fri Feb 28 00:23:04 2014 -0500 ++ ++ Fix spelling errors ++ ++commit cc82051c7e80cea772c4b72da026eb7e68d598fc ++Author: Anthony Green ++Date: Fri Feb 28 00:23:04 2014 -0500 ++ ++ Fix spelling errors ++ ++commit 001aaf4b1b56349596bb6f6b5c1613dcbbd84ea8 ++Author: Anthony Green ++Date: Fri Feb 28 00:20:17 2014 -0500 ++ ++ When no VFP arguments are present the IP register is used ++ uninitialized. Initialize it to the value of FP. ++ ++ This fixes a number of testsuite failures when configured for ++ armv7l-unknown-linux-gnueabihf ++ ++commit 49f7729c3ce697c12408c42ccb29cdf4eb66bb85 ++Author: Anthony Green ++Date: Fri Feb 28 00:17:16 2014 -0500 ++ ++ aarch64 fix ++ ++commit 447483d51c6aa9df7116f346a73fc1cf795f4c2b ++Merge: 51377bd b4df9cf ++Author: Anthony Green ++Date: Thu Feb 27 15:42:41 2014 -0500 ++ ++ Fix ChangeLog merge ++ ++commit 3998d2604b5c0d45a098ff3119a9fd9710ef429d ++Author: Josh Triplett ++Date: Mon Feb 17 11:20:33 2014 -0800 ++ ++ Fix build error on x86 without distinct long double ++ ++ src/x86/ffi64.c: In function 'classify_argument': ++ src/x86/ffi64.c:205:5: error: duplicate case value ++ case FFI_TYPE_LONGDOUBLE: ++ ^ ++ src/x86/ffi64.c:202:5: error: previously used here ++ case FFI_TYPE_DOUBLE: ++ ^ ++ ++commit 51377bda9aed0b2c1309c818460cab9d9ab3d46e ++Merge: f08da54 40927bd ++Author: Anthony Green ++Date: Sat Feb 15 08:06:29 2014 -0500 ++ ++ Merge pull request #72 from heiher/devel ++ ++ MIPS N32: Fix call floating point va function ++ ++commit f08da5465463e60a28f5e921f23ebf2ba984c148 ++Merge: 3dc3f32 fa5f25c ++Author: Anthony Green ++Date: Sat Feb 15 08:06:11 2014 -0500 ++ ++ Merge pull request #68 from zeldin/master ++ ++ Linux/ppc64: Remove assumption on contents of r11 in closure ++ ++commit 40927bd3e1e7c6007025ba10854fd8a0664e47df ++Author: Heiher ++Date: Tue Jan 21 23:18:27 2014 +0800 ++ ++ Fix call floating point va function ++ ++ I'm not sure floating-point arguments in GPR or FPR before calling ++ variable number arguments function. so, load all arguments to GPR and ++ FPR. ++ ++commit b4df9cf9cc4a9a9401a53fd6bea1f3c2c283b97b ++Author: Zachary Waldowski ++Date: Wed Feb 5 14:22:52 2014 -0500 ++ ++ AArch64: Fix void fall-through case when assertions are enabled ++ ++commit f466aad0d91a117e42571d1d6fb434fa0433c930 ++Author: Zachary Waldowski ++Date: Tue Jan 21 16:38:31 2014 -0500 ++ ++ AArch64: Fix missing semicolons when assertions are enabled ++ ++commit 7ea677733bd98917241852b8901a6b7580728895 ++Author: Anthony Green ++Date: Sat Nov 30 20:58:31 2013 -0500 ++ ++ Remove build-ios from Makefile ++ ++ Conflicts: ++ ChangeLog ++ ++commit 6ae046cc59c12b2cd40158d6bcb96f4a59886159 ++Author: Anthony Green ++Date: Sat Nov 30 21:06:51 2013 -0500 ++ ++ Mention Aarch64 on iOS ++ ++commit bfc06b3fdb32abe90ce0749aedfec649df85a7ef ++Author: Zachary Waldowski ++Date: Mon Dec 30 17:36:39 2013 -0500 ++ ++ Update ChangeLog ++ ++commit 0a0f12ce1f7be81006b08a3c81a636926d283a9b ++Author: Zachary Waldowski ++Date: Thu Jan 9 13:50:17 2014 -0500 ++ ++ AArch64: Remove duplicitous element_count call. ++ ++ This inhibits an analyzer warning by Clang. ++ ++commit 4330fdcd92e67c816288d64ab230237065768206 ++Author: Zachary Waldowski ++Date: Thu Jan 9 13:53:30 2014 -0500 ++ ++ Darwin/aarch64: Respect iOS ABI re: stack argument alignment ++ ++commit 0a333d6c3973935d4fe02aae76b10e39d3c88e07 ++Author: Zachary Waldowski ++Date: Thu Jan 9 14:03:29 2014 -0500 ++ ++ Darwin/aarch64: Fix size_t assumptions ++ ++commit 2c18e3c76aad1b426617db05a4384e7c3a920176 ++Author: Zachary Waldowski ++Date: Mon Dec 30 16:14:02 2013 -0500 ++ ++ Darwin/aarch64: Fix "shadows declaration" warnings ++ ++commit 1b8a8e20e344f3c55495ab6eb46bd14e843d4b3e ++Author: Zachary Waldowski ++Date: Thu Jan 9 13:55:21 2014 -0500 ++ ++ Darwin/aarch64: Use Clang cache invalidation builtin ++ ++commit 6030cdcae776f8fb5876a53168f7d1e75d28a242 ++Author: Zachary Waldowski ++Date: Mon Dec 30 15:45:51 2013 -0500 ++ ++ Darwin/aarch64: Account for long double being equal to double ++ ++commit 5658b0892683d2e24e4d5842978c184a7ad33858 ++Author: Zachary Waldowski ++Date: Mon Dec 30 16:33:47 2013 -0500 ++ ++ Darwin/aarch64: Use CNAME, restrict .size like ARM ++ ++commit 07175780802acec5dc49fdedd6d20a62409a6707 ++Author: Zachary Waldowski ++Date: Mon Dec 30 17:48:22 2013 -0500 ++ ++ Darwin/aarch64: Fix invalid reference in assembly ++ ++commit 9da28b44277fea3aeb827c35dd63d609d2524a8b ++Author: Zachary Waldowski ++Date: Mon Dec 30 16:23:21 2013 -0500 ++ ++ Darwin/x86_64: Fix 64-bit type shortening warnings ++ ++commit 821d398f08bd1d540a5b235507812ffeee49b580 ++Author: Zachary Waldowski ++Date: Thu Jan 9 13:15:06 2014 -0500 ++ ++ Darwin: Merge build scripts, redo project, incl. arm64 ++ ++commit 6eff9ff9e72463b9783be2514f944b6f05692054 ++Author: Zachary Waldowski ++Date: Mon Dec 30 17:48:10 2013 -0500 ++ ++ Darwin/iOS: Improve unified syntax use for LLVM ++ ++commit ba0ea99c82aadd5957386a031e3122011bd36d52 ++Author: Zachary Waldowski ++Date: Mon Dec 30 15:27:44 2013 -0500 ++ ++ Fix dlmalloc warnings due to set_segment_flags, sizeof(size_t) ++ ++commit 994be3a5c1d0d17b19103396103e128517fd62f9 ++Author: Zachary Waldowski ++Date: Mon Dec 30 15:27:14 2013 -0500 ++ ++ Darwin/iOS: Fix mis-typing of vfp_reg_free ++ ++commit a8e0a835ab1f62d03ad6391760e3e8b7732d24f8 ++Author: Zachary Waldowski ++Date: Mon Dec 30 15:26:20 2013 -0500 ++ ++ Darwin/ARM: Assert on NULL dereference ++ ++ This inhibits an analyzer warning by Clang on all platforms. ++ ++commit 13675341581c489ed9df8ba390c8e08a732decb2 ++Author: Zachary Waldowski ++Date: Thu Jan 9 13:42:08 2014 -0500 ++ ++ Darwin/i386: Inhibit Clang previous prototype warnings ++ ++commit 66469c381e2e2cc96e7d409266dea0ffe177eeca ++Author: Zachary Waldowski ++Date: Thu Jan 9 13:41:45 2014 -0500 ++ ++ Darwin/ARM: Inhibit Clang previous prototype warnings ++ ++commit 5bfe62a00d2d659eec9f19b39802b6e69844fc27 ++Author: Zachary Waldowski ++Date: Thu Jan 9 13:41:27 2014 -0500 ++ ++ Darwin/AArch64: Inhibit Clang previous prototype warnings ++ ++commit fa5f25c20f76a6ef5e950a7ccbce826672c8a620 ++Author: Marcus Comstedt ++Date: Sat Jan 4 19:00:08 2014 +0100 ++ ++ Linux/ppc64: Remove assumption on contents of r11 in closure ++ ++commit 1a0b01e171e9c750437cef2f18917f5a6e32c498 ++Author: Paulo Pizarro ++Date: Thu Jan 2 16:17:59 2014 -0200 ++ ++ When the function called by the ffi called a function defined in a shared library generate a fatal error ++ The correction was to take into consideration the GOT. ++ ++commit 3dc3f32c35db5ab995a835225f6815369735ceb7 ++Author: Anthony Green ++Date: Thu Dec 5 16:23:25 2013 -0500 ++ ++ Undo iOS ARM64 changes. ++ ++commit 356b2cbc304bfe5bdc28b8d1c68d1ff084e9ec37 ++Merge: 484a758 07345a3 ++Author: Anthony Green ++Date: Sat Nov 30 22:38:13 2013 -0500 ++ ++ Merge branch 'master' of github.com:/atgreen/libffi ++ ++commit 484a7584260e2fbb399ce90083046834271bf9ff ++Author: Anthony Green ++Date: Sat Nov 30 21:06:51 2013 -0500 ++ ++ Mention Aarch64 on iOS ++ ++commit 07345a30ec0a2fa45a7c363d301f57723690cfa0 ++Author: Anthony Green ++Date: Sat Nov 30 21:06:51 2013 -0500 ++ ++ Mention Aarch64 on iOS ++ ++commit d4b931c1b872378c35f12ddbb9a6d55e7f17c65e ++Author: Anthony Green ++Date: Sat Nov 30 20:58:31 2013 -0500 ++ ++ Remove build-ios from Makefile ++ ++commit dfbf236d70fc1ec68e6ff193584a154353508e2f ++Merge: 852ac3b bb9740e ++Author: Anthony Green ++Date: Sat Nov 30 20:54:54 2013 -0500 ++ ++ Merge branch 'master' of github.com:/atgreen/libffi ++ Add ChangeLog entry. ++ ++commit bb9740e545205f93a525c77aa6d1cbf4ca9371f3 ++Merge: ac75368 4d701e0 ++Author: Anthony Green ++Date: Sat Nov 30 17:54:39 2013 -0800 ++ ++ Merge pull request #60 from zwaldowski/ios-redo ++ ++ Mac/iOS support, including aarch64 port ++ ++commit 4d701e03faa475a5eb3b54b90046114a1e27b813 ++Author: Zachary Waldowski ++Date: Sat Nov 30 13:25:27 2013 -0500 ++ ++ Darwin: Properly export headers from Xcode project ++ ++commit 022f12eb9ad2264e838fa5fb453733f5177888f4 ++Author: Zachary Waldowski ++Date: Sat Nov 30 12:21:38 2013 -0500 ++ ++ Darwin: Freshen gen scripts, remove old build-ios.sh ++ ++commit e820fe2025d7ad3df7584407946dfaad2af69599 ++Author: Zachary Waldowski ++Date: Sat Nov 30 12:03:51 2013 -0500 ++ ++ Darwin/iOS: Include x86_64+aarch64 pieces in library ++ ++commit 0278284e470ec91db7cdc15ac3dcd64683305848 ++Author: Zachary Waldowski ++Date: Sat Nov 30 03:03:37 2013 -0500 ++ ++ Darwin/aarch64: size_t assumptions ++ ++commit 9775446b6441c91cd9059215c106aa3bcf949767 ++Author: Zachary Waldowski ++Date: Sat Nov 30 02:39:34 2013 -0500 ++ ++ Darwin/aarch64: Fix “shadows declaration†warnings ++ ++commit 4260badc37705d3618e774dfe61184ac709881c1 ++Author: Zachary Waldowski ++Date: Sat Nov 30 02:08:14 2013 -0500 ++ ++ Darwin/aarch64: Use Clang cache invalidation builtin ++ ++commit 9fa7998d5f9250908cbf12a671479852ebadf9d1 ++Author: Zachary Waldowski ++Date: Sat Nov 30 02:07:48 2013 -0500 ++ ++ Darwin/aarch64: Inhibit Xcode warning ++ ++commit 0e832048a93830575b0976406444e134e649a4f7 ++Author: Zachary Waldowski ++Date: Sat Nov 30 02:07:34 2013 -0500 ++ ++ Darwin/aarch64: double == long double ++ ++commit 602dc22d76931092610234cf063f9f1b8dbc1a51 ++Author: Zachary Waldowski ++Date: Sat Nov 30 02:06:00 2013 -0500 ++ ++ Darwin/iOS prep script: try and compile for arm64 ++ ++commit b513dfe79de4725e8a717325a9e3b5b9f69f63dc ++Author: Zachary Waldowski ++Date: Sat Nov 30 02:05:22 2013 -0500 ++ ++ Darwin/aarch64: Restrict .size to ELF like arm32. ++ ++commit bc978099bf2812de755c076b67ef9c2547607572 ++Author: Zachary Waldowski ++Date: Sat Nov 30 02:04:57 2013 -0500 ++ ++ Darwin/aarch64: Potentially(?) fix compile error ++ ++commit d6bb9314467c6e0683156559d23ca341c43fa3c8 ++Author: Zachary Waldowski ++Date: Sat Nov 30 02:04:22 2013 -0500 ++ ++ Darwin/aarch64: Use CNAME refs ++ ++commit 33c46ce5680eea28d3437c8771ec1d137e226b45 ++Author: Zachary Waldowski ++Date: Sat Nov 30 04:13:42 2013 -0500 ++ ++ Darwin/Mac: Fix 64/32 shortening warnings ++ ++commit 0612081e6c161d9d820742f995975d35da2adbc2 ++Author: Zachary Waldowski ++Date: Sat Nov 30 03:03:00 2013 -0500 ++ ++ Darwin: Misc size_t warnings ++ ++commit 6a6247d179ec3859311c2d8775841b884f309f66 ++Author: Zachary Waldowski ++Date: Sat Nov 30 02:55:48 2013 -0500 ++ ++ Darwin: Fix dlmalloc warnings due to sizeof(size_t) ++ ++commit 4d60d9e1e32de6166ffd63bbe9ce54cf961c78fc ++Author: Zachary Waldowski ++Date: Sat Nov 30 04:09:30 2013 -0500 ++ ++ Darwin: Rebuild Xcode project ++ ++commit cb719a5c1c2eb391d6a5f5e02484ba4aa990a51b ++Author: Zachary Waldowski ++Date: Sat Nov 30 04:09:18 2013 -0500 ++ ++ Darwin/iOS: Fix LLVM 3.3 warning re: memcpy. ++ ++commit 21bde92c9abb378f9c456a9d95e6f9b99ef8c920 ++Author: Zachary Waldowski ++Date: Sat Nov 30 03:43:42 2013 -0500 ++ ++ Darwin: Clean up, modernize generator scripts ++ ++commit fd54eab74cef7891e4acaaafb71e783142ecb69e ++Author: Zachary Waldowski ++Date: Sat Nov 30 03:38:02 2013 -0500 ++ ++ Darwin/Mac: Also exclude OS X generated source ++ ++commit 953b6f14c655141f9e7d82550a312c3eeb961091 ++Author: Zachary Waldowski ++Date: Tue Apr 24 11:16:20 2012 -0400 ++ ++ Darwin/iOS: More unified syntax support w/ Clang. ++ ++ Signed-off-by: Zachary Waldowski ++ ++commit c713a55379481c339877f2e0003d97cb8d9ed80e ++Author: Zachary Waldowski ++Date: Tue Apr 24 10:25:29 2012 -0400 ++ ++ Darwin/iOS: Simplify RETLDM arguments for LLVM 3.1 ++ ++ Signed-off-by: Zachary Waldowski ++ ++commit 16ba1b80028db5cb71cf86e5f79f5e48317f83c8 ++Author: Zachary Waldowski ++Date: Wed Apr 11 23:26:04 2012 -0400 ++ ++ Darwin: Silence Clang warnings. ++ ++commit 852ac3bd302d6ed97b1ef65f4cbed69c258a48df ++Merge: ab79d6e ac75368 ++Author: Anthony Green ++Date: Thu Nov 21 21:25:44 2013 -0500 ++ ++ Merge branch 'master' of github.com:/atgreen/libffi ++ ++ Conflicts: ++ ChangeLog ++ ++commit ab79d6e21992dd86139ba07530ff888833b78a04 ++Author: Alan Modra ++Date: Thu Nov 21 06:12:35 2013 -0500 ++ ++ This separates the 32-bit sysv/linux/bsd code from the 64-bit linux ++ code, and makes it possible to link code compiled with different ++ options to those used to compile libffi. For example, a ++ -mlong-double-128 libffi can be used with -mlong-double-64 code. ++ ++ Using the return value area as a place to pass parameters wasn't such ++ a good idea, causing a failure of cls_ulonglong.c. I didn't see this ++ when running the mainline gcc libffi testsuite because that version of ++ the test is inferior to the upstreamm libffi test. ++ ++ Using NUM_FPR_ARG_REGISTERS rather than NUM_FPR_ARG_REGISTERS64 meant ++ that a parameter save area could be allocated before it was strictly ++ necessary. Wrong but harmless. Found when splitting apart ffi.c ++ into 32-bit and 64-bit support. ++ ++commit ac7536889334d4be50709006d7e23536364d7891 ++Author: Alan Modra ++Date: Thu Nov 21 06:12:35 2013 -0500 ++ ++ This separates the 32-bit sysv/linux/bsd code from the 64-bit linux ++ code, and makes it possible to link code compiled with different ++ options to those used to compile libffi. For example, a ++ -mlong-double-128 libffi can be used with -mlong-double-64 code. ++ ++ Using the return value area as a place to pass parameters wasn't such ++ a good idea, causing a failure of cls_ulonglong.c. I didn't see this ++ when running the mainline gcc libffi testsuite because that version of ++ the test is inferior to the upstreamm libffi test. ++ ++ Using NUM_FPR_ARG_REGISTERS rather than NUM_FPR_ARG_REGISTERS64 meant ++ that a parameter save area could be allocated before it was strictly ++ necessary. Wrong but harmless. Found when splitting apart ffi.c ++ into 32-bit and 64-bit support. ++ ++commit 69df91cfb4fa6bcb644350a80bff970f27478a6a ++Merge: 2f45082 aa1f62c ++Author: Anthony Green ++Date: Mon Nov 18 06:34:04 2013 -0800 ++ ++ Merge pull request #59 from iains/powerpc-darwin-unwind-fix ++ ++ Fix PowerPC Darwin FDE encodings to use pcrel correctly. Modernise the picbase labels. ++ ++commit aa1f62c0a093c30325dff1d4d2b6b4b22eb96929 ++Author: Iain Sandoe ++Date: Mon Nov 18 13:11:56 2013 +0000 ++ ++ Fix PowerPC Darwin FDE encodings to use pcrel correctly. Modernise the picbase labels. ++ ++commit 2f450822a8698ba88441c56d152c7dc8924b127f ++Author: Anthony Green ++Date: Mon Nov 18 06:52:29 2013 -0500 ++ ++ Clean up code to appease modern GCC compiler. ++ ++commit 16d56c51aded374730920a4acde76ff3d2860ae1 ++Author: Alan Modra ++Date: Mon Nov 18 06:36:03 2013 -0500 ++ ++ An #endif in the wrong place would cause compile failure on powerpcle. ++ Using bl instead of b doesn't cause runtime failures as you might think, ++ but does mess the processor branch prediction. ++ ++commit 34f878a5ef28663f6b1d7fd26fb099429ea1579e ++Merge: 83f65b6 1fd0457 ++Author: Anthony Green ++Date: Sat Nov 16 06:57:54 2013 -0500 ++ ++ Merge branch 'master' of github.com:/atgreen/libffi ++ ++ Conflicts: ++ ChangeLog ++ src/powerpc/ffi.c ++ ++commit 83f65b63d9764a9cc7688fc5cda5ee2bd23faf54 ++Author: Alan Modra ++Date: Sat Nov 16 06:53:50 2013 -0500 ++ ++ Finally, this adds _CALL_ELF == 2 support. ELFv1 objects can't be ++ linked with ELFv2 objects, so this is one case where preprocessor ++ tests in ffi.c are fine. Also, there is no need to define a new ++ FFI_ELFv2 or somesuch value in enum ffi_abi. FFI_LINUX64 will happily ++ serve both ABIs. ++ ++commit 1fd045784cac874b5d76b7fa931f67209a8280d3 ++Author: Alan Modra ++Date: Sat Nov 16 06:53:50 2013 -0500 ++ ++ Finally, this adds _CALL_ELF == 2 support. ELFv1 objects can't be ++ linked with ELFv2 objects, so this is one case where preprocessor ++ tests in ffi.c are fine. Also, there is no need to define a new ++ FFI_ELFv2 or somesuch value in enum ffi_abi. FFI_LINUX64 will happily ++ serve both ABIs. ++ ++commit 362851379a49ce07d3e36e82c4e5c7b6cc16a352 ++Author: Alan Modra ++Date: Sat Nov 16 06:52:43 2013 -0500 ++ ++ Andreas' 2013-02-08 change reverted some breakage for struct return ++ values from 2011-11-12, but in so doing reintroduced string ++ instructions to sysv.S that are not supported on all powerpc variants. ++ This patch properly copies the bounce buffer to destination in C code ++ rather than in asm. ++ ++ I have tested this on powerpc64-linux, powerpc-linux and ++ powerpc-freebsd. Well, the last on powerpc-linux by lying to ++ configure with ++ ++ CC="gcc -m32 -msvr4-struct-return -mlong-double-64" \ ++ CXX="g++ -m32 -msvr4-struct-return -mlong-double-64" \ ++ /src/libffi-current/configure --build=powerpc-freebsd ++ ++ and then ++ ++ make && make CC="gcc -m32" CXX="g++ -m32" \ ++ RUNTESTFLAGS=--target_board=unix/-m32/-msvr4-struct-return/-mlong-double-64\ ++ check ++ ++commit 1c06515d927d9de1582438d4eb5953890e79c5c7 ++Author: Alan Modra ++Date: Sat Nov 16 06:41:36 2013 -0500 ++ ++ The powerpc64 ABIs align structs passed by value, a fact ignored by ++ gcc for quite some time. Since gcc now does the correct alignment, ++ libffi needs to follow suit. This ought to be made selectable via ++ a new abi value, and the #ifdefs removed from ffi.c along with many ++ other #ifdefs present there and in assembly. I'll do that with a ++ followup patch sometime. ++ ++ This is a revised version of ++ https://sourceware.org/ml/libffi-discuss/2013/msg00162.html ++ ++commit a97cf1fae575d8bfd5259c5c422025ad43911326 ++Author: Alan Modra ++Date: Sat Nov 16 06:40:13 2013 -0500 ++ ++ This patch prepares for ELFv2, where sizes of these areas change. It ++ also makes some minor changes to improve code efficiency. ++ ++commit 164283f4ac5972ce2ab5e015cc2ab1014c23276c ++Author: Alan Modra ++Date: Sat Nov 16 06:38:55 2013 -0500 ++ ++ The powerpc64 support opted to pass floating point values both in the ++ fpr area and the parameter save area, necessary when the backend ++ doesn't know if a function argument corresponds to the ellipsis ++ arguments of a variadic function. This patch adds powerpc support for ++ variadic functions, and changes the code to only pass fp in the ABI ++ mandated area. ELFv2 needs this change since the parameter save area ++ may not exist there. ++ ++ This also fixes two faulty tests that used a non-variadic function ++ cast to call a variadic function, and spuriously reasoned that this is ++ somehow necessary for static functions.. ++ ++commit 31257b3189f81a199bc2902c22bc5f2d7c54ccde ++Author: Andrew Haley ++Date: Sat Nov 16 06:35:51 2013 -0500 ++ ++ Fix sample closure code ++ ++commit db0ace3a38496af73eae3df02ef353736d16909f ++Author: Andrew Haley ++Date: Sat Nov 16 06:29:25 2013 -0500 ++ ++ Fix broken test cases ++ ++commit de10f5039ed7a53382ddcc95c368d03e535edb98 ++Merge: 58c2577 f3657da ++Author: Anthony Green ++Date: Thu Nov 14 10:56:29 2013 -0500 ++ ++ Merge branch 'master' of https://github.com/bivab/libffi ++ ++ Conflicts: ++ ChangeLog ++ ++commit f3657da278dd63afcdd8762894a9bdaea8ef028a ++Author: David Schneider ++Date: Thu Nov 14 13:02:16 2013 +0100 ++ ++ update Changelog ++ ++commit 58c2577a3ff80e7416ef0434769e2af23365719c ++Author: Alan Modra ++Date: Wed Nov 13 16:55:36 2013 -0500 ++ ++ This enshrines the current testsuite practice of using ffi_arg for ++ returned values. It would be reasonable and logical to use the actual ++ return argument type as passed to ffi_prep_cif, but this would mean ++ changing a large number of tests that use ffi_arg and all backends ++ that write results to an ffi_arg. ++ ++commit 8af42f9944f7ed72c81ae360aac6a84dc11f89dc ++Author: Anthony Green ++Date: Wed Nov 13 16:40:28 2013 -0500 ++ ++ Respect HAVE_ALLOCA_H ++ ++commit cdf405d574f479b782454516366bd4f4b9b3415e ++Author: David Schneider ++Date: Wed Nov 13 15:50:21 2013 +0100 ++ ++ add a testcase for the double/float issue on ARMHF ++ ++commit 77f823e31ffb557a466b24f7fba845fbf7831798 ++Author: David Schneider ++Date: Wed Nov 13 14:26:57 2013 +0100 ++ ++ stop trying to assing vfp regs once we are done with the registers ++ ++commit 37067ec5036f2a6ed7a4799f83f8f53160460344 ++Author: David Schneider ++Date: Tue Nov 12 19:49:01 2013 +0100 ++ ++ mark all vfp registers as used when done. ++ ++ To avoid assigning registers the would fit, once arguments have been on ++ the stack, we mark all registers as used once we do not find a free ++ register for the first time. ++ ++commit 2f5b7ce545473a7f6e41193edc29407cbebe82d5 ++Author: Anthony Green ++Date: Sat Nov 9 06:16:32 2013 -0500 ++ ++ UltraSPARC IIi fix. Update README and build configury. ++ ++commit becd754434173032f426d22ffcbfe24f55b3c137 ++Author: Mark Kettenis ++Date: Wed Nov 6 06:43:49 2013 -0500 ++ ++ Align the stack pointer to 16-bytes. ++ ++commit 05c31093409f7b3e6d795fac21d2c954313d8162 ++Author: Konstantin Belousov ++Date: Wed Nov 6 06:40:58 2013 -0500 ++ ++ Mark executable as not requiring executable stack. ++ ++commit cf6bf9818e8394cfcdb07a40c6a5e2ee6b01d333 ++Author: Anthony Green ++Date: Sat Nov 2 17:23:59 2013 -0400 ++ ++ Fix up docs ++ ++commit 02177176854d16fc0f1a5958aa34da2f306630ee ++Merge: c242217 c265b4c ++Author: Anthony Green ++Date: Sat Nov 2 17:11:22 2013 -0400 ++ ++ Merge branch 'master' of github.com:/atgreen/libffi ++ ++commit c2422174b3edc0de0b148dfd6b67087bb881c4a6 ++Merge: f4b843f d918d47 ++Author: Anthony Green ++Date: Sat Nov 2 14:08:23 2013 -0700 ++ ++ Merge pull request #45 from foss-for-synopsys-dwc-arc-processors/arc_support ++ ++ arc: Fix build error ++ ++commit c265b4cacb9130f042699a85de9c7242b3f49cc3 ++Merge: f4b843f d918d47 ++Author: Anthony Green ++Date: Sat Nov 2 14:08:23 2013 -0700 ++ ++ Merge pull request #45 from foss-for-synopsys-dwc-arc-processors/arc_support ++ ++ arc: Fix build error ++ ++commit f4b843f83710ac378c48abd87fe66bb519d30d2e ++Author: Anthony Green ++Date: Sat Nov 2 17:01:15 2013 -0400 ++ ++ Don't align stack for win32 ++ ++commit f3cd39345713db8e414cf642b6cb65a4cfe6018c ++Merge: 666f3e7 6aa1590 ++Author: Anthony Green ++Date: Sat Nov 2 13:17:57 2013 -0700 ++ ++ Merge pull request #51 from vbudovski/for_upstream ++ ++ Don't use 16 byte aligned stack for WIN32 ++ ++commit 666f3e71b56d92c49fcd2d7f349b8f8ebca0f8a3 ++Author: Anthony Green ++Date: Sat Oct 26 09:12:42 2013 -0400 ++ ++ Add more credits to README. Tidy up. ++ ++commit 73ada14e756bad97fad0e6915a821a3c7e079f81 ++Author: Anthony Green ++Date: Sat Oct 26 09:09:45 2013 -0400 ++ ++ Update README ++ ++commit d3372c54ce7117e80d389ba875dc5b6b2213c71e ++Author: Mark H Weaver ++Date: Sat Oct 26 08:30:06 2013 -0400 ++ ++ Fix N32 ABI issue for MIPS. ++ ++commit d6716aba8118eb0513885cfe557bedebb7016e8b ++Author: Anthony Green ++Date: Tue Oct 15 15:42:49 2013 -0400 ++ ++ Update travis-ci build dependencies to include texinfo ++ ++commit 16b93a211bcfbe4bd0efdcf94de225a71aa0ee02 ++Author: Sandra Loosemore ++Date: Tue Oct 15 15:33:59 2013 -0400 ++ ++ Add nios2 port. ++ ++commit 2f5626ce02fce8267ab48ceb6d7d0ed7d672a75e ++Author: Sandra Loosemore ++Date: Tue Oct 15 15:32:16 2013 -0400 ++ ++ Fix testsuite bug ++ ++commit f64e4a865557e440774436b4c2b2fd7374290e97 ++Author: Marcus Shawcroft ++Date: Tue Oct 15 15:20:14 2013 -0400 ++ ++ Fix many.c testcase for Aarch64 ++ ++commit 128cd1d2f358f26d9fa75a27cf2b30356f5dd903 ++Author: Anthony Green ++Date: Tue Oct 8 06:45:51 2013 -0400 ++ ++ Fix spelling errors ++ ++commit ff06269d707cafbfef2a88afb07a79c9d1480c5f ++Author: Anthony Green ++Date: Tue Oct 8 06:32:18 2013 -0400 ++ ++ Update README for M88K and VAX ++ ++commit d2fcbcdfbea750d1f6a9f493e2e6c4d5ffa71b34 ++Author: Anthony Green ++Date: Tue Oct 8 06:27:46 2013 -0400 ++ ++ Add m88k and VAX support. Update some configury bits. ++ ++commit 6aa15900accc0a648cdebf11ec11d11697ebfffd ++Author: Vitaly Budovski ++Date: Thu Sep 5 12:05:06 2013 +1000 ++ ++ Don't use 16 byte aligned stack for WIN32 ++ ++ This fixes a crash when accessing __stdcall functions in Python ctypes. ++ ++commit 3b44d41156149af8da2a58825fefdfa23274ae7a ++Author: Makoto Kato ++Date: Wed Jul 10 15:34:53 2013 +0900 ++ ++ Fix build failure when using clang for Android ++ ++ clang for Android generates __gnu_linux__ define, but gcc for Android doesn't. So we should add check it for Android ++ ++commit d918d47809c174d62283306b282749f8db93661f ++Author: Mischa Jonker ++Date: Mon Jul 8 15:51:36 2013 +0200 ++ ++ arc: Fix build error ++ ++ One part of the patch for ARC support was missing in the upstreamed ++ version. ++ ++ Signed-off-by: Mischa Jonker ++ ++commit d3d099b40c122550279789200263346f120f6909 ++Author: Anthony Green ++Date: Tue Jul 2 16:11:38 2013 -0400 ++ ++ little-endian ppc64 support ++ ++commit 0f8690a84c874ec09a090c8c6adfb93c594acac6 ++Author: Anthony Green ++Date: Tue Jul 2 15:54:40 2013 -0400 ++ ++ Rebuild for ARC additions ++ ++commit f88118b345f27c46f5445d6e4832c498ff9a6d85 ++Author: Anthony Green ++Date: Tue Jul 2 15:51:27 2013 -0400 ++ ++ Revert "Merge pull request #36 from abergmeier/emscripten_fix" ++ ++ This reverts commit 6a4d901dde7b3f87984c563505717cde3113d16e, reversing ++ changes made to b50a13b9c07ec09af4b9697e482acdad571e6961. ++ ++commit 6a4d901dde7b3f87984c563505717cde3113d16e ++Merge: b50a13b 587002c ++Author: Anthony Green ++Date: Tue Jul 2 12:12:34 2013 -0700 ++ ++ Merge pull request #36 from abergmeier/emscripten_fix ++ ++ Fixes for building with Emscripten ++ ++commit b50a13b9c07ec09af4b9697e482acdad571e6961 ++Merge: 767f1f9 b082e15 ++Author: Anthony Green ++Date: Tue Jul 2 12:10:26 2013 -0700 ++ ++ Merge pull request #44 from foss-for-synopsys-dwc-arc-processors/arc_support ++ ++ Add ARC support ++ ++commit 767f1f96e5282da44d7340e6815e9820a3f78e39 ++Merge: c3c40e0 b8a91d8 ++Author: Anthony Green ++Date: Tue Jul 2 12:08:04 2013 -0700 ++ ++ Merge pull request #43 from JensTimmerman/__m128 ++ ++ added include for xmmintrin.h ++ ++commit b8a91d81be77d479327fdb6bdd9fdae6d18e6e63 ++Author: Jens Timmerman ++Date: Tue Jul 2 10:57:37 2013 +0200 ++ ++ added include for xmmintrin.h ++ ++commit b082e15091961373c03d10ed0251f619ebb6ed76 ++Author: Mischa Jonker ++Date: Mon Jun 10 16:19:33 2013 +0200 ++ ++ Add ARC support ++ ++ This adds support for the ARC architecture to libffi. DesignWare ARC ++ is a family of processors from Synopsys, Inc. ++ ++ This patch has been tested on a little-endian system and passes ++ the testsuite. ++ ++ Signed-off-by: Mischa Jonker ++ ++commit cc9b518687e46b0d1acafdd4bc3f3b281c25a3d9 ++Author: Marcin Wojdyr ++Date: Tue May 14 15:01:23 2013 +0200 ++ ++ Update libffi.pc.in ++ ++ use -L${toolexeclibdir} instead of -L${libdir} ++ to be consistent with Makefile.am ++ ++commit 587002c092cffe6e7a8d7028f246c241d03b738c ++Author: Andreas Bergmeier ++Date: Fri Apr 19 17:12:24 2013 +0200 ++ ++ Enable disabling of libtool on platforms where it does not work (e.g. LLVM). ++ Build libraries normally then. ++ ++commit c3c40e0290377d7cf948b072eedd8317c4bf215e ++Merge: ede96e4 4750e3c ++Author: Anthony Green ++Date: Sat Mar 30 05:24:14 2013 -0700 ++ ++ Merge pull request #34 from davidsch/armhf ++ ++ Fix ARM hard-float support for large numbers of VFP arguments ++ ++commit 4750e3c662fd9569cb3e2d28f539685fd1ca8caf ++Author: David Schneider ++Date: Thu Mar 28 16:56:36 2013 +0100 ++ ++ update changelog ++ ++commit 9708e7cf09f1bf815f4d6485eb1f180fabb35804 ++Author: David Schneider ++Date: Wed Mar 27 19:31:04 2013 +0100 ++ ++ folow the ARM hard-float ABI in ffi_prep_incoming_args_VFP ++ ++commit b41120981e5e49ca2da10b94b154775f50da5f36 ++Author: David Schneider ++Date: Wed Mar 27 16:38:35 2013 +0100 ++ ++ create separated versions of ffi_prep_incoming_args_* for SYSV and VFP ABIs. ++ ++ The different versions will be called depending on the value of cif->abi ++ ++commit dd26f1f39c54861c5b91931f0f37a72942c2a072 ++Author: David Schneider ++Date: Thu Mar 28 15:39:01 2013 +0100 ++ ++ add a failing test for closures on ARM hardfloat ++ ++commit 3c1608613ab3c2184222b98c5482cddedd6b559b ++Author: David Schneider ++Date: Tue Mar 26 19:24:47 2013 +0100 ++ ++ extend ffi_prepare_args for FFI_VFP (hard-float ABI), fixing an issue with passing VFP arguments in VFP registers and the stack, while at the same time not using all core registers. ++ ++commit 0f2ff2d4c92719be8936179f9ab674f4d1a3fd14 ++Author: David Schneider ++Date: Tue Mar 26 19:22:02 2013 +0100 ++ ++ separate ARM ffi_prepare_args in a version implementing the simple SYSV calling convention and one for the hard-float calling convention ++ ++commit 3a352b8a8252400a83de22c7c424bf1887b4a2ef ++Author: David Schneider ++Date: Tue Mar 26 14:24:04 2013 +0100 ++ ++ move the hardfloat specific argument copying code to the helper function ++ ++commit 5df6b7944a4225b6eb329f3886be64e04e966f29 ++Author: David Schneider ++Date: Tue Mar 26 14:02:21 2013 +0100 ++ ++ extract setting of arguments to be passed to a helper function ++ ++commit 7d1048c471bb4b1f9d67a9e9f8e95f9a1d2e6d45 ++Author: David Schneider ++Date: Tue Mar 26 11:33:33 2013 +0100 ++ ++ extract code to align the argument storage pointer to a helper function ++ ++commit b9f013788f0f384c423ad963475aaacb55598135 ++Author: David Schneider ++Date: Mon Mar 25 13:27:36 2013 +0100 ++ ++ add a testcase, that on ARM hardfloat needs more than the 8 VFP argument registers to pass arguments to a call ++ ++commit 2fbdb0f231cafdb77b025d3cd8afe90cda99b3ba ++Author: David Schneider ++Date: Mon Mar 25 13:26:02 2013 +0100 ++ ++ use the absolute value to check the test result against an epsilon ++ ++commit ede96e4eb660bbf3e0fe048135efa8106f48af5d ++Merge: f22ab3c 9e34992 ++Author: Anthony Green ++Date: Sun Mar 17 18:38:21 2013 -0400 ++ ++ Merge branch 'master' of github.com:/atgreen/libffi ++ ++commit f22ab3c6877cbdd07f058b68816b0086b1cb0e1e ++Merge: 12b1886 d08124b ++Author: Anthony Green ++Date: Sun Mar 17 18:34:54 2013 -0400 ++ ++ Merge branch 'master' of github.com:/atgreen/libffi ++ ++commit 9e34992a5ea2fda1dba5875bf96dc91a7230f51f ++Merge: 12b1886 d08124b ++Author: Anthony Green ++Date: Sun Mar 17 18:34:54 2013 -0400 ++ ++ Merge branch 'master' of github.com:/atgreen/libffi ++ ++commit 12b1886d7b1f8aa264b1d348bfa47a0e14712df4 ++Author: Anthony Green ++Date: Sun Mar 17 18:32:12 2013 -0400 ++ ++ cygwin fix & updates for 3.0.13 ++ ++commit d08124bedf2c6d61874fe215404783aeb9f6f1ac ++Author: Anthony Green ++Date: Sun Mar 17 18:32:12 2013 -0400 ++ ++ cygwin fix & updates for 3.0.13 ++ ++commit cb32c812d04d1dfa72002cc04924e7e4fef89e02 ++Author: Anthony Green ++Date: Sun Mar 17 09:27:55 2013 -0400 ++ ++ Fix lib install dir ++ ++commit efd7866a361a6f636bae8400d26c6811e56ca207 ++Author: Anthony Green ++Date: Sat Mar 16 08:35:57 2013 -0400 ++ ++ 2.0.13rc1 ++ ++commit ff647ad4dff2f07dd153f295a1f70b1d906cd6ca ++Merge: 4acf005 d9dd417 ++Author: Anthony Green ++Date: Sat Mar 16 08:20:40 2013 -0400 ++ ++ Merge branch 'master' of github.com:/atgreen/libffi ++ ++ Conflicts: ++ ChangeLog ++ ++commit 4acf0056f55c757490dae6c29a65b0321327ea8a ++Author: Anthony Green ++Date: Sat Mar 16 08:18:45 2013 -0400 ++ ++ Build fix for soft-float power targets ++ ++commit 675c9839224e4268187f1ec6f512127f9db555d0 ++Author: Anthony Green ++Date: Sat Mar 16 08:12:38 2013 -0400 ++ ++ Documentation fix ++ ++commit 8a286f570ccd41db81f74ea7f248da62241d898a ++Author: Anthony Green ++Date: Sat Mar 16 08:01:19 2013 -0400 ++ ++ Fix for m68000 systems ++ ++commit d9dd417b09566af55b7b3000bb53ccaf2e1d6c92 ++Author: Anthony Green ++Date: Sat Mar 16 08:01:19 2013 -0400 ++ ++ Fix for m68000 systems ++ ++commit 215763d012a944d95406b394d6013b80d220e870 ++Author: Anthony Green ++Date: Sat Mar 16 07:57:35 2013 -0400 ++ ++ Update configury. ++ ++commit 9180d8f39c9b6afe17b78277c2711a5d9948e824 ++Merge: 2fb527a 7e1b326 ++Author: Anthony Green ++Date: Sat Mar 16 07:46:55 2013 -0400 ++ ++ Merge branch 'master' of github.com:/atgreen/libffi ++ ++commit 2fb527a017a4943e176a489ff103231b86464b59 ++Author: Anthony Green ++Date: Sat Mar 16 07:46:38 2013 -0400 ++ ++ Add Meta processor support ++ ++commit 211a9ebf4d1a9801e15e103566aed2b8c42790be ++Merge: f308faf ee18766 ++Author: Anthony Green ++Date: Sat Mar 16 04:24:40 2013 -0700 ++ ++ Merge pull request #32 from alex/patch-1 ++ ++ Fix for a crasher due to misaligned stack on x86-32. ++ ++commit 7e1b32649efd24814e86172e196f390566f9e970 ++Merge: f308faf ee18766 ++Author: Anthony Green ++Date: Sat Mar 16 04:24:40 2013 -0700 ++ ++ Merge pull request #32 from alex/patch-1 ++ ++ Fix for a crasher due to misaligned stack on x86-32. ++ ++commit ee18766b169811426c14b011fbb46d81e344f926 ++Author: Alex Gaynor ++Date: Thu Mar 14 15:00:33 2013 -0700 ++ ++ Fix for a crasher due to misaligned stack on x86-32. ++ ++ Full information on reproduction (using Python's ctypes available here: http://bugs.python.org/issue17423) ++ ++commit f308faf1eabaf8dc24966ab17fbf94368f46b9c7 ++Author: Anthony Green ++Date: Mon Feb 11 14:25:13 2013 -0500 ++ ++ Add moxie support. Release 3.0.12. ++ ++commit 4ea22e54e3b143fe05c413f6dddd236af6bcbfb2 ++Author: Anthony Green ++Date: Sun Feb 10 08:48:38 2013 -0500 ++ ++ Update README ++ ++commit 10e77227b6ae85f46f28590bfb09ca3608554358 ++Author: Anthony Green ++Date: Sun Feb 10 08:47:26 2013 -0500 ++ ++ mend ++ ++commit a9521411a53d58f2bf88199242200ceb0d4dae3a ++Author: Anthony Green ++Date: Sat Feb 9 06:54:40 2013 -0500 ++ ++ sparc v8 and testsuite fixes ++ ++commit 70b11b47eea93bf43627588d494d0b3b0d062481 ++Author: Anthony Green ++Date: Fri Feb 8 16:12:19 2013 -0500 ++ ++ Fix small struct passing on ppc ++ ++commit 63ba1fa79f7c4ce42de848debe233aab31aecb51 ++Author: Anthony Green ++Date: Fri Feb 8 15:18:19 2013 -0500 ++ ++ Remove xfail for arm*-*-*. ++ ++commit 24fbca4c1d57d4ea628c0a8ba643684daf54a37e ++Author: Anthony Green ++Date: Fri Feb 8 14:19:56 2013 -0500 ++ ++ Fix typo ++ ++commit b0fa11cb0a94ce6baca058eab9b10e40475e71d6 ++Author: Anthony Green ++Date: Fri Feb 8 14:17:13 2013 -0500 ++ ++ More man page cleanup ++ ++commit 8bd15d139a58a6e46dc90a1cb2d89f59f32f06c7 ++Author: Anthony Green ++Date: Fri Feb 8 13:56:37 2013 -0500 ++ ++ Fix many.c testcase for ppc ++ ++commit 7aab825cf198be85490d3cd80e778d415d85ad9b ++Author: Anthony Green ++Date: Fri Feb 8 13:26:21 2013 -0500 ++ ++ Add missing files to dist ++ ++commit cb03ea8f4eb08024e44abe4392edc77b89fbfbad ++Author: Anthony Green ++Date: Fri Feb 8 12:25:18 2013 -0500 ++ ++ sparc v9 fixes for sun tools ++ ++commit 35ee8d44f31dd3d3b88083c837dc351593e13cc2 ++Author: Anthony Green ++Date: Fri Feb 8 07:12:41 2013 -0500 ++ ++ Fix microblaze big-endian struct issue ++ ++commit 9db7e1a958fc484ba149efe027008b9a170395fb ++Author: Anthony Green ++Date: Thu Feb 7 21:06:08 2013 -0500 ++ ++ Fix botched sparc patch. Update version. ++ ++commit ce0138e61455f268af326e26908b9680ec2c4bea ++Author: Anthony Green ++Date: Thu Feb 7 18:04:01 2013 -0500 ++ ++ Update bug report address. rc2. ++ ++commit fd07c9e40451e0ec1d0475cd54a83d45ccaea2c0 ++Author: Anthony Green ++Date: Thu Feb 7 18:00:36 2013 -0500 ++ ++ Add cache flushing routine for sun compiler on sparc solaris 2.8 ++ ++commit ed6ae9501b2bab45daf93b4935eb0c977635b763 ++Author: Anthony Green ++Date: Thu Feb 7 16:43:36 2013 -0500 ++ ++ Add libtool-ldflags. Define toolexeclibdir for non-GCC builds. ++ ++commit ffef2e046aaec853be356f0b8770a335185ea9cf ++Author: Anthony Green ++Date: Thu Feb 7 15:47:01 2013 -0500 ++ ++ x32 and libtool fixes ++ ++commit 95eecebb2858dc6f1495a61072ff36d0a8127144 ++Author: Anthony Green ++Date: Thu Feb 7 15:32:46 2013 -0500 ++ ++ Remove a.out cruft from dist ++ ++commit 176aa9d2e23d9cd57d6f250692d910b408f9a651 ++Author: Anthony Green ++Date: Thu Feb 7 15:29:22 2013 -0500 ++ ++ Fix GCC usage test and update README ++ ++commit f3a4f3fdde89b04d66983a42a25d09161c5d4d54 ++Author: Anthony Green ++Date: Thu Feb 7 09:57:20 2013 -0500 ++ ++ Fixes for AIX xlc compiler. ++ ++commit 522f8fef49848927482bc63c94afaea5b84e5ec1 ++Author: Anthony Green ++Date: Wed Feb 6 20:31:31 2013 -0500 ++ ++ Fix man page. Clean out junk. ++ ++commit c4dfa259eb4e8e6f4c397868d7fee80aa0bb6a12 ++Author: Anthony Green ++Date: Wed Feb 6 17:43:24 2013 -0500 ++ ++ Bump soversion ++ ++commit f62bd63fe6123cadedb8b2b2c72eb549c40fbce9 ++Author: Anthony Green ++Date: Wed Feb 6 17:38:32 2013 -0500 ++ ++ Release candidate 1 ++ ++commit f7cd61e9e68a4a51147df04d75bfe5b91b9d9286 ++Author: Anthony Green ++Date: Wed Feb 6 17:38:04 2013 -0500 ++ ++ Fix pkgconfig install bits ++ ++commit 6a790129427121f7db2d876e7218a3104e6d2741 ++Author: Anthony Green ++Date: Wed Feb 6 17:37:15 2013 -0500 ++ ++ Work around LLVM ABI problem on x86-64 ++ ++commit 370112938e705128fd5dd4017fc1a1210bd0271a ++Merge: bada2e3 bcc0c28 ++Author: Anthony Green ++Date: Sun Jan 27 05:09:04 2013 -0800 ++ ++ Merge pull request #28 from jralls/master ++ ++ Reorder x86_64 checks ++ ++commit bcc0c28001b6d427d5cd8037d2e3c892babc6b4c ++Author: John Ralls ++Date: Sat Jan 26 15:21:14 2013 -0800 ++ ++ Reorder x86_64 tests ++ ++ So that darwin and cygwin/mingw are tested before the generic check -- ++ which allows them to actually be set. ++ ++commit bada2e326d9a9acf3ae40cfa4f5d7a9ba97b2ea8 ++Author: Anthony Green ++Date: Mon Jan 21 08:02:07 2013 -0500 ++ ++ Update README ++ ++commit 655bb8f3690feba8e840a5f1854b1d78ed08f692 ++Merge: 1035ffb 840f975 ++Author: Anthony Green ++Date: Mon Jan 21 08:01:24 2013 -0500 ++ ++ Merge branch 'master' of github.com:/atgreen/libffi ++ ++commit 1035ffb2f468e1a1c401d58cff7e7abb69838e68 ++Merge: aeb8719 4086024 ++Author: Anthony Green ++Date: Mon Jan 21 07:55:53 2013 -0500 ++ ++ Update README ++ ++commit 840f975866052fdd91b2c224d56e01ae5900b60d ++Merge: aeb8719 4086024 ++Author: Anthony Green ++Date: Mon Jan 21 07:55:53 2013 -0500 ++ ++ Merge branch 'master' of github.com:/atgreen/libffi ++ ++commit aeb8719a34756969970603fca4568530d56708af ++Author: Anthony Green ++Date: Mon Jan 21 07:37:30 2013 -0500 ++ ++ New microblaze support ++ ++commit 40860245a4fd91a1b88adc9171ec993c549e45d5 ++Author: Anthony Green ++Date: Mon Jan 21 07:37:30 2013 -0500 ++ ++ New microblaze support ++ ++commit 20cae32b152b43679ae65a85db9a1c6bb8a143dd ++Author: Anthony Green ++Date: Mon Jan 21 07:07:38 2013 -0500 ++ ++ Xtensa support ++ ++commit 9742f91782faef4a15941508a22c408fb7d1d227 ++Author: Anthony Green ++Date: Mon Jan 21 07:03:41 2013 -0500 ++ ++ Mention IBM XL compiler support on AIX. ++ ++commit f03eab08248f122ce3b623a18df9e19fae1b6e98 ++Author: Anthony Green ++Date: Fri Jan 11 17:14:11 2013 -0500 ++ ++ Remove obsolete inline test functions ++ ++commit 05fbe1faedc7b2580d5f14010d00e9e3cee73951 ++Author: Anthony Green ++Date: Fri Jan 11 16:54:40 2013 -0500 ++ ++ xlc compiler support ++ ++commit 0b4986a7889ed1864674192228f1162c1b5770a8 ++Author: Anthony Green ++Date: Fri Jan 11 11:19:52 2013 -0500 ++ ++ [travis] install dejagnu with sudo ++ ++commit 3c337eef51ab9a4993fc875bfa26289dd6a08881 ++Author: Anthony Green ++Date: Fri Jan 11 11:18:14 2013 -0500 ++ ++ [travis] install dejagnu ++ ++commit 90720962ce1baf9fc35d1bde1738102bcd5bd5ed ++Author: Anthony Green ++Date: Fri Jan 11 10:57:30 2013 -0500 ++ ++ Add first travis config file ++ ++commit bff052d9cd5be41ba9e47c76114054af487d3c30 ++Author: Anthony Green ++Date: Fri Jan 11 10:24:32 2013 -0500 ++ ++ 32-bit x86 fix and more ++ ++commit cd41aeab6176f839167955c016ecc19f65f75df3 ++Author: Anthony Green ++Date: Thu Jan 10 17:25:45 2013 -0500 ++ ++ Add compiler column to table ++ ++commit 8bf987d4df7c4d21435b9211f6cc86abf5904b42 ++Author: Anthony Green ++Date: Thu Jan 10 17:24:51 2013 -0500 ++ ++ Fix for sunpro compiler on Solaris ++ ++commit 3ee74fd6dc8ccd32b608bbff73526838fc34f70b ++Author: Anthony Green ++Date: Thu Jan 10 17:15:03 2013 -0500 ++ ++ Update documentation version. ++ ++commit 13e2d7b92557a9511a0414df82bf2df3edc55cba ++Author: Anthony Green ++Date: Thu Jan 10 10:52:02 2013 -0500 ++ ++ Handle both 32 and 64-bit x86 builds regardless of target triple ++ ++commit 5141543000fc86a3d49a907a2313713ee79e504d ++Author: Anthony Green ++Date: Thu Jan 10 07:35:53 2013 -0500 ++ ++ Don't run EH tests with non-GNU compiler ++ ++commit 56ba8d86f47937a0afb81a2b9e77c9d235d9db45 ++Author: Anthony Green ++Date: Thu Jan 10 07:25:10 2013 -0500 ++ ++ Don't use warning checking macro with sun compiler ++ ++commit 6a028caec1b2c7904feb4c4f9cb7e1125e1d1b60 ++Author: Anthony Green ++Date: Thu Jan 10 01:19:43 2013 -0500 ++ ++ Don't use GCCisms to define types when ++ + building with the SUNPRO compiler. ++ ++commit 2d9b3939751b3ef9739049509d353ade10b32a8f ++Author: Anthony Green ++Date: Wed Jan 9 21:14:54 2013 -0500 ++ ++ Fix for closures with sunpro compiler ++ ++commit 8308984e479e3274a36e98e8272b5adbb6b774c2 ++Author: Anthony Green ++Date: Tue Jan 8 15:14:21 2013 -0500 ++ ++ Make sure we're running dejagnu tests with the right compiler. ++ ++commit f26c7ca67147450db2fe25ea932944e6cf145d5c ++Author: Anthony Green ++Date: Tue Jan 8 14:47:05 2013 -0500 ++ ++ Make compiler options in dejagnu runs compiler specific ++ ++commit 74c776e21907fc2e59257c021f23077f8b7966cb ++Author: Anthony Green ++Date: Tue Jan 8 12:25:54 2013 -0500 ++ ++ Switch x86 Solaris to X86 from X86_64 ++ ++commit 8962c8c8d06803e310bac0ffc8e84ea15daeff3f ++Author: Anthony Green ++Date: Tue Jan 8 12:22:24 2013 -0500 ++ ++ Fix read-only eh_frame test ++ ++commit 35ddb69c2b49746d940e919ca226ecc1be94f14a ++Author: Anthony Green ++Date: Tue Jan 8 07:53:37 2013 -0500 ++ ++ Only emit DWARF unwind info when building with GCC ++ ++commit f7879bc3f3a8d0bbfcc38771732c160a58ba9cd8 ++Author: Anthony Green ++Date: Tue Jan 8 07:30:28 2013 -0500 ++ ++ Testsuite fix for Solaris vendor compiler ++ ++commit 67cea90fc0897021466fd102671019d30db474cd ++Author: Anthony Green ++Date: Mon Jan 7 06:30:24 2013 -0500 ++ ++ mend ++ ++commit 0de3277b18cf54be3b81d509b9be9b47d9bc1e82 ++Author: Thorsten Glaser ++Date: Mon Dec 3 00:02:31 2012 +0000 ++ ++ Testsuite fixes (was Re: [PATCH] Fix libffi on m68k-linux-gnu, completely) ++ ++ Dixi quod… ++ ++ >although I believe some 3.0.11 checks to be broken: ++ ++ And indeed, with a few minor changes on top of git master, ++ I still get a full run of PASS plus one XPASS on amd64-linux! ++ ++ With the other patches (from this message’s parent) and ++ these applied, I get a full PASS on m68k-linux as well. ++ ++ So, please git am these three diffs ☺ ++ ++ bye, ++ //mirabilos ++ -- ++ FWIW, I'm quite impressed with mksh interactively. I thought it was much ++ *much* more bare bones. But it turns out it beats the living hell out of ++ ksh93 in that respect. I'd even consider it for my daily use if I hadn't ++ wasted half my life on my zsh setup. :-) -- Frank Terbeck in #!/bin/mksh ++ From 5cb15a3bad1f0fb360520dd48bfc938c821cdcca Mon Sep 17 00:00:00 2001 ++ From: Thorsten Glaser ++ Date: Sun, 2 Dec 2012 23:20:56 +0000 ++ Subject: [PATCH 1/2] Fix tests writing to a closure retval via pointer casts ++ ++ As explained in ++ all other tests that do the same cast to an ffi_arg pointer instead. ++ ++ PASS on amd64-linux (Xen domU) and m68k-linux (ARAnyM) ++ ++ Signed-off-by: Thorsten Glaser ++ ++commit 8f4772f383abd71cfa141c8a70ba11c1aa4ebe2c ++Author: Anthony Green ++Date: Mon Jan 7 06:14:53 2013 -0500 ++ ++ m68k fixes for signed 8 and 16-bit calls. ++ ++commit ea7f8440d58afbebb181e295ff564fdf3d6590a0 ++Author: Anthony Green ++Date: Fri Jan 4 09:09:32 2013 -0500 ++ ++ remove gcc-ism ++ ++commit f06c0f10377ac04eeba5e632dbe5c62c629df4e6 ++Author: Anthony Green ++Date: Wed Jan 2 09:39:17 2013 -0500 ++ ++ Add missing ChangeLog entry and generated files. ++ ++commit 1f8675d4c101d19d67ca0a55ff2ba973349558ad ++Merge: 335f419 f6b58d2 ++Author: Anthony Green ++Date: Wed Jan 2 06:34:38 2013 -0800 ++ ++ Merge pull request #26 from rofl0r/master ++ ++ fix build error on ppc when long double == double ++ ++commit 335f419a86090cda9f215d149572f9481c3ad034 ++Merge: 53236d5 6d6f711 ++Author: Anthony Green ++Date: Wed Jan 2 06:30:03 2013 -0800 ++ ++ Merge pull request #23 from rurban/master ++ ++ cygwin/mingw shared libs need libtool LDFLAGS = -no-undefined ++ ++commit 53236d5061034cc0a7f4647fc1bd05ba1aeb3d2a ++Author: Anthony Green ++Date: Wed Jan 2 09:24:55 2013 -0500 ++ ++ Regenerate files ++ ++commit 72222ca3fbe560e13c8dc89ca441b28b7cc74daf ++Author: Anthony Green ++Date: Wed Jan 2 09:06:38 2013 -0500 ++ ++ Update texinfo.tex ++ ++commit 1e326c95431fc9896422fa36659f3e833852579c ++Author: Anthony Green ++Date: Wed Jan 2 09:05:02 2013 -0500 ++ ++ Update config.guess and config.sub ++ ++commit cb6671f5b8a9596ff968c6b6c304f70adf71b368 ++Author: Anthony Green ++Date: Wed Jan 2 08:56:07 2013 -0500 ++ ++ Missing .gitignore changes for xcode support ++ ++commit ebbe77966855395a2a47ed2c09a38f93eb0481cf ++Author: Anthony Green ++Date: Wed Jan 2 08:54:05 2013 -0500 ++ ++ missed x32 libtool patch. ++ ++commit 4394096da0aca0dd422b479a043c18b4f05c5770 ++Author: Anthony Green ++Date: Wed Jan 2 08:51:35 2013 -0500 ++ ++ missed trampoline_table patch. Move to GCC. ++ ++commit ed7a59c3ff7c84bd95c374a5aff21599f705e6dc ++Author: Anthony Green ++Date: Wed Jan 2 08:48:01 2013 -0500 ++ ++ Windows symbol export fix. Move to GCC. ++ ++commit ccee09a4ff843b11c7d8b6819776f57d187305c7 ++Author: Anthony Green ++Date: Wed Jan 2 08:41:55 2013 -0500 ++ ++ +2012-03-21 Peter Rosin ++ + ++ + * testsuite/lib/target-libpath.exp [*-*-cygwin*, *-*-mingw*] ++ + (set_ld_library_path_env_vars): Add the library search dir to PATH ++ + (and save PATH for later). ++ + (restore_ld_library_path_env_vars): Restore PATH. ++ ++commit 089dbce7cc0889eb26444d89ae062c73c69f26f0 ++Author: Anthony Green ++Date: Wed Jan 2 08:37:35 2013 -0500 ++ ++ med ++ ++commit 980a334c42b4b0eff32e55929ec6727d1326b05d ++Author: Anthony Green ++Date: Wed Jan 2 07:36:42 2013 -0500 ++ ++ Test GCC update ++ ++commit 8bad679ade5000e57cdc9cacde22e8b99840930f ++Author: Anthony Green ++Date: Wed Jan 2 08:28:35 2013 -0500 ++ ++ New stand-alone patch ++ ++commit 981c32ee115e9f0d6546a74592875e138222a9d1 ++Author: Anthony Green ++Date: Wed Jan 2 07:34:03 2013 -0500 ++ ++ Merge with GCC. Eliminate quilt bits. ++ ++commit 61a054929517fb80c437ba71c91f3e20cfff581a ++Author: Anthony Green ++Date: Wed Nov 28 06:07:41 2012 -0500 ++ ++ Refresh config.guess and config.sub ++ ++commit f6b58d2bdc0a24ce94dedce59802f091979df265 ++Author: rofl0r ++Date: Thu Nov 22 16:26:21 2012 +0100 ++ ++ fix build on ppc when long double == double ++ ++commit 69da33a0761aeac73f9e9646269da61c906d6020 ++Author: Anthony Green ++Date: Mon Nov 12 15:25:47 2012 -0500 ++ ++ Pull in config.sub for aarch64 support and more ++ ++commit f680b598b7bdde325ac9349e8c35151c228bf2df ++Author: Anthony Green ++Date: Tue Nov 6 16:00:40 2012 -0500 ++ ++ Add missing aarch64 configury bits ++ ++commit dfadfb19853c57c8623c436d0ef2bdafab24b433 ++Author: Anthony Green ++Date: Wed Oct 31 06:46:41 2012 -0400 ++ ++ Rebase for ppc64 fix ++ ++commit e944b8c7eb1e2eeb9c0f3b9742b4d7f476860ce1 ++Author: Anthony Green ++Date: Tue Oct 30 14:06:09 2012 -0400 ++ ++ Add PaX work-around ++ ++commit 9ccd51be1fdeb99f8b4f42f905166c2abbba8ac0 ++Merge: f342996 fa5d747 ++Author: Anthony Green ++Date: Tue Oct 30 13:37:37 2012 -0400 ++ ++ Fix commit conflicts ++ ++commit f342996cb50eb23b868afcff5ac0cdbb6b505d63 ++Author: Anthony Green ++Date: Tue Oct 30 07:42:27 2012 -0400 ++ ++ Darwin12 fix ++ ++commit 58e8b66f70cef2e3c9b0e5a707b45d634cbbf5d9 ++Author: Anthony Green ++Date: Tue Oct 30 07:07:19 2012 -0400 ++ ++ AArch64 port ++ ++commit fa5d747905472571fd472c07d4726017624f66b3 ++Author: Anthony Green ++Date: Tue Oct 30 07:07:19 2012 -0400 ++ ++ AArch64 port ++ ++commit 6993a6686f43f2313b18142c1e96189a27db2aa3 ++Author: Anthony Green ++Date: Tue Oct 30 06:59:32 2012 -0400 ++ ++ Fix autoconf macros ++ ++commit 70084e70ddb13b29dd05c751b1904de206bbe790 ++Author: Anthony Green ++Date: Fri Oct 12 23:55:06 2012 -0400 ++ ++ Update Tile* port info ++ ++commit 9c00a3f6742d61404b31268cc773e7130ff43331 ++Author: Anthony Green ++Date: Fri Oct 12 16:46:06 2012 -0400 ++ ++ TILE-Gx/TILEPro support ++ ++commit 048d2f41c3a6664b4b64bf21e804686662da4160 ++Author: Anthony Green ++Date: Thu Oct 11 10:55:25 2012 -0400 ++ ++ Rebase ++ ++commit 6d6f71108064f5069edd7bf771059d3b82640135 ++Author: Reini Urban ++Date: Sat Jul 7 12:42:00 2012 -0500 ++ ++ cygwin/mingw shared libs need libtool LDFLAGS = -no-undefined ++ ++ otherwise only static libs are created. ++ ++commit d330f19292da8f39a78a9e2b0ba08df8094e3bc5 ++Author: Nicolas Lelong ++Date: Sat May 5 09:37:02 2012 -0400 ++ ++ iOS build fixes. ++ ++commit 09b23cfc1d6d15361eee18818851fd3cacb26559 ++Author: Anthony Green ++Date: Fri Apr 27 08:29:48 2012 -0400 ++ ++ Update README with Blackfin/uClinux support ++ ++commit 213ed15c70e72d666154c08e2b41dae3f61f20d3 ++Author: Anthony Green ++Date: Fri Apr 27 01:34:15 2012 -0400 ++ ++ Add blackfin supprt from Alexandre Keunecke. ++ ++commit ff3d76fd427382ce7d2b2ed54acdd0bce470ca4f ++Author: Anthony Green ++Date: Wed Apr 11 23:16:48 2012 -0400 ++ ++ 3.0.11 ++ ++commit 7e0a412c4fd9cbe77b467a9bf86f56aea62632c3 ++Author: Anthony Green ++Date: Wed Apr 11 22:47:44 2012 -0400 ++ ++ Update files to ship ++ ++commit 39e6a5860416f7bad992149817e1da1ba7c460d4 ++Author: Zachary Waldowski ++Date: Wed Apr 11 22:39:46 2012 -0400 ++ ++ More mac/ios build improvements ++ ++commit 853cc722a16f8d1254573ef3bb73c7b8f3d8a110 ++Author: Anthony Green ++Date: Tue Apr 10 06:33:33 2012 -0400 ++ ++ Fix typo for darwin targets ++ ++commit 3f5023068cda07a3dd6dacbaa875a5b5fc96d4bb ++Author: Anthony Green ++Date: Fri Apr 6 20:34:51 2012 -0400 ++ ++ mend ++ ++commit ebb8e8945681ce0af7a5c47a980287e8ece84b84 ++Author: Mike Lewis ++Date: Fri Apr 6 20:02:08 2012 -0400 ++ ++ Build iOS library with xcode ++ ++commit a098b44f4c592c2192fcdef4fad6108eb3f4301c ++Author: Anthony Green ++Date: Fri Apr 6 17:04:35 2012 -0400 ++ ++ Reapply missing testsuite changes for arm ++ ++commit 10d1e51393f08c14045db85843208f44f9f1e9ba ++Author: Anthony Green ++Date: Fri Apr 6 11:57:14 2012 -0400 ++ ++ Update to rc4. Upgrade autoconf version. ++ ++commit 9bcc884276dc0a807b2605e510b11b1740dd9aa2 ++Author: Anthony Green ++Date: Fri Apr 6 11:53:07 2012 -0400 ++ ++ Fix Linux/x32 reference in README ++ ++commit a044a56b1cd2a0924f5ec0d6b5a5089d14fcd1a1 ++Author: Anthony Green ++Date: Fri Apr 6 10:39:10 2012 -0400 ++ ++ Linux/x32 libtool fix ++ ++commit 59bb61a36661b972e8443531d3b7bc736e131a4b ++Author: Anthony Green ++Date: Fri Apr 6 08:26:14 2012 -0400 ++ ++ Update libtool version, README, tests dists ++ ++commit f2981454cbe25cf9411b710f46c5f5552003a123 ++Author: Anthony Green ++Date: Thu Apr 5 15:45:19 2012 -0400 ++ ++ Revert debug code changes ++ ++commit 39dccddb606f6fdb8dcb177d416e884041da6e30 ++Author: Zachary Waldowski ++Date: Thu Apr 5 12:32:41 2012 -0400 ++ ++ Fix building with Clang for Darwin (OS X 10.6+ and iOS ++ 4.0+) ++ ++commit 3afaa9a34a81a305227ae8cf4f12b9d0484d055e ++Author: Peter Rosin ++Date: Tue Apr 3 07:40:31 2012 -0400 ++ ++ Fix return_uc.c test case on windows. ++ ++commit 65f40c35a2873d8328359ec4512bd0736dbe32c7 ++Author: Anthony Green ++Date: Tue Apr 3 07:35:59 2012 -0400 ++ ++ Repair ppc build regression. ++ ++commit 0a1ab12a8d15caa894116a82249551f23ef65612 ++Author: Peter Rosin ++Date: Fri Mar 30 08:14:08 2012 -0400 ++ ++ Various MSVC-related changes. ++ ++commit e1539266e6c6dde3c99832323586f33f977d1dc0 ++Author: Anthony Green ++Date: Fri Mar 30 00:40:18 2012 -0400 ++ ++ ARM VFP fix for old toolchains ++ ++commit 7c5e60b5f47d725036a72162f136272bc407e3a1 ++Author: Anthony Green ++Date: Thu Mar 29 08:48:22 2012 -0400 ++ ++ Rebase on fixed GCC sources ++ ++commit e72ed5eeaa9cfb0fdc86f6b3422734177b659f96 ++Author: Anthony Green ++Date: Wed Mar 21 09:52:28 2012 -0400 ++ ++ Fix vararg float test ++ ++commit bd78c9c3311244dd5f877c915b0dff91621dd253 ++Author: Anthony Green ++Date: Wed Mar 21 08:09:30 2012 -0400 ++ ++ More cygwin fixes ++ ++commit 84d3253f86dad6b4f261231935675d35fd964b05 ++Author: Anthony Green ++Date: Mon Mar 19 23:07:35 2012 -0400 ++ ++ Rebase post GCC merge ++ ++commit 964c5b93f80dcaacf73056b7d15a4d2b4b7a217c ++Author: Anthony Green ++Date: Sat Mar 3 14:46:20 2012 -0500 ++ ++ abi check fixes and Linux/x32 support ++ ++commit 6c194233a5f6f1d274669afc5924a9e1f69d4876 ++Author: Anthony Green ++Date: Sat Mar 3 14:17:54 2012 -0500 ++ ++ Add -no-undefined for both 32- and 64-bit x86 ++ windows-like hosts. ++ ++commit 8360bf1cd0aba8db5582266da70467de7e89a57a ++Author: Anthony Green ++Date: Thu Feb 23 07:01:13 2012 -0500 ++ ++ Ensure that users don't include ffitarget.h directly ++ ++commit d578b89619cf3d2baff027b203619dc307fc12e3 ++Author: Anthony Green ++Date: Wed Feb 15 00:18:18 2012 -0500 ++ ++ Fix ABI check regression ++ ++commit dee20f8e45c486f5018f31e09bb362992aa498c3 ++Author: Anthony Green ++Date: Fri Feb 10 13:06:46 2012 -0500 ++ ++ Rebased from gcc ++ ++commit 4130e1972d001143e5e9f3c6b65f2a6f9524169e ++Author: Anthony Green ++Date: Fri Feb 3 13:18:27 2012 -0600 ++ ++ Refresh autoconf-archive m4 scripts ++ ++commit 1ff9c604bb214b5a305064af1049577ef783730a ++Author: Anthony Green ++Date: Wed Feb 1 16:34:30 2012 -0600 ++ ++ Rebase from GCC ++ ++commit 211060eb8f714af0e935430efa6bb45e8e3ffc5d ++Author: Anthony Green ++Date: Mon Jan 23 14:24:01 2012 -0500 ++ ++ Alpha fix ++ ++commit 78d9c638ba0de6edfbc603fd65d19c6562663248 ++Author: Anthony Green ++Date: Mon Jan 23 14:17:24 2012 -0500 ++ ++ mend ++ ++commit afaf3381604bd81803d8a5f3bf4d462299f1aac3 ++Author: Anthony Green ++Date: Mon Jan 23 14:17:13 2012 -0500 ++ ++ mend ++ ++commit 9e9c4aeb77de5608d602109f22100c1c0c79faad ++Author: Anthony Green ++Date: Mon Jan 23 14:11:23 2012 -0500 ++ ++ Add Amiga support ++ ++commit 8efc0b1f4027d5a3cbf205e55d422d94e60f3226 ++Author: Anthony Green ++Date: Mon Jan 23 13:47:38 2012 -0500 ++ ++ Unlikely fixes ++ ++commit 1df51398ae183dc208ba4599ee867278b04d13d3 ++Author: Anthony Green ++Date: Mon Jan 23 13:43:59 2012 -0500 ++ ++ mend ++ ++commit cd2277cc796b96b149cd284ae85326529fe7fb9c ++Author: Anthony Green ++Date: Mon Jan 23 13:43:38 2012 -0500 ++ ++ mend ++ ++commit 164e6fe04b189746c8bd5810c6e3e919770bb9d4 ++Author: Anthony Green ++Date: Mon Jan 23 12:41:06 2012 -0500 ++ ++ m68k fixes ++ ++commit c365ee7577bef00cb3c2c0b5224147aea04138d8 ++Author: Anthony Green ++Date: Mon Jan 23 11:13:18 2012 -0500 ++ ++ Refresh ++ ++commit f22c38bbd93bcc0c04bf26c3e414556b3177c385 ++Author: Anthony Green ++Date: Fri Nov 18 15:13:41 2011 -0500 ++ ++ Update variadic patch ++ ++commit 03e9ee321a3c208f88d2432587ce40b2bb2430ba ++Author: Anthony Green ++Date: Fri Nov 18 15:13:00 2011 -0500 ++ ++ Fix cls_double_va.c and update docs ++ ++commit 95f31151ec792809cfb80d385350f9f56d95aa25 ++Author: Anthony Green ++Date: Sat Nov 12 23:46:05 2011 -0500 ++ ++ Rerun automake ++ ++commit 198ed1ef85cf18342627f8d44bc3f12c9975a49d ++Author: Anthony Green ++Date: Sat Nov 12 23:45:20 2011 -0500 ++ ++ Update version number ++ ++commit 4f17e1f142e805b13959ba2594ee735eae439f4e ++Author: Anthony Green ++Date: Sat Nov 12 17:22:24 2011 -0500 ++ ++ Fix last patch ++ ++commit ff9454da44859716a5bd4eaa344499288c79694f ++Author: Anthony Green ++Date: Sat Nov 12 17:18:51 2011 -0500 ++ ++ Add David Gilbert's variadic function call support ++ ++commit ea14ae85e8f54ff046b7fb8a9cfe349475272044 ++Author: Anthony Green ++Date: Sat Nov 12 16:36:59 2011 -0500 ++ ++ clean up ++ ++commit 52891f8a93f9b8de801cca4cf05639422dc9773e ++Author: Anthony Green ++Date: Sat Nov 12 16:35:55 2011 -0500 ++ ++ Add powerpc soft float support ++ ++commit c8f1bde8e2566c5a87474b4d08aa934d6d28ee75 ++Author: Anthony Green ++Date: Sat Nov 12 16:21:02 2011 -0500 ++ ++ Remove junk file ++ ++commit 6a6e7f862f3cc677e19131587caa619e7f9c7ffd ++Author: Anthony Green ++Date: Sat Nov 12 16:20:42 2011 -0500 ++ ++ Fix kfreebsd ++ ++commit d52fbed05ccbdee9ed8b9c911cbb4f85b0ff0f2a ++Author: Anthony Green ++Date: Sat Nov 12 16:13:41 2011 -0500 ++ ++ Add missing ChangeLog entry ++ ++commit 322052ce65c4fdac85bedc24726fd0e0094ba521 ++Author: Anthony Green ++Date: Sat Nov 12 16:11:49 2011 -0500 ++ ++ Fix arm wince alignment issue ++ ++commit af18df2bc2f52df81e7b5c619bd86db8489dc873 ++Author: Anthony Green ++Date: Sat Nov 12 15:52:08 2011 -0500 ++ ++ Remove use of ppc string instructions ++ ++commit 236c9391321f83ad40daf03f40c35c9ebc1da6b3 ++Author: Anthony Green ++Date: Sat Nov 12 07:37:40 2011 -0500 ++ ++ Fix darwin11 build problem ++ ++commit c411f140f305ebb00d33c92b7cb2742bcd241b6a ++Author: Anthony Green ++Date: Sat Nov 12 07:32:36 2011 -0500 ++ ++ Fix ax_enable_builddir macro on BSD systems ++ ++commit 3d56106b07735abef6ae9f032e94f560a0ed2f30 ++Author: Anthony Green ++Date: Sat Nov 12 07:20:24 2011 -0500 ++ ++ Rebase ++ ++commit 8c01954c50bf8ef2e00a3db166060a1b8f83a20d ++Author: Anthony Green ++Date: Tue Sep 6 14:26:32 2011 -0400 ++ ++ Build assembly files with debug info ++ ++commit fed646a2078969f4ce89c29107f1e72e03f4a977 ++Author: Anthony Green ++Date: Tue Sep 6 09:50:20 2011 -0400 ++ ++ Regenerate configury with missing m4 macros ++ ++commit d76441cf71216f8f1e62e7ec852a7f4e21371ec8 ++Author: Anthony Green ++Date: Wed Aug 24 10:14:23 2011 -0400 ++ ++ Update list of supported OpenBSD systems ++ ++commit ee6696fdf4768ba6dd037fb6dd99435afa13816e ++Author: Anthony Green ++Date: Tue Aug 23 12:30:29 2011 -0400 ++ ++ 3.0.11-rc1. soname bump. ++ ++commit c6265c36a91eab8175d0e72db84d8225418f2379 ++Author: Anthony Green ++Date: Tue Aug 23 10:31:33 2011 -0400 ++ ++ Version 3.0.10 ++ ++commit cc5e41bf32d18a14dbdd653d52eacdbdc934c392 ++Author: Anthony Green ++Date: Mon Aug 22 16:34:24 2011 -0400 ++ ++ Fix use of autoconf macros ++ ++commit 049d8386ff52399e69a530b55b9feedc8a2589d2 ++Author: Anthony Green ++Date: Mon Aug 22 14:50:10 2011 -0400 ++ ++ Many new patches ++ ++commit 3b7efa4e74f0dcebf70b447391987aedd3473306 ++Author: Anthony Green ++Date: Mon Aug 15 13:25:13 2011 -0400 ++ ++ Revert remove-debug-code patch temporarily (for ARM Fedora release) ++ ++commit d992ac54a2a9e7e064ffebcb91e05e7cb86185c7 ++Author: Anthony Green ++Date: Fri Jul 29 17:32:53 2011 -0400 ++ ++ Refresh from GCC ++ ++commit 2d3fb36420e09304220ee6c0652bae5eccdb965d ++Author: Anthony Green ++Date: Wed Mar 30 16:54:42 2011 -0400 ++ ++ Fix darwin EH ++ ++commit 30ff28e1d8cd9ed5319f1fbe9c7cccacc8161fb3 ++Author: Anthony Green ++Date: Mon Feb 28 15:36:23 2011 -0500 ++ ++ Fix permissions ++ ++commit 09f8f310f4f53a24289682d3d28f4399d7bafc3b ++Author: Anthony Green ++Date: Mon Feb 28 15:36:07 2011 -0500 ++ ++ More AIX fixes. rc9. ++ ++commit 53d7b165642c220aa5166ba350b490802f359b54 ++Merge: 18dd85d 3000dc2 ++Author: Anthony Green ++Date: Mon Feb 28 15:23:31 2011 -0500 ++ ++ Merge branch 'master' of https://github.com/landonf/libffi-ios ++ ++commit 18dd85d6cb9f3f3eea2a3b70eb4e150045905c55 ++Author: Anthony Green ++Date: Fri Feb 25 16:23:04 2011 -0500 ++ ++ rc8. fix last patch. ++ ++commit 74ee6ea8b42e60d44a3ae8938b1e42a38c1e66b4 ++Author: Anthony Green ++Date: Fri Feb 25 15:52:14 2011 -0500 ++ ++ rc7. More AIX fixes. ++ ++commit 2541679dbd3db0014890f42192dbf8008ab923fa ++Author: Anthony Green ++Date: Fri Feb 25 15:09:13 2011 -0500 ++ ++ Fix ppc32 bug ++ ++commit cbb062cc35c518004f1ab45c847f8ec4f66069ad ++Author: Anthony Green ++Date: Thu Feb 17 20:39:21 2011 -0500 ++ ++ Another non-GCC configury fix ++ ++commit 8cf8878425e9971866fa6b27a3e4914729ad3960 ++Author: Anthony Green ++Date: Tue Feb 15 15:19:49 2011 -0500 ++ ++ Fix ax_cc_maxopt.m4 ++ ++commit 24b72070c0937f9000744c77a636f07e04786b6a ++Author: Anthony Green ++Date: Mon Feb 14 15:30:57 2011 -0500 ++ ++ Fix warning and msvcc patches ++ ++commit d72c49e556a8c516e97f6722d1be2f1209c21207 ++Author: Anthony Green ++Date: Sun Feb 13 11:41:05 2011 -0500 ++ ++ Add missing msvcc.sh ++ ++commit 3000dc237f6017a7445d8404097a4f46b73fdd29 ++Merge: 55e4a5a 1fbf9dc ++Author: Landon Fuller ++Date: Sun Feb 13 08:55:53 2011 -0500 ++ ++ Merge remote branch 'upstream/master' ++ ++commit 1fbf9dc44feea564e84ad7406d17c5d5906ce0e0 ++Author: Anthony Green ++Date: Sun Feb 13 08:06:39 2011 -0500 ++ ++ Fix bad_abi test. rc5. ++ ++commit 90af15ef5c1614b76370c4d13954586fabf9e8e3 ++Author: Anthony Green ++Date: Sat Feb 12 12:29:36 2011 -0500 ++ ++ iOS fixes ++ ++commit 55e4a5aa1568558a04aa40f16fc022e459af53e3 ++Author: Landon Fuller ++Date: Sat Feb 12 12:13:46 2011 -0500 ++ ++ Add support for building a full armv6/armv7/i386 universal iOS library ++ ++commit a0c80f279b8733d001cb5e5c5a3289ecb7a6e56a ++Author: Landon Fuller ++Date: Sat Feb 12 11:43:49 2011 -0500 ++ ++ Update my e-mail address. ++ ++commit 8195e0e11df7a53fa474caa9375f73ca1136ed66 ++Author: Landon Fuller ++Date: Sat Feb 12 11:27:00 2011 -0500 ++ ++ Fix symbol prefixes on Darwin. ++ ++commit 56b3f8cef0f28cefaa0f40fe0cf7c524adef131d ++Author: Landon Fuller ++Date: Sat Feb 12 11:14:54 2011 -0500 ++ ++ Modify the ffi_closure structures to hold table/table entry pointers instead of a code buffer. ++ ++ This re-integrates commit da2773e02ab26cc11a7f. ++ ++commit 28a00f61ff3f64c4eb2269ce2aea3d493274469e ++Author: Landon Fuller ++Date: Sat Feb 12 11:01:48 2011 -0500 ++ ++ Apple assembler support; fixed most gas/ELF-isms. ++ ++commit 7f2ea33a80bfced5e48ed7292f3b8f057d54ff8f ++Author: Landon Fuller ++Date: Sat Feb 12 10:39:18 2011 -0500 ++ ++ Replace RETLDM macro. ++ ++ The macro is incompatible with Apple's assembler; switch to ++ a simple inline version. ++ ++commit 92ff23e77fa586455b427b71f49e1d9502470e6e ++Author: Landon Fuller ++Date: Sat Feb 12 10:24:49 2011 -0500 ++ ++ Switch to the current iOS 4.2 SDK. ++ ++commit 58fb8ca2dfb89ad70284bb9678d3d4dbb658c8a7 ++Merge: cc3fbd9 71c792f ++Author: Landon Fuller ++Date: Sat Feb 12 10:23:19 2011 -0500 ++ ++ Merge remote branch 'upstream/master' ++ ++commit cc3fbd975ce9366d4c40a6ff6c108f664867bd7c ++Merge: e449a43 f6ab3ed ++Author: Landon Fuller ++Date: Sat Feb 12 10:21:02 2011 -0500 ++ ++ Merge branch 'master' of github.com:landonf/libffi-ios ++ ++commit e449a43bbe12f8119399928db1ae26adc71dde14 ++Author: Landon Fuller ++Date: Sat Feb 12 10:20:42 2011 -0500 ++ ++ Allow specification of the minimum supported iOS version. ++ ++commit 71c792f51bcf3e2f334e5ea1fb1a8b667cb3aedb ++Author: Anthony Green ++Date: Sat Feb 12 09:33:11 2011 -0500 ++ ++ rc4 ++ ++commit 7c7c9f327299331022f6000603a35f2310dfe308 ++Author: Anthony Green ++Date: Sat Feb 12 09:29:29 2011 -0500 ++ ++ ungccify parts of the build ++ ++commit ed62e48b95a0fa60b685f647cb73c9e190eec35c ++Author: Anthony Green ++Date: Fri Feb 11 12:23:58 2011 -0500 ++ ++ Fix permissions ++ ++commit 17d9e9e68ddb1b915a0b9751713033861b598575 ++Author: Anthony Green ++Date: Fri Feb 11 12:23:20 2011 -0500 ++ ++ Use newer autotools. Only build debug.c when --enable-debug. ++ ++commit 6972a4ffda75761eaab7dfbe0fb1516b255e8e0c ++Author: Anthony Green ++Date: Fri Feb 11 07:32:51 2011 -0500 ++ ++ Fix xlc build on AIX ++ ++commit 1833aa0fb9831eb0725b63e35886c0f6d35df480 ++Author: Anthony Green ++Date: Fri Feb 11 07:11:04 2011 -0500 ++ ++ sparc ABI test fix. ++ ++commit f1fb139b4e283fffdcf205a903943d5e9d2bb2a2 ++Author: Anthony Green ++Date: Wed Feb 9 18:30:02 2011 -0500 ++ ++ Fix tests ++ ++commit 5cb470331d181c84d5d621e88868327a324a5898 ++Author: Anthony Green ++Date: Wed Feb 9 15:23:06 2011 -0500 ++ ++ Fix permissions ++ ++commit 269deef6dbbb426695919d3398357fada3bb288c ++Author: Anthony Green ++Date: Wed Feb 9 15:22:23 2011 -0500 ++ ++ rc3 ++ ++commit 42695e72504f647444b8e8e9b90bd24f1e3220e1 ++Author: Anthony Green ++Date: Wed Feb 9 15:12:35 2011 -0500 ++ ++ Fix IRIX support ++ ++commit a6e56b97f62a3feeb3301c24a2e4cae55e546021 ++Author: Anthony Green ++Date: Wed Feb 9 15:00:42 2011 -0500 ++ ++ Add powerpc64-*-darwin* support ++ ++commit 747d6c32d4abb07c10c3a1f93579c3929aaa2487 ++Author: Anthony Green ++Date: Wed Feb 9 14:56:23 2011 -0500 ++ ++ Add Interix support ++ ++commit eab6e41cde382aa07de6c011d514a14c0d62eb47 ++Author: Anthony Green ++Date: Wed Feb 9 10:15:02 2011 -0500 ++ ++ Remove README.markdown form libffi-ios ++ ++commit 69dbe845f4ee3e6ce8999f17a1e4f2179ef7da89 ++Author: Anthony Green ++Date: Wed Feb 9 07:38:43 2011 -0500 ++ ++ Fix xfails ++ ++commit f498318c07b95137fe259d86bdbe15347588b84a ++Author: Anthony Green ++Date: Wed Feb 9 06:26:46 2011 -0500 ++ ++ Update README for iOS again ++ ++commit 630b9c0ac43c7edcbfd892e23c09fb26724f4ac0 ++Author: Anthony Green ++Date: Wed Feb 9 06:24:23 2011 -0500 ++ ++ Update to rc2 ++ ++commit 0cad4386fa4c9ea5f8ca88b16247db4e5c8fea90 ++Author: Anthony Green ++Date: Wed Feb 9 06:11:46 2011 -0500 ++ ++ Add ChangeLog entry. Fix copyright headers. ++ ++commit 09cb76f2645bd2c151846e9249d8ea707ba01e8c ++Author: Anthony Green ++Date: Tue Feb 8 20:39:51 2011 -0500 ++ ++ Add missing change ++ ++commit 2e3a48ccdd54340983c46a29a0b41985e3e789ac ++Author: Anthony Green ++Date: Tue Feb 8 20:37:26 2011 -0500 ++ ++ Fix make dist ++ ++commit 5e4814d9928e236a2a4afe84d6e1d4fdaa473206 ++Author: Anthony Green ++Date: Tue Feb 8 19:46:28 2011 -0500 ++ ++ fix permissions ++ ++commit 5c0cc6f1536aa1738795a97303810a823c7fa2cb ++Author: Anthony Green ++Date: Tue Feb 8 19:45:59 2011 -0500 ++ ++ 3.0.10rc1 ++ ++commit 857fe3de46d2286afa2fe772920ecf4aefa1688f ++Author: Anthony Green ++Date: Tue Feb 8 19:39:20 2011 -0500 ++ ++ Clean ups ++ ++commit e2214f8adb5577c247452e2cc9f4cbe304d7ca9f ++Author: Anthony Green ++Date: Tue Feb 8 19:22:56 2011 -0500 ++ ++ Update README ++ ++commit 1106229a5721a659da5c231ec0e8211119615394 ++Merge: bc9d0be f6ab3ed ++Author: Anthony Green ++Date: Tue Feb 8 19:20:09 2011 -0500 ++ ++ Add iOS support ++ ++commit bc9d0be2958ce475757f34dd2c878948aa77a39f ++Author: Anthony Green ++Date: Tue Feb 8 17:04:26 2011 -0500 ++ ++ 3.0.10rc0 changes ++ ++commit 3b836249feae6d08d3e6887486e4b9961ddafa09 ++Author: Anthony Green ++Date: Tue Feb 8 14:28:59 2011 -0500 ++ ++ Rebase from GCC ++ ++commit a26e3940619faeba6de54824c9540c90b1aab513 ++Author: Anthony Green ++Date: Tue Feb 8 13:56:12 2011 -0500 ++ ++ copyright updates patch ++ ++commit b8099539f00e224107594101e9760b6dc081a056 ++Author: Anthony Green ++Date: Tue Feb 8 13:50:43 2011 -0500 ++ ++ Fix msvcc.sh botch ++ ++commit dc411e8f99113a34656bfd2d3ae51259972488cc ++Author: Anthony Green ++Date: Tue Feb 8 10:49:29 2011 -0500 ++ ++ Fix HP-UX build ++ ++commit 404585d1348e30ac58203bbd876d9131e5aed874 ++Author: Anthony Green ++Date: Tue Feb 8 10:44:36 2011 -0500 ++ ++ Fix sparc v8 aggregate type returns for sun's compiler ++ ++commit 19ce713188e193e4522740d24c20170411883d2d ++Author: Anthony Green ++Date: Tue Feb 8 10:34:23 2011 -0500 ++ ++ grammar fix ++ ++commit 89284fe55f1a8ad3bddbea796ee00d0e3ba411ce ++Author: Anthony Green ++Date: Tue Feb 8 10:19:19 2011 -0500 ++ ++ Fix AIX build with IBM XLC ++ ++commit ba022c338af97cb18d9f8ed5a607fd483a61c09c ++Author: Anthony Green ++Date: Tue Feb 8 10:12:48 2011 -0500 ++ ++ fix win64-underscore patch ++ ++commit 097e5f3924ee92a3ba6cd72f787da8a3eb14fea3 ++Author: Anthony Green ++Date: Tue Feb 8 10:11:00 2011 -0500 ++ ++ x86 pcrel test part 2 ++ ++commit ed2c518d960b91d444be74e5a55779a9c4602f3b ++Author: Anthony Green ++Date: Tue Feb 8 10:10:07 2011 -0500 ++ ++ x86 pcrel test ++ ++commit 0e5843995f46900ef212531281e08b224464f413 ++Author: Anthony Green ++Date: Tue Feb 8 07:52:40 2011 -0500 ++ ++ Refresh from GCC ++ ++commit 5b9cd52784339a42e417174a55e310e214d435f9 ++Author: Anthony Green ++Date: Mon Nov 22 15:19:57 2010 -0500 ++ ++ win64-underscore patch ++ ++commit 2db72615b50eb5c0f29725c02c740a2f0d7fc7d9 ++Author: Anthony Green ++Date: Sun Nov 21 10:50:56 2010 -0500 ++ ++ Rebase ++ ++commit f6ab3edc23dc8fc7c47a31c896044150c23f04b5 ++Author: Landon Fuller ++Date: Wed Oct 27 19:34:51 2010 -0400 ++ ++ Include the license header in the generated output. ++ ++commit cef619462887fa0f360e3ee702d1e04f112b5b38 ++Author: Landon Fuller ++Date: Wed Oct 27 13:59:30 2010 -0400 ++ ++ Add missing copyright/license header. ++ ++commit 53f387b203413c9aa6e31f49dbb70d37d816330b ++Author: Landon Fuller ++Date: Sun Sep 19 19:57:17 2010 -0700 ++ ++ Minor README fix. ++ ++commit 4fbcb5b5fbce11f4b168060e00639db33c85b75b ++Author: Landon Fuller ++Date: Sun Sep 19 19:50:37 2010 -0700 ++ ++ Minor README fix. ++ ++commit 8e7652ef6acab5db7a29f786686a54f05cdbdc7d ++Author: Landon Fuller ++Date: Sun Sep 19 19:49:39 2010 -0700 ++ ++ Add a libffi-ios-specific github README. ++ ++commit 83038cf24aa1a92b62b91ffee1dcc25d79243484 ++Author: Landon Fuller ++Date: Sun Sep 19 14:36:45 2010 -0700 ++ ++ Implement FFI_EXEC_TRAMPOLINE_TABLE allocator for iOS/ARM. ++ ++ This provides working closure support on iOS/ARM devices where ++ PROT_WRITE|PROT_EXEC is not permitted. The code passes basic ++ smoke tests, but requires further review. ++ ++commit b00ff3e98fdde622cef617030e14d5356dff988f ++Author: Landon Fuller ++Date: Sun Sep 19 14:22:26 2010 -0700 ++ ++ Rename the generated symbol ++ ++commit da2773e02ab26cc11a7fe87e985599f35cdf0649 ++Author: Landon Fuller ++Date: Sun Sep 19 14:21:37 2010 -0700 ++ ++ Modify the ffi_closure structures to hold table/table entry pointers instead of a code buffer. ++ ++commit 01d71b7bed41844f80cb9feef20dcc5ece5ba2d0 ++Author: Landon Fuller ++Date: Sun Sep 19 14:21:14 2010 -0700 ++ ++ Regenerated the autoconf script ++ ++commit 19afda0069c42e51c81dca7b10a5cf884b4cdce0 ++Author: Landon Fuller ++Date: Sun Sep 19 14:20:52 2010 -0700 ++ ++ Enable AC_SUBST for FFI_EXEC_TRAMPOLINE_TABLE ++ ++commit 9e1196444e78aef20028c18891f44ebe39a815fd ++Author: Landon Fuller ++Date: Sun Sep 19 10:43:06 2010 -0700 ++ ++ Add a hard-coded FFI_EXEC_TRAMPOLINE_TABLE arm implementation. ++ ++ This implements support for re-mapping a shared table of executable ++ trampolines directly in front of a writable configuration page, working ++ around PROT_WRITE restrictions for sandboxed applications on Apple's ++ iOS. ++ ++ This implementation is for testing purposes; a proper allocator is still ++ necessary, and ARM-specific code needs to be moved out of ++ src/closures.c. ++ ++commit f38364b399184e682fc3e785084bd497827bc5af ++Author: Landon Fuller ++Date: Sun Sep 19 10:42:36 2010 -0700 ++ ++ Fix symbol prefix for ffi_closure_SYSV_inner on Darwin. ++ ++commit 36849e7716b77aa25e4175d1f4be1b93dbf47aac ++Author: Landon Fuller ++Date: Sun Sep 19 09:35:04 2010 -0700 ++ ++ Whitespace/comment fixes. ++ ++commit b764162526854686e579a48b6ac5981f4eb886a3 ++Author: Landon Fuller ++Date: Sun Sep 19 09:04:34 2010 -0700 ++ ++ Fix the script name (build-iphone.sh -> build-ios.sh) ++ ++commit a3d9aa85013341451ea97766485b7a11852d32b2 ++Author: Landon Fuller ++Date: Sun Sep 19 09:03:52 2010 -0700 ++ ++ Update the autogenerated autoconf/automake files. ++ ++commit c71480eaf839f26bbdfcd8965f65ac4d8defddc0 ++Author: Landon Fuller ++Date: Sun Sep 19 09:02:05 2010 -0700 ++ ++ Update automake/autoconf to conditionally build src/arm/trampoline.S if FFI_EXEC_TRAMPOLINE_TABLE is enabled. ++ ++commit 9af9291b73bc5e27ecd949bec8157f20426d65b8 ++Author: Landon Fuller ++Date: Sun Sep 19 08:52:33 2010 -0700 ++ ++ Add the trampoline table generated by gentramp.sh ++ ++commit 68ce0c383ece84f69945d1c8c3fed03f7f9cb5d6 ++Author: Landon Fuller ++Date: Sun Sep 19 08:38:19 2010 -0700 ++ ++ Add a shell script that generates the ARM trampoline page. ++ ++ This generates a page of 340 trampolines, aligned within one page. The ++ trampolines use pc-relative addressing to reference config data ++ (context, jump address) from a page placed directly prior to the ++ trampoline page. This can be used on systems -- such as iOS -- that do not ++ support writable, executable memory by remapping the executable page ++ containing the trampolines directly above a newly allocated writable ++ config page. ++ ++commit 75af086be8830a8eafe9b1ebda199d788bcb0c62 ++Author: Landon Fuller ++Date: Sat Sep 18 18:12:19 2010 -0700 ++ ++ Update autoconf files ++ ++commit 1ac92cca9b02ef8d6a769f0de1adccd5c9630355 ++Author: Landon Fuller ++Date: Sat Sep 18 18:08:14 2010 -0700 ++ ++ Add autoconf check for W^X platforms that require a trampoline table. ++ ++ This adds the FFI_EXEC_TRAMPOLINE_TABLE. The flag is enabled for ++ arm-apple-darwin, where PROT_EXEC on writable (or formerly writable) pages is ++ not permitted for sandboxed binaries. ++ ++commit be72fbab29b7190c702d8e1ac3d149855e95879d ++Author: Landon Fuller ++Date: Sat Sep 18 18:02:25 2010 -0700 ++ ++ Use the correct host triple for arm/darwin ++ ++commit 70150bdf4509269965c72f2032bf74f285767afe ++Author: Landon Fuller ++Date: Sat Sep 18 16:38:03 2010 -0700 ++ ++ Add missing UNWIND entry; disables .pad on non-EABI targets. ++ ++commit 6b452bafaec498df975ba8ac4c99de174e5f74f7 ++Author: Landon Fuller ++Date: Sat Sep 18 16:21:32 2010 -0700 ++ ++ Apple assembler support; fixed most gas/ELF-isms. ++ ++commit 8ddac835b6f8b54ede764d0ea977dee4c82e2d67 ++Author: Landon Fuller ++Date: Sat Sep 18 15:38:06 2010 -0700 ++ ++ Fix placement of the __APPLE__ macro. ++ ++commit 69043d02936bb0579ac59b4ee1ed8dec38c38db7 ++Author: Landon Fuller ++Date: Sat Sep 18 15:32:08 2010 -0700 ++ ++ Work-around libffi's FP ABI detection. ++ ++ On iOS, we must use the AAPCS floating point return value calling ++ conventions. libffi's ARM implementation will only use these conventions ++ if __SOFTFP__ is defined, which is not the case when GCC's ++ -mfloat-abi defaults to 'softfp' instead of 'soft'. To work around this ++ we manually define __SOFTFP__ for Apple platforms in the ARM-specific ++ sysv.S. ++ ++ See also: ++ http://developer.apple.com/library/ios/#documentation/Xcode/Conceptual/iPhoneOSABIReference/Introduction/Introduction.html ++ http://infocenter.arm.com/help/topic/com.arm.doc.ihi0042d/IHI0042D_aapcs.pdf ++ ++commit a82e6c354ea805114642a6e440abd0832cb1d23f ++Author: Landon Fuller ++Date: Sat Sep 18 14:44:24 2010 -0700 ++ ++ Add a stub iOS build script to drive autoconf ++ ++commit 84e8de6e9fc19388f6f1102c013b7d0d52940ecc ++Author: Anthony Green ++Date: Fri Aug 6 01:35:12 2010 -0400 ++ ++ Restore execute permissions ++ ++commit 3aeecc9eb1a6feba6549849cdd335c926415a4fc ++Author: Anthony Green ++Date: Thu Aug 5 15:19:00 2010 -0400 ++ ++ Fix win64-struct-args patch ++ ++commit 00d0b59cd13f89ab8b44bd894eb7f0a131fcb472 ++Author: Anthony Green ++Date: Thu Aug 5 14:56:53 2010 -0400 ++ ++ Fix debug build for windows ++ ++commit bda487e87064f27965155459a62dc52a744778d0 ++Author: Anthony Green ++Date: Thu Aug 5 09:02:41 2010 -0400 ++ ++ Don't use -safeseh with ml64 ++ ++commit c1d28ba8d5029795af313ffeb81c97efc6d4c847 ++Author: Anthony Green ++Date: Thu Aug 5 08:48:16 2010 -0400 ++ ++ stdcall-x86-closure-fix ++ ++commit 5feacad4a56c85b3f23a267a30b2cf424cd59548 ++Author: Anthony Green ++Date: Thu Aug 5 08:30:04 2010 -0400 ++ ++ define generic symbols carefully ++ ++commit 10ea848900bc3018ac213cef52b44cacbe5cbebc ++Author: Anthony Green ++Date: Thu Aug 5 08:24:27 2010 -0400 ++ ++ don't copy win64 struct args ++ ++commit d14178be4c49c3ada44a9fe9efe11d444372ddab ++Author: Anthony Green ++Date: Fri Jul 23 09:14:00 2010 -0400 ++ ++ FFI_LAST_ABI fix ++ ++commit 3f5b1375ab1e2b8e3d593e21b27097a4a50f9b83 ++Author: Anthony Green ++Date: Mon Jul 12 14:39:18 2010 -0400 ++ ++ rebase ++ ++commit eaf444eabc4c78703c0f98ac0197b1619c1b1bef ++Author: Anthony Green ++Date: Sat Jul 10 08:59:09 2010 -0400 ++ ++ Fix selinux test ++ ++commit 630974152247f100ece4d44f10c3721bb4599fbf ++Author: Anthony Green ++Date: Wed May 5 20:14:56 2010 -0400 ++ ++ Micharl Kohler's spelling fixes ++ ++commit 9dc9a293f3d4589fcaf02dd4288c8cebaefa508e ++Author: Anthony Green ++Date: Tue Apr 13 10:33:52 2010 -0400 ++ ++ Rebase to latest GCC sources ++ ++commit f2c2a4fce9b3eca9f39b4f3545118bc256da4a73 ++Author: Anthony Green ++Date: Tue Apr 13 10:19:28 2010 -0400 ++ ++ Remove warnings and add OS/2 support ++ ++commit c0b69e57d529e33d18b658cc5572a21e3663247c ++Author: Anthony Green ++Date: Tue Mar 30 08:30:22 2010 -0400 ++ ++ Dan Witte's windows build fixes. ++ ++commit 59a259f4d348f593b45f452309f4d020a28051c4 ++Author: Anthony Green ++Date: Mon Mar 15 05:57:51 2010 -0400 ++ ++ Remove junk file ++ ++commit 3de1eb36d37a66829e606421939874d0d60d816d ++Author: Anthony Green ++Date: Mon Mar 15 05:57:24 2010 -0400 ++ ++ fix-comments patch ++ ++commit c3813b6d7f8a777700f4c5862190c0db148d4de8 ++Author: Anthony Green ++Date: Tue Jan 26 16:48:56 2010 -0500 ++ ++ Rebuild Makefiles with automake 1.11.1 for CVE-2009-4029. ++ ++commit 8d27f68baa365bf883b6053c5f6bc819646d5434 ++Author: Anthony Green ++Date: Fri Jan 15 11:35:37 2010 -0500 ++ ++ Mention recent changes in README ++ ++commit ff3cd68b8cf2d9a28cad7aa9beff46236eacec8c ++Author: Anthony Green ++Date: Fri Jan 15 11:27:24 2010 -0500 ++ ++ Add msvc.sh wrapper ++ ++commit cadeba6cb53414a1253582f1719c286665de7b6c ++Author: Anthony Green ++Date: Fri Jan 15 10:46:51 2010 -0500 ++ ++ Microsoft Visual C port ++ ++commit 0739e7dc00db766eb64f502ec4137b817638c9a1 ++Author: Anthony Green ++Date: Fri Jan 15 09:48:33 2010 -0500 ++ ++ Add x86 Sun Studio compiler support ++ ++commit edfdfd2e85b8d01d2455934f1d7f4d7eb2f3cf1c ++Author: Anthony Green ++Date: Wed Jan 13 02:56:19 2010 -0500 ++ ++ Add closure example doc ++ ++commit 7b7a42f221cf171e8d09df34cac6dc1fd8458cc3 ++Author: Anthony Green ++Date: Tue Jan 12 09:14:14 2010 -0500 ++ ++ Rebase from GCC ++ ++commit 4b18d1f73dc7733137869e4ab5725cb90c1c8fde ++Author: Anthony Green ++Date: Fri Jan 1 10:24:27 2010 -0500 ++ ++ Add x86-64 MingW to README ++ ++commit c3042afaf3f84abbbe9c91bf9bc9896b0d9eb003 ++Author: Anthony Green ++Date: Fri Jan 1 08:08:02 2010 -0500 ++ ++ Reset quilt patches post 3.0.9 merge with GCC ++ ++commit b0304e9679bdfec6ac45a57b5c96542697249418 ++Author: Anthony Green ++Date: Thu Dec 31 11:32:40 2009 -0500 ++ ++ Update version ++ ++commit 2e7e03d014d9c9bf40e97ce75cba089ad052fa6b ++Author: Anthony Green ++Date: Thu Dec 31 07:43:22 2009 -0500 ++ ++ Final updates before 3.0.9 ++ ++commit aea706c52825c8eee677ffa7fdbdd3aed1725492 ++Author: Anthony Green ++Date: Tue Dec 29 10:09:31 2009 -0500 ++ ++ really 3.0.9rc12 ++ ++commit 0cfe60e9d13f132b88995cfee41f2156344f6fa2 ++Author: Anthony Green ++Date: Tue Dec 29 10:06:04 2009 -0500 ++ ++ 3.0.9rc12 ++ ++commit 14e2e92e8645804b6940b3e96c98e9f7f384a6b2 ++Author: Anthony Green ++Date: Sun Dec 27 21:03:33 2009 -0500 ++ ++ 3.0.9rc11 ++ ++commit 884402787bf8eaf7ec207085037cf8ace2f660ec ++Author: Anthony Green ++Date: Sat Dec 26 12:57:23 2009 -0500 ++ ++ HPUX support and avr32 test fixes. ++ ++commit 01c78756aff22efb1f122f8e93e068d7bf2185c7 ++Author: Anthony Green ++Date: Sat Dec 26 10:05:18 2009 -0500 ++ ++ 3.0.9rc9 ++ ++commit 70868464651320268d79c6894db5a50fdc11032a ++Author: Anthony Green ++Date: Sat Dec 26 09:58:03 2009 -0500 ++ ++ Remove xfails for mips and arm ++ ++commit 838d4ad920ec85cf5ca3b511221d67f6d9a99024 ++Author: Anthony Green ++Date: Sat Dec 26 09:57:27 2009 -0500 ++ ++ Remove a bunch of xfails. ++ ++commit 7e37eaaf772f48906e69618c773b0a36c3927de9 ++Author: Anthony Green ++Date: Sat Dec 26 07:46:50 2009 -0500 ++ ++ Fix huge_struct for solaris ++ ++commit 07cc7a37194bc34064ebed7f2724333a798411c8 ++Author: Anthony Green ++Date: Sat Dec 26 07:23:04 2009 -0500 ++ ++ 3.0.9rc8 ++ ++commit 2b9be16ffabc81326128bc1bbdddff8ddc5d13d3 ++Author: Anthony Green ++Date: Sat Dec 26 07:04:45 2009 -0500 ++ ++ 3.0.9rc8 ++ ++commit 9458d88f676e9a21ab8993a54e16754b11687419 ++Author: Anthony Green ++Date: Sat Dec 26 07:02:27 2009 -0500 ++ ++ Rebase from GCC ++ ++commit 6a3412417593f068a04dc6163f4269cb295ad5ca ++Author: Anthony Green ++Date: Sat Dec 26 06:51:33 2009 -0500 ++ ++ Add Andreas Schwab's powerpc fix ++ ++commit 39c8792ece1043f41f4c395a2ce71f4cf0ff4674 ++Author: Anthony Green ++Date: Fri Dec 25 21:52:28 2009 -0500 ++ ++ 3.0.9rc7 ++ ++commit 1d04af52e3e24db69f742064694c22f8df5cc70e ++Author: Anthony Green ++Date: Fri Dec 25 09:50:36 2009 -0500 ++ ++ Updated some mips XFAILs ++ ++commit 26e9509c9b7929bc4fcf697071699051a652b1fd ++Author: Anthony Green ++Date: Fri Dec 25 02:19:23 2009 -0500 ++ ++ Clean up ChangeLog.libffi for older patches. ++ ++commit 9c157d3215e4393777f83eb6fa801df6528f40d7 ++Author: Anthony Green ++Date: Fri Dec 25 02:15:40 2009 -0500 ++ ++ Clean up undefine_AC_ARG_VAR_PRECIOUS patch. ++ ++commit d22de05b0bfc480766bc1240615ce2830eee71b8 ++Author: Anthony Green ++Date: Fri Dec 25 02:04:23 2009 -0500 ++ ++ Fix patches ++ ++commit 1fe3dc7c20dc4dbd8fed0d19c8618027d44ed971 ++Author: Anthony Green ++Date: Fri Dec 25 01:39:00 2009 -0500 ++ ++ Add windows support patch. ++ ++commit f7c0bc613a88f7dbc2d18b345c10fa438833c170 ++Author: Anthony Green ++Date: Fri Dec 25 01:22:11 2009 -0500 ++ ++ 3.0.9rc6 ++ ++commit c7fa2da8260258c11ab1dc7ac06fb611a2c1b50f ++Author: Anthony Green ++Date: Thu Dec 24 07:22:44 2009 -0500 ++ ++ 3.0.9rc6 ++ ++commit da11bece0fde66fc0268db3a01207dda857e25d2 ++Author: Anthony Green ++Date: Thu Dec 24 05:34:46 2009 -0500 ++ ++ Release 3.0.9rc5 ++ ++commit e3399b11edeab546b066bfc18574f3edb905d0dc ++Author: Anthony Green ++Date: Thu Dec 24 01:09:32 2009 -0500 ++ ++ Update README ++ ++commit 115ab36fceee69740a01ce49bc27e1908cc237b1 ++Author: Anthony Green ++Date: Thu Dec 24 00:22:00 2009 -0500 ++ ++ Update missing changes for 3.0.9r4. ++ ++commit f8c7a245bf5a80bd7e730ec03fcad17c8dcfcb07 ++Author: Anthony Green ++Date: Wed Dec 23 23:46:22 2009 -0500 ++ ++ Switch to quilt. Rebase to latest GCC. ++ ++commit ce806772f02387b9a74f6496a263a368bccd5d59 ++Merge: cd98813 dcc1f6b ++Author: Anthony Green ++Date: Mon Oct 5 00:41:35 2009 -0400 ++ ++ Merge branch 'master' of git@github.com:atgreen/libffi ++ ++commit dcc1f6b4f1ffd2713bf68b791a13f85d455c8b1b ++Author: Anthony Green ++Date: Mon Oct 5 00:29:33 2009 -0400 ++ ++ More clean up. ++ ++commit 2829f5941a223b9d851d8ab6318318e6197d7e01 ++Author: Anthony Green ++Date: Mon Oct 5 00:28:03 2009 -0400 ++ ++ Clean up ++ ++commit cd98813de517ea64041637e3e78d27a001d6d3b4 ++Author: Anthony Green ++Date: Mon Oct 5 00:25:29 2009 -0400 ++ ++ From Jens Rehsack. Fix for 64-bit AIX. ++ ++commit e4a91de766acc47f6c50f13cc11719a65e23ecba ++Author: Anthony Green ++Date: Mon Oct 5 00:16:17 2009 -0400 ++ ++ From Abdulaziz Ghuloum. Adds special case for Snow Leopard. ++ ++commit 3425a763bcdaadb8b430226f427ec833afdcc96a ++Author: Anthony Green ++Date: Sun Oct 4 23:57:29 2009 -0400 ++ ++ Fix detection of free/openbsd. From Alexis Ballier. ++ ++commit 2340e7a777902de61499d47823ad8d5e0eeb6203 ++Author: Anthony Green ++Date: Sun Oct 4 23:53:17 2009 -0400 ++ ++ AVR support ++ ++commit 5cbe2058c128e848446ae79fe15ee54260a90559 ++Author: Anthony Green ++Date: Sun Oct 4 23:53:11 2009 -0400 ++ ++ Initial stand-alone patch. ++ ++commit c6dddbd02bad9654ed58cdb0feb360934d105dec ++Author: Anthony Green ++Date: Sun Oct 4 08:11:33 2009 -0400 ++ ++ Initial commit ++ ++commit 5ffc0c37486fb1538bccc0ca7acc807d4f1af932 ++Author: Anthony Green ++Date: Sun Oct 4 07:58:22 2009 -0400 ++ ++ Update version to 3.0.9rc1. Add more useful things to .gitignore. ++ ++commit bd29f83ee9f6fa6b65adee9d3f57834f364d9887 ++Author: Anthony Green ++Date: Tue Sep 29 12:07:26 2009 -0400 ++ ++ Add .gitignore ++ ++commit 9474f853f83e3f0167c1b306177321bfcc93e56d ++Author: Anthony Green ++Date: Tue Sep 29 11:13:02 2009 -0400 ++ ++ Remove old CVSROOT files. ++ ++commit 0c25275ec24bfe2c2c25a000465f0950ef9dd51b ++Author: twall ++Date: Wed Aug 19 12:57:34 2009 +0000 ++ ++ Apply Dave Korn's cygwin/GCC changes ++ ++commit 39228c27ed3f677a95b46380a8d31602b5777e1a ++Author: aph ++Date: Tue Jun 16 18:00:47 2009 +0000 ++ ++ 2009-06-16 Wim Lewis ++ ++ * src/powerpc/ffi.c: Avoid clobbering cr3 and cr4, which are ++ supposed to be callee-saved. ++ * src/powerpc/sysv.S (small_struct_return_value): Fix overrun of ++ return buffer for odd-size structs. ++ ++commit 5e93cc704d127c2c8ae7f5d2cef621145d43e777 ++Author: aph ++Date: Tue Jun 16 17:41:47 2009 +0000 ++ ++ 2009-06-16 Andreas Tobler ++ ++ PR libffi/40444 ++ * testsuite/lib/libffi-dg.exp (libffi_target_compile): Add ++ allow_stack_execute for Darwin. ++ ++commit b509af8959dc371b92392c623522ea6f4946a71d ++Author: aph ++Date: Tue Jun 16 16:17:52 2009 +0000 ++ ++ 2009-06-16 Andrew Haley ++ ++ * configure.ac (TARGETDIR): Add missing blank lines. ++ * configure: Regenerate. ++ ++commit d57e96dc56ee76fbbb9b59d73aeaa92354db5ecb ++Author: aph ++Date: Tue Jun 16 09:59:02 2009 +0000 ++ ++ 2009-06-16 Andrew Haley ++ ++ * testsuite/libffi.call/cls_align_sint64.c, ++ testsuite/libffi.call/cls_align_uint64.c, ++ testsuite/libffi.call/cls_longdouble_va.c, ++ testsuite/libffi.call/cls_ulonglong.c, ++ testsuite/libffi.call/return_ll1.c, ++ testsuite/libffi.call/stret_medium2.c: Fix printf format ++ specifiers. ++ * testsuite/libffi.call/huge_struct.c: Ad x86 XFAILs. ++ * testsuite/libffi.call/float2.c: Fix dg-excess-errors. ++ * testsuite/libffi.call/ffitest.h, ++ testsuite/libffi.special/ffitestcxx.h (PRIdLL, PRIuLL): Define. ++ ++commit b01d6d1982c9e020507029bfd5a58a8c60d111fa ++Author: aph ++Date: Tue Jun 16 09:44:54 2009 +0000 ++ ++ 2009-06-16 Andrew Haley ++ ++ * testsuite/libffi.call/err_bad_typedef.c: xfail everywhere. ++ * testsuite/libffi.call/err_bad_abi.c: Likewise. ++ ++commit 35b6ded138591900a88055a8a8ac1fadc29a76d6 ++Author: aph ++Date: Fri Jun 12 15:29:20 2009 +0000 ++ ++ 2009-06-11 Kaz Kojima ++ ++ * testsuite/libffi.call/cls_longdouble_va.c: Add xfail sh*-*-linux-*. ++ * testsuite/libffi.call/err_bad_abi.c: Add xfail sh*-*-*. ++ * testsuite/libffi.call/err_bad_typedef.c: Likewise. ++ ++commit acc46605f2d95d67d69398e7644610f10a157ce3 ++Author: aph ++Date: Fri Jun 12 14:21:28 2009 +0000 ++ ++ 2009-06-12 Andrew Haley ++ ++ * ChangeLog.libffi: testsuite/libffi.call/cls_align_sint64.c, ++ testsuite/libffi.call/cls_align_uint64.c, ++ testsuite/libffi.call/cls_ulonglong.c, ++ testsuite/libffi.call/return_ll1.c, ++ testsuite/libffi.call/stret_medium2.c: Fix printf format ++ specifiers. ++ testsuite/libffi.special/unwindtest.cc: include stdint.h. ++ ++commit 16d1996ed0797bd7c11aca2b0fe7e7748751aaf6 ++Author: twall ++Date: Thu Jun 11 14:27:42 2009 +0000 ++ ++ update changelog ++ ++commit 92a515c33efe91be3cb0258f01c63aff208489c7 ++Author: twall ++Date: Thu Jun 11 14:27:28 2009 +0000 ++ ++ use ffi_closure_alloc instead of stack-based closure ++ ++commit e4363160ba9e50167f9ca0a7399d537a1d2cd0ce ++Author: twall ++Date: Thu Jun 11 14:26:23 2009 +0000 ++ ++ remove unused extern ++ ++commit 1dc2781d2ba38f5f000ff70069d617fb21e1d2af ++Author: twall ++Date: Thu Jun 11 11:36:16 2009 +0000 ++ ++ remove not-yet-applied changelog entries ++ ++commit bb27735fe689dac97ec0dc847ed8d3d519620109 ++Author: twall ++Date: Wed Jun 10 10:42:36 2009 +0000 ++ ++ add win64 support ++ ++commit b2a54c100c74854a409820817d54617fdda39eb8 ++Author: aph ++Date: Mon Jun 8 16:50:49 2009 +0000 ++ ++ 2009-06-08 Andrew Haley ++ ++ * testsuite/libffi.call/err_bad_abi.c: Add xfails. ++ * testsuite/libffi.call/cls_longdouble_va.c: Add xfails. ++ * testsuite/libffi.call/cls_dbls_struct.c: Add xfail x86_64-*-linux-*. ++ * testsuite/libffi.call/err_bad_typedef.c: Add xfails. ++ ++ * testsuite/libffi.call/stret_medium2.c: Add __UNUSED__ to args. ++ * testsuite/libffi.call/stret_medium.c: Likewise. ++ * testsuite/libffi.call/stret_large2.c: Likewise. ++ * testsuite/libffi.call/stret_large.c: Likewise. ++ ++commit 25723e7141f73d3736d7244b980c89d97db852b6 ++Author: aph ++Date: Fri Jun 5 13:03:40 2009 +0000 ++ ++ 2009-06-05 Andrew Haley ++ ++ * src/x86/win32.S (_ffi_closure_STDCALL): Import from gcc. ++ ++commit 70758199c7cd41f411987360ccb302b497a56dc9 ++Author: aph ++Date: Thu Jun 4 16:29:58 2009 +0000 ++ ++ 2009-06-04 Andrew Haley ++ ++ * src/powerpc/ffitarget.h: Fix misapplied merge from gcc. ++ ++commit e8bb12563f9aa23ddf36fa6a5b92b16b5c3e1a7f ++Author: aph ++Date: Thu Jun 4 14:59:18 2009 +0000 ++ ++ 2009-06-04 Andrew Haley ++ ++ * src/mips/o32.S, ++ src/mips/n32.S: Fix licence formatting. ++ ++commit d66a8e32c3671479e3ce0f6819673e5932ba6b7f ++Author: aph ++Date: Thu Jun 4 14:43:40 2009 +0000 ++ ++ 2009-06-04 Andrew Haley ++ ++ * src/x86/darwin.S: Fix licence formatting. ++ src/x86/win32.S: Likewise. ++ src/sh64/sysv.S: Likewise. ++ src/sh/sysv.S: Likewise. ++ ++commit 7c3b7fd6b5db746b5b09a718f3044f811372f941 ++Author: aph ++Date: Thu Jun 4 14:39:20 2009 +0000 ++ ++ 2009-06-04 Andrew Haley ++ ++ * src/sh64/ffi.c: Remove lint directives. Was missing from merge ++ of Andreas Tobler's patch from 2006-04-22. ++ ++commit 1a2f93a8b362db13638afd9fcb3f2650180bfa17 ++Author: aph ++Date: Thu Jun 4 10:45:51 2009 +0000 ++ ++ 2009-06-04 Andrew Haley ++ ++ * src/sh/ffi.c: Apply missing hunk from Alexandre Oliva's patch of ++ 2007-03-07. ++ ++commit 944c95cf7aaaaf7c5fa368cda4673dd38f45020e ++Author: aph ++Date: Wed Jun 3 17:42:56 2009 +0000 ++ ++ 2009-05-22 Dave Korn ++ ++ * src/x86/win32.S (_ffi_closure_STDCALL): New function. ++ (.eh_frame): Add FDE for it. ++ ++ 2009-05-22 Dave Korn ++ ++ * configure.ac: Also check if assembler supports pc-relative ++ relocs on X86_WIN32 targets. ++ * configure: Regenerate. ++ * src/x86/win32.S (ffi_prep_args): Declare extern, not global. ++ (_ffi_call_SYSV): Add missing function type symbol .def and ++ add EH markup labels. ++ (_ffi_call_STDCALL): Likewise. ++ (_ffi_closure_SYSV): Likewise. ++ (_ffi_closure_raw_SYSV): Likewise. ++ (.eh_frame): Add hand-crafted EH data. ++ ++ 2008-11-21 Eric Botcazou ++ ++ * src/sparc/ffi.c (ffi_prep_cif_machdep): Add support for ++ signed/unsigned int8/16 return values. ++ * src/sparc/v8.S (ffi_call_v8): Likewise. ++ (ffi_closure_v8): Likewise. ++ ++ 2008-03-26 Kaz Kojima ++ ++ * src/sh/sysv.S: Add .note.GNU-stack on Linux. ++ * src/sh64/sysv.S: Likewise. ++ ++ 2008-03-26 Daniel Jacobowitz ++ ++ * src/arm/sysv.S: Fix ARM comment marker. ++ ++commit 00fa972430bb1535a4b34bf029ebcad500027b0c ++Author: twall ++Date: Sat Dec 27 16:59:05 2008 +0000 ++ ++ properly glob-match ++ ++commit f5179e6794ac35af26fe86e468b8508a7a570c55 ++Author: twall ++Date: Fri Dec 26 19:06:28 2008 +0000 ++ ++ Mark XFAIL on longdouble tests for x86_64/mingw ++ ++commit 80e2b5a749208c8a18f994ec5bee84594d051cc8 ++Author: twall ++Date: Mon Dec 22 15:21:15 2008 +0000 ++ ++ clean up tests for win64 use ++ ++commit 7063d9996f742576095c7b0eb5016c0f9a670aec ++Author: green ++Date: Fri Dec 19 16:13:46 2008 +0000 ++ ++ Version 3.0.8 with x86-solaris support ++ ++commit bdfeb13f0df0a63b19d62597517237b54d92228b ++Author: green ++Date: Fri Dec 19 15:47:44 2008 +0000 ++ ++ Bump to 3.0.7 ++ ++commit 69205de17d6ac4c11d4ba92d6a5b40a0c5f246b2 ++Author: green ++Date: Thu Jul 24 18:03:48 2008 +0000 ++ ++ Many test fixes (failures due to excessive compiler warnings). ++ ++commit 260d513fea00b3613fe957a44a157fe72c4ca29e ++Author: green ++Date: Thu Jul 17 13:13:52 2008 +0000 ++ ++ Version 3.0.6. sh/sh64 fixes. ++ ++commit 3704031875feabb74e3655ed03cff4c2b3c76ac6 ++Author: green ++Date: Thu Apr 3 18:57:57 2008 +0000 ++ ++ Rev 3.0.5. ++ ++commit 8406f5f48f7f58a1c982a93a95d521cf82b3241f ++Author: green ++Date: Thu Apr 3 18:57:34 2008 +0000 ++ ++ 3.0.5 ++ ++commit 23a9e73212b62f9684cedb0ce70e92c59cfdaffa ++Author: green ++Date: Wed Mar 5 00:07:02 2008 +0000 ++ ++ 2008-03-04 Anthony Green ++ Blake Chaffin ++ hos@tamanegi.org ++ ++ * testsuite/libffi.call/cls_align_longdouble_split2.c ++ testsuite/libffi.call/cls_align_longdouble_split.c ++ testsuite/libffi.call/cls_dbls_struct.c ++ testsuite/libffi.call/cls_double_va.c ++ testsuite/libffi.call/cls_longdouble.c ++ testsuite/libffi.call/cls_longdouble_va.c ++ testsuite/libffi.call/cls_pointer.c ++ testsuite/libffi.call/cls_pointer_stack.c ++ testsuite/libffi.call/err_bad_abi.c ++ testsuite/libffi.call/err_bad_typedef.c ++ testsuite/libffi.call/huge_struct.c ++ testsuite/libffi.call/stret_large2.c ++ testsuite/libffi.call/stret_large.c ++ testsuite/libffi.call/stret_medium2.c ++ testsuite/libffi.call/stret_medium.c: New tests from Apple. ++ ++commit 429e37d3ad653e52e75bf725c883ab79e859f89a ++Author: green ++Date: Thu Feb 28 04:50:19 2008 +0000 ++ ++ clicky ++ ++commit 51e79c428348c033314f54bcb30f7e388c59e347 ++Author: green ++Date: Thu Feb 28 04:47:35 2008 +0000 ++ ++ getclicky ++ ++commit affcab04e280efeace45a72c4dc6152c0e4f1b7f ++Author: green ++Date: Tue Feb 26 19:01:53 2008 +0000 ++ ++ 2008-02-26 Jakub Jelinek ++ Anthony Green ++ ++ * src/alpha/osf.S: Add .note.GNU-stack on Linux. ++ * src/s390/sysv.S: Likewise. ++ * src/powerpc/linux64.S: Likewise. ++ * src/powerpc/linux64_closure.S: Likewise. ++ * src/powerpc/ppc_closure.S: Likewise. ++ * src/powerpc/sysv.S: Likewise. ++ * src/x86/unix64.S: Likewise. ++ * src/x86/sysv.S: Likewise. ++ * src/sparc/v8.S: Likewise. ++ * src/sparc/v9.S: Likewise. ++ * src/m68k/sysv.S: Likewise. ++ * src/ia64/unix.S: Likewise. ++ * src/arm/sysv.S: Likewise. ++ ++commit 59689d5522c159a3ac967adb6b891cf5f22c890f ++Author: green ++Date: Tue Feb 26 17:40:51 2008 +0000 ++ ++ 2008-02-26 Anthony Green ++ Thomas Heller ++ ++ * src/x86/ffi.c (ffi_closure_SYSV_inner): Change C++ comment to C ++ comment. ++ ++commit b13c84cf4668828ff8429ba4a2f94cd1eb574ae0 ++Author: green ++Date: Tue Feb 26 17:38:15 2008 +0000 ++ ++ 2008-02-26 Anthony Green ++ Thomas Heller ++ ++ * include/ffi.h.in: Change void (*)() to void (*)(void). ++ ++commit 265289f679ffd24a88ae1aa2cef0e4aa14703cd8 ++Author: green ++Date: Tue Feb 26 17:34:36 2008 +0000 ++ ++ 2008-02-26 Anthony Green ++ ++ * src/alpha/ffi.c: Change void (*)() to void (*)(void). ++ src/alpha/osf.S, src/arm/ffi.c, src/frv/ffi.c, src/ia64/ffi.c, ++ src/ia64/unix.S, src/java_raw_api.c, src/m32r/ffi.c, ++ src/mips/ffi.c, src/pa/ffi.c, src/pa/hpux32.S, src/pa/linux.S, ++ src/powerpc/ffi.c, src/powerpc/ffi_darwin.c, src/raw_api.c, ++ src/s390/ffi.c, src/sh/ffi.c, src/sh64/ffi.c, src/sparc/ffi.c, ++ src/x86/ffi.c, src/x86/unix64.S, src/x86/darwin64.S,> src/x86/ffi64.c: Ditto. ++ ++commit fb5036cd6d0f909918e90f7d2d9fd80d46682d5d ++Author: green ++Date: Sun Feb 24 17:25:25 2008 +0000 ++ ++ fix date ++ ++commit 40bec108e7d0181e6c9928aa7a33187bcc0f3d6f ++Author: green ++Date: Sun Feb 24 17:25:02 2008 +0000 ++ ++ New release ++ ++commit b922048fa82ea109a4af269ee47bbc2a586bbac2 ++Author: green ++Date: Sun Feb 24 17:24:00 2008 +0000 ++ ++ 2008-02-24 Anthony Green ++ ++ * configure.ac: Accept openbsd*, not just openbsd. ++ Bump version to 3.0.4. ++ * configure, doc/stamp-vti, doc/version.texi: Rebuilt. ++ * libtool-version: Increment revision. ++ * README: Update for new release. ++ ++commit affca4b92d06e5554784c7e9b233029ef83f7d8a ++Author: green ++Date: Fri Feb 22 21:53:29 2008 +0000 ++ ++ sync readme with web page. ++ ++commit 3e53d8752ea74859b4c64fbbf935e62a937c4d78 ++Author: green ++Date: Fri Feb 22 21:52:38 2008 +0000 ++ ++ New release ++ ++commit 4d92f6c8e78fe084be65f3e8b58b859901ba796d ++Author: green ++Date: Fri Feb 22 21:49:46 2008 +0000 ++ ++ 2008-02-22 Anthony Green ++ ++ * configure.ac: Bump version to 3.0.3. ++ * configure, doc/stamp-vti, doc/version.texi: Rebuilt. ++ * libtool-version: Increment revision. ++ * README: Update for new release. Clean up test docs. ++ ++commit 0e185fa11a01f816824ba2687ed3715ab6219bef ++Author: green ++Date: Fri Feb 22 21:43:18 2008 +0000 ++ ++ Update configure script. ++ ++commit f73986bd211cfbbaa593d1309504d0dc68626191 ++Author: green ++Date: Fri Feb 22 21:40:53 2008 +0000 ++ ++ 2008-02-22 Bjoern Koenig ++ Andreas Tobler ++ ++ * configure.ac: Add amd64-*-freebsd* target. ++ * configure: Regenerate. ++ ++commit 0208f68fe5de30c33e7f70ebc281635917013f5a ++Author: green ++Date: Fri Feb 22 21:15:44 2008 +0000 ++ ++ 2008-02-22 Thomas Heller ++ ++ * configure.ac: Add x86 OpenBSD support. ++ * configure: Rebuilt. ++ ++commit 01adb0e638a86cf0d5e668ed8e08be9b0cd2505f ++Author: green ++Date: Thu Feb 21 16:17:26 2008 +0000 ++ ++ Fix README. ++ ++commit 1edd4563225981a14f7d4fb9919b1ed88e38082f ++Author: green ++Date: Thu Feb 21 13:39:01 2008 +0000 ++ ++ 3.0.2 ++ ++commit c9b542800864e2204db6e83f3843a17813ba6165 ++Author: green ++Date: Thu Feb 21 13:36:43 2008 +0000 ++ ++ add missing file ++ ++commit d5fa5633d5c8d3c212a2267cfa38fba4091baa2c ++Author: green ++Date: Thu Feb 21 13:36:19 2008 +0000 ++ ++ 2008-02-21 Anthony Green ++ ++ * configure.ac: Bump version to 3.0.2. ++ * configure, doc/stamp-vti, doc/version.texi: Rebuilt. ++ * libtool-version: Increment revision. ++ * README: Update for new release. ++ ++ 2008-02-21 Björn König ++ ++ * src/x86/freebsd.S: New file. ++ * configure.ac: Add x86 FreeBSD support. ++ * Makefile.am: Ditto. ++ ++commit ac35bfc6fcadd8880c1efce36724820f9074b318 ++Author: green ++Date: Sat Feb 16 01:03:56 2008 +0000 ++ ++ Updated ++ ++commit f7942975fee7b0162647dd79e2652615b737e98e ++Author: green ++Date: Sat Feb 16 01:02:00 2008 +0000 ++ ++ 2008-02-15 Anthony Green ++ ++ * configure.ac: Bump version to 3.0.1. ++ * configure, doc/stamp-vti, doc/version.texi: Rebuilt. ++ * libtool-version: Increment revision. ++ * README: Update for new release. ++ ++ 2008-02-15 David Daney ++ ++ * src/mips/ffi.c: Remove extra '>' from include directive. ++ (ffi_prep_closure_loc): Use clear_location instead of tramp. ++ ++commit 59aa6bb1bfc86a610ac1a8b123443efd75854dd1 ++Author: green ++Date: Fri Feb 15 20:52:26 2008 +0000 ++ ++ Add more platforms. ++ ++commit 45a45ab99074448be0ae1a8d2ade50d28b60f8de ++Author: green ++Date: Fri Feb 15 19:16:36 2008 +0000 ++ ++ 3.0 notes ++ ++commit 4db74cbea888c9f1251b85baf00d99b83d3b994d ++Author: green ++Date: Fri Feb 15 19:10:26 2008 +0000 ++ ++ Update ++ ++commit c3e1101ffabf44d8a2ee46e03ba9ab582050a825 ++Author: green ++Date: Fri Feb 15 18:43:40 2008 +0000 ++ ++ 2008-02-15 Anthony Green ++ ++ * configure.ac: Bump version to 3.0.0, ++ * configure, doc/stamp-vti, doc/version.texi: Rebuilt. ++ ++ 2008-02-15 David Daney ++ ++ * src/mips/ffi.c (USE__BUILTIN___CLEAR_CACHE): ++ Define (conditionally), and use it to include cachectl.h. ++ (ffi_prep_closure_loc): Fix cache flushing. ++ * src/mips/ffitarget.h (_ABIN32, _ABI64, _ABIO32): Define. ++ ++commit 7e0cc12e9233ad285db41ce8dbdda61ed2a7fb06 ++Author: green ++Date: Fri Feb 15 15:51:03 2008 +0000 ++ ++ New release ++ ++commit 2d7dc885ec40d53866f29984d595511942c8b686 ++Author: green ++Date: Fri Feb 15 15:30:26 2008 +0000 ++ ++ * man/ffi_call.3, man/ffi_prep_cif.3, man/ffi.3: ++ Update dates and remove all references to ffi_prep_closure. ++ * configure.ac: Bump version to 2.99.9. ++ * configure, doc/stamp-vti, doc/version.texi: Rebuilt. ++ ++commit a0525f03eeaaed33b1eac80e0c016455cee3615d ++Author: green ++Date: Fri Feb 15 15:14:30 2008 +0000 ++ ++ New release. ++ ++commit 2b30dfb3146ee26ad956d00ee05eb835ca1a95b4 ++Author: green ++Date: Fri Feb 15 15:12:43 2008 +0000 ++ ++ * man/ffi_prep_closure.3: Delete. ++ * man/Makefile.am (EXTRA_DIST): Remove ffi_prep_closure.3. ++ (man_MANS): Ditto. ++ * man/Makefile.in: Rebuilt. ++ * configure.ac: Bump version to 2.99.8. ++ * configure, doc/stamp-vti, doc/version.texi: Rebuilt. ++ ++commit bf41e64840ebcb6cc31a6f028253c1fde82705d8 ++Author: green ++Date: Fri Feb 15 01:56:50 2008 +0000 ++ ++ Update. ++ ++commit 4d39ddee677bbb61d621893b91e11eac5e7c4af7 ++Author: green ++Date: Fri Feb 15 01:24:06 2008 +0000 ++ ++ * configure.ac: Bump version to 2.99.7. ++ * configure, doc/stamp-vti, doc/version.texi: Rebuilt. ++ * include/ffi.h.in LICENSE src/debug.c src/closures.c ++ src/ffitest.c src/s390/sysv.S src/s390/ffitarget.h ++ src/types.c src/m68k/ffitarget.h src/raw_api.c src/frv/ffi.c ++ src/frv/ffitarget.h src/sh/ffi.c src/sh/sysv.S ++ src/sh/ffitarget.h src/powerpc/ffitarget.h src/pa/ffi.c ++ src/pa/ffitarget.h src/pa/linux.S src/java_raw_api.c ++ src/cris/ffitarget.h src/x86/ffi.c src/x86/sysv.S ++ src/x86/unix64.S src/x86/win32.S src/x86/ffitarget.h ++ src/x86/ffi64.c src/x86/darwin.S src/ia64/ffi.c ++ src/ia64/ffitarget.h src/ia64/ia64_flags.h src/ia64/unix.S ++ src/sparc/ffi.c src/sparc/v9.S src/sparc/ffitarget.h ++ src/sparc/v8.S src/alpha/ffi.c src/alpha/ffitarget.h ++ src/alpha/osf.S src/sh64/ffi.c src/sh64/sysv.S ++ src/sh64/ffitarget.h src/mips/ffi.c src/mips/ffitarget.h ++ src/mips/n32.S src/mips/o32.S src/arm/ffi.c src/arm/sysv.S ++ src/arm/ffitarget.h src/prep_cif.c: Update license text. ++ ++commit d58b032b41a12bd3d72148da6822ab59dd698ff9 ++Author: green ++Date: Fri Feb 15 00:59:25 2008 +0000 ++ ++ New release ++ ++commit 91e5478df6d5ac63efbb10f025807b4606afab56 ++Author: green ++Date: Fri Feb 15 00:50:30 2008 +0000 ++ ++ Update supported platforms. Bump version. ++ ++commit bd0768f877c8f7fd0d36af2191b203d4d057b1ce ++Author: green ++Date: Fri Feb 15 00:45:33 2008 +0000 ++ ++ * configure.ac: Bump version to 2.99.5. ++ * configure: Rebuilt. ++ * Makefile.am (EXTRA_DIST): Add darwin64.S ++ * Makefile.in: Rebuilt. ++ * testsuite/lib/libffi-dg.exp: Remove libstdc++ bits from GCC tree. ++ * LICENSE: Update WARRANTY. ++ ++commit 49d345f767bd2cfee951bceaab6a1a07986cf293 ++Author: green ++Date: Thu Feb 14 23:43:27 2008 +0000 ++ ++ update license reference ++ ++commit 12ac48fc79b515db7c9accd9fcaa87b0dcefccdb ++Author: green ++Date: Thu Feb 14 23:42:08 2008 +0000 ++ ++ Update WARRANTY ++ ++commit 6b91c41da87e78552f2990dfc504a0a3349f340b ++Author: green ++Date: Thu Feb 14 23:38:27 2008 +0000 ++ ++ fix tarball reference ++ ++commit 2b59579e3533334bee4788e076b4e520c2ab518c ++Author: green ++Date: Thu Feb 14 23:35:58 2008 +0000 ++ ++ First update in 5 years! ++ ++commit 6cbdf3f3a3777a93382a2d508ddef1c353ff0955 ++Author: green ++Date: Thu Feb 14 22:44:06 2008 +0000 ++ ++ Fix .pc file bug and bump version ++ ++commit 1d1dc81104b209df3cfef0840735c59efae2f655 ++Author: green ++Date: Thu Feb 14 22:03:37 2008 +0000 ++ ++ Add man files and info file. Update README. Tag as 2.99.3. ++ ++commit f045a2367f793fa8b01534cf2e25bcc46afc8fa1 ++Author: tromey ++Date: Thu Feb 14 20:46:57 2008 +0000 ++ ++ Move entry from ChangeLog to ChangeLog.libffi ++ ++commit 6257f07d1a9efd27fa83639cfba281f5d3188731 ++Author: tromey ++Date: Thu Feb 14 20:33:17 2008 +0000 ++ ++ * aclocal.m4, Makefile.in, configure, fficonfig.h.in: Rebuilt. ++ * mdate-sh, texinfo.tex: New files. ++ * Makefile.am (info_TEXINFOS): New variable. ++ * doc/libffi.texi: New file. ++ * doc/version.texi: Likewise. ++ ++commit 4232af563c5509c3760a33e3684a2b958be755e1 ++Author: green ++Date: Thu Feb 14 16:19:21 2008 +0000 ++ ++ * Makefile.am (AM_CFLAGS): Don't compile with -D. ++ (lib_LTLIBRARIES): Define. ++ (toolexeclib_LIBRARIES): Undefine. ++ * Makefile.in: Rebuilt. ++ * configure.ac: Reset version to 2.99.1. ++ * configure.in: Rebuilt. ++ ++commit 961543615c31f092b578a4b4cda914db64f9d0fa ++Author: green ++Date: Thu Feb 14 15:57:40 2008 +0000 ++ ++ Fix typo. ++ ++commit aeb0abab87222f637fbf352d4effd3b76b52ed26 ++Author: green ++Date: Thu Feb 14 15:54:27 2008 +0000 ++ ++ * libffi.pc.in: Usse @PACKAGE_NAME@ and @PACKAGE_VERSION@. ++ * configure.ac: Reset version to 2.99.1. ++ * configure.in: Rebuilt. ++ * Makefile.am (EXTRA_DIST): Add ChangeLog.libffi. ++ * Makefile.in: Rebuilt. ++ * LICENSE: Update copyright notice. ++ ++commit 77fe243556433eae119d8bd7469bfccdd5bd8a1a ++Author: green ++Date: Thu Feb 14 15:37:00 2008 +0000 ++ ++ Fix make dist again ++ ++commit d4970cf4529459bf0f0e43c602cac396786c6802 ++Author: green ++Date: Thu Feb 14 15:18:56 2008 +0000 ++ ++ Fix make dist ++ ++commit f0b1462f2d3024922ad71421bd5c4311fcb16da5 ++Author: green ++Date: Thu Feb 14 15:01:41 2008 +0000 ++ ++ Use pkgconfig. Increment libtool CURRENT version. ++ ++commit 27e52f33baa069012a5adb2a3807f9ca1f2165ab ++Author: green ++Date: Sun Feb 3 13:59:48 2008 +0000 ++ ++ Fix header installs when using DESTDIR. ++ ++commit fadab28eb6e33fb6dcdd7b9323e147142216d548 ++Author: twall ++Date: Sun Feb 3 12:32:22 2008 +0000 ++ ++ update changelog ++ ++commit b5e44c8dfa92c87b99762c303cf5574a16db8f27 ++Author: twall ++Date: Sun Feb 3 01:12:32 2008 +0000 ++ ++ offset from code base address, not data base address ++ ++commit f359848d1a995c0e44566d815f218729dc996e22 ++Author: green ++Date: Fri Feb 1 21:29:43 2008 +0000 ++ ++ Fix header installs. ++ ++commit c30df49e157c7bfc8e19e3f8a72b9464fe225e54 ++Author: green ++Date: Fri Feb 1 21:13:55 2008 +0000 ++ ++ Revert my broken changes to twall's patch. ++ ++commit 675561bb9aa0732c76698df10dd3007b5d0ec759 ++Author: green ++Date: Thu Jan 31 13:44:25 2008 +0000 ++ ++ Fix make dist . ++ ++commit abc0bbf3813dc43e23d4c23e6fe794dbf287639b ++Author: green ++Date: Thu Jan 31 11:58:57 2008 +0000 ++ ++ Add Tim Wall's x86 windows patch. ++ ++commit e332366d15a31198735b593ec8f7fc0558d783b8 ++Author: green ++Date: Wed Jan 30 13:21:02 2008 +0000 ++ ++ Add HJ's -fomit-frame-pointer struct return fix ++ ++commit d4204240392af5b7750a08671b08e9c22dff5e93 ++Author: green ++Date: Wed Jan 30 12:42:34 2008 +0000 ++ ++ Clean up for new automake. ++ ++commit f4932dd020df574637c9fb3fc1bb18e5a8f304cc ++Author: green ++Date: Wed Jan 30 12:40:25 2008 +0000 ++ ++ Fixes to run testsuite ++ ++commit 085520ddc8db6a916bfc416b871fcb2d00074d40 ++Author: green ++Date: Tue Jan 29 15:16:43 2008 +0000 ++ ++ New files from gcc tree. ++ ++commit 77175b3f7234e4875a4ef554ed1fe9fdc4133794 ++Author: green ++Date: Tue Jan 29 15:15:20 2008 +0000 ++ ++ Latest gcc svn sources ++ ++commit 2544e45a0b2b634053df02da3a2ed9680eeed2a1 ++Author: green ++Date: Tue Jan 29 14:28:13 2008 +0000 ++ ++ Install ffitarget.h in $prefix/include. ++ ++commit 6002211b1cc4daeb587d054b4f83968bda2c981e ++Author: green ++Date: Tue Jan 29 12:30:10 2008 +0000 ++ ++ Add new files. ++ ++commit ccabd2b16be883cd03e5f0cd88ccfdd6ca39239d ++Author: green ++Date: Tue Jan 29 12:28:15 2008 +0000 ++ ++ Merge from gcc ++ ++commit e680ecfbfca1da8d1823e48bc89b8375e66e128b ++Author: tromey ++Date: Sun Dec 24 23:12:15 2006 +0000 ++ ++ Pulled in libffi from gcc trunk. ++ Fixed build and install for standalone use. ++ ++commit e7ba08965942ce872fdbc69f70f9848cc3d0bad6 ++Author: root ++Date: Sun Jun 4 23:22:24 2006 +0000 ++ ++ sourcware.org ++ ++commit 0cd4aa24e21aaa964dfbdebc25ec5c8188049375 ++Author: root ++Date: Sun May 30 01:51:57 2004 +0000 ++ ++ Add LockDir ++ ++commit 5826120fbd940d26cca76ed2522187505581e1ed ++Author: green ++Date: Tue Nov 4 06:09:08 2003 +0000 ++ ++ Add link to Gianni's web site. ++ ++commit 220aa4b27db42d7ffaac5056000d5179f00d5ea3 ++Author: jsm ++Date: Tue Jan 21 08:07:42 2003 +0000 ++ ++ Newer, better, increased from before! (list of acceptable anon usernames) ++ ++commit 1c3adc892cc1403dc4d3d7003a2385899836612e ++Author: green ++Date: Fri Dec 6 01:28:03 2002 +0000 ++ ++ Fixed Cygnus references. ++ ++commit 4af66bb62fab9a8e318af3bf01e5486596a0c8d4 ++Author: green ++Date: Sun Oct 21 19:18:42 2001 +0000 ++ ++ Testsuite fixes. ++ ++commit 5435965f9015ce40584c98d3816c3d05e7de1d21 ++Author: green ++Date: Mon Apr 23 00:32:03 2001 +0000 ++ ++ * include/ffi_common.h: Delete, after moving contents to... ++ * include/ffi_private.h: Subsume contents of ffi_common.h. ++ * include/Makefile.am (noinst_HEADERS): Remove ffi_common.h. ++ * include/Makefile.in: Rebuilt. ++ * arm/ffi.c, m68k/ffi.c, mips/ffi.c, powerpc/ffi.c, s390/ffi.c, ++ ia64/ffi.c: Include ffi_private.h, not ffi_common.h. ++ * alpha/ffi.c, sparc/ffi.c, x86/ffi.c: Don't include ffi_common.h. ++ * types.c, raw_api.c, java_raw_api.c, prep_cif.c: Don't include ++ ffi_common.h. ++ * debug.c: Include ffi_private.h instead of ffi_common.h. ++ ++ * mips/ffi.c (calc_n32_struct_flags): Make static. ++ (FIX_ARGP): Remove call to debugging routine ffi_stop_here. ++ ++ * mips/n32.S: Include ffi_private.h. ++ * mips/o32.S: Include ffi_private.h. ++ ++commit 6fdb7de0fe3b7385e1fd78812ae69d9b3069d994 ++Author: green ++Date: Sun Apr 22 19:38:34 2001 +0000 ++ ++ * README: Update some comments. ++ ++ * Makefile.am (SUBDIRS): Add include so ffi.h gets installed. ++ * Makefile.in: Rebuilt. ++ ++ * include/ffi.h: Change ALPHA to __alpha__ and SPARC to __sparc__. ++ * types.c: Ditto. ++ * prep_cif.c (ffi_prep_cif): Ditto. ++ ++ * alpha/ffi.c, alpha/osf.S, sparc/ffi.c, sparc/v8.S, sparc/v9.S: ++ Include ffi_private.h. ++ ++ * include/ffi_private.h (FFI_TYPE_LAST): Define. ++ ++commit bc7144b01b9707ef35f1a2e3e6996e005e82953a ++Author: green ++Date: Sun Apr 22 18:28:36 2001 +0000 ++ ++ Moved files from old home ++ ++commit e57279831e20368c1aa1d2b35462b8629be73959 ++Author: green ++Date: Sun Apr 22 18:23:47 2001 +0000 ++ ++ These are dead. ++ ++commit 7247436b5fe71767b29dc02b4da0fe18b08082e6 ++Author: green ++Date: Sun Apr 22 18:22:43 2001 +0000 ++ ++ All these files live somewhere else now. ++ ++commit a8b0d40ff908e275028f676870c31d0d70274a98 ++Author: green ++Date: Sun Apr 22 18:17:14 2001 +0000 ++ ++ Many changes. Not quite there yet. ++ ++commit f893d2273355710a290a26faebf5f12c3a34d0e3 ++Author: green ++Date: Sun Apr 22 18:13:22 2001 +0000 ++ ++ Moved m68k files ++ ++commit 688ddfeced89cbb9d37b53005e1f7f2b9c78a8d7 ++Author: green ++Date: Sun Apr 22 18:12:33 2001 +0000 ++ ++ New, target indepentent, header ++ ++commit f9e40776d488d5ecf43b3ae21444a1a2f6eca528 ++Author: green ++Date: Sun Apr 22 18:11:57 2001 +0000 ++ ++ Many changes. ++ ++commit 8c1d2eb47f6bc314c431b75c85c107e8e43c4a76 ++Author: green ++Date: Sun Apr 22 18:10:47 2001 +0000 ++ ++ Many changes ++ ++commit 1359dfc6582680a158b3caa3efb7a368da4aa12d ++Author: green ++Date: Sun Apr 22 18:10:20 2001 +0000 ++ ++ Moved ia64 files ++ ++commit 6e2de5eee316a4579869aff50c7c5f6f478582d8 ++Author: green ++Date: Sun Apr 22 18:08:11 2001 +0000 ++ ++ Moved arm files ++ ++commit 8807355af34cba8ffe87aee51152dfccec2771fa ++Author: green ++Date: Mon Apr 9 00:58:38 2001 +0000 ++ ++ Many many updates. Merge from gcc and then some. ++ ++commit f7e9f91adec4ff1c2e7a13b3de81d2c5a3f55e7e ++Author: green ++Date: Mon Apr 17 03:32:37 2000 +0000 ++ ++ Mnay fixes. ++ ++commit c4860de618f4956283f5c8230a2544e403dfe390 ++Author: green ++Date: Mon Apr 17 03:18:46 2000 +0000 ++ ++ Merge from libgcj. Merged patches from net. See ChangeLog for details. ++ ++commit c578b58314990c3853429297c38ba14015fec5fa ++Author: jsm ++Date: Sat Oct 9 20:18:16 1999 +0000 ++ ++ 1999-10-09 Jason Molenda (jsm@bugshack.cygnus.com) ++ ++ * CVSROOT/auto_checkout, CVSROOT/commit_prep, CVSROOT/log_accum: ++ Deleted; generic versions now used for all repositories. ++ ++ * CVSROOT/commitinfo, CVSROOT/loginfo: Change pathnames to ++ generic versions. ++ ++ * CVSROOT/checkoutlist: Don't try to check out the removed ++ files any longer. ++ ++commit acdb20051207fed7652dd9f122f65de5458c474c ++Author: jsm ++Date: Sat Oct 9 20:18:15 1999 +0000 ++ ++ 1999-10-09 Jason Molenda (jsm@bugshack.cygnus.com) ++ ++ * CVSROOT/auto_checkout, CVSROOT/commit_prep, CVSROOT/log_accum: ++ Deleted; generic versions now used for all repositories. ++ ++ * CVSROOT/commitinfo, CVSROOT/loginfo: Change pathnames to ++ generic versions. ++ ++ * CVSROOT/checkoutlist: Don't try to check out the removed ++ files any longer. ++ ++commit e75be655ceedf7ab24c4e99d75eec9efeb979bc7 ++Author: green ++Date: Sun Aug 8 13:16:41 1999 +0000 ++ ++ New configury ++ ++commit d6669a0dd5b266005325bbf6d5a8ff34574d809e ++Author: green ++Date: Sun Aug 8 13:05:12 1999 +0000 ++ ++ * include/ffi.h.in: Try to work around messy header problem ++ with PACKAGE and VERSION. ++ ++ * configure: Rebuilt. ++ * configure.in: Change version to 2.00-beta. ++ ++ * fficonfig.h.in: Rebuilt. ++ * acconfig.h (FFI_NO_STRUCTS, FFI_NO_RAW_API): Define. ++ ++ * src/x86/ffi.c (ffi_raw_call): Rename. ++ ++commit 4819d52b007934a40d6d29a75ee30e857c4a93ae ++Author: green ++Date: Wed Aug 4 18:02:34 1999 +0000 ++ ++ New file for Kresten's closure work ++ ++commit 2dbf801eb427cbf5021a9e1e512b5fc523524700 ++Author: green ++Date: Wed Aug 4 18:00:05 1999 +0000 ++ ++ Kresten's closure work. Initial checkin. ++ ++commit d170961701b0f2bf7e824d7caba2ebe10002ed84 ++Author: green ++Date: Thu Jul 8 14:36:52 1999 +0000 ++ ++ * configure.in: Add x86 and powerpc BeOS configurations. ++ From Makoto Kato . ++ ++commit c7747d976924ec6f2229cbcfbbdb98d364e10de9 ++Author: jsm ++Date: Wed May 12 23:32:16 1999 +0000 ++ ++ 1999-05-12 Jason Molenda (jsm@bugshack.cygnus.com) ++ * index.html: Add links to libffi* mail list archives. ++ ++commit dd2aa9a8de22e26df3bbc85d068358641f6202f7 ++Author: green ++Date: Thu May 6 05:34:36 1999 +0000 ++ ++ * configure.in: Add warning about this being beta code. ++ Remove src/Makefile.am from the picture. ++ * configure: Rebuilt. ++ * Makefile.am: Move logic from src/Makefile.am. Add changes ++ to support libffi as a target library. ++ * Makefile.in: Rebuilt. ++ * aclocal.m4, config.guess, config.sub, ltconfig, ltmain.sh: ++ Upgraded to new autoconf, automake, libtool. ++ * README: Tweaks. ++ * LICENSE: Update copyright date. ++ * src/Makefile.am, src/Makefile.in: Removed. ++ ++commit 4e9452abed58a3058ccdb446f96a29d50dda1f34 ++Author: green ++Date: Wed May 5 22:06:13 1999 +0000 ++ ++ Updated to new automake, libtool, autoconf - nothing works :-) ++ ++commit 6d3b2bddaf4967fba8b8656c01bfc77ec0f2800c ++Author: jsm ++Date: Mon Apr 26 15:55:28 1999 +0000 ++ ++ 1999-04-26 Jason Molenda (jsm@bugshack.cygnus.com) ++ * index.html: Missed a reference to libffi-discuss@cygnus.com. Fixed. ++ ++commit ebc6a9c28af831d3d187af8ff17319f0f309bd98 ++Author: jsm ++Date: Mon Apr 26 15:53:29 1999 +0000 ++ ++ 1999-04-26 Jason Molenda (jsm@bugshack.cygnus.com) ++ * index.html: Change links to ftp directory to point to sourceware ++ directory. ++ Change mailing list subscription forms to point to sourceware lists. ++ ++commit 78ffc52a8b257061348c576ccb6fbbf8b48b0fff ++Author: jsm ++Date: Sun Apr 18 01:33:21 1999 +0000 ++ ++ Standard sourceware setup. ++ ++commit b4d77e827d7ebef7e57ebcd71e71c15c62f1e0a8 ++Author: jsm ++Date: Mon Nov 30 11:11:25 1998 +0000 ++ ++ Small typeo. (I wouldn't bother except that it made the sentence hard ++ for me to parse on a casual read.) ++ ++commit bfb73f08fdc987e37070c5fb0b196fbd28872888 ++Author: jsm ++Date: Mon Nov 30 10:44:55 1998 +0000 ++ ++ A few cleanups. Most notably, point to the correct subscribe cgi-bin ++ script. ++ ++commit af8b7f037ccee3b7939ee226a1a2bbc2f057b35c ++Author: green ++Date: Mon Nov 30 06:20:05 1998 +0000 ++ ++ * index.html: Reformatted and updated to reflect hosting on ++ sourceware.cygnus.com (new mailing lists, etc). ++ ++commit 334f0b060942aff8d26badaf7dde7830450dc5da ++Author: green ++Date: Sun Nov 29 16:56:12 1998 +0000 ++ ++ initial snapshot of documentation ++ ++commit 3ab5cb4a1dcc7ecd7e773c97582b0099976c4753 ++Author: green ++Date: Sun Nov 29 16:56:10 1998 +0000 ++ ++ Initial revision ++ ++commit d2a9eb5a8b7cbc8b769809cad59c82b975c178e2 ++Merge: d3782ec bc75c54 ++Author: green ++Date: Sun Nov 29 16:48:16 1998 +0000 ++ ++ This commit was generated by cvs2svn to compensate for changes in r7, which ++ included commits to RCS files with non-trunk default branches. ++ ++commit bc75c54bd311658005b065f1bf201b204c81cbca ++Author: green ++Date: Sun Nov 29 16:48:16 1998 +0000 ++ ++ Import of v1 code. ++ ++commit d3782ec8160c644421dcea17b605fec6e328f14e ++Author: jsm ++Date: Fri Nov 20 20:18:00 1998 +0000 ++ ++ Send commit messages to mailing lists. ++ ++commit 8d8d3843c484c2bb70d8375b2b799f75eb03f709 ++Author: jsm ++Date: Thu Oct 1 22:08:36 1998 +0000 ++ ++ initial checkin ++ ++commit 49634f3bf221cc1939abafc788f7e4e31293fe73 ++Author: jsm ++Date: Thu Oct 1 22:08:35 1998 +0000 ++ ++ Add standard setup. ++ ++commit c64a84c7693f8cd400fb94bba3c9bcfd9ad1fc36 ++Author: jsm ++Date: Thu Oct 1 22:08:34 1998 +0000 ++ ++ Add readers and standard modules file. ++ ++commit 9813273b07fd082da573b3b6bfb8d23809b59eea ++Author: jsm ++Date: Thu Oct 1 22:08:33 1998 +0000 ++ ++ initial checkin +diff -r c0e311e010fc Modules/_ctypes/libffi/ChangeLog.libffi-3.1 +--- /dev/null ++++ b/Modules/_ctypes/libffi/ChangeLog.libffi-3.1 +@@ -0,0 +1,6000 @@ ++2014-03-16 Josh Triplett ++ ++ * ChangeLog: Archive to ChangeLog.libffi-3.1 and delete. Future ++ changelogs will come from git, with autogenerated snapshots shipped in ++ distributed tarballs. ++ ++2014-03-16 Josh Triplett ++ ++ Add support for stdcall, thiscall, and fastcall on non-Windows ++ x86-32. ++ ++ Linux supports the stdcall calling convention, either via ++ functions explicitly declared with the stdcall attribute, or via ++ code compiled with -mrtd which effectively makes stdcall the ++ default. ++ ++ This introduces FFI_STDCALL, FFI_THISCALL, and FFI_FASTCALL on ++ non-Windows x86-32 platforms, as non-default calling conventions. ++ ++ * Makefile.am: Compile in src/x86/win32.S on non-Windows x86-32. ++ * src/x86/ffitarget.h: Add FFI_STDCALL, FFI_THISCALL, and ++ FFI_FASTCALL on non-Windows x86-32. Increase trampoline size to ++ accomodate these calling conventions, and unify some ifdeffery. ++ * src/x86/ffi.c: Add support for FFI_STDCALL, FFI_THISCALL, and ++ FFI_FASTCALL on non-Windows x86-32 platforms; update ifdeffery. ++ * src/x86/win32.S: Support compiling on non-Windows x86-32 ++ platforms. On those platforms, avoid redefining the SYSV symbols ++ already provided by src/x86/sysv.S. ++ * testsuite/libffi.call/closure_stdcall.c: Run on non-Windows. ++ #define __stdcall if needed. ++ * testsuite/libffi.call/closure_thiscall.c: Run on non-Windows. ++ #define __fastcall if needed. ++ * testsuite/libffi.call/fastthis1_win32.c: Run on non-Windows. ++ * testsuite/libffi.call/fastthis2_win32.c: Ditto. ++ * testsuite/libffi.call/fastthis3_win32.c: Ditto. ++ * testsuite/libffi.call/many2_win32.c: Ditto. ++ * testsuite/libffi.call/many_win32.c: Ditto. ++ * testsuite/libffi.call/strlen2_win32.c: Ditto. ++ * testsuite/libffi.call/strlen_win32.c: Ditto. ++ * testsuite/libffi.call/struct1_win32.c: Ditto. ++ * testsuite/libffi.call/struct2_win32.c: Ditto. ++ ++2014-03-16 Josh Triplett ++ ++ * prep_cif.c: Remove unnecessary ifdef for X86_WIN32. ++ ffi_prep_cif_core had a special case for X86_WIN32, checking for ++ FFI_THISCALL in addition to the FFI_FIRST_ABI-to-FFI_LAST_ABI ++ range before returning FFI_BAD_ABI. However, on X86_WIN32, ++ FFI_THISCALL already falls in that range, making the special case ++ unnecessary. Remove it. ++ ++2014-03-16 Josh Triplett ++ ++ * testsuite/libffi.call/closure_stdcall.c, ++ testsuite/libffi.call/closure_thiscall.c: Remove fragile stack ++ pointer checks. These files included inline assembly to save the ++ stack pointer before and after the call, and compare the values. ++ However, compilers can and do leave the stack in different states ++ for these two pieces of inline assembly, such as by saving a ++ temporary value on the stack across the call; observed with gcc ++ -Os, and verified as spurious through careful inspection of ++ disassembly. ++ ++2014-03-16 Josh Triplett ++ ++ * testsuite/libffi.call/many.c: Avoid spurious failure due to ++ excess floating-point precision. ++ * testsuite/libffi.call/many_win32.c: Ditto. ++ ++2014-03-16 Josh Triplett ++ ++ * libtool-ldflags: Re-add. ++ ++2014-03-16 Josh Triplett ++ ++ * Makefile.in, aclocal.m4, compile, config.guess, config.sub, ++ configure, depcomp, include/Makefile.in, install-sh, ++ libtool-ldflags, ltmain.sh, m4/libtool.m4, m4/ltoptions.m4, ++ m4/ltsugar.m4, m4/ltversion.m4, m4/lt~obsolete.m4, ++ man/Makefile.in, mdate-sh, missing, testsuite/Makefile.in: Delete ++ autogenerated files from version control. ++ * .gitignore: Add autogenerated files. ++ * autogen.sh: New script to generate the autogenerated files. ++ * README: Document requirement to run autogen.sh when building ++ directly from version control. ++ * .travis.yml: Run autogen.sh ++ ++2014-03-14 Anthony Green ++ ++ * configure, Makefile.in: Rebuilt. ++ ++2014-03-10 Mike Hommey ++ ++ * configure.ac: Allow building for mipsel with Android NDK r8. ++ * Makefile.am (AM_MAKEFLAGS): Replace double quotes with single ++ quotes. ++ ++2014-03-10 Landry Breuil ++ ++ * configure.ac: Ensure the linker supports @unwind sections in libffi. ++ ++2014-03-01 Anthony Green ++ ++ * Makefile.am (EXTRA_DIST): Replace old scripts with ++ generate-darwin-source-and-headers.py. ++ * Makefile.in: Rebuilt. ++ ++2014-02-28 Anthony Green ++ ++ * Makefile.am (AM_CFLAGS): Reintroduce missing -DFFI_DEBUG for ++ --enable-debug builds. ++ * Makefile.in: Rebuilt. ++ ++2014-02-28 Makoto Kato ++ ++ * src/closures.c: Fix build failure when using clang for Android. ++ ++2014-02-28 Marcin Wojdyr ++ ++ * libffi.pc.in (toolexeclibdir): use -L${toolexeclibdir} instead ++ of -L${libdir}. ++ ++2014-02-28 Paulo Pizarro ++ ++ * src/bfin/sysv.S: Calling functions in shared libraries requires ++ considering the GOT. ++ ++2014-02-28 Josh Triplett ++ ++ * src/x86/ffi64.c (classify_argument): Handle case where ++ FFI_TYPE_LONGDOUBLE == FFI_TYPE_DOUBLE. ++ ++2014-02-28 Anthony Green ++ ++ * ltmain.sh: Generate with libtool-2.4.2.418. ++ * m4/libtool.m4, m4/ltoptions.m4, m4/ltversion.m4: Ditto. ++ * configure: Rebuilt. ++ ++2014-02-28 Dominik Vogt ++ ++ * configure.ac (AC_ARG_ENABLE struct): Fix typo in help ++ message. ++ (AC_ARG_ENABLE raw_api): Ditto. ++ * configure, fficonfig.h.in: Rebuilt. ++ ++2014-02-28 Will Newton ++ ++ * src/arm/sysv.S: Initialize IP register with FP. ++ ++2014-02-28 Yufeng Zhang ++ ++ * src/aarch64/sysv.S (ffi_closure_SYSV): Use x29 as the ++ main CFA reg; update cfi_rel_offset. ++ ++2014-02-15 Marcus Comstedt ++ ++ * src/powerpc/ffi_linux64.c, src/powerpc/linux64_closure.S: Remove ++ assumption on contents of r11 in closure. ++ ++2014-02-09 Heiher ++ ++ * src/mips/n32.S: Fix call floating point va function. ++ ++2014-01-21 Zachary Waldowski ++ ++ * src/aarch64/ffi.c: Fix missing semicolons on assertions under ++ debug mode. ++ ++2013-12-30 Zachary Waldowski ++ ++ * .gitignore: Exclude darwin_* generated source and build_* trees. ++ * src/aarch64/ffi.c, src/arm/ffi.c, src/x86/ffi.c: Inhibit Clang ++ previous prototype warnings. ++ * src/arm/ffi.c: Prevent NULL dereference, fix short type warning ++ * src/dlmalloc.c: Fix warnings from set_segment_flags return type, ++ and the native use of size_t for malloc on platforms ++ * src/arm/sysv.S: Use unified syntax. Clang clean-ups for ++ ARM_FUNC_START. ++ * generate-osx-source-and-headers.py: Remove. ++ * build-ios.sh: Remove. ++ * libffi.xcodeproj/project.pbxproj: Rebuild targets. Include ++ x86_64+aarch64 pieces in library. Export headers properly. ++ * src/x86/ffi64.c: More Clang warning clean-ups. ++ * src/closures.c (open_temp_exec_file_dir): Use size_t. ++ * src/prep_cif.c (ffi_prep_cif_core): Cast ALIGN result. ++ * src/aarch64/sysv.S: Use CNAME for global symbols. Only use ++ .size for ELF targets. ++ * src/aarch64/ffi.c: Clean up for double == long double. Clean up ++ from Clang warnings. Use Clang cache invalidation builtin. Use ++ size_t in place of unsigned in many places. Accommodate for ++ differences in Apple AArch64 ABI. ++ ++2013-12-02 Daniel Rodríguez Troitiño ++ ++ * generate-darwin-source-and-headers.py: Clean up, modernize, ++ merged version of previous scripts. ++ ++2013-11-21 Anthony Green ++ ++ * configure, Makefile.in, include/Makefile.in, include/ffi.h.in, ++ man/Makefile.in, testsuite/Makefile.in, fficonfig.h.in: Rebuilt. ++ ++2013-11-21 Alan Modra ++ ++ * Makefile.am (EXTRA_DIST): Add new src/powerpc files. ++ (nodist_libffi_la_SOURCES ): Likewise. ++ * configure.ac (HAVE_LONG_DOUBLE_VARIANT): Define for powerpc. ++ * include/ffi.h.in (ffi_prep_types): Declare. ++ * src/prep_cif.c (ffi_prep_cif_core): Call ffi_prep_types. ++ * src/types.c (FFI_NONCONST_TYPEDEF): Define and use for ++ HAVE_LONG_DOUBLE_VARIANT. ++ * src/powerpc/ffi_powerpc.h: New file. ++ * src/powerpc/ffi.c: Split into.. ++ * src/powerpc/ffi_sysv.c: ..new file, and.. ++ * src/powerpc/ffi_linux64.c: ..new file, rewriting parts. ++ * src/powerpc/ffitarget.h (enum ffi_abi): Rewrite powerpc ABI ++ selection as bits controlling features. ++ * src/powerpc/linux64.S: For consistency, use POWERPC64 rather ++ than __powerpc64__. ++ * src/powerpc/linux64_closure.S: Likewise. ++ * src/powerpc/ppc_closure.S: Likewise. Move .note.FNU-stack ++ inside guard. ++ * src/powerpc/sysv.S: Likewise. ++ * configure: Regenerate. ++ * fficonfig.h.in: Regenerate. ++ * Makefile.in: Regenerate. ++ ++2013-11-20 Alan Modra ++ ++ * src/powerpc/ffi.c (ffi_prep_cif_machdep_core): Use ++ NUM_FPR_ARG_REGISTERS64 and NUM_GPR_ARG_REGISTERS64 not their ++ 32-bit versions for 64-bit code. ++ * src/powerpc/linux64_closure.S: Don't use the return value area ++ as a parameter save area on ELFv2. ++ ++2013-11-18 Iain Sandoe ++ ++ * src/powerpc/darwin.S (EH): Correct use of pcrel FDE encoding. ++ * src/powerpc/darwin_closure.S (EH): Likewise. Modernise picbase ++ labels. ++ ++2013-11-18 Anthony Green ++ ++ * src/arm/ffi.c (ffi_call): Hoist declaration of temp to top of ++ function. ++ * src/arm/ffi.c (ffi_closure_inner): Moderize function declaration ++ to appease compiler. ++ Thanks for Gregory P. Smith . ++ ++2013-11-18 Anthony Green ++ ++ * README (tested): Mention PowerPC ELFv2. ++ ++2013-11-16 Alan Modra ++ ++ * src/powerpc/ppc_closure.S: Move errant #endif to where it belongs. ++ Don't bl .Luint128. ++ ++2013-11-16 Alan Modra ++ ++ * src/powerpc/ffi.c (ffi_prep_cif_machdep_core): Use #if _CALL_ELF ++ test to select parameter save sizing for ELFv2 vs. ELFv1. ++ * src/powerpc/ffitarget.h (FFI_V2_TYPE_FLOAT_HOMOG, ++ FFI_V2_TYPE_DOUBLE_HOMOG, FFI_V2_TYPE_SMALL_STRUCT): Define. ++ (FFI_TRAMPOLINE_SIZE): Define variant for ELFv2. ++ * src/powerpc/ffi.c (FLAG_ARG_NEEDS_PSAVE): Define. ++ (discover_homogeneous_aggregate): New function. ++ (ffi_prep_args64): Adjust start of param save area for ELFv2. ++ Handle homogenous floating point struct parms. ++ (ffi_prep_cif_machdep_core): Adjust space calculation for ELFv2. ++ Handle ELFv2 return values. Set FLAG_ARG_NEEDS_PSAVE. Handle ++ homogenous floating point structs. ++ (ffi_call): Increase size of smst_buffer for ELFv2. Handle ELFv2. ++ (flush_icache): Compile for ELFv2. ++ (ffi_prep_closure_loc): Set up ELFv2 trampoline. ++ (ffi_closure_helper_LINUX64): Don't return all structs directly ++ to caller. Handle homogenous floating point structs. Handle ++ ELFv2 struct return values. ++ * src/powerpc/linux64.S (ffi_call_LINUX64): Set up r2 for ++ ELFv2. Adjust toc save location. Call function pointer using ++ r12. Handle FLAG_RETURNS_SMST. Don't predict branches. ++ * src/powerpc/linux64_closure.S (ffi_closure_LINUX64): Set up r2 ++ for ELFv2. Define ELFv2 versions of STACKFRAME, PARMSAVE, and ++ RETVAL. Handle possibly missing parameter save area. Handle ++ ELFv2 return values. ++ (.note.GNU-stack): Move inside outer #ifdef. ++ ++2013-11-16 Alan Modra ++ ++ * src/powerpc/ffi.c (ffi_prep_cif_machdep): Revert 2013-02-08 ++ change. Do not consume an int arg when returning a small struct ++ for FFI_SYSV ABI. ++ (ffi_call): Only use bounce buffer when FLAG_RETURNS_SMST. ++ Properly copy bounce buffer to destination. ++ * src/powerpc/sysv.S: Revert 2013-02-08 change. ++ * src/powerpc/ppc_closure.S: Remove stray '+'. ++ ++2013-11-16 Alan Modra ++ ++ * src/powerpc/ffi.c (ffi_prep_args64): Align struct parameters ++ according to __STRUCT_PARM_ALIGN__. ++ (ffi_prep_cif_machdep_core): Likewise. ++ (ffi_closure_helper_LINUX64): Likewise. ++ ++2013-11-16 Alan Modra ++ ++ * src/powerpc/linux64.S (ffi_call_LINUX64): Tweak restore of r28. ++ (.note.GNU-stack): Move inside outer #ifdef. ++ * src/powerpc/linux64_closure.S (STACKFRAME, PARMSAVE, ++ RETVAL): Define and use throughout. ++ (ffi_closure_LINUX64): Save fprs before buying stack. ++ (.note.GNU-stack): Move inside outer #ifdef. ++ ++2013-11-16 Alan Modra ++ ++ * src/powerpc/ffitarget.h (FFI_TARGET_SPECIFIC_VARIADIC): Define. ++ (FFI_EXTRA_CIF_FIELDS): Define. ++ * src/powerpc/ffi.c (ffi_prep_args64): Save fprs as per the ++ ABI, not to both fpr and param save area. ++ (ffi_prep_cif_machdep_core): Renamed from ffi_prep_cif_machdep. ++ Keep initial flags. Formatting. Remove dead FFI_LINUX_SOFT_FLOAT ++ code. ++ (ffi_prep_cif_machdep, ffi_prep_cif_machdep_var): New functions. ++ (ffi_closure_helper_LINUX64): Pass floating point as per ABI, ++ not to both fpr and parameter save areas. ++ ++ * libffi/testsuite/libffi.call/cls_double_va.c (main): Correct ++ function cast and don't call ffi_prep_cif. ++ * libffi/testsuite/libffi.call/cls_longdouble_va.c (main): Likewise. ++ ++2013-11-15 Andrew Haley ++ ++ * doc/libffi.texi (Closure Example): Fix the sample code. ++ * doc/libffi.info, doc/stamp-vti, doc/version.texi: Rebuilt. ++ ++2013-11-15 Andrew Haley ++ ++ * testsuite/libffi.call/va_struct1.c (main): Fix broken test. ++ * testsuite/libffi.call/cls_uint_va.c (cls_ret_T_fn): Likewise ++ * testsuite/libffi.call/cls_struct_va1.c (test_fn): Likewise. ++ * testsuite/libffi.call/va_1.c (main): Likewise. ++ ++2013-11-14 David Schneider ++ ++ * src/arm/ffi.c: Fix register allocation for mixed float and ++ doubles. ++ * testsuite/libffi.call/cls_many_mixed_float_double.c: Testcase ++ for many mixed float and double arguments. ++ ++2013-11-13 Alan Modra ++ ++ * doc/libffi.texi (Simple Example): Correct example code. ++ * doc/libffi.info, doc/stamp-vti, doc/version.texi: Rebuilt. ++ ++2013-11-13 Anthony Green ++ ++ * include/ffi_common.h: Respect HAVE_ALLOCA_H for GNU compiler ++ based build. (Thanks to tmr111116 on github) ++ ++2013-11-09 Anthony Green ++ ++ * m4/libtool.m4: Refresh. ++ * configure, Makefile.in: Rebuilt. ++ * README: Add more notes about next release. ++ ++2013-11-09 Shigeharu TAKENO ++ ++ * m4/ax_gcc_archflag.m4 (ax_gcc_arch): Don't recognize ++ UltraSPARC-IIi as ultrasparc3. ++ ++2013-11-06 Mark Kettenis ++ ++ * src/x86/freebsd.S (ffi_call_SYSV): Align the stack pointer to ++ 16-bytes. ++ ++2013-11-06 Konstantin Belousov ++ ++ * src/x86/freebsd.S (ffi_closure_raw_SYSV): Mark the assembler ++ source as not requiring executable stack. ++ ++2013-11-02 Anthony Green ++ ++ * doc/libffi.texi (The Basics): Clarify return value buffer size ++ requirements. Also, NULL result buffer pointers are no longer ++ supported. ++ * doc/libffi.info: Rebuilt. ++ ++2013-11-02 Mischa Jonker ++ ++ * Makefile.am (nodist_libffi_la_SOURCES): Fix build error. ++ * Makefile.in: Rebuilt. ++ ++2013-11-02 David Schneider ++ ++ * src/arm/ffi.c: more robust argument handling for closures on arm hardfloat ++ * testsuite/libffi.call/many_mixed.c: New file. ++ * testsuite/libffi.call/cls_many_mixed_args.c: More tests. ++ ++2013-11-02 Vitaly Budovski ++ ++ * src/x86/ffi.c (ffi_prep_cif_machdep): Don't align stack for win32. ++ ++2013-10-23 Mark H Weaver ++ ++ * src/mips/ffi.c: Fix handling of uint32_t arguments on the ++ MIPS N32 ABI. ++ ++2013-10-13 Sandra Loosemore ++ ++ * README: Add Nios II to table of supported platforms. ++ * Makefile.am (EXTRA_DIST): Add nios2 files. ++ (nodist_libffi_la_SOURCES): Likewise. ++ * Makefile.in: Regenerated. ++ * configure.ac (nios2*-linux*): New host. ++ (NIOS2): Add AM_CONDITIONAL. ++ * configure: Regenerated. ++ * src/nios2/ffi.c: New. ++ * src/nios2/ffitarget.h: New. ++ * src/nios2/sysv.S: New. ++ * src/prep_cif.c (initialize_aggregate): Handle extra structure ++ alignment via FFI_AGGREGATE_ALIGNMENT. ++ (ffi_prep_cif_core): Conditionalize structure return for NIOS2. ++ ++2013-10-10 Sandra Loosemore ++ ++ * testsuite/libffi.call/cls_many_mixed_args.c (cls_ret_double_fn): ++ Fix uninitialized variable. ++ ++2013-10-11 Marcus Shawcroft ++ ++ * testsuite/libffi.call/many.c (many): Replace * with +. ++ ++2013-10-08 Ondřej Bílka ++ ++ * src/aarch64/ffi.c, src/aarch64/sysv.S, src/arm/ffi.c, ++ src/arm/gentramp.sh, src/bfin/sysv.S, src/closures.c, ++ src/dlmalloc.c, src/ia64/ffi.c, src/microblaze/ffi.c, ++ src/microblaze/sysv.S, src/powerpc/darwin_closure.S, ++ src/powerpc/ffi.c, src/powerpc/ffi_darwin.c, src/sh/ffi.c, ++ src/tile/tile.S, testsuite/libffi.call/nested_struct11.c: Fix ++ spelling errors. ++ ++2013-10-08 Anthony Green ++ ++ * aclocal.m4, compile, config.guess, config.sub, depcomp, ++ install-sh, mdate-sh, missing, texinfo.tex: Update from upstream. ++ * configure.ac: Update version to 3.0.14-rc0. ++ * Makefile.in, configure, Makefile.in, include/Makefile.in, ++ man/Makefile.in, testsuite/Makefile.in: Rebuilt. ++ * README: Mention M88K and VAX. ++ ++2013-07-15 Miod Vallat ++ ++ * Makefile.am, ++ configure.ac, ++ src/m88k/ffi.c, ++ src/m88k/ffitarget.h, ++ src/m88k/obsd.S, ++ src/vax/elfbsd.S, ++ src/vax/ffi.c, ++ src/vax/ffitarget.h: Add m88k and vax support. ++ ++2013-06-24 Alan Modra ++ ++ * src/powerpc/ffi.c (ffi_prep_args_SYSV): Move var declaration ++ before statements. ++ (ffi_prep_args64): Support little-endian. ++ (ffi_closure_helper_SYSV, ffi_closure_helper_LINUX64): Likewise. ++ * src/powerpc/linux64_closure.S (ffi_closure_LINUX64): Likewise. ++ * src/powerpc/ppc_closure.S (ffi_closure_SYSV): Likewise. ++ ++2013-06-12 Mischa Jonker ++ ++ * configure.ac: Add support for ARC. ++ * Makefile.am: Likewise. ++ * README: Add ARC details. ++ * src/arc/arcompact.S: New. ++ * src/arc/ffi.c: Likewise. ++ * src/arc/ffitarget.h: Likewise. ++ ++2013-03-28 David Schneider ++ ++ * src/arm/ffi.c: Fix support for ARM hard-float calling convention. ++ * src/arm/sysv.S: call different methods for SYSV and VFP ABIs. ++ * testsuite/libffi.call/cls_many_mixed_args.c: testcase for a closure with ++ mixed arguments, many doubles. ++ * testsuite/libffi.call/many_double.c: testcase for calling a function using ++ more than 8 doubles. ++ * testcase/libffi.call/many.c: use absolute value to check result against an ++ epsilon ++ ++2013-03-17 Anthony Green ++ ++ * README: Update for 3.0.13. ++ * configure.ac: Ditto. ++ * configure: Rebuilt. ++ * doc/*: Update version. ++ ++2013-03-17 Dave Korn ++ ++ * src/closures.c (is_emutramp_enabled ++ [!FFI_MMAP_EXEC_EMUTRAMP_PAX]): Move default definition outside ++ enclosing #if scope. ++ ++2013-03-17 Anthony Green ++ ++ * configure.ac: Only modify toolexecdir in certain cases. ++ * configure: Rebuilt. ++ ++2013-03-16 Gilles Talis ++ ++ * src/powerpc/ffi.c (ffi_prep_args_SYSV): Don't use ++ fparg_count,etc on __NO_FPRS__ targets. ++ ++2013-03-16 Alan Hourihane ++ ++ * src/m68k/sysv.S (epilogue): Don't use extb instruction on ++ m680000 machines. ++ ++2013-03-16 Alex Gaynor ++ ++ * src/x86/ffi.c (ffi_prep_cif_machdep): Always align stack. ++ ++2013-03-13 Markos Chandras ++ ++ * configure.ac: Add support for Imagination Technologies Meta. ++ * Makefile.am: Likewise. ++ * README: Add Imagination Technologies Meta details. ++ * src/metag/ffi.c: New. ++ * src/metag/ffitarget.h: Likewise. ++ * src/metag/sysv.S: Likewise. ++ ++2013-02-24 Andreas Schwab ++ ++ * doc/libffi.texi (Structures): Fix missing category argument of ++ @deftp. ++ ++2013-02-11 Anthony Green ++ ++ * configure.ac: Update release number to 3.0.12. ++ * configure: Rebuilt. ++ * README: Update release info. ++ ++2013-02-10 Anthony Green ++ ++ * README: Add Moxie. ++ * src/moxie/ffi.c: Created. ++ * src/moxie/eabi.S: Created. ++ * src/moxie/ffitarget.h: Created. ++ * Makefile.am (nodist_libffi_la_SOURCES): Add Moxie. ++ * Makefile.in: Rebuilt. ++ * configure.ac: Add Moxie. ++ * configure: Rebuilt. ++ * testsuite/libffi.call/huge_struct.c: Disable format string ++ warnings for moxie*-*-elf tests. ++ ++2013-02-10 Anthony Green ++ ++ * Makefile.am (LTLDFLAGS): Fix reference. ++ * Makefile.in: Rebuilt. ++ ++2013-02-10 Anthony Green ++ ++ * README: Update supported platforms. Update test results link. ++ ++2013-02-09 Anthony Green ++ ++ * testsuite/libffi.call/negint.c: Remove forced -O2. ++ * testsuite/libffi.call/many2.c (foo): Remove GCCism. ++ * testsuite/libffi.call/ffitest.h: Add default PRIuPTR definition. ++ ++ * src/sparc/v8.S (ffi_closure_v8): Import ancient ulonglong ++ closure return type fix developed by Martin v. Löwis for cpython ++ fork. ++ ++2013-02-08 Andreas Tobler ++ ++ * src/powerpc/ffi.c (ffi_prep_cif_machdep): Fix small struct ++ support. ++ * src/powerpc/sysv.S: Ditto. ++ ++2013-02-08 Anthony Green ++ ++ * testsuite/libffi.call/cls_longdouble.c: Remove xfail for ++ arm*-*-*. ++ ++2013-02-08 Anthony Green ++ ++ * src/sparc/ffi.c (ffi_prep_closure_loc): Fix cache flushing for GCC. ++ ++2013-02-08 Matthias Klose ++ ++ * man/ffi_prep_cif.3: Clean up for debian linter. ++ ++2013-02-08 Peter Bergner ++ ++ * src/powerpc/ffi.c (ffi_prep_args_SYSV): Account for FP args pushed ++ on the stack. ++ ++2013-02-08 Anthony Green ++ ++ * Makefile.am (EXTRA_DIST): Add missing files. ++ * testsuite/Makefile.am (EXTRA_DIST): Ditto. ++ * Makefile.in: Rebuilt. ++ ++2013-02-08 Anthony Green ++ ++ * configure.ac: Move sparc asm config checks to within functions ++ for compatibility with sun tools. ++ * configure: Rebuilt. ++ * src/sparc/ffi.c (ffi_prep_closure_loc): Flush cache on v9 ++ systems. ++ * src/sparc/v8.S (ffi_flush_icache): Implement a sparc v9 cache ++ flusher. ++ ++2013-02-08 Nathan Rossi ++ ++ * src/microblaze/ffi.c (ffi_closure_call_SYSV): Fix handling of ++ small big-endian structures. ++ (ffi_prep_args): Ditto. ++ ++2013-02-07 Anthony Green ++ ++ * src/sparc/v8.S (ffi_call_v8): Fix typo from last patch ++ (effectively hiding ffi_call_v8). ++ ++2013-02-07 Anthony Green ++ ++ * configure.ac: Update bug reporting address. ++ * configure.in: Rebuild. ++ ++ * src/sparc/v8.S (ffi_flush_icache): Out-of-line cache flusher for ++ Sun compiler. ++ * src/sparc/ffi.c (ffi_call): Remove warning. ++ Call ffi_flush_icache for non-GCC builds. ++ (ffi_prep_closure_loc): Use ffi_flush_icache. ++ ++ * Makefile.am (EXTRA_DIST): Add libtool-ldflags. ++ * Makefile.in: Rebuilt. ++ * libtool-ldflags: New file. ++ ++2013-02-07 Daniel Schepler ++ ++ * configure.ac: Correctly identify x32 systems as 64-bit. ++ * m4/libtool.m4: Remove libtool expr error. ++ * aclocal.m4, configure: Rebuilt. ++ ++2013-02-07 Anthony Green ++ ++ * configure.ac: Fix GCC usage test. ++ * configure: Rebuilt. ++ * README: Mention LLVM/GCC x86_64 issue. ++ * testsuite/Makefile.in: Rebuilt. ++ ++2013-02-07 Anthony Green ++ ++ * testsuite/libffi.call/cls_double_va.c (main): Replace // style ++ comments with /* */ for xlc compiler. ++ * testsuite/libffi.call/stret_large.c (main): Ditto. ++ * testsuite/libffi.call/stret_large2.c (main): Ditto. ++ * testsuite/libffi.call/nested_struct1.c (main): Ditto. ++ * testsuite/libffi.call/huge_struct.c (main): Ditto. ++ * testsuite/libffi.call/float_va.c (main): Ditto. ++ * testsuite/libffi.call/cls_struct_va1.c (main): Ditto. ++ * testsuite/libffi.call/cls_pointer_stack.c (main): Ditto. ++ * testsuite/libffi.call/cls_pointer.c (main): Ditto. ++ * testsuite/libffi.call/cls_longdouble_va.c (main): Ditto. ++ ++2013-02-06 Anthony Green ++ ++ * man/ffi_prep_cif.3: Clean up for debian lintian checker. ++ ++2013-02-06 Anthony Green ++ ++ * Makefile.am (pkgconfigdir): Add missing pkgconfig install bits. ++ * Makefile.in: Rebuild. ++ ++2013-02-02 Mark H Weaver ++ ++ * src/x86/ffi64.c (ffi_call): Sign-extend integer arguments passed ++ via general purpose registers. ++ ++2013-01-21 Nathan Rossi ++ ++ * README: Add MicroBlaze details. ++ * Makefile.am: Add MicroBlaze support. ++ * configure.ac: Likewise. ++ * src/microblaze/ffi.c: New. ++ * src/microblaze/ffitarget.h: Likewise. ++ * src/microblaze/sysv.S: Likewise. ++ ++2013-01-21 Nathan Rossi ++ * testsuite/libffi.call/return_uc.c: Fixed issue. ++ ++2013-01-21 Chris Zankel ++ ++ * README: Add Xtensa support. ++ * Makefile.am: Likewise. ++ * configure.ac: Likewise. ++ * Makefile.in Regenerate. ++ * configure: Likewise. ++ * src/prep_cif.c: Handle Xtensa. ++ * src/xtensa: New directory. ++ * src/xtensa/ffi.c: New file. ++ * src/xtensa/ffitarget.h: Ditto. ++ * src/xtensa/sysv.S: Ditto. ++ ++2013-01-11 Anthony Green ++ ++ * src/powerpc/ffi_darwin.c (ffi_prep_args): Replace // style ++ comments with /* */ for xlc compiler. ++ * src/powerpc/aix.S (ffi_call_AIX): Ditto. ++ * testsuite/libffi.call/ffitest.h (allocate_mmap): Delete ++ deprecated inline function. ++ * testsuite/libffi.special/ffitestcxx.h: Ditto. ++ * README: Add update for AIX support. ++ ++2013-01-11 Anthony Green ++ ++ * configure.ac: Robustify pc relative reloc check. ++ * m4/ax_cc_maxopt.m4: Don't -malign-double. This is an ABI ++ changing option for 32-bit x86. ++ * aclocal.m4, configure: Rebuilt. ++ * README: Update supported target list. ++ ++2013-01-10 Anthony Green ++ ++ * README (tested): Add Compiler column to table. ++ ++2013-01-10 Anthony Green ++ ++ * src/x86/ffi64.c (struct register_args): Make sse array and array ++ of unions for sunpro compiler compatibility. ++ ++2013-01-10 Anthony Green ++ ++ * configure.ac: Test target platform size_t size. Handle both 32 ++ and 64-bit builds for x86_64-* and i?86-* targets (allowing for ++ CFLAG option to change default settings). ++ * configure, aclocal.m4: Rebuilt. ++ ++2013-01-10 Anthony Green ++ ++ * testsuite/libffi.special/special.exp: Only run exception ++ handling tests when using GNU compiler. ++ ++ * m4/ax_compiler_vendor.m4: New file. ++ * configure.ac: Test for compiler vendor and don't use ++ AX_CFLAGS_WARN_ALL with the sun compiler. ++ * aclocal.m4, configure: Rebuilt. ++ ++2013-01-10 Anthony Green ++ ++ * include/ffi_common.h: Don't use GCCisms to define types when ++ building with the SUNPRO compiler. ++ ++2013-01-10 Anthony Green ++ ++ * configure.ac: Put local.exp in the right place. ++ * configure: Rebuilt. ++ ++ * src/x86/ffi.c: Update comment about regparm function attributes. ++ * src/x86/sysv.S (ffi_closure_SYSV): The SUNPRO compiler requires ++ that all function arguments be passed on the stack (no regparm ++ support). ++ ++2013-01-08 Anthony Green ++ ++ * configure.ac: Generate local.exp. This sets CC_FOR_TARGET ++ when we are using the vendor compiler. ++ * testsuite/Makefile.am (EXTRA_DEJAGNU_SITE_CONFIG): Point to ++ ../local.exp. ++ * configure, testsuite/Makefile.in: Rebuilt. ++ ++ * testsuite/libffi.call/call.exp: Run tests with different ++ options, depending on whether or not we are using gcc or the ++ vendor compiler. ++ * testsuite/lib/libffi.exp (libffi-init): Set using_gcc based on ++ whether or not we are building/testing with gcc. ++ ++2013-01-08 Anthony Green ++ ++ * configure.ac: Switch x86 solaris target to X86 by default. ++ * configure: Rebuilt. ++ ++2013-01-08 Anthony Green ++ ++ * configure.ac: Fix test for read-only eh_frame. ++ * configure: Rebuilt. ++ ++2013-01-08 Anthony Green ++ ++ * src/x86/sysv.S, src/x86/unix64.S: Only emit DWARF unwind info ++ when building with the GNU toolchain. ++ * testsuite/libffi.call/ffitest.h (CHECK): Fix for Solaris vendor ++ compiler. ++ ++2013-01-07 Thorsten Glaser ++ ++ * testsuite/libffi.call/cls_uchar_va.c, ++ testsuite/libffi.call/cls_ushort_va.c, ++ testsuite/libffi.call/va_1.c: Testsuite fixes. ++ ++2013-01-07 Thorsten Glaser ++ ++ * src/m68k/ffi.c (CIF_FLAGS_SINT8, CIF_FLAGS_SINT16): Define. ++ (ffi_prep_cif_machdep): Fix 8-bit and 16-bit signed calls. ++ * src/m68k/sysv.S (ffi_call_SYSV, ffi_closure_SYSV): Ditto. ++ ++2013-01-04 Anthony Green ++ ++ * Makefile.am (AM_CFLAGS): Don't automatically add -fexceptions ++ and -Wall. This is set in the configure script after testing for ++ GCC. ++ * Makefile.in: Rebuilt. ++ ++2013-01-02 rofl0r ++ ++ * src/powerpc/ffi.c (ffi_prep_cif_machdep): Fix build error on ppc ++ when long double == double. ++ ++2013-01-02 Reini Urban ++ ++ * Makefile.am (libffi_la_LDFLAGS): Add -no-undefined to LDFLAGS ++ (required for shared libs on cygwin/mingw). ++ * Makefile.in: Rebuilt. ++ ++2012-10-31 Alan Modra ++ ++ * src/powerpc/linux64_closure.S: Add new ABI support. ++ * src/powerpc/linux64.S: Likewise. ++ ++2012-10-30 Magnus Granberg ++ Pavel Labushev ++ ++ * configure.ac: New options pax_emutramp ++ * configure, fficonfig.h.in: Regenerated ++ * src/closures.c: New function emutramp_enabled_check() and ++ checks. ++ ++2012-10-30 Frederick Cheung ++ ++ * configure.ac: Enable FFI_MAP_EXEC_WRIT for Darwin 12 (mountain ++ lion) and future version. ++ * configure: Rebuild. ++ ++2012-10-30 James Greenhalgh ++ Marcus Shawcroft ++ ++ * README: Add details of aarch64 port. ++ * src/aarch64/ffi.c: New. ++ * src/aarch64/ffitarget.h: Likewise. ++ * src/aarch64/sysv.S: Likewise. ++ * Makefile.am: Support aarch64. ++ * configure.ac: Support aarch64. ++ * Makefile.in, configure: Rebuilt. ++ ++2012-10-30 James Greenhalgh ++ Marcus Shawcroft ++ ++ * testsuite/lib/libffi.exp: Add support for aarch64. ++ * testsuite/libffi.call/cls_struct_va1.c: New. ++ * testsuite/libffi.call/cls_uchar_va.c: Likewise. ++ * testsuite/libffi.call/cls_uint_va.c: Likewise. ++ * testsuite/libffi.call/cls_ulong_va.c: Likewise. ++ * testsuite/libffi.call/cls_ushort_va.c: Likewise. ++ * testsuite/libffi.call/nested_struct11.c: Likewise. ++ * testsuite/libffi.call/uninitialized.c: Likewise. ++ * testsuite/libffi.call/va_1.c: Likewise. ++ * testsuite/libffi.call/va_struct1.c: Likewise. ++ * testsuite/libffi.call/va_struct2.c: Likewise. ++ * testsuite/libffi.call/va_struct3.c: Likewise. ++ ++2012-10-12 Walter Lee ++ ++ * Makefile.am: Add TILE-Gx/TILEPro support. ++ * configure.ac: Likewise. ++ * Makefile.in: Regenerate. ++ * configure: Likewise. ++ * src/prep_cif.c (ffi_prep_cif_core): Handle TILE-Gx/TILEPro. ++ * src/tile: New directory. ++ * src/tile/ffi.c: New file. ++ * src/tile/ffitarget.h: Ditto. ++ * src/tile/tile.S: Ditto. ++ ++2012-10-12 Matthias Klose ++ ++ * generate-osx-source-and-headers.py: Normalize whitespace. ++ ++2012-09-14 David Edelsohn ++ ++ * configure: Regenerated. ++ ++2012-08-26 Andrew Pinski ++ ++ PR libffi/53014 ++ * src/mips/ffi.c (ffi_prep_closure_loc): Allow n32 with soft-float and n64 with ++ soft-float. ++ ++2012-08-08 Uros Bizjak ++ ++ * src/s390/ffi.c (ffi_prep_closure_loc): Don't ASSERT ABI test, ++ just return FFI_BAD_ABI when things are wrong. ++ ++2012-07-18 H.J. Lu ++ ++ PR libffi/53982 ++ PR libffi/53973 ++ * src/x86/ffitarget.h: Check __ILP32__ instead of __LP64__ for x32. ++ (FFI_SIZEOF_JAVA_RAW): Defined to 4 for x32. ++ ++2012-05-16 H.J. Lu ++ ++ * configure: Regenerated. ++ ++2012-05-05 Nicolas Lelong ++ ++ * libffi.xcodeproj/project.pbxproj: Fixes. ++ * README: Update for iOS builds. ++ ++2012-04-23 Alexandre Keunecke I. de Mendonca ++ ++ * configure.ac: Add Blackfin/sysv support ++ * Makefile.am: Add Blackfin/sysv support ++ * src/bfin/ffi.c: Add Blackfin/sysv support ++ * src/bfin/ffitarget.h: Add Blackfin/sysv support ++ ++2012-04-11 Anthony Green ++ ++ * Makefile.am (EXTRA_DIST): Add new script. ++ * Makefile.in: Rebuilt. ++ ++2012-04-11 Zachary Waldowski ++ ++ * generate-ios-source-and-headers.py, ++ libffi.xcodeproj/project.pbxproj: Support a Mac static library via ++ Xcode. Set iOS compatibility to 4.0. Move iOS trampoline ++ generation into an Xcode "run script" phase. Include both as ++ Xcode build scripts. Don't always regenerate config files. ++ ++2012-04-10 Anthony Green ++ ++ * src/powerpc/ffi_darwin.c (ffi_prep_args): Add missing semicolon. ++ ++2012-04-06 Anthony Green ++ ++ * Makefile.am (EXTRA_DIST): Add new iOS/xcode files. ++ * Makefile.in: Rebuilt. ++ ++2012-04-06 Mike Lewis ++ ++ * generate-ios-source-and-headers.py: New file. ++ * libffi.xcodeproj/project.pbxproj: New file. ++ * README: Update instructions on building iOS binary. ++ * build-ios.sh: Delete. ++ ++2012-04-06 Anthony Green ++ ++ * src/x86/ffi64.c (UINT128): Define differently for Intel and GNU ++ compilers, then use it. ++ ++2012-04-06 H.J. Lu ++ ++ * m4/libtool.m4 (_LT_ENABLE_LOCK): Support x32. ++ ++2012-04-06 Anthony Green ++ ++ * testsuite/Makefile.am (EXTRA_DIST): Add missing test cases. ++ * testsuite/Makefile.in: Rebuilt. ++ ++2012-04-05 Zachary Waldowski ++ ++ * include/ffi.h.in: Add missing trampoline table fields. ++ * src/arm/sysv.S: Fix ENTRY definition, and wrap symbol references ++ in CNAME. ++ * src/x86/ffi.c: Wrap Windows specific code in ifdefs. ++ ++2012-04-02 Peter Bergner ++ ++ * src/powerpc/ffi.c (ffi_prep_args_SYSV): Declare double_tmp. ++ Silence casting pointer to integer of different size warning. ++ Delete goto to previously deleted label. ++ (ffi_call): Silence possibly undefined warning. ++ (ffi_closure_helper_SYSV): Declare variable type. ++ ++2012-04-02 Peter Rosin ++ ++ * src/x86/win32.S (ffi_call_win32): Sign/zero extend the return ++ value in the Intel version as is already done for the AT&T version. ++ (ffi_closure_SYSV): Likewise. ++ (ffi_closure_raw_SYSV): Likewise. ++ (ffi_closure_STDCALL): Likewise. ++ ++2012-03-29 Peter Rosin ++ ++ * src/x86/win32.S (ffi_closure_raw_THISCALL): Unify the frame ++ generation, fix the ENDP label and remove the surplus third arg ++ from the 'lea' insn. ++ ++2012-03-29 Peter Rosin ++ ++ * src/x86/win32.S (ffi_closure_raw_SYSV): Make the 'stubraw' label ++ visible outside the PROC, so that ffi_closure_raw_THISCALL can see ++ it. Also instruct the assembler to add a frame to the function. ++ ++2012-03-23 Peter Rosin ++ ++ * Makefile.am (AM_CPPFLAGS): Add -DFFI_BUILDING. ++ * Makefile.in: Rebuilt. ++ * include/ffi.h.in [MSVC]: Add __declspec(dllimport) decorations ++ to all data exports, when compiling libffi clients using MSVC. ++ ++2012-03-29 Peter Rosin ++ ++ * src/x86/ffitarget.h (ffi_abi): Add new ABI FFI_MS_CDECL and ++ make it the default for MSVC. ++ (FFI_TYPE_MS_STRUCT): New structure return convention. ++ * src/x86/ffi.c (ffi_prep_cif_machdep): Tweak the structure ++ return convention for FFI_MS_CDECL to be FFI_TYPE_MS_STRUCT ++ instead of an ordinary FFI_TYPE_STRUCT. ++ (ffi_prep_args): Treat FFI_TYPE_MS_STRUCT as FFI_TYPE_STRUCT. ++ (ffi_call): Likewise. ++ (ffi_prep_incoming_args_SYSV): Likewise. ++ (ffi_raw_call): Likewise. ++ (ffi_prep_closure_loc): Treat FFI_MS_CDECL as FFI_SYSV. ++ * src/x86/win32.S (ffi_closure_SYSV): For FFI_TYPE_MS_STRUCT, ++ return a pointer to the result structure in eax and don't pop ++ that pointer from the stack, the caller takes care of it. ++ (ffi_call_win32): Treat FFI_TYPE_MS_STRUCT as FFI_TYPE_STRUCT. ++ (ffi_closure_raw_SYSV): Likewise. ++ ++2012-03-22 Peter Rosin ++ ++ * testsuite/libffi.call/closure_stdcall.c [MSVC]: Add inline ++ assembly version with Intel syntax. ++ * testsuite/libffi.call/closure_thiscall.c [MSVC]: Likewise. ++ ++2012-03-23 Peter Rosin ++ ++ * testsuite/libffi.call/ffitest.h: Provide abstration of ++ __attribute__((fastcall)) in the form of a __FASTCALL__ ++ define. Define it to __fastcall for MSVC. ++ * testsuite/libffi.call/fastthis1_win32.c: Use the above. ++ * testsuite/libffi.call/fastthis2_win32.c: Likewise. ++ * testsuite/libffi.call/fastthis3_win32.c: Likewise. ++ * testsuite/libffi.call/strlen2_win32.c: Likewise. ++ * testsuite/libffi.call/struct1_win32.c: Likewise. ++ * testsuite/libffi.call/struct2_win32.c: Likewise. ++ ++2012-03-22 Peter Rosin ++ ++ * src/x86/win32.S [MSVC] (ffi_closure_THISCALL): Remove the manual ++ frame on function entry, MASM adds one automatically. ++ ++2012-03-22 Peter Rosin ++ ++ * testsuite/libffi.call/ffitest.h [MSVC]: Add kludge for missing ++ bits in the MSVC headers. ++ ++2012-03-22 Peter Rosin ++ ++ * testsuite/libffi.call/cls_12byte.c: Adjust to the C89 style ++ with no declarations after statements. ++ * testsuite/libffi.call/cls_16byte.c: Likewise. ++ * testsuite/libffi.call/cls_18byte.c: Likewise. ++ * testsuite/libffi.call/cls_19byte.c: Likewise. ++ * testsuite/libffi.call/cls_1_1byte.c: Likewise. ++ * testsuite/libffi.call/cls_20byte.c: Likewise. ++ * testsuite/libffi.call/cls_20byte1.c: Likewise. ++ * testsuite/libffi.call/cls_24byte.c: Likewise. ++ * testsuite/libffi.call/cls_2byte.c: Likewise. ++ * testsuite/libffi.call/cls_3_1byte.c: Likewise. ++ * testsuite/libffi.call/cls_3byte1.c: Likewise. ++ * testsuite/libffi.call/cls_3byte2.c: Likewise. ++ * testsuite/libffi.call/cls_4_1byte.c: Likewise. ++ * testsuite/libffi.call/cls_4byte.c: Likewise. ++ * testsuite/libffi.call/cls_5_1_byte.c: Likewise. ++ * testsuite/libffi.call/cls_5byte.c: Likewise. ++ * testsuite/libffi.call/cls_64byte.c: Likewise. ++ * testsuite/libffi.call/cls_6_1_byte.c: Likewise. ++ * testsuite/libffi.call/cls_6byte.c: Likewise. ++ * testsuite/libffi.call/cls_7_1_byte.c: Likewise. ++ * testsuite/libffi.call/cls_7byte.c: Likewise. ++ * testsuite/libffi.call/cls_8byte.c: Likewise. ++ * testsuite/libffi.call/cls_9byte1.c: Likewise. ++ * testsuite/libffi.call/cls_9byte2.c: Likewise. ++ * testsuite/libffi.call/cls_align_double.c: Likewise. ++ * testsuite/libffi.call/cls_align_float.c: Likewise. ++ * testsuite/libffi.call/cls_align_longdouble.c: Likewise. ++ * testsuite/libffi.call/cls_align_longdouble_split.c: Likewise. ++ * testsuite/libffi.call/cls_align_longdouble_split2.c: Likewise. ++ * testsuite/libffi.call/cls_align_pointer.c: Likewise. ++ * testsuite/libffi.call/cls_align_sint16.c: Likewise. ++ * testsuite/libffi.call/cls_align_sint32.c: Likewise. ++ * testsuite/libffi.call/cls_align_sint64.c: Likewise. ++ * testsuite/libffi.call/cls_align_uint16.c: Likewise. ++ * testsuite/libffi.call/cls_align_uint32.c: Likewise. ++ * testsuite/libffi.call/cls_align_uint64.c: Likewise. ++ * testsuite/libffi.call/cls_dbls_struct.c: Likewise. ++ * testsuite/libffi.call/cls_pointer_stack.c: Likewise. ++ * testsuite/libffi.call/err_bad_typedef.c: Likewise. ++ * testsuite/libffi.call/huge_struct.c: Likewise. ++ * testsuite/libffi.call/nested_struct.c: Likewise. ++ * testsuite/libffi.call/nested_struct1.c: Likewise. ++ * testsuite/libffi.call/nested_struct10.c: Likewise. ++ * testsuite/libffi.call/nested_struct2.c: Likewise. ++ * testsuite/libffi.call/nested_struct3.c: Likewise. ++ * testsuite/libffi.call/nested_struct4.c: Likewise. ++ * testsuite/libffi.call/nested_struct5.c: Likewise. ++ * testsuite/libffi.call/nested_struct6.c: Likewise. ++ * testsuite/libffi.call/nested_struct7.c: Likewise. ++ * testsuite/libffi.call/nested_struct8.c: Likewise. ++ * testsuite/libffi.call/nested_struct9.c: Likewise. ++ * testsuite/libffi.call/stret_large.c: Likewise. ++ * testsuite/libffi.call/stret_large2.c: Likewise. ++ * testsuite/libffi.call/stret_medium.c: Likewise. ++ * testsuite/libffi.call/stret_medium2.c: Likewise. ++ * testsuite/libffi.call/struct1.c: Likewise. ++ * testsuite/libffi.call/struct1_win32.c: Likewise. ++ * testsuite/libffi.call/struct2.c: Likewise. ++ * testsuite/libffi.call/struct2_win32.c: Likewise. ++ * testsuite/libffi.call/struct3.c: Likewise. ++ * testsuite/libffi.call/struct4.c: Likewise. ++ * testsuite/libffi.call/struct5.c: Likewise. ++ * testsuite/libffi.call/struct6.c: Likewise. ++ * testsuite/libffi.call/struct7.c: Likewise. ++ * testsuite/libffi.call/struct8.c: Likewise. ++ * testsuite/libffi.call/struct9.c: Likewise. ++ * testsuite/libffi.call/testclosure.c: Likewise. ++ ++2012-03-21 Peter Rosin ++ ++ * testsuite/libffi.call/float_va.c (float_va_fn): Use %f when ++ printing doubles (%lf is for long doubles). ++ (main): Likewise. ++ ++2012-03-21 Peter Rosin ++ ++ * testsuite/lib/target-libpath.exp [*-*-cygwin*, *-*-mingw*] ++ (set_ld_library_path_env_vars): Add the library search dir to PATH ++ (and save PATH for later). ++ (restore_ld_library_path_env_vars): Restore PATH. ++ ++2012-03-21 Peter Rosin ++ ++ * testsuite/lib/target-libpath.exp [*-*-cygwin*, *-*-mingw*] ++ (set_ld_library_path_env_vars): Add the library search dir to PATH ++ (and save PATH for later). ++ (restore_ld_library_path_env_vars): Restore PATH. ++ ++2012-03-20 Peter Rosin ++ ++ * testsuite/libffi.call/strlen2_win32.c (main): Remove bug. ++ * src/x86/win32.S [MSVC] (ffi_closure_SYSV): Make the 'stub' label ++ visible outside the PROC, so that ffi_closure_THISCALL can see it. ++ ++2012-03-20 Peter Rosin ++ ++ * testsuite/libffi.call/strlen2_win32.c (main): Remove bug. ++ * src/x86/win32.S [MSVC] (ffi_closure_SYSV): Make the 'stub' label ++ visible outside the PROC, so that ffi_closure_THISCALL can see it. ++ ++2012-03-19 Alan Hourihane ++ ++ * src/m68k/ffi.c: Add MINT support. ++ * src/m68k/sysv.S: Ditto. ++ ++2012-03-06 Chung-Lin Tang ++ ++ * src/arm/ffi.c (ffi_call): Add __ARM_EABI__ guard around call to ++ ffi_call_VFP(). ++ (ffi_prep_closure_loc): Add __ARM_EABI__ guard around use of ++ ffi_closure_VFP. ++ * src/arm/sysv.S: Add __ARM_EABI__ guard around VFP code. ++ ++2012-03-19 chennam ++ ++ * src/powerpc/ffi_darwin.c (ffi_prep_closure_loc): Fix AIX closure ++ support. ++ ++2012-03-13 Kaz Kojima ++ ++ * src/sh/ffi.c (ffi_prep_closure_loc): Don't ASSERT ABI test, ++ just return FFI_BAD_ABI when things are wrong. ++ * src/sh64/ffi.c (ffi_prep_closure_loc): Ditto. ++ ++2012-03-09 David Edelsohn ++ ++ * src/powerpc/aix_closure.S (ffi_closure_ASM): Adjust for Darwin64 ++ change to return value of ffi_closure_helper_DARWIN and load type ++ from return type. ++ ++2012-03-03 H.J. Lu ++ ++ * src/x86/ffi64.c (ffi_call): Cast the return value to unsigned ++ long. ++ (ffi_prep_closure_loc): Cast to 64bit address in trampoline. ++ (ffi_closure_unix64_inner): Cast return pointer to unsigned long ++ first. ++ ++ * src/x86/ffitarget.h (FFI_SIZEOF_ARG): Defined to 8 for x32. ++ (ffi_arg): Set to unsigned long long for x32. ++ (ffi_sarg): Set to long long for x32. ++ ++2012-03-03 H.J. Lu ++ ++ * src/prep_cif.c (ffi_prep_cif_core): Properly check bad ABI. ++ ++2012-03-03 Andoni Morales Alastruey ++ ++ * configure.ac: Add -no-undefined for both 32- and 64-bit x86 ++ windows-like hosts. ++ * configure: Rebuilt. ++ ++2012-02-27 Mikael Pettersson ++ ++ PR libffi/52223 ++ * Makefile.am (FLAGS_TO_PASS): Define. ++ * Makefile.in: Regenerate. ++ ++2012-02-23 Anthony Green ++ ++ * src/*/ffitarget.h: Ensure that users never include ffitarget.h ++ directly. ++ ++2012-02-23 Kai Tietz ++ ++ PR libffi/52221 ++ * src/x86/ffi.c (ffi_closure_raw_THISCALL): New ++ prototype. ++ (ffi_prep_raw_closure_loc): Use ffi_closure_raw_THISCALL for ++ thiscall-convention. ++ (ffi_raw_call): Use ffi_prep_args_raw. ++ * src/x86/win32.S (ffi_closure_raw_THISCALL): Add ++ implementation for stub. ++ ++2012-02-10 Kai Tietz ++ ++ * configure.ac (AM_LTLDFLAGS): Add -no-undefine for x64 ++ windows target. ++ * configure: Regenerated. ++ ++2012-02-08 Kai Tietz ++ ++ * src/prep_cif.c (ffi_prep_cif): Allow for X86_WIN32 ++ also FFI_THISCALL. ++ * src/x86/ffi.c (ffi_closure_THISCALL): Add prototype. ++ (FFI_INIT_TRAMPOLINE_THISCALL): New trampoline code. ++ (ffi_prep_closure_loc): Add FFI_THISCALL support. ++ * src/x86/ffitarget.h (FFI_TRAMPOLINE_SIZE): Adjust size. ++ * src/x86/win32.S (ffi_closure_THISCALL): New closure code ++ for thiscall-calling convention. ++ * testsuite/libffi.call/closure_thiscall.c: New test. ++ ++2012-01-28 Kai Tietz ++ ++ * src/libffi/src/x86/ffi.c (ffi_call_win32): Add new ++ argument to prototype for specify calling-convention. ++ (ffi_call): Add support for stdcall/thiscall convention. ++ (ffi_prep_args): Likewise. ++ (ffi_raw_call): Likewise. ++ * src/x86/ffitarget.h (ffi_abi): Add FFI_THISCALL and ++ FFI_FASTCALL. ++ * src/x86/win32.S (_ffi_call_win32): Add support for ++ fastcall/thiscall calling-convention calls. ++ * testsuite/libffi.call/fastthis1_win32.c: New test. ++ * testsuite/libffi.call/fastthis2_win32.c: New test. ++ * testsuite/libffi.call/fastthis3_win32.c: New test. ++ * testsuite/libffi.call/strlen2_win32.c: New test. ++ * testsuite/libffi.call/many2_win32.c: New test. ++ * testsuite/libffi.call/struct1_win32.c: New test. ++ * testsuite/libffi.call/struct2_win32.c: New test. ++ ++2012-01-23 Uros Bizjak ++ ++ * src/alpha/ffi.c (ffi_prep_closure_loc): Check for bad ABI. ++ ++2012-01-23 Anthony Green ++ Chris Young ++ ++ * configure.ac: Add Amiga support. ++ * configure: Rebuilt. ++ ++2012-01-23 Dmitry Nadezhin ++ ++ * include/ffi_common.h (LIKELY, UNLIKELY): Fix definitions. ++ ++2012-01-23 Andreas Schwab ++ ++ * src/m68k/sysv.S (ffi_call_SYSV): Properly test for plain ++ mc68000. Test for __HAVE_68881__ in addition to __MC68881__. ++ ++2012-01-19 Jakub Jelinek ++ ++ PR rtl-optimization/48496 ++ * src/ia64/ffi.c (ffi_call): Fix up aliasing violations. ++ ++2012-01-09 Rainer Orth ++ ++ * configure.ac (i?86-*-*): Set TARGET to X86_64. ++ * configure: Regenerate. ++ ++2011-12-07 Andrew Pinski ++ ++ PR libffi/50051 ++ * src/mips/n32.S: Add ".set mips4". ++ ++2011-11-21 Andreas Tobler ++ ++ * configure: Regenerate. ++ ++2011-11-12 David Gilbert ++ ++ * doc/libffi.texi, include/ffi.h.in, include/ffi_common.h, ++ man/Makefile.am, man/ffi.3, man/ffi_prep_cif.3, ++ man/ffi_prep_cif_var.3, src/arm/ffi.c, src/arm/ffitarget.h, ++ src/cris/ffi.c, src/prep_cif.c, ++ testsuite/libffi.call/cls_double_va.c, ++ testsuite/libffi.call/cls_longdouble_va.c, ++ testsuite/libffi.call/float_va.c: Many changes to support variadic ++ function calls. ++ ++2011-11-12 Kyle Moffett ++ ++ * src/powerpc/ffi.c, src/powerpc/ffitarget.h, ++ src/powerpc/ppc_closure.S, src/powerpc/sysv.S: Many changes for ++ softfloat powerpc variants. ++ ++2011-11-12 Petr Salinger ++ ++ * configure.ac (FFI_EXEC_TRAMPOLINE_TABLE): Fix kfreebsd support. ++ * configure: Rebuilt. ++ ++2011-11-12 Timothy Wall ++ ++ * src/arm/ffi.c (ffi_prep_args, ffi_prep_incoming_args_SYSV): Max ++ alignment of 4 for wince on ARM. ++ ++2011-11-12 Kyle Moffett ++ Anthony Green ++ ++ * src/ppc/sysv.S, src/ppc/ffi.c: Remove use of ppc string ++ instructions (not available on some cores, like the PPC440). ++ ++2011-11-12 Kimura Wataru ++ ++ * m4/ax_enable_builddir: Change from string comparison to numeric ++ comparison for wc output. ++ * configure.ac: Enable FFI_MMAP_EXEC_WRIT for darwin11 aka Mac OS ++ X 10.7. ++ * configure: Rebuilt. ++ ++2011-11-12 Anthony Green ++ ++ * Makefile.am (AM_CCASFLAGS): Add -g option to build assembly ++ files with debug info. ++ * Makefile.in: Rebuilt. ++ ++2011-11-12 Jasper Lievisse Adriaanse ++ ++ * README: Update list of supported OpenBSD systems. ++ ++2011-11-12 Anthony Green ++ ++ * libtool-version: Update. ++ * Makefile.am (nodist_libffi_la_SOURCES): Add src/debug.c if ++ FFI_DEBUG. ++ (libffi_la_SOURCES): Remove src/debug.c ++ (EXTRA_DIST): Add src/debug.c ++ * Makefile.in: Rebuilt. ++ * README: Update for 3.0.11. ++ ++2011-11-10 Richard Henderson ++ ++ * configure.ac (GCC_AS_CFI_PSEUDO_OP): Use it instead of inline check. ++ * configure, aclocal.m4: Rebuild. ++ ++2011-09-04 Iain Sandoe ++ ++ PR libffi/49594 ++ * src/powerpc/darwin_closure.S (stubs): Make the stub binding ++ helper reference track the architecture pointer size. ++ ++2011-08-25 Andrew Haley ++ ++ * src/arm/ffi.c (FFI_INIT_TRAMPOLINE): Remove hard-coded assembly ++ instructions. ++ * src/arm/sysv.S (ffi_arm_trampoline): Put them here instead. ++ ++2011-07-11 Andrew Haley ++ ++ * src/arm/ffi.c (FFI_INIT_TRAMPOLINE): Clear icache. ++ ++2011-06-29 Rainer Orth ++ ++ * testsuite/libffi.call/cls_double_va.c: Move PR number to comment. ++ * testsuite/libffi.call/cls_longdouble_va.c: Likewise. ++ ++2011-06-29 Rainer Orth ++ ++ PR libffi/46660 ++ * testsuite/libffi.call/cls_double_va.c: xfail dg-output on ++ mips-sgi-irix6*. ++ * testsuite/libffi.call/cls_longdouble_va.c: Likewise. ++ ++2011-06-14 Rainer Orth ++ ++ * testsuite/libffi.call/huge_struct.c (test_large_fn): Use PRIu8, ++ PRId8 instead of %hhu, %hhd. ++ * testsuite/libffi.call/ffitest.h [__alpha__ && __osf__] (PRId8, ++ PRIu8): Define. ++ [__sgi__] (PRId8, PRIu8): Define. ++ ++2011-04-29 Rainer Orth ++ ++ * src/alpha/osf.S (UA_SI, FDE_ENCODING, FDE_ENCODE, FDE_ARANGE): ++ Define. ++ Use them to handle ELF vs. ECOFF differences. ++ [__osf__] (_GLOBAL__F_ffi_call_osf): Define. ++ ++2011-03-30 Timothy Wall ++ ++ * src/powerpc/darwin.S: Fix unknown FDE encoding. ++ * src/powerpc/darwin_closure.S: ditto. ++ ++2011-02-25 Anthony Green ++ ++ * src/powerpc/ffi.c (ffi_prep_closure_loc): Allow for more ++ 32-bit ABIs. ++ ++2011-02-15 Anthony Green ++ ++ * m4/ax_cc_maxopt.m4: Don't -malign-double or use -ffast-math. ++ * configure: Rebuilt. ++ ++2011-02-13 Ralf Wildenhues ++ ++ * configure: Regenerate. ++ ++2011-02-13 Anthony Green ++ ++ * include/ffi_common.h (UNLIKELY, LIKELY): Define. ++ * src/x86/ffi64.c (UNLIKELY, LIKELY): Remove definition. ++ * src/prep_cif.c (UNLIKELY, LIKELY): Remove definition. ++ ++ * src/prep_cif.c (initialize_aggregate): Convert assertion into ++ FFI_BAD_TYPEDEF return. Initialize arg size and alignment to 0. ++ ++ * src/pa/ffi.c (ffi_prep_closure_loc): Don't ASSERT ABI test, ++ just return FFI_BAD_ABI when things are wrong. ++ * src/arm/ffi.c (ffi_prep_closure_loc): Ditto. ++ * src/powerpc/ffi.c (ffi_prep_closure_loc): Ditto. ++ * src/mips/ffi.c (ffi_prep_closure_loc): Ditto. ++ * src/ia64/ffi.c (ffi_prep_closure_loc): Ditto. ++ * src/avr32/ffi.c (ffi_prep_closure_loc): Ditto. ++ ++2011-02-11 Anthony Green ++ ++ * src/sparc/ffi.c (ffi_prep_closure_loc): Don't ASSERT ABI test, ++ just return FFI_BAD_ABI when things are wrong. ++ ++2012-02-11 Eric Botcazou ++ ++ * src/sparc/v9.S (STACKFRAME): Bump to 176. ++ ++2011-02-09 Stuart Shelton ++ ++ http://bugs.gentoo.org/show_bug.cgi?id=286911 ++ * src/mips/ffitarget.h: Clean up error messages. ++ * src/java_raw_api.c (ffi_java_translate_args): Cast raw arg to ++ ffi_raw*. ++ * include/ffi.h.in: Add pragma for SGI compiler. ++ ++2011-02-09 Anthony Green ++ ++ * configure.ac: Add powerpc64-*-darwin* support. ++ ++2011-02-09 Anthony Green ++ ++ * README: Mention Interix. ++ ++2011-02-09 Jonathan Callen ++ ++ * configure.ac: Add Interix to win32/cygwin/mingw case. ++ * configure: Ditto. ++ * src/closures.c: Treat Interix like Cygwin, instead of as a ++ generic win32. ++ ++2011-02-09 Anthony Green ++ ++ * testsuite/libffi.call/err_bad_typedef.c: Remove xfail. ++ * testsuite/libffi.call/err_bad_abi.c: Remove xfail. ++ * src/x86/ffi64.c (UNLIKELY, LIKELY): Define. ++ (ffi_prep_closure_loc): Check for bad ABI. ++ * src/prep_cif.c (UNLIKELY, LIKELY): Define. ++ (initialize_aggregate): Check for bad types. ++ ++2011-02-09 Landon Fuller ++ ++ * Makefile.am (EXTRA_DIST): Add build-ios.sh, src/arm/gentramp.sh, ++ src/arm/trampoline.S. ++ (nodist_libffi_la_SOURCES): Add src/arc/trampoline.S. ++ * configure.ac (FFI_EXEC_TRAMPOLINE_TABLE): Define. ++ * src/arm/ffi.c (ffi_trampoline_table) ++ (ffi_closure_trampoline_table_page, ffi_trampoline_table_entry) ++ (FFI_TRAMPOLINE_CODELOC_CONFIG, FFI_TRAMPOLINE_CONFIG_PAGE_OFFSET) ++ (FFI_TRAMPOLINE_COUNT, ffi_trampoline_lock, ffi_trampoline_tables) ++ (ffi_trampoline_table_alloc, ffi_closure_alloc, ffi_closure_free): ++ Define for FFI_EXEC_TRAMPOLINE_TABLE case (iOS). ++ (ffi_prep_closure_loc): Handl FFI_EXEC_TRAMPOLINE_TABLE case ++ separately. ++ * src/arm/sysv.S: Handle Apple iOS host. ++ * src/closures.c: Handle FFI_EXEC_TRAMPOLINE_TABLE case. ++ * build-ios.sh: New file. ++ * fficonfig.h.in, configure, Makefile.in: Rebuilt. ++ * README: Mention ARM iOS. ++ ++2011-02-08 Oren Held ++ ++ * src/dlmalloc.c (_STRUCT_MALLINFO): Define in order to avoid ++ redefinition of mallinfo on HP-UX. ++ ++2011-02-08 Ginn Chen ++ ++ * src/sparc/ffi.c (ffi_call): Make compatible with Solaris Studio ++ aggregate return ABI. Flush cache. ++ (ffi_prep_closure_loc): Flush cache. ++ ++2011-02-11 Anthony Green ++ ++ From Tom Honermann : ++ * src/powerpc/aix.S (ffi_call_AIX): Support for xlc toolchain on ++ AIX. Declare .ffi_prep_args. Insert nops after branch ++ instructions so that the AIX linker can insert TOC reload ++ instructions. ++ * src/powerpc/aix_closure.S: Declare .ffi_closure_helper_DARWIN. ++ ++2011-02-08 Ed ++ ++ * src/powerpc/asm.h: Fix grammar nit in comment. ++ ++2011-02-08 Uli Link ++ ++ * include/ffi.h.in (FFI_64_BIT_MAX): Define and use. ++ ++2011-02-09 Rainer Orth ++ ++ PR libffi/46661 ++ * testsuite/libffi.call/cls_pointer.c (main): Cast void * to ++ uintptr_t first. ++ * testsuite/libffi.call/cls_pointer_stack.c (main): Likewise. ++ ++2011-02-08 Rafael Avila de Espindola ++ ++ * configure.ac: Fix x86 test for pc related relocs. ++ * configure: Rebuilt. ++ ++2011-02-07 Joel Sherrill ++ ++ * libffi/src/m68k/ffi.c: Add RTEMS support for cache flushing. ++ Handle case when CPU variant does not have long double support. ++ * libffi/src/m68k/sysv.S: Add support for mc68000, Coldfire, ++ and cores with soft floating point. ++ ++2011-02-07 Joel Sherrill ++ ++ * configure.ac: Add mips*-*-rtems* support. ++ * configure: Regenerate. ++ * src/mips/ffitarget.h: Ensure needed constants are available ++ for targets which do not have sgidefs.h. ++ ++2011-01-26 Dave Korn ++ ++ PR target/40125 ++ * configure.ac (AM_LTLDFLAGS): Add -bindir option for windows DLLs. ++ * configure: Regenerate. ++ ++2010-12-18 Iain Sandoe ++ ++ PR libffi/29152 ++ PR libffi/42378 ++ * src/powerpc/darwin_closure.S: Provide Darwin64 implementation, ++ update comments. ++ * src/powerpc/ffitarget.h (POWERPC_DARWIN64): New, ++ (FFI_TRAMPOLINE_SIZE): Update for Darwin64. ++ * src/powerpc/darwin.S: Provide Darwin64 implementation, ++ update comments. ++ * src/powerpc/ffi_darwin.c: Likewise. ++ ++2010-12-06 Rainer Orth ++ ++ * configure.ac (libffi_cv_as_ascii_pseudo_op): Use double ++ backslashes. ++ (libffi_cv_as_string_pseudo_op): Likewise. ++ * configure: Regenerate. ++ ++2010-12-03 Chung-Lin Tang ++ ++ * src/arm/sysv.S (ffi_closure_SYSV): Add UNWIND to .pad directive. ++ (ffi_closure_VFP): Same. ++ (ffi_call_VFP): Move down to before ffi_closure_VFP. Add '.fpu vfp' ++ directive. ++ ++2010-12-01 Rainer Orth ++ ++ * testsuite/libffi.call/ffitest.h [__sgi] (PRId64, PRIu64): Define. ++ (PRIuPTR): Define. ++ ++2010-11-29 Richard Henderson ++ Rainer Orth ++ ++ * src/x86/sysv.S (FDE_ENCODING, FDE_ENCODE): Define. ++ (.eh_frame): Use FDE_ENCODING. ++ (.LASFDE1, .LASFDE2, LASFDE3): Simplify with FDE_ENCODE. ++ ++2010-11-22 Jacek Caban ++ ++ * configure.ac: Check for symbol underscores on mingw-w64. ++ * configure: Rebuilt. ++ * src/x86/win64.S: Correctly access extern symbols in respect to ++ underscores. ++ ++2010-11-15 Rainer Orth ++ ++ * testsuite/lib/libffi-dg.exp: Rename ... ++ * testsuite/lib/libffi.exp: ... to this. ++ * libffi/testsuite/libffi.call/call.exp: Don't load libffi-dg.exp. ++ * libffi/testsuite/libffi.special/special.exp: Likewise. ++ ++2010-10-28 Chung-Lin Tang ++ ++ * src/arm/ffi.c (ffi_prep_args): Add VFP register argument handling ++ code, new parameter, and return value. Update comments. ++ (ffi_prep_cif_machdep): Add case for VFP struct return values. Add ++ call to layout_vfp_args(). ++ (ffi_call_SYSV): Update declaration. ++ (ffi_call_VFP): New declaration. ++ (ffi_call): Add VFP struct return conditions. Call ffi_call_VFP() ++ when ABI is FFI_VFP. ++ (ffi_closure_VFP): New declaration. ++ (ffi_closure_SYSV_inner): Add new vfp_args parameter, update call to ++ ffi_prep_incoming_args_SYSV(). ++ (ffi_prep_incoming_args_SYSV): Update parameters. Add VFP argument ++ case handling. ++ (ffi_prep_closure_loc): Pass ffi_closure_VFP to trampoline ++ construction under VFP hard-float. ++ (rec_vfp_type_p): New function. ++ (vfp_type_p): Same. ++ (place_vfp_arg): Same. ++ (layout_vfp_args): Same. ++ * src/arm/ffitarget.h (ffi_abi): Add FFI_VFP. Define FFI_DEFAULT_ABI ++ based on __ARM_PCS_VFP. ++ (FFI_EXTRA_CIF_FIELDS): Define for adding VFP hard-float specific ++ fields. ++ (FFI_TYPE_STRUCT_VFP_FLOAT): Define internally used type code. ++ (FFI_TYPE_STRUCT_VFP_DOUBLE): Same. ++ * src/arm/sysv.S (ffi_call_SYSV): Change call of ffi_prep_args() to ++ direct call. Move function pointer load upwards. ++ (ffi_call_VFP): New function. ++ (ffi_closure_VFP): Same. ++ ++ * testsuite/lib/libffi-dg.exp (check-flags): New function. ++ (dg-skip-if): New function. ++ * testsuite/libffi.call/cls_double_va.c: Skip if target is arm*-*-* ++ and compiler options include -mfloat-abi=hard. ++ * testsuite/libffi.call/cls_longdouble_va.c: Same. ++ ++2010-10-01 Jakub Jelinek ++ ++ PR libffi/45677 ++ * src/x86/ffi64.c (ffi_prep_cif_machdep): Ensure cif->bytes is ++ a multiple of 8. ++ * testsuite/libffi.call/many2.c: New test. ++ ++2010-08-20 Mark Wielaard ++ ++ * src/closures.c (open_temp_exec_file_mnt): Check if getmntent_r ++ returns NULL. ++ ++2010-08-09 Andreas Tobler ++ ++ * configure.ac: Add target powerpc64-*-freebsd*. ++ * configure: Regenerate. ++ * testsuite/libffi.call/cls_align_longdouble_split.c: Pass ++ -mlong-double-128 only to linux targets. ++ * testsuite/libffi.call/cls_align_longdouble_split2.c: Likewise. ++ * testsuite/libffi.call/cls_longdouble.c: Likewise. ++ * testsuite/libffi.call/huge_struct.c: Likewise. ++ ++2010-08-05 Dan Witte ++ ++ * Makefile.am: Pass FFI_DEBUG define to msvcc.sh for linking to the ++ debug CRT when --enable-debug is given. ++ * configure.ac: Define it. ++ * msvcc.sh: Translate -g and -DFFI_DEBUG appropriately. ++ ++2010-08-04 Dan Witte ++ ++ * src/x86/ffitarget.h: Add X86_ANY define for all x86/x86_64 ++ platforms. ++ * src/x86/ffi.c: Remove redundant ifdef checks. ++ * src/prep_cif.c: Push stack space computation into src/x86/ffi.c ++ for X86_ANY so return value space doesn't get added twice. ++ ++2010-08-03 Neil Rashbrooke ++ ++ * msvcc.sh: Don't pass -safeseh to ml64 because behavior is buggy. ++ ++2010-07-22 Dan Witte ++ ++ * src/*/ffitarget.h: Make FFI_LAST_ABI one past the last valid ABI. ++ * src/prep_cif.c: Fix ABI assertion. ++ * src/cris/ffi.c: Ditto. ++ ++2010-07-10 Evan Phoenix ++ ++ * src/closures.c (selinux_enabled_check): Fix strncmp usage bug. ++ ++2010-07-07 Dan Horák ++ ++ * include/ffi.h.in: Protect #define with #ifndef. ++ * src/powerpc/ffitarget.h: Ditto. ++ * src/s390/ffitarget.h: Ditto. ++ * src/sparc/ffitarget.h: Ditto. ++ ++2010-07-07 Neil Roberts ++ ++ * src/x86/sysv.S (ffi_call_SYSV): Align the stack pointer to ++ 16-bytes. ++ ++2010-07-02 Jakub Jelinek ++ ++ * Makefile.am (AM_MAKEFLAGS): Pass also mandir to submakes. ++ * Makefile.in: Regenerated. ++ ++2010-05-19 Rainer Orth ++ ++ * configure.ac (libffi_cv_as_x86_pcrel): Check for illegal in as ++ output, too. ++ (libffi_cv_as_ascii_pseudo_op): Check for .ascii. ++ (libffi_cv_as_string_pseudo_op): Check for .string. ++ * configure: Regenerate. ++ * fficonfig.h.in: Regenerate. ++ * src/x86/sysv.S (.eh_frame): Use .ascii, .string or error. ++ ++2010-05-11 Dan Witte ++ ++ * doc/libffi.tex: Document previous change. ++ ++2010-05-11 Makoto Kato ++ ++ * src/x86/ffi.c (ffi_call): Don't copy structs passed by value. ++ ++2010-05-05 Michael Kohler ++ ++ * src/dlmalloc.c (dlfree): Fix spelling. ++ * src/ia64/ffi.c (ffi_prep_cif_machdep): Ditto. ++ * configure.ac: Ditto. ++ * configure: Rebuilt. ++ ++2010-04-13 Dan Witte ++ ++ * msvcc.sh: Build with -W3 instead of -Wall. ++ * src/powerpc/ffi_darwin.c: Remove build warnings. ++ * src/x86/ffi.c: Ditto. ++ * src/x86/ffitarget.h: Ditto. ++ ++2010-04-12 Dan Witte ++ Walter Meinl ++ ++ * configure.ac: Add OS/2 support. ++ * configure: Rebuilt. ++ * src/closures.c: Ditto. ++ * src/dlmalloc.c: Ditto. ++ * src/x86/win32.S: Ditto. ++ ++2010-04-07 Jakub Jelinek ++ ++ * testsuite/libffi.call/err_bad_abi.c: Remove unused args variable. ++ ++2010-04-02 Ralf Wildenhues ++ ++ * Makefile.in: Regenerate. ++ * aclocal.m4: Regenerate. ++ * include/Makefile.in: Regenerate. ++ * man/Makefile.in: Regenerate. ++ * testsuite/Makefile.in: Regenerate. ++ ++2010-03-30 Dan Witte ++ ++ * msvcc.sh: Disable build warnings. ++ * README (tested): Clarify windows build procedure. ++ ++2010-03-15 Rainer Orth ++ ++ * configure.ac (libffi_cv_as_x86_64_unwind_section_type): New test. ++ * configure: Regenerate. ++ * fficonfig.h.in: Regenerate. ++ * libffi/src/x86/unix64.S (.eh_frame) ++ [HAVE_AS_X86_64_UNWIND_SECTION_TYPE]: Use @unwind section type. ++ ++2010-03-14 Matthias Klose ++ ++ * src/x86/ffi64.c: Fix typo in comment. ++ * src/x86/ffi.c: Use /* ... */ comment style. ++ ++2010-02-24 Rainer Orth ++ ++ * doc/libffi.texi (The Closure API): Fix typo. ++ * doc/libffi.info: Remove. ++ ++2010-02-15 Matthias Klose ++ ++ * src/arm/sysv.S (__ARM_ARCH__): Define for processor ++ __ARM_ARCH_7EM__. ++ ++2010-01-15 Anthony Green ++ ++ * README: Add notes on building with Microsoft Visual C++. ++ ++2010-01-15 Daniel Witte ++ ++ * msvcc.sh: New file. ++ ++ * src/x86/win32.S: Port assembly routines to MSVC and #ifdef. ++ * src/x86/ffi.c: Tweak function declaration and remove excess ++ parens. ++ * include/ffi.h.in: Add __declspec(align(8)) to typedef struct ++ ffi_closure. ++ ++ * src/x86/ffi.c: Merge ffi_call_SYSV and ffi_call_STDCALL into new ++ function ffi_call_win32 on X86_WIN32. ++ * src/x86/win32.S (ffi_call_SYSV): Rename to ffi_call_win32. ++ (ffi_call_STDCALL): Remove. ++ ++ * src/prep_cif.c (ffi_prep_cif): Move stack space allocation code ++ to ffi_prep_cif_machdep for x86. ++ * src/x86/ffi.c (ffi_prep_cif_machdep): To here. ++ ++2010-01-15 Oliver Kiddle ++ ++ * src/x86/ffitarget.h (ffi_abi): Check for __i386 and __amd64 for ++ Sun Studio compiler compatibility. ++ ++2010-01-12 Conrad Irwin ++ ++ * doc/libffi.texi: Add closure example. ++ ++2010-01-07 Rainer Orth ++ ++ PR libffi/40701 ++ * testsuite/libffi.call/ffitest.h [__alpha__ && __osf__] (PRIdLL, ++ PRIuLL, PRId64, PRIu64, PRIuPTR): Define. ++ * testsuite/libffi.call/cls_align_sint64.c: Add -Wno-format on ++ alpha*-dec-osf*. ++ * testsuite/libffi.call/cls_align_uint64.c: Likewise. ++ * testsuite/libffi.call/cls_ulonglong.c: Likewise. ++ * testsuite/libffi.call/return_ll1.c: Likewise. ++ * testsuite/libffi.call/stret_medium2.c: Likewise. ++ * testsuite/libffi.special/ffitestcxx.h (allocate_mmap): Cast ++ MAP_FAILED to char *. ++ ++2010-01-06 Rainer Orth ++ ++ * src/mips/n32.S: Use .abicalls and .eh_frame with __GNUC__. ++ ++2009-12-31 Anthony Green ++ ++ * README: Update for libffi 3.0.9. ++ ++2009-12-27 Matthias Klose ++ ++ * configure.ac (HAVE_LONG_DOUBLE): Define for mips when ++ appropriate. ++ * configure: Rebuilt. ++ ++2009-12-26 Anthony Green ++ ++ * testsuite/libffi.call/cls_longdouble_va.c: Mark as xfail for ++ avr32*-*-*. ++ * testsuite/libffi.call/cls_double_va.c: Ditto. ++ ++2009-12-26 Andreas Tobler ++ ++ * testsuite/libffi.call/ffitest.h: Conditionally include stdint.h ++ and inttypes.h. ++ * testsuite/libffi.special/unwindtest.cc: Ditto. ++ ++2009-12-26 Andreas Tobler ++ ++ * configure.ac: Add amd64-*-openbsd*. ++ * configure: Rebuilt. ++ * testsuite/lib/libffi-dg.exp (libffi_target_compile): Link ++ openbsd programs with -lpthread. ++ ++2009-12-26 Anthony Green ++ ++ * testsuite/libffi.call/cls_double_va.c, ++ testsuite/libffi.call/cls_longdouble.c, ++ testsuite/libffi.call/cls_longdouble_va.c, ++ testsuite/libffi.call/cls_pointer.c, ++ testsuite/libffi.call/cls_pointer_stack.c: Remove xfail for ++ mips*-*-* and arm*-*-*. ++ * testsuite/libffi.call/cls_align_longdouble_split.c, ++ testsuite/libffi.call/cls_align_longdouble_split2.c, ++ testsuite/libffi.call/stret_medium2.c, ++ testsuite/libffi.call/stret_medium.c, ++ testsuite/libffi.call/stret_large.c, ++ testsuite/libffi.call/stret_large2.c: Remove xfail for arm*-*-*. ++ ++2009-12-31 Kay Tietz ++ ++ * testsuite/libffi.call/ffitest.h, ++ testsuite/libffi.special/ffitestcxx.h (PRIdLL, PRuLL): Fix ++ definitions. ++ ++2009-12-31 Carlo Bramini ++ ++ * configure.ac (AM_LTLDFLAGS): Define for windows hosts. ++ * Makefile.am (libffi_la_LDFLAGS): Add AM_LTLDFLAGS. ++ * configure: Rebuilt. ++ * Makefile.in: Rebuilt. ++ ++2009-12-31 Anthony Green ++ Blake Chaffin. ++ ++ * testsuite/libffi.call/huge_struct.c: New test case from Blake ++ Chaffin @ Apple. ++ ++2009-12-28 David Edelsohn ++ ++ * src/powerpc/ffi_darwin.c (ffi_prep_args): Copy abi and nargs to ++ local variables. ++ (aix_adjust_aggregate_sizes): New function. ++ (ffi_prep_cif_machdep): Call it. ++ ++2009-12-26 Andreas Tobler ++ ++ * configure.ac: Define FFI_MMAP_EXEC_WRIT for the given targets. ++ * configure: Regenerate. ++ * fficonfig.h.in: Likewise. ++ * src/closures.c: Remove the FFI_MMAP_EXEC_WRIT definition for ++ Solaris/x86. ++ ++2009-12-26 Andreas Schwab ++ ++ * src/powerpc/ffi.c (ffi_prep_args_SYSV): Advance intarg_count ++ when a float arguments is passed in memory. ++ (ffi_closure_helper_SYSV): Mark general registers as used up when ++ a 64bit or soft-float long double argument is passed in memory. ++ ++2009-12-25 Matthias Klose ++ ++ * man/ffi_call.3: Fix #include in examples. ++ * doc/libffi.texi: Add dircategory. ++ ++2009-12-25 Frank Everdij ++ ++ * include/ffi.h.in: Placed '__GNUC__' ifdef around ++ '__attribute__((aligned(8)))' in ffi_closure, fixes compile for ++ IRIX MIPSPro c99. ++ * include/ffi_common.h: Added '__sgi' define to non ++ '__attribute__((__mode__()))' integer typedefs. ++ * src/mips/ffi.c (ffi_call, ffi_closure_mips_inner_O32, ++ ffi_closure_mips_inner_N32): Added 'defined(_MIPSEB)' to BE check. ++ (ffi_closure_mips_inner_O32, ffi_closure_mips_inner_N32): Added ++ FFI_LONGDOUBLE support and alignment(N32 only). ++ * src/mips/ffitarget.h: Corrected '#include ' for IRIX and ++ fixed non '__attribute__((__mode__()))' integer typedefs. ++ * src/mips/n32.S: Put '#ifdef linux' around '.abicalls' and '.eh_frame' ++ since they are Linux/GNU Assembler specific. ++ ++2009-12-25 Bradley Smith ++ ++ * configure.ac, Makefile.am, src/avr32/ffi.c, ++ src/avr32/ffitarget.h, ++ src/avr32/sysv.S: Add AVR32 port. ++ * configure, Makefile.in: Rebuilt. ++ ++2009-12-21 Andreas Tobler ++ ++ * configure.ac: Make i?86 build on FreeBSD and OpenBSD. ++ * configure: Regenerate. ++ ++2009-12-15 John David Anglin ++ ++ * testsuite/libffi.call/ffitest.h: Define PRIuPTR on PA HP-UX. ++ ++2009-12-13 John David Anglin ++ ++ * src/pa/ffi.c (ffi_closure_inner_pa32): Handle FFI_TYPE_LONGDOUBLE ++ type on HP-UX. ++ ++2012-02-13 Kai Tietz ++ ++ PR libffi/52221 ++ * src/x86/ffi.c (ffi_prep_raw_closure_loc): Add thiscall ++ support for X86_WIN32. ++ (FFI_INIT_TRAMPOLINE_THISCALL): Fix displacement. ++ ++2009-12-11 Eric Botcazou ++ ++ * src/sparc/ffi.c (ffi_closure_sparc_inner_v9): Properly align 'long ++ double' arguments. ++ ++2009-12-11 Eric Botcazou ++ ++ * testsuite/libffi.call/ffitest.h: Define PRIuPTR on Solaris < 10. ++ ++2009-12-10 Rainer Orth ++ ++ PR libffi/40700 ++ * src/closures.c [X86_64 && __sun__ && __svr4__] ++ (FFI_MMAP_EXEC_WRIT): Define. ++ ++2009-12-08 David Daney ++ ++ * testsuite/libffi.call/stret_medium.c: Remove xfail for mips*-*-* ++ * testsuite/libffi.call/cls_align_longdouble_split2.c: Same. ++ * testsuite/libffi.call/stret_large.c: Same. ++ * testsuite/libffi.call/cls_align_longdouble_split.c: Same. ++ * testsuite/libffi.call/stret_large2.c: Same. ++ * testsuite/libffi.call/stret_medium2.c: Same. ++ ++2009-12-07 David Edelsohn ++ ++ * src/powerpc/aix_closure.S (libffi_closure_ASM): Fix tablejump ++ typo. ++ ++2009-12-05 David Edelsohn ++ ++ * src/powerpc/aix.S: Update AIX32 code to be consistent with AIX64 ++ code. ++ * src/powerpc/aix_closure.S: Same. ++ ++2009-12-05 Ralf Wildenhues ++ ++ * Makefile.in: Regenerate. ++ * configure: Regenerate. ++ * include/Makefile.in: Regenerate. ++ * man/Makefile.in: Regenerate. ++ * testsuite/Makefile.in: Regenerate. ++ ++2009-12-04 David Edelsohn ++ ++ * src/powerpc/aix_closure.S: Reorganize 64-bit code to match ++ linux64_closure.S. ++ ++2009-12-04 Uros Bizjak ++ ++ PR libffi/41908 ++ * src/x86/ffi64.c (classify_argument): Update from ++ gcc/config/i386/i386.c. ++ (ffi_closure_unix64_inner): Do not use the address of two consecutive ++ SSE registers directly. ++ * testsuite/libffi.call/cls_dbls_struct.c (main): Remove xfail ++ for x86_64 linux targets. ++ ++2009-12-04 David Edelsohn ++ ++ * src/powerpc/ffi_darwin.c (ffi_closure_helper_DARWIN): Increment ++ pfr for long double split between fpr13 and stack. ++ ++2009-12-03 David Edelsohn ++ ++ * src/powerpc/ffi_darwin.c (ffi_prep_args): Increment next_arg and ++ fparg_count twice for long double. ++ ++2009-12-03 David Edelsohn ++ ++ PR libffi/42243 ++ * src/powerpc/ffi_darwin.c (ffi_prep_args): Remove extra parentheses. ++ ++2009-12-03 Uros Bizjak ++ ++ * testsuite/libffi.call/cls_longdouble_va.c (main): Fix format string. ++ Remove xfails for x86 linux targets. ++ ++2009-12-02 David Edelsohn ++ ++ * src/powerpc/ffi_darwin.c (ffi_prep_args): Fix typo in INT64 ++ case. ++ ++2009-12-01 David Edelsohn ++ ++ * src/powerpc/aix.S (ffi_call_AIX): Convert to more standard ++ register usage. Call ffi_prep_args directly. Add long double ++ return value support. ++ * src/powerpc/ffi_darwin.c (ffi_prep_args): Double arg increment ++ applies to FFI_TYPE_DOUBLE. Correct fpr_base increment typo. ++ Separate FFI_TYPE_SINT32 and FFI_TYPE_UINT32 cases. ++ (ffi_prep_cif_machdep): Only 16 byte stack alignment in 64 bit ++ mode. ++ (ffi_closure_helper_DARWIN): Remove nf and ng counters. Move temp ++ into case. ++ * src/powerpc/aix_closure.S: Maintain 16 byte stack alignment. ++ Allocate result area between params and FPRs. ++ ++2009-11-30 David Edelsohn ++ ++ PR target/35484 ++ * src/powerpc/ffitarget.h (POWERPC64): Define for PPC64 Linux and ++ AIX64. ++ * src/powerpc/aix.S: Implement AIX64 version. ++ * src/powerpc/aix_closure.S: Implement AIX64 version. ++ (ffi_closure_ASM): Use extsb, lha and displament addresses. ++ * src/powerpc/ffi_darwin.c (ffi_prep_args): Implement AIX64 ++ support. ++ (ffi_prep_cif_machdep): Same. ++ (ffi_call): Same. ++ (ffi_closure_helper_DARWIN): Same. ++ ++2009-11-02 Andreas Tobler ++ ++ PR libffi/41908 ++ * testsuite/libffi.call/testclosure.c: New test. ++ ++2009-09-28 Kai Tietz ++ ++ * src/x86/win64.S (_ffi_call_win64 stack): Remove for gnu ++ assembly version use of ___chkstk. ++ ++2009-09-23 Matthias Klose ++ ++ PR libffi/40242, PR libffi/41443 ++ * src/arm/sysv.S (__ARM_ARCH__): Define for processors ++ __ARM_ARCH_6T2__, __ARM_ARCH_6M__, __ARM_ARCH_7__, ++ __ARM_ARCH_7A__, __ARM_ARCH_7R__, __ARM_ARCH_7M__. ++ Change the conditionals to __SOFTFP__ || __ARM_EABI__ ++ for -mfloat-abi=softfp to work. ++ ++2009-09-17 Loren J. Rittle ++ ++ PR testsuite/32843 (strikes again) ++ * src/x86/ffi.c (ffi_prep_cif_machdep): Add X86_FREEBSD to ++ enable proper extension on char and short. ++ ++2009-09-15 David Daney ++ ++ * src/java_raw_api.c (ffi_java_raw_to_rvalue): Remove special ++ handling for FFI_TYPE_POINTER. ++ * src/mips/ffitarget.h (FFI_TYPE_STRUCT_D_SOFT, ++ FFI_TYPE_STRUCT_F_SOFT, FFI_TYPE_STRUCT_DD_SOFT, ++ FFI_TYPE_STRUCT_FF_SOFT, FFI_TYPE_STRUCT_FD_SOFT, ++ FFI_TYPE_STRUCT_DF_SOFT, FFI_TYPE_STRUCT_SOFT): New defines. ++ (FFI_N32_SOFT_FLOAT, FFI_N64_SOFT_FLOAT): New ffi_abi enumerations. ++ (enum ffi_abi): Set FFI_DEFAULT_ABI for soft-float. ++ * src/mips/n32.S (ffi_call_N32): Add handling for soft-float ++ structure and pointer returns. ++ (ffi_closure_N32): Add handling for pointer returns. ++ * src/mips/ffi.c (ffi_prep_args, calc_n32_struct_flags, ++ calc_n32_return_struct_flags): Handle soft-float. ++ (ffi_prep_cif_machdep): Handle soft-float, fix pointer handling. ++ (ffi_call_N32): Declare proper argument types. ++ (ffi_call, copy_struct_N32, ffi_closure_mips_inner_N32): Handle ++ soft-float. ++ ++2009-08-24 Ralf Wildenhues ++ ++ * configure.ac (AC_PREREQ): Bump to 2.64. ++ ++2009-08-22 Ralf Wildenhues ++ ++ * Makefile.am (install-html, install-pdf): Remove. ++ * Makefile.in: Regenerate. ++ ++ * Makefile.in: Regenerate. ++ * aclocal.m4: Regenerate. ++ * configure: Regenerate. ++ * fficonfig.h.in: Regenerate. ++ * include/Makefile.in: Regenerate. ++ * man/Makefile.in: Regenerate. ++ * testsuite/Makefile.in: Regenerate. ++ ++2011-08-22 Jasper Lievisse Adriaanse ++ ++ * configure.ac: Add OpenBSD/hppa and OpenBSD/powerpc support. ++ * configure: Rebuilt. ++ ++2009-07-30 Ralf Wildenhues ++ ++ * configure.ac (_AC_ARG_VAR_PRECIOUS): Use m4_rename_force. ++ ++2009-07-24 Dave Korn ++ ++ PR libffi/40807 ++ * src/x86/ffi.c (ffi_prep_cif_machdep): Also use sign/zero-extending ++ return types for X86_WIN32. ++ * src/x86/win32.S (_ffi_call_SYSV): Handle omitted return types. ++ (_ffi_call_STDCALL, _ffi_closure_SYSV, _ffi_closure_raw_SYSV, ++ _ffi_closure_STDCALL): Likewise. ++ ++ * src/closures.c (is_selinux_enabled): Define to const 0 for Cygwin. ++ (dlmmap, dlmunmap): Also use these functions on Cygwin. ++ ++2009-07-11 Richard Sandiford ++ ++ PR testsuite/40699 ++ PR testsuite/40707 ++ PR testsuite/40709 ++ * testsuite/lib/libffi-dg.exp: Revert 2009-07-02, 2009-07-01 and ++ 2009-06-30 commits. ++ ++2009-07-01 Richard Sandiford ++ ++ * testsuite/lib/libffi-dg.exp (libffi-init): Set ld_library_path ++ to "" before adding paths. (This reinstates an assignment that ++ was removed by my 2009-06-30 commit, but changes the initial ++ value from "." to "".) ++ ++2009-07-01 H.J. Lu ++ ++ PR testsuite/40601 ++ * testsuite/lib/libffi-dg.exp (libffi-init): Properly set ++ gccdir. Adjust ld_library_path for gcc only if gccdir isn't ++ empty. ++ ++2009-06-30 Richard Sandiford ++ ++ * testsuite/lib/libffi-dg.exp (libffi-init): Don't add "." ++ to ld_library_path. Use add_path. Add just find_libgcc_s ++ to ld_library_path, not every libgcc multilib directory. ++ ++2009-06-16 Wim Lewis ++ ++ * src/powerpc/ffi.c: Avoid clobbering cr3 and cr4, which are ++ supposed to be callee-saved. ++ * src/powerpc/sysv.S (small_struct_return_value): Fix overrun of ++ return buffer for odd-size structs. ++ ++2009-06-16 Andreas Tobler ++ ++ PR libffi/40444 ++ * testsuite/lib/libffi-dg.exp (libffi_target_compile): Add ++ allow_stack_execute for Darwin. ++ ++2009-06-16 Andrew Haley ++ ++ * configure.ac (TARGETDIR): Add missing blank lines. ++ * configure: Regenerate. ++ ++2009-06-16 Andrew Haley ++ ++ * testsuite/libffi.call/cls_align_sint64.c, ++ testsuite/libffi.call/cls_align_uint64.c, ++ testsuite/libffi.call/cls_longdouble_va.c, ++ testsuite/libffi.call/cls_ulonglong.c, ++ testsuite/libffi.call/return_ll1.c, ++ testsuite/libffi.call/stret_medium2.c: Fix printf format ++ specifiers. ++ * testsuite/libffi.call/ffitest.h, ++ testsuite/libffi.special/ffitestcxx.h (PRIdLL, PRIuLL): Define. ++ ++2009-06-15 Andrew Haley ++ ++ * testsuite/libffi.call/err_bad_typedef.c: xfail everywhere. ++ * testsuite/libffi.call/err_bad_abi.c: Likewise. ++ ++2009-06-12 Andrew Haley ++ ++ * Makefile.am: Remove info_TEXINFOS. ++ ++2009-06-12 Andrew Haley ++ ++ * ChangeLog.libffi: testsuite/libffi.call/cls_align_sint64.c, ++ testsuite/libffi.call/cls_align_uint64.c, ++ testsuite/libffi.call/cls_ulonglong.c, ++ testsuite/libffi.call/return_ll1.c, ++ testsuite/libffi.call/stret_medium2.c: Fix printf format ++ specifiers. ++ testsuite/libffi.special/unwindtest.cc: include stdint.h. ++ ++2009-06-11 Timothy Wall ++ ++ * Makefile.am, ++ configure.ac, ++ include/ffi.h.in, ++ include/ffi_common.h, ++ src/closures.c, ++ src/dlmalloc.c, ++ src/x86/ffi.c, ++ src/x86/ffitarget.h, ++ src/x86/win64.S (new), ++ README: Added win64 support (mingw or MSVC) ++ * Makefile.in, ++ include/Makefile.in, ++ man/Makefile.in, ++ testsuite/Makefile.in, ++ configure, ++ aclocal.m4: Regenerated ++ * ltcf-c.sh: properly escape cygwin/w32 path ++ * man/ffi_call.3: Clarify size requirements for return value. ++ * src/x86/ffi64.c: Fix filename in comment. ++ * src/x86/win32.S: Remove unused extern. ++ ++ * testsuite/libffi.call/closure_fn0.c, ++ testsuite/libffi.call/closure_fn1.c, ++ testsuite/libffi.call/closure_fn2.c, ++ testsuite/libffi.call/closure_fn3.c, ++ testsuite/libffi.call/closure_fn4.c, ++ testsuite/libffi.call/closure_fn5.c, ++ testsuite/libffi.call/closure_fn6.c, ++ testsuite/libffi.call/closure_stdcall.c, ++ testsuite/libffi.call/cls_12byte.c, ++ testsuite/libffi.call/cls_16byte.c, ++ testsuite/libffi.call/cls_18byte.c, ++ testsuite/libffi.call/cls_19byte.c, ++ testsuite/libffi.call/cls_1_1byte.c, ++ testsuite/libffi.call/cls_20byte.c, ++ testsuite/libffi.call/cls_20byte1.c, ++ testsuite/libffi.call/cls_24byte.c, ++ testsuite/libffi.call/cls_2byte.c, ++ testsuite/libffi.call/cls_3_1byte.c, ++ testsuite/libffi.call/cls_3byte1.c, ++ testsuite/libffi.call/cls_3byte2.c, ++ testsuite/libffi.call/cls_4_1byte.c, ++ testsuite/libffi.call/cls_4byte.c, ++ testsuite/libffi.call/cls_5_1_byte.c, ++ testsuite/libffi.call/cls_5byte.c, ++ testsuite/libffi.call/cls_64byte.c, ++ testsuite/libffi.call/cls_6_1_byte.c, ++ testsuite/libffi.call/cls_6byte.c, ++ testsuite/libffi.call/cls_7_1_byte.c, ++ testsuite/libffi.call/cls_7byte.c, ++ testsuite/libffi.call/cls_8byte.c, ++ testsuite/libffi.call/cls_9byte1.c, ++ testsuite/libffi.call/cls_9byte2.c, ++ testsuite/libffi.call/cls_align_double.c, ++ testsuite/libffi.call/cls_align_float.c, ++ testsuite/libffi.call/cls_align_longdouble.c, ++ testsuite/libffi.call/cls_align_longdouble_split.c, ++ testsuite/libffi.call/cls_align_longdouble_split2.c, ++ testsuite/libffi.call/cls_align_pointer.c, ++ testsuite/libffi.call/cls_align_sint16.c, ++ testsuite/libffi.call/cls_align_sint32.c, ++ testsuite/libffi.call/cls_align_sint64.c, ++ testsuite/libffi.call/cls_align_uint16.c, ++ testsuite/libffi.call/cls_align_uint32.c, ++ testsuite/libffi.call/cls_align_uint64.c, ++ testsuite/libffi.call/cls_dbls_struct.c, ++ testsuite/libffi.call/cls_double.c, ++ testsuite/libffi.call/cls_double_va.c, ++ testsuite/libffi.call/cls_float.c, ++ testsuite/libffi.call/cls_longdouble.c, ++ testsuite/libffi.call/cls_longdouble_va.c, ++ testsuite/libffi.call/cls_multi_schar.c, ++ testsuite/libffi.call/cls_multi_sshort.c, ++ testsuite/libffi.call/cls_multi_sshortchar.c, ++ testsuite/libffi.call/cls_multi_uchar.c, ++ testsuite/libffi.call/cls_multi_ushort.c, ++ testsuite/libffi.call/cls_multi_ushortchar.c, ++ testsuite/libffi.call/cls_pointer.c, ++ testsuite/libffi.call/cls_pointer_stack.c, ++ testsuite/libffi.call/cls_schar.c, ++ testsuite/libffi.call/cls_sint.c, ++ testsuite/libffi.call/cls_sshort.c, ++ testsuite/libffi.call/cls_uchar.c, ++ testsuite/libffi.call/cls_uint.c, ++ testsuite/libffi.call/cls_ulonglong.c, ++ testsuite/libffi.call/cls_ushort.c, ++ testsuite/libffi.call/err_bad_abi.c, ++ testsuite/libffi.call/err_bad_typedef.c, ++ testsuite/libffi.call/float2.c, ++ testsuite/libffi.call/huge_struct.c, ++ testsuite/libffi.call/nested_struct.c, ++ testsuite/libffi.call/nested_struct1.c, ++ testsuite/libffi.call/nested_struct10.c, ++ testsuite/libffi.call/nested_struct2.c, ++ testsuite/libffi.call/nested_struct3.c, ++ testsuite/libffi.call/nested_struct4.c, ++ testsuite/libffi.call/nested_struct5.c, ++ testsuite/libffi.call/nested_struct6.c, ++ testsuite/libffi.call/nested_struct7.c, ++ testsuite/libffi.call/nested_struct8.c, ++ testsuite/libffi.call/nested_struct9.c, ++ testsuite/libffi.call/problem1.c, ++ testsuite/libffi.call/return_ldl.c, ++ testsuite/libffi.call/return_ll1.c, ++ testsuite/libffi.call/stret_large.c, ++ testsuite/libffi.call/stret_large2.c, ++ testsuite/libffi.call/stret_medium.c, ++ testsuite/libffi.call/stret_medium2.c, ++ testsuite/libffi.special/unwindtest.cc: use ffi_closure_alloc instead ++ of checking for MMAP. Use intptr_t instead of long casts. ++ ++2009-06-11 Kaz Kojima ++ ++ * testsuite/libffi.call/cls_longdouble_va.c: Add xfail sh*-*-linux-*. ++ * testsuite/libffi.call/err_bad_abi.c: Add xfail sh*-*-*. ++ * testsuite/libffi.call/err_bad_typedef.c: Likewise. ++ ++2009-06-09 Andrew Haley ++ ++ * src/x86/freebsd.S: Add missing file. ++ ++2009-06-08 Andrew Haley ++ ++ Import from libffi 3.0.8: ++ ++ * doc/libffi.texi: New file. ++ * doc/libffi.info: Likewise. ++ * doc/stamp-vti: Likewise. ++ * man/Makefile.am: New file. ++ * man/ffi_call.3: New file. ++ ++ * Makefile.am (EXTRA_DIST): Add src/x86/darwin64.S, ++ src/dlmalloc.c. ++ (nodist_libffi_la_SOURCES): Add X86_FREEBSD. ++ ++ * configure.ac: Bump version to 3.0.8. ++ parisc*-*-linux*: Add. ++ i386-*-freebsd* | i386-*-openbsd*: Add. ++ powerpc-*-beos*: Add. ++ AM_CONDITIONAL X86_FREEBSD: Add. ++ AC_CONFIG_FILES: Add man/Makefile. ++ ++ * include/ffi.h.in (FFI_FN): Change void (*)() to void (*)(void). ++ ++2009-06-08 Andrew Haley ++ ++ * README: Import from libffi 3.0.8. ++ ++2009-06-08 Andrew Haley ++ ++ * testsuite/libffi.call/err_bad_abi.c: Add xfails. ++ * testsuite/libffi.call/cls_longdouble_va.c: Add xfails. ++ * testsuite/libffi.call/cls_dbls_struct.c: Add xfail x86_64-*-linux-*. ++ * testsuite/libffi.call/err_bad_typedef.c: Add xfails. ++ ++ * testsuite/libffi.call/stret_medium2.c: Add __UNUSED__ to args. ++ * testsuite/libffi.call/stret_medium.c: Likewise. ++ * testsuite/libffi.call/stret_large2.c: Likewise. ++ * testsuite/libffi.call/stret_large.c: Likewise. ++ ++2008-12-26 Timothy Wall ++ ++ * testsuite/libffi.call/cls_longdouble.c, ++ testsuite/libffi.call/cls_longdouble_va.c, ++ testsuite/libffi.call/cls_align_longdouble.c, ++ testsuite/libffi.call/cls_align_longdouble_split.c, ++ testsuite/libffi.call/cls_align_longdouble_split2.c: mark expected ++ failures on x86_64 cygwin/mingw. ++ ++2008-12-22 Timothy Wall ++ ++ * testsuite/libffi.call/closure_fn0.c, ++ testsuite/libffi.call/closure_fn1.c, ++ testsuite/libffi.call/closure_fn2.c, ++ testsuite/libffi.call/closure_fn3.c, ++ testsuite/libffi.call/closure_fn4.c, ++ testsuite/libffi.call/closure_fn5.c, ++ testsuite/libffi.call/closure_fn6.c, ++ testsuite/libffi.call/closure_loc_fn0.c, ++ testsuite/libffi.call/closure_stdcall.c, ++ testsuite/libffi.call/cls_align_pointer.c, ++ testsuite/libffi.call/cls_pointer.c, ++ testsuite/libffi.call/cls_pointer_stack.c: use portable cast from ++ pointer to integer (intptr_t). ++ * testsuite/libffi.call/cls_longdouble.c: disable for win64. ++ ++2008-07-24 Anthony Green ++ ++ * testsuite/libffi.call/cls_dbls_struct.c, ++ testsuite/libffi.call/cls_double_va.c, ++ testsuite/libffi.call/cls_longdouble.c, ++ testsuite/libffi.call/cls_longdouble_va.c, ++ testsuite/libffi.call/cls_pointer.c, ++ testsuite/libffi.call/cls_pointer_stack.c, ++ testsuite/libffi.call/err_bad_abi.c: Clean up failures from ++ compiler warnings. ++ ++2008-03-04 Anthony Green ++ Blake Chaffin ++ hos@tamanegi.org ++ ++ * testsuite/libffi.call/cls_align_longdouble_split2.c ++ testsuite/libffi.call/cls_align_longdouble_split.c ++ testsuite/libffi.call/cls_dbls_struct.c ++ testsuite/libffi.call/cls_double_va.c ++ testsuite/libffi.call/cls_longdouble.c ++ testsuite/libffi.call/cls_longdouble_va.c ++ testsuite/libffi.call/cls_pointer.c ++ testsuite/libffi.call/cls_pointer_stack.c ++ testsuite/libffi.call/err_bad_abi.c ++ testsuite/libffi.call/err_bad_typedef.c ++ testsuite/libffi.call/stret_large2.c ++ testsuite/libffi.call/stret_large.c ++ testsuite/libffi.call/stret_medium2.c ++ testsuite/libffi.call/stret_medium.c: New tests from Apple. ++ ++2009-06-05 Andrew Haley ++ ++ * src/x86/ffitarget.h, src/x86/ffi.c: Merge stdcall changes from ++ libffi. ++ ++2009-06-04 Andrew Haley ++ ++ * src/x86/ffitarget.h, src/x86/win32.S, src/x86/ffi.c: Back out ++ stdcall changes. ++ ++2008-02-26 Anthony Green ++ Thomas Heller ++ ++ * src/x86/ffi.c (ffi_closure_SYSV_inner): Change C++ comment to C ++ comment. ++ ++2008-02-03 Timothy Wall ++ ++ * src/x86/ffi.c (FFI_INIT_TRAMPOLINE_STDCALL): Calculate jump return ++ offset based on code pointer, not data pointer. ++ ++2008-01-31 Timothy Wall ++ ++ * testsuite/libffi.call/closure_stdcall.c: Add test for stdcall ++ closures. ++ * src/x86/ffitarget.h: Increase size of trampoline for stdcall ++ closures. ++ * src/x86/win32.S: Add assembly for stdcall closure. ++ * src/x86/ffi.c: Initialize stdcall closure trampoline. ++ ++2009-06-04 Andrew Haley ++ ++ * include/ffi.h.in: Change void (*)() to void (*)(void). ++ * src/x86/ffi.c: Likewise. ++ ++2009-06-04 Andrew Haley ++ ++ * src/powerpc/ppc_closure.S: Insert licence header. ++ * src/powerpc/linux64_closure.S: Likewise. ++ * src/m68k/sysv.S: Likewise. ++ ++ * src/sh64/ffi.c: Change void (*)() to void (*)(void). ++ * src/powerpc/ffi.c: Likewise. ++ * src/powerpc/ffi_darwin.c: Likewise. ++ * src/m32r/ffi.c: Likewise. ++ * src/sh64/ffi.c: Likewise. ++ * src/x86/ffi64.c: Likewise. ++ * src/alpha/ffi.c: Likewise. ++ * src/alpha/osf.S: Likewise. ++ * src/frv/ffi.c: Likewise. ++ * src/s390/ffi.c: Likewise. ++ * src/pa/ffi.c: Likewise. ++ * src/pa/hpux32.S: Likewise. ++ * src/ia64/unix.S: Likewise. ++ * src/ia64/ffi.c: Likewise. ++ * src/sparc/ffi.c: Likewise. ++ * src/mips/ffi.c: Likewise. ++ * src/sh/ffi.c: Likewise. ++ ++2008-02-15 David Daney ++ ++ * src/mips/ffi.c (USE__BUILTIN___CLEAR_CACHE): ++ Define (conditionally), and use it to include cachectl.h. ++ (ffi_prep_closure_loc): Fix cache flushing. ++ * src/mips/ffitarget.h (_ABIN32, _ABI64, _ABIO32): Define. ++ ++2009-06-04 Andrew Haley ++ ++ include/ffi.h.in, ++ src/arm/ffitarget.h, ++ src/arm/ffi.c, ++ src/arm/sysv.S, ++ src/powerpc/ffitarget.h, ++ src/closures.c, ++ src/sh64/ffitarget.h, ++ src/sh64/ffi.c, ++ src/sh64/sysv.S, ++ src/types.c, ++ src/x86/ffi64.c, ++ src/x86/ffitarget.h, ++ src/x86/win32.S, ++ src/x86/darwin.S, ++ src/x86/ffi.c, ++ src/x86/sysv.S, ++ src/x86/unix64.S, ++ src/alpha/ffitarget.h, ++ src/alpha/ffi.c, ++ src/alpha/osf.S, ++ src/m68k/ffitarget.h, ++ src/frv/ffitarget.h, ++ src/frv/ffi.c, ++ src/s390/ffitarget.h, ++ src/s390/sysv.S, ++ src/cris/ffitarget.h, ++ src/pa/linux.S, ++ src/pa/ffitarget.h, ++ src/pa/ffi.c, ++ src/raw_api.c, ++ src/ia64/ffitarget.h, ++ src/ia64/unix.S, ++ src/ia64/ffi.c, ++ src/ia64/ia64_flags.h, ++ src/java_raw_api.c, ++ src/debug.c, ++ src/sparc/v9.S, ++ src/sparc/ffitarget.h, ++ src/sparc/ffi.c, ++ src/sparc/v8.S, ++ src/mips/ffitarget.h, ++ src/mips/n32.S, ++ src/mips/o32.S, ++ src/mips/ffi.c, ++ src/prep_cif.c, ++ src/sh/ffitarget.h, ++ src/sh/ffi.c, ++ src/sh/sysv.S: Update license text. ++ ++2009-05-22 Dave Korn ++ ++ * src/x86/win32.S (_ffi_closure_STDCALL): New function. ++ (.eh_frame): Add FDE for it. ++ ++2009-05-22 Dave Korn ++ ++ * configure.ac: Also check if assembler supports pc-relative ++ relocs on X86_WIN32 targets. ++ * configure: Regenerate. ++ * src/x86/win32.S (ffi_prep_args): Declare extern, not global. ++ (_ffi_call_SYSV): Add missing function type symbol .def and ++ add EH markup labels. ++ (_ffi_call_STDCALL): Likewise. ++ (_ffi_closure_SYSV): Likewise. ++ (_ffi_closure_raw_SYSV): Likewise. ++ (.eh_frame): Add hand-crafted EH data. ++ ++2009-04-09 Jakub Jelinek ++ ++ * testsuite/lib/libffi-dg.exp: Change copyright header to refer to ++ version 3 of the GNU General Public License and to point readers ++ at the COPYING3 file and the FSF's license web page. ++ * testsuite/libffi.call/call.exp: Likewise. ++ * testsuite/libffi.special/special.exp: Likewise. ++ ++2009-03-01 Ralf Wildenhues ++ ++ * configure: Regenerate. ++ ++2008-12-18 Rainer Orth ++ ++ PR libffi/26048 ++ * configure.ac (HAVE_AS_X86_PCREL): New test. ++ * configure: Regenerate. ++ * fficonfig.h.in: Regenerate. ++ * src/x86/sysv.S [!FFI_NO_RAW_API]: Precalculate ++ RAW_CLOSURE_CIF_OFFSET, RAW_CLOSURE_FUN_OFFSET, ++ RAW_CLOSURE_USER_DATA_OFFSET for the Solaris 10/x86 assembler. ++ (.eh_frame): Only use SYMBOL-. iff HAVE_AS_X86_PCREL. ++ * src/x86/unix64.S (.Lstore_table): Move to .text section. ++ (.Lload_table): Likewise. ++ (.eh_frame): Only use SYMBOL-. iff HAVE_AS_X86_PCREL. ++ ++2008-12-18 Ralf Wildenhues ++ ++ * configure: Regenerate. ++ ++2008-11-21 Eric Botcazou ++ ++ * src/sparc/ffi.c (ffi_prep_cif_machdep): Add support for ++ signed/unsigned int8/16 return values. ++ * src/sparc/v8.S (ffi_call_v8): Likewise. ++ (ffi_closure_v8): Likewise. ++ ++2008-09-26 Peter O'Gorman ++ Steve Ellcey ++ ++ * configure: Regenerate for new libtool. ++ * Makefile.in: Ditto. ++ * include/Makefile.in: Ditto. ++ * aclocal.m4: Ditto. ++ ++2008-08-25 Andreas Tobler ++ ++ * src/powerpc/ffitarget.h (ffi_abi): Add FFI_LINUX and ++ FFI_LINUX_SOFT_FLOAT to the POWERPC_FREEBSD enum. ++ Add note about flag bits used for FFI_SYSV_TYPE_SMALL_STRUCT. ++ Adjust copyright notice. ++ * src/powerpc/ffi.c: Add two new flags to indicate if we have one ++ register or two register to use for FFI_SYSV structs. ++ (ffi_prep_cif_machdep): Pass the right register flag introduced above. ++ (ffi_closure_helper_SYSV): Fix the return type for ++ FFI_SYSV_TYPE_SMALL_STRUCT. Comment. ++ Adjust copyright notice. ++ ++2008-07-16 Kaz Kojima ++ ++ * src/sh/ffi.c (ffi_prep_closure_loc): Turn INSN into an unsigned ++ int. ++ ++2008-06-17 Ralf Wildenhues ++ ++ * configure: Regenerate. ++ * include/Makefile.in: Regenerate. ++ * testsuite/Makefile.in: Regenerate. ++ ++2008-06-07 Joseph Myers ++ ++ * configure.ac (parisc*-*-linux*, powerpc-*-sysv*, ++ powerpc-*-beos*): Remove. ++ * configure: Regenerate. ++ ++2008-05-09 Julian Brown ++ ++ * Makefile.am (LTLDFLAGS): New. ++ (libffi_la_LDFLAGS): Use above. ++ * Makefile.in: Regenerate. ++ ++2008-04-18 Paolo Bonzini ++ ++ PR bootstrap/35457 ++ * aclocal.m4: Regenerate. ++ * configure: Regenerate. ++ ++2008-03-26 Kaz Kojima ++ ++ * src/sh/sysv.S: Add .note.GNU-stack on Linux. ++ * src/sh64/sysv.S: Likewise. ++ ++2008-03-26 Daniel Jacobowitz ++ ++ * src/arm/sysv.S: Fix ARM comment marker. ++ ++2008-03-26 Jakub Jelinek ++ ++ * src/alpha/osf.S: Add .note.GNU-stack on Linux. ++ * src/s390/sysv.S: Likewise. ++ * src/powerpc/ppc_closure.S: Likewise. ++ * src/powerpc/sysv.S: Likewise. ++ * src/x86/unix64.S: Likewise. ++ * src/x86/sysv.S: Likewise. ++ * src/sparc/v8.S: Likewise. ++ * src/sparc/v9.S: Likewise. ++ * src/m68k/sysv.S: Likewise. ++ * src/arm/sysv.S: Likewise. ++ ++2008-03-16 Ralf Wildenhues ++ ++ * aclocal.m4: Regenerate. ++ * configure: Likewise. ++ * Makefile.in: Likewise. ++ * include/Makefile.in: Likewise. ++ * testsuite/Makefile.in: Likewise. ++ ++2008-02-12 Bjoern Koenig ++ Andreas Tobler ++ ++ * configure.ac: Add amd64-*-freebsd* target. ++ * configure: Regenerate. ++ ++2008-01-30 H.J. Lu ++ ++ PR libffi/34612 ++ * src/x86/sysv.S (ffi_closure_SYSV): Pop 4 byte from stack when ++ returning struct. ++ ++ * testsuite/libffi.call/call.exp: Add "-O2 -fomit-frame-pointer" ++ tests. ++ ++2008-01-24 David Edelsohn ++ ++ * configure: Regenerate. ++ ++2008-01-06 Andreas Tobler ++ ++ * src/x86/ffi.c (ffi_prep_cif_machdep): Fix thinko. ++ ++2008-01-05 Andreas Tobler ++ ++ PR testsuite/32843 ++ * src/x86/ffi.c (ffi_prep_cif_machdep): Add code for ++ signed/unsigned int8/16 for X86_DARWIN. ++ Updated copyright info. ++ Handle one and two byte structs with special cif->flags. ++ * src/x86/ffitarget.h: Add special types for one and two byte structs. ++ Updated copyright info. ++ * src/x86/darwin.S (ffi_call_SYSV): Rewrite to use a jump table like ++ sysv.S ++ Remove code to pop args from the stack after call. ++ Special-case signed/unsigned for int8/16, one and two byte structs. ++ (ffi_closure_raw_SYSV): Handle FFI_TYPE_UINT8, ++ FFI_TYPE_SINT8, FFI_TYPE_UINT16, FFI_TYPE_SINT16, FFI_TYPE_UINT32, ++ FFI_TYPE_SINT32. ++ Updated copyright info. ++ ++2007-12-08 David Daney ++ ++ * src/mips/n32.S (ffi_call_N32): Replace dadd with ADDU, dsub with ++ SUBU, add with ADDU and use smaller code sequences. ++ ++2007-12-07 David Daney ++ ++ * src/mips/ffi.c (ffi_prep_cif_machdep): Handle long double return ++ type. ++ ++2007-12-06 David Daney ++ ++ * include/ffi.h.in (FFI_SIZEOF_JAVA_RAW): Define if not already ++ defined. ++ (ffi_java_raw): New typedef. ++ (ffi_java_raw_call, ffi_java_ptrarray_to_raw, ++ ffi_java_raw_to_ptrarray): Change parameter types from ffi_raw to ++ ffi_java_raw. ++ (ffi_java_raw_closure) : Same. ++ (ffi_prep_java_raw_closure, ffi_prep_java_raw_closure_loc): Change ++ parameter types. ++ * src/java_raw_api.c (ffi_java_raw_size): Replace FFI_SIZEOF_ARG with ++ FFI_SIZEOF_JAVA_RAW. ++ (ffi_java_raw_to_ptrarray): Change type of raw to ffi_java_raw. ++ Replace FFI_SIZEOF_ARG with FFI_SIZEOF_JAVA_RAW. Use ++ sizeof(ffi_java_raw) for alignment calculations. ++ (ffi_java_ptrarray_to_raw): Same. ++ (ffi_java_rvalue_to_raw): Add special handling for FFI_TYPE_POINTER ++ if FFI_SIZEOF_JAVA_RAW == 4. ++ (ffi_java_raw_to_rvalue): Same. ++ (ffi_java_raw_call): Change type of raw to ffi_java_raw. ++ (ffi_java_translate_args): Same. ++ (ffi_prep_java_raw_closure_loc, ffi_prep_java_raw_closure): Change ++ parameter types. ++ * src/mips/ffitarget.h (FFI_SIZEOF_JAVA_RAW): Define for N32 ABI. ++ ++2007-12-06 David Daney ++ ++ * src/mips/n32.S (ffi_closure_N32): Use 64-bit add instruction on ++ pointer values. ++ ++2007-12-01 Andreas Tobler ++ ++ PR libffi/31937 ++ * src/powerpc/ffitarget.h: Introduce new ABI FFI_LINUX_SOFT_FLOAT. ++ Add local FFI_TYPE_UINT128 to handle soft-float long-double-128. ++ * src/powerpc/ffi.c: Distinguish between __NO_FPRS__ and not and ++ set the NUM_FPR_ARG_REGISTERS according to. ++ Add support for potential soft-float support under hard-float ++ architecture. ++ (ffi_prep_args_SYSV): Set NUM_FPR_ARG_REGISTERS to 0 in case of ++ FFI_LINUX_SOFT_FLOAT, handle float, doubles and long-doubles according ++ to the FFI_LINUX_SOFT_FLOAT ABI. ++ (ffi_prep_cif_machdep): Likewise. ++ (ffi_closure_helper_SYSV): Likewise. ++ * src/powerpc/ppc_closure.S: Make sure not to store float/double ++ on archs where __NO_FPRS__ is true. ++ Add FFI_TYPE_UINT128 support. ++ * src/powerpc/sysv.S: Add support for soft-float long-double-128. ++ Adjust copyright notice. ++ ++2007-11-25 Andreas Tobler ++ ++ * src/closures.c: Move defintion of MAYBE_UNUSED from here to ... ++ * include/ffi_common.h: ... here. ++ Update copyright. ++ ++2007-11-17 Andreas Tobler ++ ++ * src/powerpc/sysv.S: Load correct cr to compare if we have long double. ++ * src/powerpc/linux64.S: Likewise. ++ * src/powerpc/ffi.c: Add a comment to show which part goes into cr6. ++ * testsuite/libffi.call/return_ldl.c: New test. ++ ++2007-09-04 ++ ++ * src/arm/sysv.S (UNWIND): New. ++ (Whole file): Conditionally compile unwinder directives. ++ * src/arm/sysv.S: Add unwinder directives. ++ ++ * src/arm/ffi.c (ffi_prep_args): Align structs by at least 4 bytes. ++ Only treat r0 as a struct address if we're actually returning a ++ struct by address. ++ Only copy the bytes that are actually within a struct. ++ (ffi_prep_cif_machdep): A Composite Type not larger than 4 bytes ++ is returned in r0, not passed by address. ++ (ffi_call): Allocate a word-sized temporary for the case where ++ a composite is returned in r0. ++ (ffi_prep_incoming_args_SYSV): Align as necessary. ++ ++2007-08-05 Steven Newbury ++ ++ * src/arm/ffi.c (FFI_INIT_TRAMPOLINE): Use __clear_cache instead of ++ directly using the sys_cacheflush syscall. ++ ++2007-07-27 Andrew Haley ++ ++ * src/arm/sysv.S (ffi_closure_SYSV): Add soft-float. ++ ++2007-09-03 Maciej W. Rozycki ++ ++ * Makefile.am: Unify MIPS_IRIX and MIPS_LINUX into MIPS. ++ * configure.ac: Likewise. ++ * Makefile.in: Regenerate. ++ * include/Makefile.in: Likewise. ++ * testsuite/Makefile.in: Likewise. ++ * configure: Likewise. ++ ++2007-08-24 David Daney ++ ++ * testsuite/libffi.call/return_sl.c: New test. ++ ++2007-08-10 David Daney ++ ++ * testsuite/libffi.call/cls_multi_ushort.c, ++ testsuite/libffi.call/cls_align_uint16.c, ++ testsuite/libffi.call/nested_struct1.c, ++ testsuite/libffi.call/nested_struct3.c, ++ testsuite/libffi.call/cls_7_1_byte.c, ++ testsuite/libffi.call/nested_struct5.c, ++ testsuite/libffi.call/cls_double.c, ++ testsuite/libffi.call/nested_struct7.c, ++ testsuite/libffi.call/cls_sint.c, ++ testsuite/libffi.call/nested_struct9.c, ++ testsuite/libffi.call/cls_20byte1.c, ++ testsuite/libffi.call/cls_multi_sshortchar.c, ++ testsuite/libffi.call/cls_align_sint64.c, ++ testsuite/libffi.call/cls_3byte2.c, ++ testsuite/libffi.call/cls_multi_schar.c, ++ testsuite/libffi.call/cls_multi_uchar.c, ++ testsuite/libffi.call/cls_19byte.c, ++ testsuite/libffi.call/cls_9byte1.c, ++ testsuite/libffi.call/cls_align_float.c, ++ testsuite/libffi.call/closure_fn1.c, ++ testsuite/libffi.call/problem1.c, ++ testsuite/libffi.call/closure_fn3.c, ++ testsuite/libffi.call/cls_sshort.c, ++ testsuite/libffi.call/closure_fn5.c, ++ testsuite/libffi.call/cls_align_double.c, ++ testsuite/libffi.call/nested_struct.c, ++ testsuite/libffi.call/cls_2byte.c, ++ testsuite/libffi.call/nested_struct10.c, ++ testsuite/libffi.call/cls_4byte.c, ++ testsuite/libffi.call/cls_6byte.c, ++ testsuite/libffi.call/cls_8byte.c, ++ testsuite/libffi.call/cls_multi_sshort.c, ++ testsuite/libffi.call/cls_align_sint16.c, ++ testsuite/libffi.call/cls_align_uint32.c, ++ testsuite/libffi.call/cls_20byte.c, ++ testsuite/libffi.call/cls_float.c, ++ testsuite/libffi.call/nested_struct2.c, ++ testsuite/libffi.call/cls_5_1_byte.c, ++ testsuite/libffi.call/nested_struct4.c, ++ testsuite/libffi.call/cls_24byte.c, ++ testsuite/libffi.call/nested_struct6.c, ++ testsuite/libffi.call/cls_64byte.c, ++ testsuite/libffi.call/nested_struct8.c, ++ testsuite/libffi.call/cls_uint.c, ++ testsuite/libffi.call/cls_multi_ushortchar.c, ++ testsuite/libffi.call/cls_schar.c, ++ testsuite/libffi.call/cls_uchar.c, ++ testsuite/libffi.call/cls_align_uint64.c, ++ testsuite/libffi.call/cls_ulonglong.c, ++ testsuite/libffi.call/cls_align_longdouble.c, ++ testsuite/libffi.call/cls_1_1byte.c, ++ testsuite/libffi.call/cls_12byte.c, ++ testsuite/libffi.call/cls_3_1byte.c, ++ testsuite/libffi.call/cls_3byte1.c, ++ testsuite/libffi.call/cls_4_1byte.c, ++ testsuite/libffi.call/cls_6_1_byte.c, ++ testsuite/libffi.call/cls_16byte.c, ++ testsuite/libffi.call/cls_18byte.c, ++ testsuite/libffi.call/closure_fn0.c, ++ testsuite/libffi.call/cls_9byte2.c, ++ testsuite/libffi.call/closure_fn2.c, ++ testsuite/libffi.call/closure_fn4.c, ++ testsuite/libffi.call/cls_ushort.c, ++ testsuite/libffi.call/closure_fn6.c, ++ testsuite/libffi.call/cls_5byte.c, ++ testsuite/libffi.call/cls_align_pointer.c, ++ testsuite/libffi.call/cls_7byte.c, ++ testsuite/libffi.call/cls_align_sint32.c, ++ testsuite/libffi.special/unwindtest_ffi_call.cc, ++ testsuite/libffi.special/unwindtest.cc: Remove xfail for mips64*-*-*. ++ ++2007-08-10 David Daney ++ ++ PR libffi/28313 ++ * configure.ac: Don't treat mips64 as a special case. ++ * Makefile.am (nodist_libffi_la_SOURCES): Add n32.S. ++ * configure: Regenerate ++ * Makefile.in: Ditto. ++ * fficonfig.h.in: Ditto. ++ * src/mips/ffitarget.h (REG_L, REG_S, SUBU, ADDU, SRL, LI): Indent. ++ (LA, EH_FRAME_ALIGN, FDE_ADDR_BYTES): New preprocessor macros. ++ (FFI_DEFAULT_ABI): Set for n64 case. ++ (FFI_CLOSURES, FFI_TRAMPOLINE_SIZE): Define for n32 and n64 cases. ++ * src/mips/n32.S (ffi_call_N32): Add debug macros and labels for FDE. ++ (ffi_closure_N32): New function. ++ (.eh_frame): New section ++ * src/mips/o32.S: Clean up comments. ++ (ffi_closure_O32): Pass ffi_closure parameter in $12. ++ * src/mips/ffi.c: Use FFI_MIPS_N32 instead of ++ _MIPS_SIM == _ABIN32 throughout. ++ (FFI_MIPS_STOP_HERE): New, use in place of ++ ffi_stop_here. ++ (ffi_prep_args): Use unsigned long to hold pointer values. Rewrite ++ to support n32/n64 ABIs. ++ (calc_n32_struct_flags): Rewrite. ++ (calc_n32_return_struct_flags): Remove unused variable. Reverse ++ position of flag bits. ++ (ffi_prep_cif_machdep): Rewrite n32 portion. ++ (ffi_call): Enable for n64. Add special handling for small structure ++ return values. ++ (ffi_prep_closure_loc): Add n32 and n64 support. ++ (ffi_closure_mips_inner_O32): Add cast to silence warning. ++ (copy_struct_N32, ffi_closure_mips_inner_N32): New functions. ++ ++2007-08-08 David Daney ++ ++ * testsuite/libffi.call/ffitest.h (ffi_type_mylong): Remove definition. ++ * testsuite/libffi.call/cls_align_uint16.c (main): Use correct type ++ specifiers. ++ * testsuite/libffi.call/nested_struct1.c (main): Ditto. ++ * testsuite/libffi.call/cls_sint.c (main): Ditto. ++ * testsuite/libffi.call/nested_struct9.c (main): Ditto. ++ * testsuite/libffi.call/cls_20byte1.c (main): Ditto. ++ * testsuite/libffi.call/cls_9byte1.c (main): Ditto. ++ * testsuite/libffi.call/closure_fn1.c (main): Ditto. ++ * testsuite/libffi.call/closure_fn3.c (main): Ditto. ++ * testsuite/libffi.call/return_dbl2.c (main): Ditto. ++ * testsuite/libffi.call/cls_sshort.c (main): Ditto. ++ * testsuite/libffi.call/return_fl3.c (main): Ditto. ++ * testsuite/libffi.call/closure_fn5.c (main): Ditto. ++ * testsuite/libffi.call/nested_struct.c (main): Ditto. ++ * testsuite/libffi.call/nested_struct10.c (main): Ditto. ++ * testsuite/libffi.call/return_ll1.c (main): Ditto. ++ * testsuite/libffi.call/cls_8byte.c (main): Ditto. ++ * testsuite/libffi.call/cls_align_uint32.c (main): Ditto. ++ * testsuite/libffi.call/cls_align_sint16.c (main): Ditto. ++ * testsuite/libffi.call/cls_20byte.c (main): Ditto. ++ * testsuite/libffi.call/nested_struct2.c (main): Ditto. ++ * testsuite/libffi.call/cls_24byte.c (main): Ditto. ++ * testsuite/libffi.call/nested_struct6.c (main): Ditto. ++ * testsuite/libffi.call/cls_uint.c (main): Ditto. ++ * testsuite/libffi.call/cls_12byte.c (main): Ditto. ++ * testsuite/libffi.call/cls_16byte.c (main): Ditto. ++ * testsuite/libffi.call/closure_fn0.c (main): Ditto. ++ * testsuite/libffi.call/cls_9byte2.c (main): Ditto. ++ * testsuite/libffi.call/closure_fn2.c (main): Ditto. ++ * testsuite/libffi.call/return_dbl1.c (main): Ditto. ++ * testsuite/libffi.call/closure_fn4.c (main): Ditto. ++ * testsuite/libffi.call/closure_fn6.c (main): Ditto. ++ * testsuite/libffi.call/cls_align_sint32.c (main): Ditto. ++ ++2007-08-07 Andrew Haley ++ ++ * src/x86/sysv.S (ffi_closure_raw_SYSV): Fix typo in previous ++ checkin. ++ ++2007-08-06 Andrew Haley ++ ++ PR testsuite/32843 ++ * src/x86/sysv.S (ffi_closure_raw_SYSV): Handle FFI_TYPE_UINT8, ++ FFI_TYPE_SINT8, FFI_TYPE_UINT16, FFI_TYPE_SINT16, FFI_TYPE_UINT32, ++ FFI_TYPE_SINT32. ++ ++2007-08-02 David Daney ++ ++ * testsuite/libffi.call/return_ul.c (main): Define return type as ++ ffi_arg. Use proper printf conversion specifier. ++ ++2007-07-30 Andrew Haley ++ ++ PR testsuite/32843 ++ * src/x86/ffi.c (ffi_prep_cif_machdep): in x86 case, add code for ++ signed/unsigned int8/16. ++ * src/x86/sysv.S (ffi_call_SYSV): Rewrite to: ++ Use a jump table. ++ Remove code to pop args from the stack after call. ++ Special-case signed/unsigned int8/16. ++ * testsuite/libffi.call/return_sc.c (main): Revert. ++ ++2007-07-26 Richard Guenther ++ ++ PR testsuite/32843 ++ * testsuite/libffi.call/return_sc.c (main): Verify call ++ result as signed char, not ffi_arg. ++ ++2007-07-16 Rainer Orth ++ ++ * configure.ac (i?86-*-solaris2.1[0-9]): Set TARGET to X86_64. ++ * configure: Regenerate. ++ ++2007-07-11 David Daney ++ ++ * src/mips/ffi.c: Don't include sys/cachectl.h. ++ (ffi_prep_closure_loc): Use __builtin___clear_cache() instead of ++ cacheflush(). ++ ++2007-05-18 Aurelien Jarno ++ ++ * src/arm/ffi.c (ffi_prep_closure_loc): Renamed and ajusted ++ from (ffi_prep_closure): ... this. ++ (FFI_INIT_TRAMPOLINE): Adjust. ++ ++2005-12-31 Phil Blundell ++ ++ * src/arm/ffi.c (ffi_prep_incoming_args_SYSV, ++ ffi_closure_SYSV_inner, ffi_prep_closure): New, add closure support. ++ * src/arm/sysv.S(ffi_closure_SYSV): Likewise. ++ * src/arm/ffitarget.h (FFI_TRAMPOLINE_SIZE): Likewise. ++ (FFI_CLOSURES): Enable closure support. ++ ++2007-07-03 Andrew Haley ++ ++ * testsuite/libffi.call/cls_multi_ushort.c, ++ testsuite/libffi.call/cls_align_uint16.c, ++ testsuite/libffi.call/nested_struct1.c, ++ testsuite/libffi.call/nested_struct3.c, ++ testsuite/libffi.call/cls_7_1_byte.c, ++ testsuite/libffi.call/cls_double.c, ++ testsuite/libffi.call/nested_struct5.c, ++ testsuite/libffi.call/nested_struct7.c, ++ testsuite/libffi.call/cls_sint.c, ++ testsuite/libffi.call/nested_struct9.c, ++ testsuite/libffi.call/cls_20byte1.c, ++ testsuite/libffi.call/cls_multi_sshortchar.c, ++ testsuite/libffi.call/cls_align_sint64.c, ++ testsuite/libffi.call/cls_3byte2.c, ++ testsuite/libffi.call/cls_multi_schar.c, ++ testsuite/libffi.call/cls_multi_uchar.c, ++ testsuite/libffi.call/cls_19byte.c, ++ testsuite/libffi.call/cls_9byte1.c, ++ testsuite/libffi.call/cls_align_float.c, ++ testsuite/libffi.call/closure_fn1.c, ++ testsuite/libffi.call/problem1.c, ++ testsuite/libffi.call/closure_fn3.c, ++ testsuite/libffi.call/cls_sshort.c, ++ testsuite/libffi.call/closure_fn5.c, ++ testsuite/libffi.call/cls_align_double.c, ++ testsuite/libffi.call/cls_2byte.c, ++ testsuite/libffi.call/nested_struct.c, ++ testsuite/libffi.call/nested_struct10.c, ++ testsuite/libffi.call/cls_4byte.c, ++ testsuite/libffi.call/cls_6byte.c, ++ testsuite/libffi.call/cls_8byte.c, ++ testsuite/libffi.call/cls_multi_sshort.c, ++ testsuite/libffi.call/cls_align_uint32.c, ++ testsuite/libffi.call/cls_align_sint16.c, ++ testsuite/libffi.call/cls_float.c, ++ testsuite/libffi.call/cls_20byte.c, ++ testsuite/libffi.call/cls_5_1_byte.c, ++ testsuite/libffi.call/nested_struct2.c, ++ testsuite/libffi.call/cls_24byte.c, ++ testsuite/libffi.call/nested_struct4.c, ++ testsuite/libffi.call/nested_struct6.c, ++ testsuite/libffi.call/cls_64byte.c, ++ testsuite/libffi.call/nested_struct8.c, ++ testsuite/libffi.call/cls_uint.c, ++ testsuite/libffi.call/cls_multi_ushortchar.c, ++ testsuite/libffi.call/cls_schar.c, ++ testsuite/libffi.call/cls_uchar.c, ++ testsuite/libffi.call/cls_align_uint64.c, ++ testsuite/libffi.call/cls_ulonglong.c, ++ testsuite/libffi.call/cls_align_longdouble.c, ++ testsuite/libffi.call/cls_1_1byte.c, ++ testsuite/libffi.call/cls_12byte.c, ++ testsuite/libffi.call/cls_3_1byte.c, ++ testsuite/libffi.call/cls_3byte1.c, ++ testsuite/libffi.call/cls_4_1byte.c, ++ testsuite/libffi.call/cls_6_1_byte.c, ++ testsuite/libffi.call/cls_16byte.c, ++ testsuite/libffi.call/cls_18byte.c, ++ testsuite/libffi.call/closure_fn0.c, ++ testsuite/libffi.call/cls_9byte2.c, ++ testsuite/libffi.call/closure_fn2.c, ++ testsuite/libffi.call/closure_fn4.c, ++ testsuite/libffi.call/cls_ushort.c, ++ testsuite/libffi.call/closure_fn6.c, ++ testsuite/libffi.call/cls_5byte.c, ++ testsuite/libffi.call/cls_align_pointer.c, ++ testsuite/libffi.call/cls_7byte.c, ++ testsuite/libffi.call/cls_align_sint32.c, ++ testsuite/libffi.special/unwindtest_ffi_call.cc, ++ testsuite/libffi.special/unwindtest.cc: Enable for ARM. ++ ++2007-07-05 H.J. Lu ++ ++ * aclocal.m4: Regenerated. ++ ++2007-06-02 Paolo Bonzini ++ ++ * configure: Regenerate. ++ ++2007-05-23 Steve Ellcey ++ ++ * Makefile.in: Regenerate. ++ * configure: Regenerate. ++ * aclocal.m4: Regenerate. ++ * include/Makefile.in: Regenerate. ++ * testsuite/Makefile.in: Regenerate. ++ ++2007-05-10 Roman Zippel ++ ++ * src/m68k/ffi.c (ffi_prep_incoming_args_SYSV, ++ ffi_closure_SYSV_inner,ffi_prep_closure): New, add closure support. ++ * src/m68k/sysv.S(ffi_closure_SYSV,ffi_closure_struct_SYSV): Likewise. ++ * src/m68k/ffitarget.h (FFI_TRAMPOLINE_SIZE): Likewise. ++ (FFI_CLOSURES): Enable closure support. ++ ++2007-05-10 Roman Zippel ++ ++ * configure.ac (HAVE_AS_CFI_PSEUDO_OP): New test. ++ * configure: Regenerate. ++ * fficonfig.h.in: Regenerate. ++ * src/m68k/sysv.S (CFI_STARTPROC,CFI_ENDPROC, ++ CFI_OFFSET,CFI_DEF_CFA): New macros. ++ (ffi_call_SYSV): Add callframe annotation. ++ ++2007-05-10 Roman Zippel ++ ++ * src/m68k/ffi.c (ffi_prep_args,ffi_prep_cif_machdep): Fix ++ numerous test suite failures. ++ * src/m68k/sysv.S (ffi_call_SYSV): Likewise. ++ ++2007-04-11 Paolo Bonzini ++ ++ * Makefile.am (EXTRA_DIST): Bring up to date. ++ * Makefile.in: Regenerate. ++ * src/frv/eabi.S: Remove RCS keyword. ++ ++2007-04-06 Richard Henderson ++ ++ * configure.ac: Tidy target case. ++ (HAVE_LONG_DOUBLE): Allow the target to override. ++ * configure: Regenerate. ++ * include/ffi.h.in: Don't define ffi_type_foo if ++ LIBFFI_HIDE_BASIC_TYPES is defined. ++ (ffi_type_longdouble): If not HAVE_LONG_DOUBLE, define ++ to ffi_type_double. ++ * types.c (LIBFFI_HIDE_BASIC_TYPES): Define. ++ (FFI_TYPEDEF, ffi_type_void): Mark the data const. ++ (ffi_type_longdouble): Special case for Alpha. Don't define ++ if long double == double. ++ ++ * src/alpha/ffi.c (FFI_TYPE_LONGDOUBLE): Assert unique value. ++ (ffi_prep_cif_machdep): Handle it as the 128-bit type. ++ (ffi_call, ffi_closure_osf_inner): Likewise. ++ (ffi_closure_osf_inner): Likewise. Mark hidden. ++ (ffi_call_osf, ffi_closure_osf): Mark hidden. ++ * src/alpha/ffitarget.h (FFI_LAST_ABI): Tidy definition. ++ * src/alpha/osf.S (ffi_call_osf, ffi_closure_osf): Mark hidden. ++ (load_table): Handle 128-bit long double. ++ ++ * testsuite/libffi.call/float4.c: Add -mieee for alpha. ++ ++2007-04-06 Tom Tromey ++ ++ PR libffi/31491: ++ * README: Fixed bug in example. ++ ++2007-04-03 Jakub Jelinek ++ ++ * src/closures.c: Include sys/statfs.h. ++ (_GNU_SOURCE): Define on Linux. ++ (FFI_MMAP_EXEC_SELINUX): Define. ++ (selinux_enabled): New variable. ++ (selinux_enabled_check): New function. ++ (is_selinux_enabled): Define. ++ (dlmmap): Use it. ++ ++2007-03-24 Uros Bizjak ++ ++ * testsuite/libffi.call/return_fl2.c (return_fl): Mark as static. ++ Use 'volatile float sum' to create sum of floats to avoid false ++ negative due to excess precision on ix86 targets. ++ (main): Ditto. ++ ++2007-03-08 Alexandre Oliva ++ ++ * src/powerpc/ffi.c (flush_icache): Fix left-over from previous ++ patch. ++ (ffi_prep_closure_loc): Remove unneeded casts. Add needed ones. ++ ++2007-03-07 Alexandre Oliva ++ ++ * include/ffi.h.in (ffi_closure_alloc, ffi_closure_free): New. ++ (ffi_prep_closure_loc): New. ++ (ffi_prep_raw_closure_loc): New. ++ (ffi_prep_java_raw_closure_loc): New. ++ * src/closures.c: New file. ++ * src/dlmalloc.c [FFI_MMAP_EXEC_WRIT] (struct malloc_segment): ++ Replace sflags with exec_offset. ++ [FFI_MMAP_EXEC_WRIT] (mmap_exec_offset, add_segment_exec_offset, ++ sub_segment_exec_offset): New macros. ++ (get_segment_flags, set_segment_flags, check_segment_merge): New ++ macros. ++ (is_mmapped_segment, is_extern_segment): Use get_segment_flags. ++ (add_segment, sys_alloc, create_mspace, create_mspace_with_base, ++ destroy_mspace): Use new macros. ++ (sys_alloc): Silence warning. ++ * Makefile.am (libffi_la_SOURCES): Add src/closures.c. ++ * Makefile.in: Rebuilt. ++ * src/prep_cif [FFI_CLOSURES] (ffi_prep_closure): Implement in ++ terms of ffi_prep_closure_loc. ++ * src/raw_api.c (ffi_prep_raw_closure_loc): Renamed and adjusted ++ from... ++ (ffi_prep_raw_closure): ... this. Re-implement in terms of the ++ renamed version. ++ * src/java_raw_api (ffi_prep_java_raw_closure_loc): Renamed and ++ adjusted from... ++ (ffi_prep_java_raw_closure): ... this. Re-implement in terms of ++ the renamed version. ++ * src/alpha/ffi.c (ffi_prep_closure_loc): Renamed from ++ (ffi_prep_closure): ... this. ++ * src/pa/ffi.c: Likewise. ++ * src/cris/ffi.c: Likewise. Adjust. ++ * src/frv/ffi.c: Likewise. ++ * src/ia64/ffi.c: Likewise. ++ * src/mips/ffi.c: Likewise. ++ * src/powerpc/ffi_darwin.c: Likewise. ++ * src/s390/ffi.c: Likewise. ++ * src/sh/ffi.c: Likewise. ++ * src/sh64/ffi.c: Likewise. ++ * src/sparc/ffi.c: Likewise. ++ * src/x86/ffi64.c: Likewise. ++ * src/x86/ffi.c: Likewise. ++ (FFI_INIT_TRAMPOLINE): Adjust. ++ (ffi_prep_raw_closure_loc): Renamed and adjusted from... ++ (ffi_prep_raw_closure): ... this. ++ * src/powerpc/ffi.c (ffi_prep_closure_loc): Renamed from ++ (ffi_prep_closure): ... this. ++ (flush_icache): Adjust. ++ ++2007-03-07 Alexandre Oliva ++ ++ * src/dlmalloc.c: New file, imported version 2.8.3 of Doug ++ Lea's malloc. ++ ++2007-03-01 Brooks Moses ++ ++ * Makefile.am: Add dummy install-pdf target. ++ * Makefile.in: Regenerate ++ ++2007-02-13 Andreas Krebbel ++ ++ * src/s390/ffi.c (ffi_prep_args, ffi_prep_cif_machdep, ++ ffi_closure_helper_SYSV): Add long double handling. ++ ++2007-02-02 Jakub Jelinek ++ ++ * src/powerpc/linux64.S (ffi_call_LINUX64): Move restore of r2 ++ immediately after bctrl instruction. ++ ++2007-01-18 Alexandre Oliva ++ ++ * Makefile.am (all-recursive, install-recursive, ++ mostlyclean-recursive, clean-recursive, distclean-recursive, ++ maintainer-clean-recursive): Add missing targets. ++ * Makefile.in: Rebuilt. ++ ++2006-12-14 Andreas Tobler ++ ++ * configure.ac: Add TARGET for x86_64-*-darwin*. ++ * Makefile.am (nodist_libffi_la_SOURCES): Add rules for 64-bit sources ++ for X86_DARWIN. ++ * src/x86/ffitarget.h: Set trampoline size for x86_64-*-darwin*. ++ * src/x86/darwin64.S: New file for x86_64-*-darwin* support. ++ * configure: Regenerate. ++ * Makefile.in: Regenerate. ++ * include/Makefile.in: Regenerate. ++ * testsuite/Makefile.in: Regenerate. ++ * testsuite/libffi.special/unwindtest_ffi_call.cc: New test case for ++ ffi_call only. ++ ++2006-12-13 Andreas Tobler ++ ++ * aclocal.m4: Regenerate with aclocal -I .. as written in the ++ Makefile.am. ++ ++2006-10-31 Geoffrey Keating ++ ++ * src/powerpc/ffi_darwin.c (darwin_adjust_aggregate_sizes): New. ++ (ffi_prep_cif_machdep): Call darwin_adjust_aggregate_sizes for ++ Darwin. ++ * testsuite/libffi.call/nested_struct4.c: Remove Darwin XFAIL. ++ * testsuite/libffi.call/nested_struct6.c: Remove Darwin XFAIL. ++ ++2006-10-10 Paolo Bonzini ++ Sandro Tolaini ++ ++ * configure.ac [i*86-*-darwin*]: Set X86_DARWIN symbol and ++ conditional. ++ * configure: Regenerated. ++ * Makefile.am (nodist_libffi_la_SOURCES) [X86_DARWIN]: New case. ++ (EXTRA_DIST): Add src/x86/darwin.S. ++ * Makefile.in: Regenerated. ++ * include/Makefile.in: Regenerated. ++ * testsuite/Makefile.in: Regenerated. ++ ++ * src/x86/ffi.c (ffi_prep_cif_machdep) [X86_DARWIN]: Treat like ++ X86_WIN32, and additionally align stack to 16 bytes. ++ * src/x86/darwin.S: New, based on sysv.S. ++ * src/prep_cif.c (ffi_prep_cif) [X86_DARWIN]: Align > 8-byte structs. ++ ++2006-09-12 David Daney ++ ++ PR libffi/23935 ++ * include/Makefile.am: Install both ffi.h and ffitarget.h in ++ $(libdir)/gcc/$(target_alias)/$(gcc_version)/include. ++ * aclocal.m4: Regenerated for automake 1.9.6. ++ * Makefile.in: Regenerated. ++ * include/Makefile.in: Regenerated. ++ * testsuite/Makefile.in: Regenerated. ++ ++2006-08-17 Andreas Tobler ++ ++ * include/ffi_common.h (struct): Revert accidental commit. ++ ++2006-08-15 Andreas Tobler ++ ++ * include/ffi_common.h: Remove lint directives. ++ * include/ffi.h.in: Likewise. ++ ++2006-07-25 Torsten Schoenfeld ++ ++ * include/ffi.h.in (ffi_type_ulong, ffi_type_slong): Define correctly ++ for 32-bit architectures. ++ * testsuite/libffi.call/return_ul.c: New test case. ++ ++2006-07-19 David Daney ++ ++ * testsuite/libffi.call/closure_fn6.c: Remove xfail for mips, ++ xfail remains for mips64. ++ ++2006-05-23 Carlos O'Donell ++ ++ * Makefile.am: Add install-html target. Add install-html to .PHONY ++ * Makefile.in: Regenerate. ++ * aclocal.m4: Regenerate. ++ * include/Makefile.in: Regenerate. ++ * testsuite/Makefile.in: Regenerate. ++ ++2006-05-18 John David Anglin ++ ++ * pa/ffi.c (ffi_prep_args_pa32): Load floating point arguments from ++ stack slot. ++ ++2006-04-22 Andreas Tobler ++ ++ * README: Remove notice about 'Crazy Comments'. ++ * src/debug.c: Remove lint directives. Cleanup white spaces. ++ * src/java_raw_api.c: Likewise. ++ * src/prep_cif.c: Likewise. ++ * src/raw_api.c: Likewise. ++ * src/ffitest.c: Delete. No longer needed, all test cases migrated ++ to the testsuite. ++ * src/arm/ffi.c: Remove lint directives. ++ * src/m32r/ffi.c: Likewise. ++ * src/pa/ffi.c: Likewise. ++ * src/powerpc/ffi.c: Likewise. ++ * src/powerpc/ffi_darwin.c: Likewise. ++ * src/sh/ffi.c: Likewise. ++ * src/sh64/ffi.c: Likewise. ++ * src/x86/ffi.c: Likewise. ++ * testsuite/libffi.call/float2.c: Likewise. ++ * testsuite/libffi.call/promotion.c: Likewise. ++ * testsuite/libffi.call/struct1.c: Likewise. ++ ++2006-04-13 Andreas Tobler ++ ++ * src/pa/hpux32.S: Correct unwind offset calculation for ++ ffi_closure_pa32. ++ * src/pa/linux.S: Likewise. ++ ++2006-04-12 James E Wilson ++ ++ PR libgcj/26483 ++ * src/ia64/ffi.c (stf_spill, ldf_fill): Rewrite as macros. ++ (hfa_type_load): Call stf_spill. ++ (hfa_type_store): Call ldf_fill. ++ (ffi_call): Adjust calls to above routines. Add local temps for ++ macro result. ++ ++2006-04-10 Matthias Klose ++ ++ * testsuite/lib/libffi-dg.exp (libffi-init): Recognize multilib ++ directory names containing underscores. ++ ++2006-04-07 James E Wilson ++ ++ * testsuite/libffi.call/float4.c: New testcase. ++ ++2006-04-05 John David Anglin ++ Andreas Tobler ++ ++ * Makefile.am: Add PA_HPUX port. ++ * Makefile.in: Regenerate. ++ * include/Makefile.in: Likewise. ++ * testsuite/Makefile.in: Likewise. ++ * configure.ac: Add PA_HPUX rules. ++ * configure: Regenerate. ++ * src/pa/ffitarget.h: Rename linux target to PA_LINUX. ++ Add PA_HPUX and PA64_HPUX. ++ Rename FFI_LINUX ABI to FFI_PA32 ABI. ++ (FFI_TRAMPOLINE_SIZE): Define for 32-bit HP-UX targets. ++ (FFI_TYPE_SMALL_STRUCT2): Define. ++ (FFI_TYPE_SMALL_STRUCT4): Likewise. ++ (FFI_TYPE_SMALL_STRUCT8): Likewise. ++ (FFI_TYPE_SMALL_STRUCT3): Redefine. ++ (FFI_TYPE_SMALL_STRUCT5): Likewise. ++ (FFI_TYPE_SMALL_STRUCT6): Likewise. ++ (FFI_TYPE_SMALL_STRUCT7): Likewise. ++ * src/pa/ffi.c (ROUND_DOWN): Delete. ++ (fldw, fstw, fldd, fstd): Use '__asm__'. ++ (ffi_struct_type): Add support for FFI_TYPE_SMALL_STRUCT2, ++ FFI_TYPE_SMALL_STRUCT4 and FFI_TYPE_SMALL_STRUCT8. ++ (ffi_prep_args_LINUX): Rename to ffi_prep_args_pa32. Update comment. ++ Simplify incrementing of stack slot variable. Change type of local ++ 'n' to unsigned int. ++ (ffi_size_stack_LINUX): Rename to ffi_size_stack_pa32. Handle long ++ double on PA_HPUX. ++ (ffi_prep_cif_machdep): Likewise. ++ (ffi_call): Likewise. ++ (ffi_closure_inner_LINUX): Rename to ffi_closure_inner_pa32. Change ++ return type to ffi_status. Simplify incrementing of stack slot ++ variable. Only copy floating point argument registers when PA_LINUX ++ is true. Reformat debug statement. ++ Add support for FFI_TYPE_SMALL_STRUCT2, FFI_TYPE_SMALL_STRUCT4 and ++ FFI_TYPE_SMALL_STRUCT8. ++ (ffi_closure_LINUX): Rename to ffi_closure_pa32. Add 'extern' to ++ declaration. ++ (ffi_prep_closure): Make linux trampoline conditional on PA_LINUX. ++ Add nops to cache flush. Add trampoline for PA_HPUX. ++ * src/pa/hpux32.S: New file. ++ * src/pa/linux.S (ffi_call_LINUX): Rename to ffi_call_pa32. Rename ++ ffi_prep_args_LINUX to ffi_prep_args_pa32. ++ Localize labels. Add support for 2, 4 and 8-byte small structs. Handle ++ unaligned destinations in 3, 5, 6 and 7-byte small structs. Order ++ argument type checks so that common argument types appear first. ++ (ffi_closure_LINUX): Rename to ffi_closure_pa32. Rename ++ ffi_closure_inner_LINUX to ffi_closure_inner_pa32. ++ ++2006-03-24 Alan Modra ++ ++ * src/powerpc/ffitarget.h (enum ffi_abi): Add FFI_LINUX. Default ++ for 32-bit using IBM extended double format. Fix FFI_LAST_ABI. ++ * src/powerpc/ffi.c (ffi_prep_args_SYSV): Handle linux variant of ++ FFI_TYPE_LONGDOUBLE. ++ (ffi_prep_args64): Assert using IBM extended double. ++ (ffi_prep_cif_machdep): Don't munge FFI_TYPE_LONGDOUBLE type. ++ Handle FFI_LINUX FFI_TYPE_LONGDOUBLE return and args. ++ (ffi_call): Handle FFI_LINUX. ++ (ffi_closure_helper_SYSV): Non FFI_LINUX long double return needs ++ gpr3 return pointer as for struct return. Handle FFI_LINUX ++ FFI_TYPE_LONGDOUBLE return and args. Don't increment "nf" ++ unnecessarily. ++ * src/powerpc/ppc_closure.S (ffi_closure_SYSV): Load both f1 and f2 ++ for FFI_TYPE_LONGDOUBLE. Move epilogue insns into case table. ++ Don't use r6 as pointer to results, instead use sp offset. Don't ++ make a special call to load lr with case table address, instead ++ use offset from previous call. ++ * src/powerpc/sysv.S (ffi_call_SYSV): Save long double return. ++ * src/powerpc/linux64.S (ffi_call_LINUX64): Simplify long double ++ return. ++ ++2006-03-15 Kaz Kojima ++ ++ * src/sh64/ffi.c (ffi_prep_cif_machdep): Handle float arguments ++ passed with FP registers correctly. ++ (ffi_closure_helper_SYSV): Likewise. ++ * src/sh64/sysv.S: Likewise. ++ ++2006-03-01 Andreas Tobler ++ ++ * testsuite/libffi.special/unwindtest.cc (closure_test_fn): Mark cif, ++ args and userdata unused. ++ (closure_test_fn1): Mark cif and userdata unused. ++ (main): Remove unused res. ++ ++2006-02-28 Andreas Tobler ++ ++ * testsuite/libffi.call/call.exp: Adjust FSF address. Add test runs for ++ -O2, -O3, -Os and the warning flags -W -Wall. ++ * testsuite/libffi.special/special.exp: Likewise. ++ * testsuite/libffi.call/ffitest.h: Add an __UNUSED__ macro to mark ++ unused parameter unused for gcc or else do nothing. ++ * testsuite/libffi.special/ffitestcxx.h: Likewise. ++ * testsuite/libffi.call/cls_12byte.c (cls_struct_12byte_gn): Mark cif ++ and userdata unused. ++ * testsuite/libffi.call/cls_16byte.c (cls_struct_16byte_gn): Likewise. ++ * testsuite/libffi.call/cls_18byte.c (cls_struct_18byte_gn): Likewise. ++ * testsuite/libffi.call/cls_19byte.c (cls_struct_19byte_gn): Likewise. ++ * testsuite/libffi.call/cls_1_1byte.c (cls_struct_1_1byte_gn): Likewise. ++ * testsuite/libffi.call/cls_20byte.c (cls_struct_20byte_gn): Likewise. ++ * testsuite/libffi.call/cls_20byte1.c (cls_struct_20byte_gn): Likewise. ++ * testsuite/libffi.call/cls_24byte.c (cls_struct_24byte_gn): Likewise. ++ * testsuite/libffi.call/cls_2byte.c (cls_struct_2byte_gn): Likewise. ++ * testsuite/libffi.call/cls_3_1byte.c (cls_struct_3_1byte_gn): Likewise. ++ * testsuite/libffi.call/cls_3byte1.c (cls_struct_3byte_gn): Likewise. ++ * testsuite/libffi.call/cls_3byte2.c (cls_struct_3byte_gn1): Likewise. ++ * testsuite/libffi.call/cls_4_1byte.c (cls_struct_4_1byte_gn): Likewise. ++ * testsuite/libffi.call/cls_4byte.c (cls_struct_4byte_gn): Likewise. ++ * testsuite/libffi.call/cls_5_1_byte.c (cls_struct_5byte_gn): Likewise. ++ * testsuite/libffi.call/cls_5byte.c (cls_struct_5byte_gn): Likewise. ++ * testsuite/libffi.call/cls_64byte.c (cls_struct_64byte_gn): Likewise. ++ * testsuite/libffi.call/cls_6_1_byte.c (cls_struct_6byte_gn): Likewise. ++ * testsuite/libffi.call/cls_6byte.c (cls_struct_6byte_gn): Likewise. ++ * testsuite/libffi.call/cls_7_1_byte.c (cls_struct_7byte_gn): Likewise. ++ * testsuite/libffi.call/cls_7byte.c (cls_struct_7byte_gn): Likewise. ++ * testsuite/libffi.call/cls_8byte.c (cls_struct_8byte_gn): Likewise. ++ * testsuite/libffi.call/cls_9byte1.c (cls_struct_9byte_gn): Likewise. ++ * testsuite/libffi.call/cls_9byte2.c (cls_struct_9byte_gn): Likewise. ++ * testsuite/libffi.call/cls_align_double.c (cls_struct_align_gn): ++ Likewise. ++ * testsuite/libffi.call/cls_align_float.c (cls_struct_align_gn): ++ Likewise. ++ * testsuite/libffi.call/cls_align_longdouble.c (cls_struct_align_gn): ++ Likewise. ++ * testsuite/libffi.call/cls_align_pointer.c (cls_struct_align_fn): Cast ++ void* to avoid compiler warning. ++ (main): Likewise. ++ (cls_struct_align_gn): Mark cif and userdata unused. ++ * testsuite/libffi.call/cls_align_sint16.c (cls_struct_align_gn): ++ Likewise. ++ * testsuite/libffi.call/cls_align_sint32.c (cls_struct_align_gn): ++ Likewise. ++ * testsuite/libffi.call/cls_align_sint64.c (cls_struct_align_gn): ++ Likewise. ++ * testsuite/libffi.call/cls_align_uint16.c (cls_struct_align_gn): ++ Likewise. ++ * testsuite/libffi.call/cls_align_uint32.c (cls_struct_align_gn): ++ Likewise. ++ * testsuite/libffi.call/cls_double.c (cls_ret_double_fn): Likewise. ++ * testsuite/libffi.call/cls_float.c (cls_ret_float_fn): Likewise. ++ * testsuite/libffi.call/cls_multi_schar.c (test_func_gn): Mark cif and ++ data unused. ++ (main): Cast res_call to silence gcc. ++ * testsuite/libffi.call/cls_multi_sshort.c (test_func_gn): Mark cif and ++ data unused. ++ (main): Cast res_call to silence gcc. ++ * testsuite/libffi.call/cls_multi_sshortchar.c (test_func_gn): Mark cif ++ and data unused. ++ (main): Cast res_call to silence gcc. ++ * testsuite/libffi.call/cls_multi_uchar.c (test_func_gn): Mark cif and ++ data unused. ++ (main): Cast res_call to silence gcc. ++ * testsuite/libffi.call/cls_multi_ushort.c (test_func_gn): Mark cif and ++ data unused. ++ (main): Cast res_call to silence gcc. ++ * testsuite/libffi.call/cls_multi_ushortchar.c (test_func_gn): Mark cif ++ and data unused. ++ (main): Cast res_call to silence gcc. ++ * testsuite/libffi.call/cls_schar.c (cls_ret_schar_fn): Mark cif and ++ userdata unused. ++ (cls_ret_schar_fn): Cast printf parameter to silence gcc. ++ * testsuite/libffi.call/cls_sint.c (cls_ret_sint_fn): Mark cif and ++ userdata unused. ++ (cls_ret_sint_fn): Cast printf parameter to silence gcc. ++ * testsuite/libffi.call/cls_sshort.c (cls_ret_sshort_fn): Mark cif and ++ userdata unused. ++ (cls_ret_sshort_fn): Cast printf parameter to silence gcc. ++ * testsuite/libffi.call/cls_uchar.c (cls_ret_uchar_fn): Mark cif and ++ userdata unused. ++ (cls_ret_uchar_fn): Cast printf parameter to silence gcc. ++ * testsuite/libffi.call/cls_uint.c (cls_ret_uint_fn): Mark cif and ++ userdata unused. ++ (cls_ret_uint_fn): Cast printf parameter to silence gcc. ++ * testsuite/libffi.call/cls_ulonglong.c (cls_ret_ulonglong_fn): Mark cif ++ and userdata unused. ++ * testsuite/libffi.call/cls_ushort.c (cls_ret_ushort_fn): Mark cif and ++ userdata unused. ++ (cls_ret_ushort_fn): Cast printf parameter to silence gcc. ++ * testsuite/libffi.call/float.c (floating): Remove unused parameter e. ++ * testsuite/libffi.call/float1.c (main): Remove unused variable i. ++ Cleanup white spaces. ++ * testsuite/libffi.call/negint.c (checking): Remove unused variable i. ++ * testsuite/libffi.call/nested_struct.c (cls_struct_combined_gn): Mark ++ cif and userdata unused. ++ * testsuite/libffi.call/nested_struct1.c (cls_struct_combined_gn): ++ Likewise. ++ * testsuite/libffi.call/nested_struct10.c (B_gn): Likewise. ++ * testsuite/libffi.call/nested_struct2.c (B_fn): Adjust printf ++ formatters to silence gcc. ++ (B_gn): Mark cif and userdata unused. ++ * testsuite/libffi.call/nested_struct3.c (B_gn): Mark cif and userdata ++ unused. ++ * testsuite/libffi.call/nested_struct4.c: Mention related PR. ++ (B_gn): Mark cif and userdata unused. ++ * testsuite/libffi.call/nested_struct5.c (B_gn): Mark cif and userdata ++ unused. ++ * testsuite/libffi.call/nested_struct6.c: Mention related PR. ++ (B_gn): Mark cif and userdata unused. ++ * testsuite/libffi.call/nested_struct7.c (B_gn): Mark cif and userdata ++ unused. ++ * testsuite/libffi.call/nested_struct8.c (B_gn): Likewise. ++ * testsuite/libffi.call/nested_struct9.c (B_gn): Likewise. ++ * testsuite/libffi.call/problem1.c (stub): Likewise. ++ * testsuite/libffi.call/pyobjc-tc.c (main): Cast the result to silence ++ gcc. ++ * testsuite/libffi.call/return_fl2.c (return_fl): Add the note mentioned ++ in the last commit for this test case in the test case itself. ++ * testsuite/libffi.call/closure_fn0.c (closure_test_fn0): Mark cif as ++ unused. ++ * testsuite/libffi.call/closure_fn1.c (closure_test_fn1): Likewise. ++ * testsuite/libffi.call/closure_fn2.c (closure_test_fn2): Likewise. ++ * testsuite/libffi.call/closure_fn3.c (closure_test_fn3): Likewise. ++ * testsuite/libffi.call/closure_fn4.c (closure_test_fn0): Likewise. ++ * testsuite/libffi.call/closure_fn5.c (closure_test_fn5): Likewise. ++ * testsuite/libffi.call/closure_fn6.c (closure_test_fn0): Likewise. ++ ++2006-02-22 Kaz Kojima ++ ++ * src/sh/sysv.S: Fix register numbers in the FDE for ++ ffi_closure_SYSV. ++ ++2006-02-20 Andreas Tobler ++ ++ * testsuite/libffi.call/return_fl2.c (return_fl): Remove static ++ declaration to avoid a false negative on ix86. See PR323. ++ ++2006-02-18 Kaz Kojima ++ ++ * src/sh/ffi.c (ffi_closure_helper_SYSV): Remove unused variable ++ and cast integer to void * if needed. Update the pointer to ++ the FP register saved area correctly. ++ ++2006-02-17 Andreas Tobler ++ ++ * testsuite/libffi.call/nested_struct6.c: XFAIL this test until PR25630 ++ is fixed. ++ * testsuite/libffi.call/nested_struct4.c: Likewise. ++ ++2006-02-16 Andreas Tobler ++ ++ * testsuite/libffi.call/return_dbl.c: New test case. ++ * testsuite/libffi.call/return_dbl1.c: Likewise. ++ * testsuite/libffi.call/return_dbl2.c: Likewise. ++ * testsuite/libffi.call/return_fl.c: Likewise. ++ * testsuite/libffi.call/return_fl1.c: Likewise. ++ * testsuite/libffi.call/return_fl2.c: Likewise. ++ * testsuite/libffi.call/return_fl3.c: Likewise. ++ * testsuite/libffi.call/closure_fn6.c: Likewise. ++ ++ * testsuite/libffi.call/nested_struct2.c: Remove ffi_type_mylong ++ definition. ++ * testsuite/libffi.call/ffitest.h: Add ffi_type_mylong definition ++ here to be used by other test cases too. ++ ++ * testsuite/libffi.call/nested_struct10.c: New test case. ++ * testsuite/libffi.call/nested_struct9.c: Likewise. ++ * testsuite/libffi.call/nested_struct8.c: Likewise. ++ * testsuite/libffi.call/nested_struct7.c: Likewise. ++ * testsuite/libffi.call/nested_struct6.c: Likewise. ++ * testsuite/libffi.call/nested_struct5.c: Likewise. ++ * testsuite/libffi.call/nested_struct4.c: Likewise. ++ ++2006-01-21 Andreas Tobler ++ ++ * configure.ac: Enable libffi for sparc64-*-freebsd*. ++ * configure: Rebuilt. ++ ++2006-01-18 Jakub Jelinek ++ ++ * src/powerpc/sysv.S (smst_two_register): Don't call __ashldi3, ++ instead do the shifting inline. ++ * src/powerpc/ppc_closure.S (ffi_closure_SYSV): Don't compute %r5 ++ shift count unconditionally. Simplify load sequences for 1, 2, 3, 4 ++ and 8 byte structs, for the remaining struct sizes don't call ++ __lshrdi3, instead do the shifting inline. ++ ++2005-12-07 Thiemo Seufer ++ ++ * src/mips/ffitarget.h: Remove obsolete sgidefs.h include. Add ++ missing parentheses. ++ * src/mips/o32.S (ffi_call_O32): Code formatting. Define ++ and use A3_OFF, FP_OFF, RA_OFF. Micro-optimizations. ++ (ffi_closure_O32): Likewise, but with newly defined A3_OFF2, ++ A2_OFF2, A1_OFF2, A0_OFF2, RA_OFF2, FP_OFF2, S0_OFF2, GP_OFF2, ++ V1_OFF2, V0_OFF2, FA_1_1_OFF2, FA_1_0_OFF2, FA_0_1_OFF2, ++ FA_0_0_OFF2. ++ * src/mips/ffi.c (ffi_prep_args): Code formatting. Fix ++ endianness bugs. ++ (ffi_prep_closure): Improve trampoline instruction scheduling. ++ (ffi_closure_mips_inner_O32): Fix endianness bugs. ++ ++2005-12-03 Alan Modra ++ ++ * src/powerpc/ffi.c: Formatting. ++ (ffi_prep_args_SYSV): Avoid possible aliasing problems by using unions. ++ (ffi_prep_args64): Likewise. ++ ++2005-09-30 Geoffrey Keating ++ ++ * testsuite/lib/libffi-dg.exp (libffi_target_compile): For ++ darwin, use -shared-libgcc not -lgcc_s, and explain why. ++ ++2005-09-26 Tom Tromey ++ ++ * testsuite/libffi.call/float1.c (value_type): New typedef. ++ (CANARY): New define. ++ (main): Check for result buffer overflow. ++ * src/powerpc/linux64.S: Handle linux64 long double returns. ++ * src/powerpc/ffi.c (FLAG_RETURNS_128BITS): New constant. ++ (ffi_prep_cif_machdep): Handle linux64 long double returns. ++ ++2005-08-25 Alan Modra ++ ++ PR target/23404 ++ * src/powerpc/ffi.c (ffi_prep_args_SYSV): Correct placement of stack ++ homed fp args. ++ (ffi_status ffi_prep_cif_machdep): Correct stack sizing for same. ++ ++2005-08-11 Jakub Jelinek ++ ++ * configure.ac (HAVE_HIDDEN_VISIBILITY_ATTRIBUTE): New test. ++ (AH_BOTTOM): Add FFI_HIDDEN definition. ++ * configure: Rebuilt. ++ * fficonfig.h.in: Rebuilt. ++ * src/powerpc/ffi.c (hidden): Remove. ++ (ffi_closure_LINUX64, ffi_prep_args64, ffi_call_LINUX64, ++ ffi_closure_helper_LINUX64): Use FFI_HIDDEN instead of hidden. ++ * src/powerpc/linux64_closure.S (ffi_closure_LINUX64, ++ .ffi_closure_LINUX64): Use FFI_HIDDEN instead of .hidden. ++ * src/x86/ffi.c (ffi_closure_SYSV, ffi_closure_raw_SYSV): Remove, ++ add FFI_HIDDEN to its prototype. ++ (ffi_closure_SYSV_inner): New. ++ * src/x86/sysv.S (ffi_closure_SYSV, ffi_closure_raw_SYSV): New. ++ * src/x86/win32.S (ffi_closure_SYSV, ffi_closure_raw_SYSV): New. ++ ++2005-08-10 Alfred M. Szmidt ++ ++ PR libffi/21819: ++ * configure: Rebuilt. ++ * configure.ac: Handle i*86-*-gnu*. ++ ++2005-08-09 Jakub Jelinek ++ ++ * src/powerpc/ppc_closure.S (ffi_closure_SYSV): Use ++ DW_CFA_offset_extended_sf rather than ++ DW_CFA_GNU_negative_offset_extended. ++ * src/powerpc/sysv.S (ffi_call_SYSV): Likewise. ++ ++2005-07-22 SUGIOKA Toshinobu ++ ++ * src/sh/sysv.S (ffi_call_SYSV): Stop argument popping correctly ++ on sh3. ++ (ffi_closure_SYSV): Change the stack layout for sh3 struct argument. ++ * src/sh/ffi.c (ffi_prep_args): Fix sh3 argument copy, when it is ++ partially on register. ++ (ffi_closure_helper_SYSV): Likewise. ++ (ffi_prep_cif_machdep): Don't set too many cif->flags. ++ ++2005-07-20 Kaz Kojima ++ ++ * src/sh/ffi.c (ffi_call): Handle small structures correctly. ++ Remove empty line. ++ * src/sh64/ffi.c (simple_type): Remove. ++ (return_type): Handle small structures correctly. ++ (ffi_prep_args): Likewise. ++ (ffi_call): Likewise. ++ (ffi_closure_helper_SYSV): Likewise. ++ * src/sh64/sysv.S (ffi_call_SYSV): Handle 1, 2 and 4-byte return. ++ Emit position independent code if PIC and remove wrong datalabel ++ prefixes from EH data. ++ ++2005-07-19 Andreas Tobler ++ ++ * Makefile.am (nodist_libffi_la_SOURCES): Add POWERPC_FREEBSD. ++ * Makefile.in: Regenerate. ++ * include/Makefile.in: Likewise. ++ * testsuite/Makefile.in: Likewise. ++ * configure.ac: Add POWERPC_FREEBSD rules. ++ * configure: Regenerate. ++ * src/powerpc/ffitarget.h: Add POWERPC_FREEBSD rules. ++ (FFI_SYSV_TYPE_SMALL_STRUCT): Define. ++ * src/powerpc/ffi.c: Add flags to handle small structure returns ++ in ffi_call_SYSV. ++ (ffi_prep_cif_machdep): Handle small structures for SYSV 4 ABI. ++ Aka FFI_SYSV. ++ (ffi_closure_helper_SYSV): Likewise. ++ * src/powerpc/ppc_closure.S: Add return types for small structures. ++ * src/powerpc/sysv.S: Add bits to handle small structures for ++ final SYSV 4 ABI. ++ ++2005-07-10 Andreas Tobler ++ ++ * testsuite/libffi.call/cls_5_1_byte.c: New test file. ++ * testsuite/libffi.call/cls_6_1_byte.c: Likewise. ++ * testsuite/libffi.call/cls_7_1_byte.c: Likewise. ++ ++2005-07-05 Randolph Chung ++ ++ * src/pa/ffi.c (ffi_struct_type): Rename FFI_TYPE_SMALL_STRUCT1 ++ as FFI_TYPE_SMALL_STRUCT3. Break out handling for 5-7 byte ++ structures. Kill compilation warnings. ++ (ffi_closure_inner_LINUX): Print return values as hex in debug ++ message. Rename FFI_TYPE_SMALL_STRUCT1 as FFI_TYPE_SMALL_STRUCT3. ++ Properly handle 5-7 byte structure returns. ++ * src/pa/ffitarget.h (FFI_TYPE_SMALL_STRUCT1) ++ (FFI_TYPE_SMALL_STRUCT2): Remove. ++ (FFI_TYPE_SMALL_STRUCT3, FFI_TYPE_SMALL_STRUCT5) ++ (FFI_TYPE_SMALL_STRUCT6, FFI_TYPE_SMALL_STRUCT7): Define. ++ * src/pa/linux.S: Mark source file as using PA1.1 assembly. ++ (checksmst1, checksmst2): Remove. ++ (checksmst3): Optimize handling of 3-byte struct returns. ++ (checksmst567): Properly handle 5-7 byte struct returns. ++ ++2005-06-15 Rainer Orth ++ ++ PR libgcj/21943 ++ * src/mips/n32.S: Enforce PIC code. ++ * src/mips/o32.S: Likewise. ++ ++2005-06-15 Rainer Orth ++ ++ * configure.ac: Treat i*86-*-solaris2.10 and up as X86_64. ++ * configure: Regenerate. ++ ++2005-06-01 Alan Modra ++ ++ * src/powerpc/ppc_closure.S (ffi_closure_SYSV): Don't use JUMPTARGET ++ to call ffi_closure_helper_SYSV. Append @local instead. ++ * src/powerpc/sysv.S (ffi_call_SYSV): Likewise for ffi_prep_args_SYSV. ++ ++2005-05-17 Kelley Cook ++ ++ * configure.ac: Use AC_C_BIGENDIAN instead of AC_C_BIGENDIAN_CROSS. ++ Use AC_CHECK_SIZEOF instead of AC_COMPILE_CHECK_SIZEOF. ++ * Makefile.am (ACLOCAL_AMFLAGS): Remove -I ../config. ++ * aclocal.m4, configure, fficonfig.h.in, Makefile.in, ++ include/Makefile.in, testsuite/Makefile.in: Regenerate. ++ ++2005-05-09 Mike Stump ++ ++ * configure: Regenerate. ++ ++2005-05-08 Richard Henderson ++ ++ PR libffi/21285 ++ * src/alpha/osf.S: Update unwind into to match code. ++ ++2005-05-04 Andreas Degert ++ Richard Henderson ++ ++ * src/x86/ffi64.c (ffi_prep_cif_machdep): Save sse-used flag in ++ bit 11 of flags. ++ (ffi_call): Mask return type field. Pass ssecount to ffi_call_unix64. ++ (ffi_prep_closure): Set carry bit if sse-used flag set. ++ * src/x86/unix64.S (ffi_call_unix64): Add ssecount argument. ++ Only load sse registers if ssecount non-zero. ++ (ffi_closure_unix64): Only save sse registers if carry set on entry. ++ ++2005-04-29 Ralf Corsepius ++ ++ * configure.ac: Add i*86-*-rtems*, sparc*-*-rtems*, ++ powerpc-*rtems*, arm*-*-rtems*, sh-*-rtems*. ++ * configure: Regenerate. ++ ++2005-04-20 Hans-Peter Nilsson ++ ++ * testsuite/lib/libffi-dg.exp (libffi-dg-test-1): In regsub use, ++ have Tcl8.3-compatible intermediate variable. ++ ++2005-04-18 Simon Posnjak ++ Hans-Peter Nilsson ++ ++ * Makefile.am: Add CRIS support. ++ * configure.ac: Likewise. ++ * Makefile.in, configure, testsuite/Makefile.in, ++ include/Makefile.in: Regenerate. ++ * src/cris: New directory. ++ * src/cris/ffi.c, src/cris/sysv.S, src/cris/ffitarget.h: New files. ++ * src/prep_cif.c (ffi_prep_cif): Wrap in #ifndef __CRIS__. ++ ++ * testsuite/lib/libffi-dg.exp (libffi-dg-test-1): Replace \n with ++ \r?\n in output tests. ++ ++2005-04-12 Mike Stump ++ ++ * configure: Regenerate. ++ ++2005-03-30 Hans Boehm ++ ++ * src/ia64/ffitarget.h (ffi_arg): Use long long instead of DI. ++ ++2005-03-30 Steve Ellcey ++ ++ * src/ia64/ffitarget.h (ffi_arg) ADD DI attribute. ++ (ffi_sarg) Ditto. ++ * src/ia64/unix.S (ffi_closure_unix): Extend gp ++ to 64 bits in ILP32 mode. ++ Load 64 bits even for short data. ++ ++2005-03-23 Mike Stump ++ ++ * src/powerpc/darwin.S: Update for -m64 multilib. ++ * src/powerpc/darwin_closure.S: Likewise. ++ ++2005-03-21 Zack Weinberg ++ ++ * configure.ac: Do not invoke TL_AC_GCC_VERSION. ++ Do not set tool_include_dir. ++ * aclocal.m4, configure, Makefile.in, testsuite/Makefile.in: ++ Regenerate. ++ * include/Makefile.am: Set gcc_version and toollibffidir. ++ * include/Makefile.in: Regenerate. ++ ++2005-02-22 Andrew Haley ++ ++ * src/powerpc/ffi.c (ffi_prep_cif_machdep): Bump alignment to ++ odd-numbered register pairs for 64-bit integer types. ++ ++2005-02-23 Andreas Tobler ++ ++ PR libffi/20104 ++ * testsuite/libffi.call/return_ll1.c: New test case. ++ ++2005-02-11 Janis Johnson ++ ++ * testsuite/libffi.call/cls_align_longdouble.c: Remove dg-options. ++ * testsuite/libffi.call/float.c: Ditto. ++ * testsuite/libffi.call/float2.c: Ditto. ++ * testsuite/libffi.call/float3.c: Ditto. ++ ++2005-02-08 Andreas Tobler ++ ++ * src/frv/ffitarget.h: Remove PPC stuff which does not belong to frv. ++ ++2005-01-12 Eric Botcazou ++ ++ * testsuite/libffi.special/special.exp (cxx_options): Add ++ -shared-libgcc. ++ ++2004-12-31 Richard Henderson ++ ++ * src/types.c (FFI_AGGREGATE_TYPEDEF): Remove. ++ (FFI_TYPEDEF): Rename from FFI_INTEGRAL_TYPEDEF. Replace size and ++ offset parameters with a type parameter; deduce size and structure ++ alignment. Update all users. ++ ++2004-12-31 Richard Henderson ++ ++ * src/types.c (FFI_TYPE_POINTER): Define with sizeof. ++ (FFI_TYPE_LONGDOUBLE): Fix for ia64. ++ * src/ia64/ffitarget.h (struct ffi_ia64_trampoline_struct): Move ++ into ffi_prep_closure. ++ * src/ia64/ia64_flags.h, src/ia64/ffi.c, src/ia64/unix.S: Rewrite ++ from scratch. ++ ++2004-12-27 Richard Henderson ++ ++ * src/x86/unix64.S: Fix typo in unwind info. ++ ++2004-12-25 Richard Henderson ++ ++ * src/x86/ffi64.c (struct register_args): Rename from stackLayout. ++ (enum x86_64_reg_class): Add X86_64_COMPLEX_X87_CLASS. ++ (merge_classes): Check for it. ++ (SSE_CLASS_P): New. ++ (classify_argument): Pass byte_offset by value; perform all updates ++ inside struct case. ++ (examine_argument): Add classes argument; handle ++ X86_64_COMPLEX_X87_CLASS. ++ (ffi_prep_args): Merge into ... ++ (ffi_call): ... here. Share stack frame with ffi_call_unix64. ++ (ffi_prep_cif_machdep): Setup cif->flags for proper structure return. ++ (ffi_fill_return_value): Remove. ++ (ffi_prep_closure): Remove dead assert. ++ (ffi_closure_unix64_inner): Rename from ffi_closure_UNIX64_inner. ++ Rewrite to use struct register_args instead of va_list. Create ++ flags for handling structure returns. ++ * src/x86/unix64.S: Remove dead strings. ++ (ffi_call_unix64): Rename from ffi_call_UNIX64. Rewrite to share ++ stack frame with ffi_call. Handle structure returns properly. ++ (float2sse, floatfloat2sse, double2sse): Remove. ++ (sse2float, sse2double, sse2floatfloat): Remove. ++ (ffi_closure_unix64): Rename from ffi_closure_UNIX64. Rewrite ++ to handle structure returns properly. ++ ++2004-12-08 David Edelsohn ++ ++ * Makefile.am (AM_MAKEFLAGS): Remove duplicate LIBCFLAGS and ++ PICFLAG. ++ * Makefile.in: Regenerated. ++ ++2004-12-02 Richard Sandiford ++ ++ * configure.ac: Use TL_AC_GCC_VERSION to set gcc_version. ++ * configure, aclocal.m4, Makefile.in: Regenerate. ++ * include/Makefile.in, testsuite/Makefile.in: Regenerate. ++ ++2004-11-29 Kelley Cook ++ ++ * configure: Regenerate for libtool change. ++ ++2004-11-25 Kelley Cook ++ ++ * configure: Regenerate for libtool reversion. ++ ++2004-11-24 Kelley Cook ++ ++ * configure: Regenerate for libtool change. ++ ++2004-11-23 John David Anglin ++ ++ * testsuite/lib/libffi-dg.exp: Use new procs in target-libpath.exp. ++ ++2004-11-23 Richard Sandiford ++ ++ * src/mips/o32.S (ffi_call_O32, ffi_closure_O32): Use jalr instead ++ of jal. Use an absolute encoding for the frame information. ++ ++2004-11-23 Kelley Cook ++ ++ * Makefile.am: Remove no-dependencies. Add ACLOCAL_AMFLAGS. ++ * acinclude.m4: Delete logic for sincludes. ++ * aclocal.m4, Makefile.in, configure: Regenerate. ++ * include/Makefile: Likewise. ++ * testsuite/Makefile: Likewise. ++ ++2004-11-22 Eric Botcazou ++ ++ * src/sparc/ffi.c (ffi_prep_closure): Align doubles and 64-bit integers ++ on a 8-byte boundary. ++ * src/sparc/v8.S (ffi_closure_v8): Reserve frame space for arguments. ++ ++2004-10-27 Richard Earnshaw ++ ++ * src/arm/ffi.c (ffi_prep_cif_machdep): Handle functions that return ++ long long values. Round stack allocation to a multiple of 8 bytes ++ for ATPCS compatibility. ++ * src/arm/sysv.S (ffi_call_SYSV): Rework to avoid use of APCS register ++ names. Handle returning long long types. Add Thumb and interworking ++ support. Improve soft-float code. ++ ++2004-10-27 Richard Earnshaw ++ ++ * testsuite/lib/libffi-db.exp (load_gcc_lib): New function. ++ (libffi_exit): New function. ++ (libffi_init): Build the testglue wrapper if needed. ++ ++2004-10-25 Eric Botcazou ++ ++ PR other/18138 ++ * testsuite/lib/libffi-dg.exp: Accept more than one multilib libgcc. ++ ++2004-10-25 Kazuhiro Inaoka ++ ++ * src/m32r/libffitarget.h (FFI_CLOSURES): Set to 0. ++ ++2004-10-20 Kaz Kojima ++ ++ * src/sh/sysv.S (ffi_call_SYSV): Don't align for double data. ++ * testsuite/libffi.call/float3.c: New test case. ++ ++2004-10-18 Kaz Kojima ++ ++ * src/sh/ffi.c (ffi_prep_closure): Set T bit in trampoline for ++ the function returning a structure pointed with R2. ++ * src/sh/sysv.S (ffi_closure_SYSV): Use R2 as the pointer to ++ the structure return value if T bit set. Emit position ++ independent code and EH data if PIC. ++ ++2004-10-13 Kazuhiro Inaoka ++ ++ * Makefile.am: Add m32r support. ++ * configure.ac: Likewise. ++ * Makefile.in: Regenerate. ++ * confiugre: Regenerate. ++ * src/types.c: Add m32r port to FFI_INTERNAL_TYPEDEF ++ (uint64, sint64, double, longdouble) ++ * src/m32r: New directory. ++ * src/m32r/ffi.c: New file. ++ * src/m32r/sysv.S: Likewise. ++ * src/m32r/ffitarget.h: Likewise. ++ ++2004-10-02 Kaz Kojima ++ ++ * testsuite/libffi.call/negint.c: New test case. ++ ++2004-09-14 H.J. Lu ++ ++ PR libgcj/17465 ++ * testsuite/lib/libffi-dg.exp: Don't use global ld_library_path. ++ Set up LD_LIBRARY_PATH, SHLIB_PATH, LD_LIBRARYN32_PATH, ++ LD_LIBRARY64_PATH, LD_LIBRARY_PATH_32, LD_LIBRARY_PATH_64 and ++ DYLD_LIBRARY_PATH. ++ ++2004-09-05 Andreas Tobler ++ ++ * testsuite/libffi.call/many_win32.c: Remove whitespaces. ++ * testsuite/libffi.call/promotion.c: Likewise. ++ * testsuite/libffi.call/return_ll.c: Remove unused var. Cleanup ++ whitespaces. ++ * testsuite/libffi.call/return_sc.c: Likewise. ++ * testsuite/libffi.call/return_uc.c: Likewise. ++ ++2004-09-05 Andreas Tobler ++ ++ * src/powerpc/darwin.S: Fix comments and identation. ++ * src/powerpc/darwin_closure.S: Likewise. ++ ++2004-09-02 Andreas Tobler ++ ++ * src/powerpc/ffi_darwin.c: Add flag for longdouble return values. ++ (ffi_prep_args): Handle longdouble arguments. ++ (ffi_prep_cif_machdep): Set flags for longdouble. Calculate space for ++ longdouble. ++ (ffi_closure_helper_DARWIN): Add closure handling for longdouble. ++ * src/powerpc/darwin.S (_ffi_call_DARWIN): Add handling of longdouble ++ values. ++ * src/powerpc/darwin_closure.S (_ffi_closure_ASM): Likewise. ++ * src/types.c: Defined longdouble size and alignment for darwin. ++ ++2004-09-02 Andreas Tobler ++ ++ * src/powerpc/aix.S: Remove whitespaces. ++ * src/powerpc/aix_closure.S: Likewise. ++ * src/powerpc/asm.h: Likewise. ++ * src/powerpc/ffi.c: Likewise. ++ * src/powerpc/ffitarget.h: Likewise. ++ * src/powerpc/linux64.S: Likewise. ++ * src/powerpc/linux64_closure.S: Likewise. ++ * src/powerpc/ppc_closure.S: Likewise. ++ * src/powerpc/sysv.S: Likewise. ++ ++2004-08-30 Anthony Green ++ ++ * Makefile.am: Add frv support. ++ * Makefile.in, testsuite/Makefile.in: Rebuilt. ++ * configure.ac: Read configure.host. ++ * configure.in: Read configure.host. ++ * configure.host: New file. frv-elf needs libgloss. ++ * include/ffi.h.in: Force ffi_closure to have a nice big (8) ++ alignment. This is needed to frv and shouldn't harm the others. ++ * include/ffi_common.h (ALIGN_DOWN): New macro. ++ * src/frv/ffi.c, src/frv/ffitarget.h, src/frv/eabi.S: New files. ++ ++2004-08-24 David Daney ++ ++ * testsuite/libffi.call/closure_fn0.c: Xfail mips64* instead of mips*. ++ * testsuite/libffi.call/closure_fn1.c: Likewise. ++ * testsuite/libffi.call/closure_fn2.c Likewise. ++ * testsuite/libffi.call/closure_fn3.c: Likewise. ++ * testsuite/libffi.call/closure_fn4.c: Likewise. ++ * testsuite/libffi.call/closure_fn5.c: Likewise. ++ * testsuite/libffi.call/cls_18byte.c: Likewise. ++ * testsuite/libffi.call/cls_19byte.c: Likewise. ++ * testsuite/libffi.call/cls_1_1byte.c: Likewise. ++ * testsuite/libffi.call/cls_20byte.c: Likewise. ++ * testsuite/libffi.call/cls_20byte1.c: Likewise. ++ * testsuite/libffi.call/cls_24byte.c: Likewise. ++ * testsuite/libffi.call/cls_2byte.c: Likewise. ++ * testsuite/libffi.call/cls_3_1byte.c: Likewise. ++ * testsuite/libffi.call/cls_3byte1.c: Likewise. ++ * testsuite/libffi.call/cls_3byte2.c: Likewise. ++ * testsuite/libffi.call/cls_4_1byte.c: Likewise. ++ * testsuite/libffi.call/cls_4byte.c: Likewise. ++ * testsuite/libffi.call/cls_64byte.c: Likewise. ++ * testsuite/libffi.call/cls_6byte.c: Likewise. ++ * testsuite/libffi.call/cls_7byte.c: Likewise. ++ * testsuite/libffi.call/cls_8byte.c: Likewise. ++ * testsuite/libffi.call/cls_9byte1.c: Likewise. ++ * testsuite/libffi.call/cls_9byte2.c: Likewise. ++ * testsuite/libffi.call/cls_align_double.c: Likewise. ++ * testsuite/libffi.call/cls_align_float.c: Likewise. ++ * testsuite/libffi.call/cls_align_longdouble.c: Likewise. ++ * testsuite/libffi.call/cls_align_pointer.c: Likewise. ++ * testsuite/libffi.call/cls_align_sint16.c: Likewise. ++ * testsuite/libffi.call/cls_align_sint32.c: Likewise. ++ * testsuite/libffi.call/cls_align_sint64.c: Likewise. ++ * testsuite/libffi.call/cls_align_uint16.c: Likewise. ++ * testsuite/libffi.call/cls_align_uint32.c: Likewise. ++ * testsuite/libffi.call/cls_align_uint64.c: Likewise. ++ * testsuite/libffi.call/cls_double.c: Likewise. ++ * testsuite/libffi.call/cls_float.c: Likewise. ++ * testsuite/libffi.call/cls_multi_schar.c: Likewise. ++ * testsuite/libffi.call/cls_multi_sshort.c: Likewise. ++ * testsuite/libffi.call/cls_multi_sshortchar.c: Likewise. ++ * testsuite/libffi.call/cls_multi_uchar.c: Likewise. ++ * testsuite/libffi.call/cls_multi_ushort.c: Likewise. ++ * testsuite/libffi.call/cls_multi_ushortchar.c: Likewise. ++ * testsuite/libffi.call/cls_schar.c: Likewise. ++ * testsuite/libffi.call/cls_sint.c: Likewise. ++ * testsuite/libffi.call/cls_sshort.c: Likewise. ++ * testsuite/libffi.call/cls_uchar.c: Likewise. ++ * testsuite/libffi.call/cls_uint.c: Likewise. ++ * testsuite/libffi.call/cls_ulonglong.c: Likewise. ++ * testsuite/libffi.call/cls_ushort.c: Likewise. ++ * testsuite/libffi.call/nested_struct.c: Likewise. ++ * testsuite/libffi.call/nested_struct1.c: Likewise. ++ * testsuite/libffi.call/nested_struct2.c: Likewise. ++ * testsuite/libffi.call/nested_struct3.c: Likewise. ++ * testsuite/libffi.call/problem1.c: Likewise. ++ * testsuite/libffi.special/unwindtest.cc: Likewise. ++ * testsuite/libffi.call/cls_12byte.c: Likewise and set return value ++ to zero. ++ * testsuite/libffi.call/cls_16byte.c: Likewise. ++ * testsuite/libffi.call/cls_5byte.c: Likewise. ++ ++2004-08-23 David Daney ++ ++ PR libgcj/13141 ++ * src/mips/ffitarget.h (FFI_O32_SOFT_FLOAT): New ABI. ++ * src/mips/ffi.c (ffi_prep_args): Fix alignment calculation. ++ (ffi_prep_cif_machdep): Handle FFI_O32_SOFT_FLOAT floating point ++ parameters and return types. ++ (ffi_call): Handle FFI_O32_SOFT_FLOAT ABI. ++ (ffi_prep_closure): Ditto. ++ (ffi_closure_mips_inner_O32): Handle FFI_O32_SOFT_FLOAT ABI, fix ++ alignment calculations. ++ * src/mips/o32.S (ffi_closure_O32): Don't use floating point ++ instructions if FFI_O32_SOFT_FLOAT, make stack frame ABI compliant. ++ ++2004-08-14 Casey Marshall ++ ++ * src/mips/ffi.c (ffi_pref_cif_machdep): set `cif->flags' to ++ contain `FFI_TYPE_UINT64' as return type for any 64-bit ++ integer (O32 ABI only). ++ (ffi_prep_closure): new function. ++ (ffi_closure_mips_inner_O32): new function. ++ * src/mips/ffitarget.h: Define `FFI_CLOSURES' and ++ `FFI_TRAMPOLINE_SIZE' appropriately if the ABI is o32. ++ * src/mips/o32.S (ffi_call_O32): add labels for .eh_frame. Return ++ 64 bit integers correctly. ++ (ffi_closure_O32): new function. ++ Added DWARF-2 unwind info for both functions. ++ ++2004-08-10 Andrew Haley ++ ++ * src/x86/ffi64.c (ffi_prep_args ): 8-align all stack arguments. ++ ++2004-08-01 Robert Millan ++ ++ * configure.ac: Detect knetbsd-gnu and kfreebsd-gnu. ++ * configure: Regenerate. ++ ++2004-07-30 Maciej W. Rozycki ++ ++ * acinclude.m4 (AC_FUNC_MMAP_BLACKLIST): Check for ++ and mmap() explicitly instead of relying on preset autoconf cache ++ variables. ++ * aclocal.m4: Regenerate. ++ * configure: Regenerate. ++ ++2004-07-11 Ulrich Weigand ++ ++ * src/s390/ffi.c (ffi_prep_args): Fix C aliasing violation. ++ (ffi_check_float_struct): Remove unused prototype. ++ ++2004-06-30 Geoffrey Keating ++ ++ * src/powerpc/ffi_darwin.c (flush_icache): ';' is a comment ++ character on Darwin, use '\n\t' instead. ++ ++2004-06-26 Matthias Klose ++ ++ * libtool-version: Fix typo in revision/age. ++ ++2004-06-17 Matthias Klose ++ ++ * libtool-version: New. ++ * Makefile.am (libffi_la_LDFLAGS): Use -version-info for soname. ++ * Makefile.in: Regenerate. ++ ++2004-06-15 Paolo Bonzini ++ ++ * Makefile.am: Remove useless multilib rules. ++ * Makefile.in: Regenerate. ++ * aclocal.m4: Regenerate with automake 1.8.5. ++ * configure.ac: Remove useless multilib configury. ++ * configure: Regenerate. ++ ++2004-06-15 Paolo Bonzini ++ ++ * .cvsignore: New file. ++ ++2004-06-10 Jakub Jelinek ++ ++ * src/ia64/unix.S (ffi_call_unix): Insert group barrier break ++ fp_done. ++ (ffi_closure_UNIX): Fix f14/f15 adjustment if FLOAT_SZ is ever ++ changed from 8. ++ ++2004-06-06 Sean McNeil ++ ++ * configure.ac: Add x86_64-*-freebsd* support. ++ * configure: Regenerate. ++ ++2004-04-26 Joe Buck ++ ++ Bug 15093 ++ * configure.ac: Test for existence of mmap and sys/mman.h before ++ checking blacklist. Fix suggested by Jim Wilson. ++ * configure: Regenerate. ++ ++2004-04-26 Matt Austern ++ ++ * src/powerpc/darwin.S: Go through a non-lazy pointer for initial ++ FDE location. ++ * src/powerpc/darwin_closure.S: Likewise. ++ ++2004-04-24 Andreas Tobler ++ ++ * testsuite/libffi.call/cls_multi_schar.c (main): Fix initialization ++ error. Reported by Thomas Heller . ++ * testsuite/libffi.call/cls_multi_sshort.c (main): Likewise. ++ * testsuite/libffi.call/cls_multi_ushort.c (main): Likewise. ++ ++2004-03-20 Matthias Klose ++ ++ * src/pa/linux.S: Fix typo. ++ ++2004-03-19 Matthias Klose ++ ++ * Makefile.am: Update. ++ * Makefile.in: Regenerate. ++ * src/pa/ffi.h.in: Remove. ++ * src/pa/ffitarget.h: New file. ++ ++2004-02-10 Randolph Chung ++ ++ * Makefile.am: Add PA support. ++ * Makefile.in: Regenerate. ++ * include/Makefile.in: Regenerate. ++ * configure.ac: Add PA target. ++ * configure: Regenerate. ++ * src/pa/ffi.c: New file. ++ * src/pa/ffi.h.in: Add PA support. ++ * src/pa/linux.S: New file. ++ * prep_cif.c: Add PA support. ++ ++2004-03-16 Hosaka Yuji ++ ++ * src/types.c: Fix alignment size of X86_WIN32 case int64 and ++ double. ++ * src/x86/ffi.c (ffi_prep_args): Replace ecif->cif->rtype->type ++ with ecif->cif->flags. ++ (ffi_call, ffi_prep_incoming_args_SYSV): Replace cif->rtype->type ++ with cif->flags. ++ (ffi_prep_cif_machdep): Add X86_WIN32 struct case. ++ (ffi_closure_SYSV): Add 1 or 2-bytes struct case for X86_WIN32. ++ * src/x86/win32.S (retstruct1b, retstruct2b, sc_retstruct1b, ++ sc_retstruct2b): Add for 1 or 2-bytes struct case. ++ ++2004-03-15 Kelley Cook ++ ++ * configure.in: Rename file to ... ++ * configure.ac: ... this. ++ * fficonfig.h.in: Regenerate. ++ * Makefile.in: Regenerate. ++ * include/Makefile.in: Regenerate. ++ * testsuite/Makefile.in: Regenerate. ++ ++2004-03-12 Matt Austern ++ ++ * src/powerpc/darwin.S: Fix EH information so it corresponds to ++ changes in EH format resulting from addition of linkonce support. ++ * src/powerpc/darwin_closure.S: Likewise. ++ ++2004-03-11 Andreas Tobler ++ Paolo Bonzini ++ ++ * Makefile.am (AUTOMAKE_OPTIONS): Set them. ++ Remove VPATH. Remove rules for object files. Remove multilib support. ++ (AM_CCASFLAGS): Add. ++ * configure.in (AC_CONFIG_HEADERS): Relace AM_CONFIG_HEADER. ++ (AC_PREREQ): Bump version to 2.59. ++ (AC_INIT): Fill with version info and bug address. ++ (ORIGINAL_LD_FOR_MULTILIBS): Remove. ++ (AM_ENABLE_MULTILIB): Use this instead of AC_ARG_ENABLE. ++ De-precious CC so that the right flags are passed down to multilibs. ++ (AC_MSG_ERROR): Replace obsolete macro AC_ERROR. ++ (AC_CONFIG_FILES): Replace obsolete macro AC_LINK_FILES. ++ (AC_OUTPUT): Reorganize the output with AC_CONFIG_COMMANDS. ++ * configure: Rebuilt. ++ * aclocal.m4: Likewise. ++ * Makefile.in, include/Makefile.in, testsuite/Makefile.in: Likewise. ++ * fficonfig.h.in: Likewise. ++ ++2004-03-11 Andreas Schwab ++ ++ * src/ia64/ffi.c (ffi_prep_incoming_args_UNIX): Get floating point ++ arguments from fp registers only for the first 8 parameter slots. ++ Don't convert a float parameter when passed in memory. ++ ++2004-03-09 Hans-Peter Nilsson ++ ++ * configure: Regenerate for config/accross.m4 correction. ++ ++2004-02-25 Matt Kraai ++ ++ * src/powerpc/ffi.c (ffi_prep_args_SYSV): Change ++ ecif->cif->bytes to bytes. ++ (ffi_prep_cif_machdep): Add braces around nested if statement. ++ ++2004-02-09 Alan Modra ++ ++ * src/types.c (pointer): POWERPC64 has 8 byte pointers. ++ ++ * src/powerpc/ffi.c (ffi_prep_args64): Correct long double handling. ++ (ffi_closure_helper_LINUX64): Fix typo. ++ * testsuite/libffi.call/cls_align_longdouble.c: Pass -mlong-double-128 ++ for powerpc64-*-*. ++ * testsuite/libffi.call/float.c: Likewise. ++ * testsuite/libffi.call/float2.c: Likewise. ++ ++2004-02-08 Alan Modra ++ ++ * src/powerpc/ffi.c (ffi_prep_cif_machdep ): Correct ++ long double function return and long double arg handling. ++ (ffi_closure_helper_LINUX64): Formatting. Delete unused "ng" var. ++ Use "end_pfr" instead of "nf". Correct long double handling. ++ Localise "temp". ++ * src/powerpc/linux64.S (ffi_call_LINUX64): Save f2 long double ++ return value. ++ * src/powerpc/linux64_closure.S (ffi_closure_LINUX64): Allocate ++ space for long double return value. Adjust stack frame and offsets. ++ Load f2 long double return. ++ ++2004-02-07 Alan Modra ++ ++ * src/types.c: Use 16 byte long double for POWERPC64. ++ ++2004-01-25 Eric Botcazou ++ ++ * src/sparc/ffi.c (ffi_prep_args_v9): Shift the parameter array ++ when the structure return address is passed in %o0. ++ (ffi_V9_return_struct): Rename into ffi_v9_layout_struct. ++ (ffi_v9_layout_struct): Align the field following a nested structure ++ on a word boundary. Use memmove instead of memcpy. ++ (ffi_call): Update call to ffi_V9_return_struct. ++ (ffi_prep_closure): Define 'ctx' only for V8. ++ (ffi_closure_sparc_inner): Clone into ffi_closure_sparc_inner_v8 ++ and ffi_closure_sparc_inner_v9. ++ (ffi_closure_sparc_inner_v8): Return long doubles by reference. ++ Always skip the structure return address. For structures and long ++ doubles, copy the argument directly. ++ (ffi_closure_sparc_inner_v9): Skip the structure return address only ++ if required. Shift the maximum floating-point slot accordingly. For ++ big structures, copy the argument directly; otherwise, left-justify the ++ argument and call ffi_v9_layout_struct to lay out the structure on ++ the stack. ++ * src/sparc/v8.S: Undef STACKFRAME before defining it. ++ (ffi_closure_v8): Pass the structure return address. Update call to ++ ffi_closure_sparc_inner_v8. Short-circuit FFI_TYPE_INT handling. ++ Skip the 'unimp' insn when returning long doubles and structures. ++ * src/sparc/v9.S: Undef STACKFRAME before defining it. ++ (ffi_closure_v9): Increase the frame size by 2 words. Short-circuit ++ FFI_TYPE_INT handling. Load structures both in integers and ++ floating-point registers on return. ++ * README: Update status of the SPARC port. ++ ++2004-01-24 Andreas Tobler ++ ++ * testsuite/libffi.call/pyobjc-tc.c (main): Treat result value ++ as of type ffi_arg. ++ * testsuite/libffi.call/struct3.c (main): Fix CHECK. ++ ++2004-01-22 Ulrich Weigand ++ ++ * testsuite/libffi.call/cls_uint.c (cls_ret_uint_fn): Treat result ++ value as of type ffi_arg, not unsigned int. ++ ++2004-01-21 Michael Ritzert ++ ++ * ffi64.c (ffi_prep_args): Cast the RHS of an assignment instead ++ of the LHS. ++ ++2004-01-12 Andreas Tobler ++ ++ * testsuite/lib/libffi-dg.exp: Set LD_LIBRARY_PATH_32 for ++ Solaris. ++ ++2004-01-08 Rainer Orth ++ ++ * testsuite/libffi.call/ffitest.h (allocate_mmap): Cast MAP_FAILED ++ to void *. ++ ++2003-12-10 Richard Henderson ++ ++ * testsuite/libffi.call/cls_align_pointer.c: Cast pointers to ++ size_t instead of int. ++ ++2003-12-04 Hosaka Yuji ++ ++ * testsuite/libffi.call/many_win32.c: Include . ++ * testsuite/libffi.call/many_win32.c (main): Replace variable ++ int i with unsigned long ul. ++ ++ * testsuite/libffi.call/cls_align_uint64.c: New test case. ++ * testsuite/libffi.call/cls_align_sint64.c: Likewise. ++ * testsuite/libffi.call/cls_align_uint32.c: Likewise. ++ * testsuite/libffi.call/cls_align_sint32.c: Likewise. ++ * testsuite/libffi.call/cls_align_uint16.c: Likewise. ++ * testsuite/libffi.call/cls_align_sint16.c: Likewise. ++ * testsuite/libffi.call/cls_align_float.c: Likewise. ++ * testsuite/libffi.call/cls_align_double.c: Likewise. ++ * testsuite/libffi.call/cls_align_longdouble.c: Likewise. ++ * testsuite/libffi.call/cls_align_pointer.c: Likewise. ++ ++2003-12-02 Hosaka Yuji ++ ++ PR other/13221 ++ * src/x86/ffi.c (ffi_prep_args, ffi_prep_incoming_args_SYSV): ++ Align arguments to 32 bits. ++ ++2003-12-01 Andreas Tobler ++ ++ PR other/13221 ++ * testsuite/libffi.call/cls_multi_sshort.c: New test case. ++ * testsuite/libffi.call/cls_multi_sshortchar.c: Likewise. ++ * testsuite/libffi.call/cls_multi_uchar.c: Likewise. ++ * testsuite/libffi.call/cls_multi_schar.c: Likewise. ++ * testsuite/libffi.call/cls_multi_ushortchar.c: Likewise. ++ * testsuite/libffi.call/cls_multi_ushort.c: Likewise. ++ ++ * testsuite/libffi.special/unwindtest.cc: Cosmetics. ++ ++2003-11-26 Kaveh R. Ghazi ++ ++ * testsuite/libffi.call/ffitest.h: Include . ++ * testsuite/libffi.special/ffitestcxx.h: Likewise. ++ ++2003-11-22 Andreas Tobler ++ ++ * Makefile.in: Rebuilt. ++ * configure: Likewise. ++ * testsuite/libffi.special/unwindtest.cc: Convert the mmap to ++ the right type. ++ ++2003-11-21 Andreas Jaeger ++ Andreas Tobler ++ ++ * acinclude.m4: Add AC_FUNC_MMAP_BLACKLIST. ++ * configure.in: Call AC_FUNC_MMAP_BLACKLIST. ++ * Makefile.in: Rebuilt. ++ * aclocal.m4: Likewise. ++ * configure: Likewise. ++ * fficonfig.h.in: Likewise. ++ * testsuite/lib/libffi-dg.exp: Add include dir. ++ * testsuite/libffi.call/ffitest.h: Add MMAP definitions. ++ * testsuite/libffi.special/ffitestcxx.h: Likewise. ++ * testsuite/libffi.call/closure_fn0.c: Use MMAP functionality ++ for ffi_closure if available. ++ * testsuite/libffi.call/closure_fn1.c: Likewise. ++ * testsuite/libffi.call/closure_fn2.c: Likewise. ++ * testsuite/libffi.call/closure_fn3.c: Likewise. ++ * testsuite/libffi.call/closure_fn4.c: Likewise. ++ * testsuite/libffi.call/closure_fn5.c: Likewise. ++ * testsuite/libffi.call/cls_12byte.c: Likewise. ++ * testsuite/libffi.call/cls_16byte.c: Likewise. ++ * testsuite/libffi.call/cls_18byte.c: Likewise. ++ * testsuite/libffi.call/cls_19byte.c: Likewise. ++ * testsuite/libffi.call/cls_1_1byte.c: Likewise. ++ * testsuite/libffi.call/cls_20byte.c: Likewise. ++ * testsuite/libffi.call/cls_20byte1.c: Likewise. ++ * testsuite/libffi.call/cls_24byte.c: Likewise. ++ * testsuite/libffi.call/cls_2byte.c: Likewise. ++ * testsuite/libffi.call/cls_3_1byte.c: Likewise. ++ * testsuite/libffi.call/cls_3byte1.c: Likewise. ++ * testsuite/libffi.call/cls_3byte2.c: Likewise. ++ * testsuite/libffi.call/cls_4_1byte.c: Likewise. ++ * testsuite/libffi.call/cls_4byte.c: Likewise. ++ * testsuite/libffi.call/cls_5byte.c: Likewise. ++ * testsuite/libffi.call/cls_64byte.c: Likewise. ++ * testsuite/libffi.call/cls_6byte.c: Likewise. ++ * testsuite/libffi.call/cls_7byte.c: Likewise. ++ * testsuite/libffi.call/cls_8byte.c: Likewise. ++ * testsuite/libffi.call/cls_9byte1.c: Likewise. ++ * testsuite/libffi.call/cls_9byte2.c: Likewise. ++ * testsuite/libffi.call/cls_double.c: Likewise. ++ * testsuite/libffi.call/cls_float.c: Likewise. ++ * testsuite/libffi.call/cls_schar.c: Likewise. ++ * testsuite/libffi.call/cls_sint.c: Likewise. ++ * testsuite/libffi.call/cls_sshort.c: Likewise. ++ * testsuite/libffi.call/cls_uchar.c: Likewise. ++ * testsuite/libffi.call/cls_uint.c: Likewise. ++ * testsuite/libffi.call/cls_ulonglong.c: Likewise. ++ * testsuite/libffi.call/cls_ushort.c: Likewise. ++ * testsuite/libffi.call/nested_struct.c: Likewise. ++ * testsuite/libffi.call/nested_struct1.c: Likewise. ++ * testsuite/libffi.call/nested_struct2.c: Likewise. ++ * testsuite/libffi.call/nested_struct3.c: Likewise. ++ * testsuite/libffi.call/problem1.c: Likewise. ++ * testsuite/libffi.special/unwindtest.cc: Likewise. ++ ++2003-11-20 Andreas Tobler ++ ++ * testsuite/lib/libffi-dg.exp: Make the -lgcc_s conditional. ++ ++2003-11-19 Andreas Tobler ++ ++ * testsuite/lib/libffi-dg.exp: Add DYLD_LIBRARY_PATH for darwin. ++ Add -lgcc_s to additional flags. ++ ++2003-11-12 Andreas Tobler ++ ++ * configure.in, include/Makefile.am: PR libgcj/11147, install ++ the ffitarget.h header file in a gcc versioned and target ++ dependent place. ++ * configure: Regenerated. ++ * Makefile.in, include/Makefile.in: Likewise. ++ * testsuite/Makefile.in: Likewise. ++ ++2003-11-09 Andreas Tobler ++ ++ * testsuite/libffi.call/closure_fn0.c: Print result and check ++ with dg-output to make debugging easier. ++ * testsuite/libffi.call/closure_fn1.c: Likewise. ++ * testsuite/libffi.call/closure_fn2.c: Likewise. ++ * testsuite/libffi.call/closure_fn3.c: Likewise. ++ * testsuite/libffi.call/closure_fn4.c: Likewise. ++ * testsuite/libffi.call/closure_fn5.c: Likewise. ++ * testsuite/libffi.call/cls_12byte.c: Likewise. ++ * testsuite/libffi.call/cls_16byte.c: Likewise. ++ * testsuite/libffi.call/cls_18byte.c: Likewise. ++ * testsuite/libffi.call/cls_19byte.c: Likewise. ++ * testsuite/libffi.call/cls_1_1byte.c: Likewise. ++ * testsuite/libffi.call/cls_20byte.c: Likewise. ++ * testsuite/libffi.call/cls_20byte1.c: Likewise. ++ * testsuite/libffi.call/cls_24byte.c: Likewise. ++ * testsuite/libffi.call/cls_2byte.c: Likewise. ++ * testsuite/libffi.call/cls_3_1byte.c: Likewise. ++ * testsuite/libffi.call/cls_3byte1.c: Likewise. ++ * testsuite/libffi.call/cls_3byte2.c: Likewise. ++ * testsuite/libffi.call/cls_4_1byte.c: Likewise. ++ * testsuite/libffi.call/cls_4byte.c: Likewise. ++ * testsuite/libffi.call/cls_5byte.c: Likewise. ++ * testsuite/libffi.call/cls_64byte.c: Likewise. ++ * testsuite/libffi.call/cls_6byte.c: Likewise. ++ * testsuite/libffi.call/cls_7byte.c: Likewise. ++ * testsuite/libffi.call/cls_8byte.c: Likewise. ++ * testsuite/libffi.call/cls_9byte1.c: Likewise. ++ * testsuite/libffi.call/cls_9byte2.c: Likewise. ++ * testsuite/libffi.call/cls_double.c: Likewise. ++ * testsuite/libffi.call/cls_float.c: Likewise. ++ * testsuite/libffi.call/cls_schar.c: Likewise. ++ * testsuite/libffi.call/cls_sint.c: Likewise. ++ * testsuite/libffi.call/cls_sshort.c: Likewise. ++ * testsuite/libffi.call/cls_uchar.c: Likewise. ++ * testsuite/libffi.call/cls_uint.c: Likewise. ++ * testsuite/libffi.call/cls_ulonglong.c: Likewise. ++ * testsuite/libffi.call/cls_ushort.c: Likewise. ++ * testsuite/libffi.call/problem1.c: Likewise. ++ ++ * testsuite/libffi.special/unwindtest.cc: Make ffi_closure ++ static. ++ ++2003-11-08 Andreas Tobler ++ ++ * testsuite/libffi.call/cls_9byte2.c: New test case. ++ * testsuite/libffi.call/cls_9byte1.c: Likewise. ++ * testsuite/libffi.call/cls_64byte.c: Likewise. ++ * testsuite/libffi.call/cls_20byte1.c: Likewise. ++ * testsuite/libffi.call/cls_19byte.c: Likewise. ++ * testsuite/libffi.call/cls_18byte.c: Likewise. ++ * testsuite/libffi.call/closure_fn4.c: Likewise. ++ * testsuite/libffi.call/closure_fn5.c: Likewise. ++ * testsuite/libffi.call/cls_schar.c: Likewise. ++ * testsuite/libffi.call/cls_sint.c: Likewise. ++ * testsuite/libffi.call/cls_sshort.c: Likewise. ++ * testsuite/libffi.call/nested_struct2.c: Likewise. ++ * testsuite/libffi.call/nested_struct3.c: Likewise. ++ ++2003-11-08 Andreas Tobler ++ ++ * testsuite/libffi.call/cls_double.c: Do a check on the result. ++ * testsuite/libffi.call/cls_uchar.c: Likewise. ++ * testsuite/libffi.call/cls_uint.c: Likewise. ++ * testsuite/libffi.call/cls_ulonglong.c: Likewise. ++ * testsuite/libffi.call/cls_ushort.c: Likewise. ++ * testsuite/libffi.call/return_sc.c: Cleanup whitespaces. ++ ++2003-11-06 Andreas Tobler ++ ++ * src/prep_cif.c (ffi_prep_cif): Move the validity check after ++ the initialization. ++ ++2003-10-23 Andreas Tobler ++ ++ * src/java_raw_api.c (ffi_java_ptrarray_to_raw): Replace ++ FFI_ASSERT(FALSE) with FFI_ASSERT(0). ++ ++2003-10-22 David Daney ++ ++ * src/mips/ffitarget.h: Replace undefined UINT32 and friends with ++ __attribute__((__mode__(__SI__))) and friends. ++ ++2003-10-22 Andreas Schwab ++ ++ * src/ia64/ffi.c: Replace FALSE/TRUE with false/true. ++ ++2003-10-21 Andreas Tobler ++ ++ * configure.in: AC_LINK_FILES(ffitarget.h). ++ * configure: Regenerate. ++ * Makefile.in: Likewise. ++ * include/Makefile.in: Likewise. ++ * testsuite/Makefile.in: Likewise. ++ * fficonfig.h.in: Likewise. ++ ++2003-10-21 Paolo Bonzini ++ Richard Henderson ++ ++ Avoid that ffi.h includes fficonfig.h. ++ ++ * Makefile.am (EXTRA_DIST): Include ffitarget.h files ++ (TARGET_SRC_MIPS_GCC): Renamed to TARGET_SRC_MIPS_IRIX. ++ (TARGET_SRC_MIPS_SGI): Removed. ++ (MIPS_GCC): Renamed to TARGET_SRC_MIPS_IRIX. ++ (MIPS_SGI): Removed. ++ (CLEANFILES): Removed. ++ (mostlyclean-am, clean-am, mostlyclean-sub, clean-sub): New ++ targets. ++ * acconfig.h: Removed. ++ * configure.in: Compute sizeofs only for double and long double. ++ Use them to define and subst HAVE_LONG_DOUBLE. Include comments ++ into AC_DEFINE instead of using acconfig.h. Create ++ include/ffitarget.h instead of include/fficonfig.h. Rename ++ MIPS_GCC to MIPS_IRIX, drop MIPS_SGI since we are in gcc's tree. ++ AC_DEFINE EH_FRAME_FLAGS. ++ * include/Makefile.am (DISTCLEANFILES): New automake macro. ++ (hack_DATA): Add ffitarget.h. ++ * include/ffi.h.in: Remove all system specific definitions. ++ Declare raw API even if it is not installed, why bother? ++ Use limits.h instead of SIZEOF_* to define ffi_type_*. Do ++ not define EH_FRAME_FLAGS, it is in fficonfig.h now. Include ++ ffitarget.h instead of fficonfig.h. Remove ALIGN macro. ++ (UINT_ARG, INT_ARG): Removed, use ffi_arg and ffi_sarg instead. ++ * include/ffi_common.h (bool): Do not define. ++ (ffi_assert): Accept failed assertion. ++ (ffi_type_test): Return void and accept file/line. ++ (FFI_ASSERT): Pass stringized failed assertion. ++ (FFI_ASSERT_AT): New macro. ++ (FFI_ASSERT_VALID_TYPE): New macro. ++ (UINT8, SINT8, UINT16, SINT16, UINT32, SINT32, ++ UINT64, SINT64): Define here with gcc's __attribute__ macro ++ instead of in ffi.h ++ (FLOAT32, ALIGN): Define here instead of in ffi.h ++ * include/ffi-mips.h: Removed. Its content moved to ++ src/mips/ffitarget.h after separating assembly and C sections. ++ * src/alpha/ffi.c, src/alpha/ffi.c, src/java_raw_api.c ++ src/prep_cif.c, src/raw_api.c, src/ia64/ffi.c, ++ src/mips/ffi.c, src/mips/n32.S, src/mips/o32.S, ++ src/mips/ffitarget.h, src/sparc/ffi.c, src/x86/ffi64.c: ++ SIZEOF_ARG -> FFI_SIZEOF_ARG. ++ * src/ia64/ffi.c: Include stdbool.h (provided by GCC 2.95+). ++ * src/debug.c (ffi_assert): Accept stringized failed assertion. ++ (ffi_type_test): Rewritten. ++ * src/prep-cif.c (initialize_aggregate, ffi_prep_cif): Call ++ FFI_ASSERT_VALID_TYPE. ++ * src/alpha/ffitarget.h, src/arm/ffitarget.h, ++ src/ia64/ffitarget.h, src/m68k/ffitarget.h, ++ src/mips/ffitarget.h, src/powerpc/ffitarget.h, ++ src/s390/ffitarget.h, src/sh/ffitarget.h, ++ src/sh64/ffitarget.h, src/sparc/ffitarget.h, ++ src/x86/ffitarget.h: New files. ++ * src/alpha/osf.S, src/arm/sysv.S, src/ia64/unix.S, ++ src/m68k/sysv.S, src/mips/n32.S, src/mips/o32.S, ++ src/powerpc/aix.S, src/powerpc/darwin.S, ++ src/powerpc/ffi_darwin.c, src/powerpc/linux64.S, ++ src/powerpc/linux64_closure.S, src/powerpc/ppc_closure.S, ++ src/powerpc/sysv.S, src/s390/sysv.S, src/sh/sysv.S, ++ src/sh64/sysv.S, src/sparc/v8.S, src/sparc/v9.S, ++ src/x86/sysv.S, src/x86/unix64.S, src/x86/win32.S: ++ include fficonfig.h ++ ++2003-10-20 Rainer Orth ++ ++ * src/mips/ffi.c: Use _ABIN32, _ABIO32 instead of external ++ _MIPS_SIM_NABI32, _MIPS_SIM_ABI32. ++ ++2003-10-19 Andreas Tobler ++ ++ * src/powerpc/ffi_darwin.c (ffi_prep_args): Declare bytes again. ++ Used when FFI_DEBUG = 1. ++ ++2003-10-14 Alan Modra ++ ++ * src/types.c (double, longdouble): Default POWERPC64 to 8 byte size ++ and align. ++ ++2003-10-06 Rainer Orth ++ ++ * include/ffi_mips.h: Define FFI_MIPS_N32 for N32/N64 ABIs, ++ FFI_MIPS_O32 for O32 ABI. ++ ++2003-10-01 Andreas Tobler ++ ++ * testsuite/lib/libffi-dg.exp: Set LD_LIBRARY_PATH_64 for ++ SPARC64. Cleanup whitespaces. ++ ++2003-09-19 Andreas Tobler ++ ++ * testsuite/libffi.call/closure_fn0.c: Xfail mips, arm, ++ strongarm, xscale. Cleanup whitespaces. ++ * testsuite/libffi.call/closure_fn1.c: Likewise. ++ * testsuite/libffi.call/closure_fn2.c: Likewise. ++ * testsuite/libffi.call/closure_fn3.c: Likewise. ++ * testsuite/libffi.call/cls_12byte.c: Likewise. ++ * testsuite/libffi.call/cls_16byte.c: Likewise. ++ * testsuite/libffi.call/cls_1_1byte.c: Likewise. ++ * testsuite/libffi.call/cls_20byte.c: Likewise. ++ * testsuite/libffi.call/cls_24byte.c: Likewise. ++ * testsuite/libffi.call/cls_2byte.c: Likewise. ++ * testsuite/libffi.call/cls_3_1byte.c: Likewise. ++ * testsuite/libffi.call/cls_3byte1.c: Likewise. ++ * testsuite/libffi.call/cls_3byte2.c: Likewise. ++ * testsuite/libffi.call/cls_4_1byte.c: Likewise. ++ * testsuite/libffi.call/cls_4byte.c: Likewise. ++ * testsuite/libffi.call/cls_5byte.c: Likewise. ++ * testsuite/libffi.call/cls_6byte.c: Likewise. ++ * testsuite/libffi.call/cls_7byte.c: Likewise. ++ * testsuite/libffi.call/cls_8byte.c: Likewise. ++ * testsuite/libffi.call/cls_double.c: Likewise. ++ * testsuite/libffi.call/cls_float.c: Likewise. ++ * testsuite/libffi.call/cls_uchar.c: Likewise. ++ * testsuite/libffi.call/cls_uint.c: Likewise. ++ * testsuite/libffi.call/cls_ulonglong.c: Likewise. ++ * testsuite/libffi.call/cls_ushort.c: Likewise. ++ * testsuite/libffi.call/nested_struct.c: Likewise. ++ * testsuite/libffi.call/nested_struct1.c: Likewise. ++ * testsuite/libffi.call/problem1.c: Likewise. ++ * testsuite/libffi.special/unwindtest.cc: Likewise. ++ * testsuite/libffi.call/pyobjc-tc.c: Cleanup whitespaces. ++ ++2003-09-18 David Edelsohn ++ ++ * src/powerpc/aix.S: Cleanup whitespaces. ++ * src/powerpc/aix_closure.S: Likewise. ++ ++2003-09-18 Andreas Tobler ++ ++ * src/powerpc/darwin.S: Cleanup whitespaces, comment formatting. ++ * src/powerpc/darwin_closure.S: Likewise. ++ * src/powerpc/ffi_darwin.c: Likewise. ++ ++2003-09-18 Andreas Tobler ++ David Edelsohn ++ ++ * src/types.c (double): Add AIX and Darwin to the right TYPEDEF. ++ * src/powerpc/aix_closure.S: Remove the pointer to the outgoing ++ parameter stack. ++ * src/powerpc/darwin_closure.S: Likewise. ++ * src/powerpc/ffi_darwin.c (ffi_prep_args): Handle structures ++ according to the Darwin/AIX ABI. ++ (ffi_prep_cif_machdep): Likewise. ++ (ffi_closure_helper_DARWIN): Likewise. ++ Remove the outgoing parameter stack logic. Simplify the evaluation ++ of the different CASE types. ++ (ffi_prep_clousure): Avoid the casts on lvalues. Change the branch ++ statement in the trampoline code. ++ ++2003-09-18 Kaz Kojima ++ ++ * src/sh/ffi.c (ffi_prep_args): Take account into the alignement ++ for the register size. ++ (ffi_closure_helper_SYSV): Handle the structure return value ++ address correctly. ++ (ffi_closure_helper_SYSV): Return the appropriate type when ++ the registers are used for the structure return value. ++ * src/sh/sysv.S (ffi_closure_SYSV): Fix the stack layout for ++ the 64-bit return value. Update copyright years. ++ ++2003-09-17 Rainer Orth ++ ++ * testsuite/lib/libffi-dg.exp (libffi_target_compile): Search in ++ srcdir for ffi_mips.h. ++ ++2003-09-12 Alan Modra ++ ++ * src/prep_cif.c (initialize_aggregate): Include tail padding in ++ structure size. ++ * src/powerpc/linux64_closure.S (ffi_closure_LINUX64): Correct ++ placement of float result. ++ * testsuite/libffi.special/unwindtest.cc (closure_test_fn1): Correct ++ cast of "resp" for big-endian 64 bit machines. ++ ++2003-09-11 Alan Modra ++ ++ * src/types.c (double, longdouble): Merge identical SH and ARM ++ typedefs, and add POWERPC64. ++ * src/powerpc/ffi.c (ffi_prep_args64): Correct next_arg calc for ++ struct split over gpr and rest. ++ (ffi_prep_cif_machdep): Correct intarg_count for structures. ++ * src/powerpc/linux64.S (ffi_call_LINUX64): Fix gpr offsets. ++ ++2003-09-09 Andreas Tobler ++ ++ * src/powerpc/ffi.c (ffi_closure_helper_SYSV) Handle struct ++ passing correctly. ++ ++2003-09-09 Alan Modra ++ ++ * configure: Regenerate. ++ ++2003-09-04 Andreas Tobler ++ ++ * Makefile.am: Remove build rules for ffitest. ++ * Makefile.in: Rebuilt. ++ ++2003-09-04 Andreas Tobler ++ ++ * src/java_raw_api.c: Include to fix compiler warning ++ about implicit declaration of abort(). ++ ++2003-09-04 Andreas Tobler ++ ++ * Makefile.am: Add dejagnu test framework. Fixes PR other/11411. ++ * Makefile.in: Rebuilt. ++ * configure.in: Add dejagnu test framework. ++ * configure: Rebuilt. ++ ++ * testsuite/Makefile.am: New file. ++ * testsuite/Makefile.in: Built ++ * testsuite/lib/libffi-dg.exp: New file. ++ * testsuite/config/default.exp: Likewise. ++ * testsuite/libffi.call/call.exp: Likewise. ++ * testsuite/libffi.call/ffitest.h: Likewise. ++ * testsuite/libffi.call/closure_fn0.c: Likewise. ++ * testsuite/libffi.call/closure_fn1.c: Likewise. ++ * testsuite/libffi.call/closure_fn2.c: Likewise. ++ * testsuite/libffi.call/closure_fn3.c: Likewise. ++ * testsuite/libffi.call/cls_1_1byte.c: Likewise. ++ * testsuite/libffi.call/cls_3_1byte.c: Likewise. ++ * testsuite/libffi.call/cls_4_1byte.c: Likewise. ++ * testsuite/libffi.call/cls_2byte.c: Likewise. ++ * testsuite/libffi.call/cls_3byte1.c: Likewise. ++ * testsuite/libffi.call/cls_3byte2.c: Likewise. ++ * testsuite/libffi.call/cls_4byte.c: Likewise. ++ * testsuite/libffi.call/cls_5byte.c: Likewise. ++ * testsuite/libffi.call/cls_6byte.c: Likewise. ++ * testsuite/libffi.call/cls_7byte.c: Likewise. ++ * testsuite/libffi.call/cls_8byte.c: Likewise. ++ * testsuite/libffi.call/cls_12byte.c: Likewise. ++ * testsuite/libffi.call/cls_16byte.c: Likewise. ++ * testsuite/libffi.call/cls_20byte.c: Likewise. ++ * testsuite/libffi.call/cls_24byte.c: Likewise. ++ * testsuite/libffi.call/cls_double.c: Likewise. ++ * testsuite/libffi.call/cls_float.c: Likewise. ++ * testsuite/libffi.call/cls_uchar.c: Likewise. ++ * testsuite/libffi.call/cls_uint.c: Likewise. ++ * testsuite/libffi.call/cls_ulonglong.c: Likewise. ++ * testsuite/libffi.call/cls_ushort.c: Likewise. ++ * testsuite/libffi.call/float.c: Likewise. ++ * testsuite/libffi.call/float1.c: Likewise. ++ * testsuite/libffi.call/float2.c: Likewise. ++ * testsuite/libffi.call/many.c: Likewise. ++ * testsuite/libffi.call/many_win32.c: Likewise. ++ * testsuite/libffi.call/nested_struct.c: Likewise. ++ * testsuite/libffi.call/nested_struct1.c: Likewise. ++ * testsuite/libffi.call/pyobjc-tc.c: Likewise. ++ * testsuite/libffi.call/problem1.c: Likewise. ++ * testsuite/libffi.call/promotion.c: Likewise. ++ * testsuite/libffi.call/return_ll.c: Likewise. ++ * testsuite/libffi.call/return_sc.c: Likewise. ++ * testsuite/libffi.call/return_uc.c: Likewise. ++ * testsuite/libffi.call/strlen.c: Likewise. ++ * testsuite/libffi.call/strlen_win32.c: Likewise. ++ * testsuite/libffi.call/struct1.c: Likewise. ++ * testsuite/libffi.call/struct2.c: Likewise. ++ * testsuite/libffi.call/struct3.c: Likewise. ++ * testsuite/libffi.call/struct4.c: Likewise. ++ * testsuite/libffi.call/struct5.c: Likewise. ++ * testsuite/libffi.call/struct6.c: Likewise. ++ * testsuite/libffi.call/struct7.c: Likewise. ++ * testsuite/libffi.call/struct8.c: Likewise. ++ * testsuite/libffi.call/struct9.c: Likewise. ++ * testsuite/libffi.special/special.exp: New file. ++ * testsuite/libffi.special/ffitestcxx.h: Likewise. ++ * testsuite/libffi.special/unwindtest.cc: Likewise. ++ ++ ++2003-08-13 Kaz Kojima ++ ++ * src/sh/ffi.c (OFS_INT16): Set 0 for little endian case. Update ++ copyright years. ++ ++2003-08-02 Alan Modra ++ ++ * src/powerpc/ffi.c (ffi_prep_args64): Modify for changed gcc ++ structure passing. ++ (ffi_closure_helper_LINUX64): Likewise. ++ * src/powerpc/linux64.S: Remove code writing to parm save area. ++ * src/powerpc/linux64_closure.S (ffi_closure_LINUX64): Use return ++ address in lr from ffi_closure_helper_LINUX64 call to calculate ++ table address. Optimize function tail. ++ ++2003-07-28 Andreas Tobler ++ ++ * src/sparc/ffi.c: Handle all floating point registers. ++ * src/sparc/v9.S: Likewise. Fixes second part of PR target/11410. ++ ++2003-07-11 Gerald Pfeifer ++ ++ * README: Note that libffi is not part of GCC. Update the project ++ URL and status. ++ ++2003-06-19 Franz Sirl ++ ++ * src/powerpc/ppc_closure.S: Include ffi.h. ++ ++2003-06-13 Rainer Orth ++ ++ * src/x86/sysv.S: Avoid gas-only .uleb128/.sleb128 directives. ++ Use C style comments. ++ ++2003-06-13 Kaz Kojima ++ ++ * Makefile.am: Add SHmedia support. Fix a typo of SH support. ++ * Makefile.in: Regenerate. ++ * configure.in (sh64-*-linux*, sh5*-*-linux*): Add target. ++ * configure: Regenerate. ++ * include/ffi.h.in: Add SHmedia support. ++ * src/sh64/ffi.c: New file. ++ * src/sh64/sysv.S: New file. ++ ++2003-05-16 Jakub Jelinek ++ ++ * configure.in (HAVE_RO_EH_FRAME): Check whether .eh_frame section ++ should be read-only. ++ * configure: Rebuilt. ++ * fficonfig.h.in: Rebuilt. ++ * include/ffi.h.in (EH_FRAME_FLAGS): Define. ++ * src/alpha/osf.S: Use EH_FRAME_FLAGS. ++ * src/powerpc/linux64.S: Likewise. ++ * src/powerpc/linux64_closure.S: Likewise. Include ffi.h. ++ * src/powerpc/sysv.S: Use EH_FRAME_FLAGS. Use pcrel encoding ++ if -fpic/-fPIC/-mrelocatable. ++ * src/powerpc/powerpc_closure.S: Likewise. ++ * src/sparc/v8.S: If HAVE_RO_EH_FRAME is defined, don't include ++ #write in .eh_frame flags. ++ * src/sparc/v9.S: Likewise. ++ * src/x86/unix64.S: Use EH_FRAME_FLAGS. ++ * src/x86/sysv.S: Likewise. Use pcrel encoding if -fpic/-fPIC. ++ * src/s390/sysv.S: Use EH_FRAME_FLAGS. Include ffi.h. ++ ++2003-05-07 Jeff Sturm ++ ++ Fixes PR bootstrap/10656 ++ * configure.in (HAVE_AS_REGISTER_PSEUDO_OP): Test assembler ++ support for .register pseudo-op. ++ * src/sparc/v8.S: Use it. ++ * fficonfig.h.in: Rebuilt. ++ * configure: Rebuilt. ++ ++2003-04-18 Jakub Jelinek ++ ++ * include/ffi.h.in (POWERPC64): Define if 64-bit. ++ (enum ffi_abi): Add FFI_LINUX64 on POWERPC. ++ Make it the default on POWERPC64. ++ (FFI_TRAMPOLINE_SIZE): Define to 24 on POWERPC64. ++ * configure.in: Change powerpc-*-linux* into powerpc*-*-linux*. ++ * configure: Rebuilt. ++ * src/powerpc/ffi.c (hidden): Define. ++ (ffi_prep_args_SYSV): Renamed from ++ ffi_prep_args. Cast pointers to unsigned long to shut up warnings. ++ (NUM_GPR_ARG_REGISTERS64, NUM_FPR_ARG_REGISTERS64, ++ ASM_NEEDS_REGISTERS64): New. ++ (ffi_prep_args64): New function. ++ (ffi_prep_cif_machdep): Handle FFI_LINUX64 ABI. ++ (ffi_call): Likewise. ++ (ffi_prep_closure): Likewise. ++ (flush_icache): Surround by #ifndef POWERPC64. ++ (ffi_dblfl): New union type. ++ (ffi_closure_helper_SYSV): Use it to avoid aliasing problems. ++ (ffi_closure_helper_LINUX64): New function. ++ * src/powerpc/ppc_closure.S: Surround whole file by #ifndef ++ __powerpc64__. ++ * src/powerpc/sysv.S: Likewise. ++ (ffi_call_SYSV): Rename ffi_prep_args to ffi_prep_args_SYSV. ++ * src/powerpc/linux64.S: New file. ++ * src/powerpc/linux64_closure.S: New file. ++ * Makefile.am (EXTRA_DIST): Add src/powerpc/linux64.S and ++ src/powerpc/linux64_closure.S. ++ (TARGET_SRC_POWERPC): Likewise. ++ ++ * src/ffitest.c (closure_test_fn, closure_test_fn1, closure_test_fn2, ++ closure_test_fn3): Fix result printing on big-endian 64-bit ++ machines. ++ (main): Print tst2_arg instead of uninitialized tst2_result. ++ ++ * src/ffitest.c (main): Hide what closure pointer really points to ++ from the compiler. ++ ++2003-04-16 Richard Earnshaw ++ ++ * configure.in (arm-*-netbsdelf*): Add configuration. ++ (configure): Regenerated. ++ ++2003-04-04 Loren J. Rittle ++ ++ * include/Makefile.in: Regenerate. ++ ++2003-03-21 Zdenek Dvorak ++ ++ * libffi/include/ffi.h.in: Define X86 instead of X86_64 in 32 ++ bit mode. ++ * libffi/src/x86/ffi.c (ffi_closure_SYSV, ffi_closure_raw_SYSV): ++ Receive closure pointer through parameter, read args using ++ __builtin_dwarf_cfa. ++ (FFI_INIT_TRAMPOLINE): Send closure reference through eax. ++ ++2003-03-12 Andreas Schwab ++ ++ * configure.in: Avoid trailing /. in toolexeclibdir. ++ * configure: Rebuilt. ++ ++2003-03-03 Andreas Tobler ++ ++ * src/powerpc/darwin_closure.S: Recode to fit dynamic libraries. ++ ++2003-02-06 Andreas Tobler ++ ++ * libffi/src/powerpc/darwin_closure.S: ++ Fix alignement bug, allocate 8 bytes for the result. ++ * libffi/src/powerpc/aix_closure.S: ++ Likewise. ++ * libffi/src/powerpc/ffi_darwin.c: ++ Update stackframe description for aix/darwin_closure.S. ++ ++2003-02-06 Jakub Jelinek ++ ++ * src/s390/ffi.c (ffi_closure_helper_SYSV): Add hidden visibility ++ attribute. ++ ++2003-01-31 Christian Cornelssen , ++ Andreas Schwab ++ ++ * configure.in: Adjust command to source config-ml.in to account ++ for changes to the libffi_basedir definition. ++ (libffi_basedir): Remove ${srcdir} from value and include trailing ++ slash if nonempty. ++ ++ * configure: Regenerate. ++ ++2003-01-29 Franz Sirl ++ ++ * src/powerpc/ppc_closure.S: Recode to fit shared libs. ++ ++2003-01-28 Andrew Haley ++ ++ * include/ffi.h.in: Enable FFI_CLOSURES for x86_64. ++ * src/x86/ffi64.c (ffi_prep_closure): New. ++ (ffi_closure_UNIX64_inner): New. ++ * src/x86/unix64.S (ffi_closure_UNIX64): New. ++ ++2003-01-27 Alexandre Oliva ++ ++ * configure.in (toolexecdir, toolexeclibdir): Set and AC_SUBST. ++ Remove USE_LIBDIR conditional. ++ * Makefile.am (toolexecdir, toolexeclibdir): Don't override. ++ * Makefile.in, configure: Rebuilt. ++ ++2003-01027 David Edelsohn ++ ++ * Makefile.am (TARGET_SRC_POWERPC_AIX): Fix typo. ++ * Makefile.in: Regenerate. ++ ++2003-01-22 Andrew Haley ++ ++ * src/powerpc/darwin.S (_ffi_call_AIX): Add Augmentation size to ++ unwind info. ++ ++2003-01-21 Andreas Tobler ++ ++ * src/powerpc/darwin.S: Add unwind info. ++ * src/powerpc/darwin_closure.S: Likewise. ++ ++2003-01-14 Andrew Haley ++ ++ * src/x86/ffi64.c (ffi_prep_args): Check for void retval. ++ (ffi_prep_cif_machdep): Likewise. ++ * src/x86/unix64.S: Add unwind info. ++ ++2003-01-14 Andreas Jaeger ++ ++ * src/ffitest.c (main): Only use ffi_closures if those are ++ supported. ++ ++2003-01-13 Andreas Tobler ++ ++ * libffi/src/ffitest.c ++ add closure testcases ++ ++2003-01-13 Kevin B. Hendricks ++ ++ * libffi/src/powerpc/ffi.c ++ fix alignment bug for float (4 byte aligned iso 8 byte) ++ ++2003-01-09 Geoffrey Keating ++ ++ * src/powerpc/ffi_darwin.c: Remove RCS version string. ++ * src/powerpc/darwin.S: Remove RCS version string. ++ ++2003-01-03 Jeff Sturm ++ ++ * include/ffi.h.in: Add closure defines for SPARC, SPARC64. ++ * src/ffitest.c (main): Use static storage for closure. ++ * src/sparc/ffi.c (ffi_prep_closure, ffi_closure_sparc_inner): New. ++ * src/sparc/v8.S (ffi_closure_v8): New. ++ * src/sparc/v9.S (ffi_closure_v9): New. ++ ++2002-11-10 Ranjit Mathew ++ ++ * include/ffi.h.in: Added FFI_STDCALL ffi_type ++ enumeration for X86_WIN32. ++ * src/x86/win32.S: Added ffi_call_STDCALL function ++ definition. ++ * src/x86/ffi.c (ffi_call/ffi_raw_call): Added ++ switch cases for recognising FFI_STDCALL and ++ calling ffi_call_STDCALL if target is X86_WIN32. ++ * src/ffitest.c (my_stdcall_strlen/stdcall_many): ++ stdcall versions of the "my_strlen" and "many" ++ test functions (for X86_WIN32). ++ Added test cases to test stdcall invocation using ++ these functions. ++ ++2002-12-02 Kaz Kojima ++ ++ * src/sh/sysv.S: Add DWARF2 unwind info. ++ ++2002-11-27 Ulrich Weigand ++ ++ * src/s390/sysv.S (.eh_frame section): Make section read-only. ++ ++2002-11-26 Jim Wilson ++ ++ * src/types.c (FFI_TYPE_POINTER): Has size 8 on IA64. ++ ++2002-11-23 H.J. Lu ++ ++ * acinclude.m4: Add dummy AM_PROG_LIBTOOL. ++ Include ../config/accross.m4. ++ * aclocal.m4; Rebuild. ++ * configure: Likewise. ++ ++2002-11-15 Ulrich Weigand ++ ++ * src/s390/sysv.S (.eh_frame section): Adapt to pcrel FDE encoding. ++ ++2002-11-11 DJ Delorie ++ ++ * configure.in: Look for common files in the right place. ++ ++2002-10-08 Ulrich Weigand ++ ++ * src/java_raw_api.c (ffi_java_raw_to_ptrarray): Interpret ++ raw data as _Jv_word values, not ffi_raw. ++ (ffi_java_ptrarray_to_raw): Likewise. ++ (ffi_java_rvalue_to_raw): New function. ++ (ffi_java_raw_call): Call it. ++ (ffi_java_raw_to_rvalue): New function. ++ (ffi_java_translate_args): Call it. ++ * src/ffitest.c (closure_test_fn): Interpret return value ++ as ffi_arg, not int. ++ * src/s390/ffi.c (ffi_prep_cif_machdep): Add missing ++ FFI_TYPE_POINTER case. ++ (ffi_closure_helper_SYSV): Likewise. Also, assume return ++ values extended to word size. ++ ++2002-10-02 Andreas Jaeger ++ ++ * src/x86/ffi64.c (ffi_prep_cif_machdep): Remove debug output. ++ ++2002-10-01 Bo Thorsen ++ ++ * include/ffi.h.in: Fix i386 win32 compilation. ++ ++2002-09-30 Ulrich Weigand ++ ++ * configure.in: Add s390x-*-linux-* target. ++ * configure: Regenerate. ++ * include/ffi.h.in: Define S390X for s390x targets. ++ (FFI_CLOSURES): Define for s390/s390x. ++ (FFI_TRAMPOLINE_SIZE): Likewise. ++ (FFI_NATIVE_RAW_API): Likewise. ++ * src/prep_cif.c (ffi_prep_cif): Do not compute stack space for s390. ++ * src/types.c (FFI_TYPE_POINTER): Use 8-byte pointers on s390x. ++ * src/s390/ffi.c: Major rework of existing code. Add support for ++ s390x targets. Add closure support. ++ * src/s390/sysv.S: Likewise. ++ ++2002-09-29 Richard Earnshaw ++ ++ * src/arm/sysv.S: Fix typo. ++ ++2002-09-28 Richard Earnshaw ++ ++ * src/arm/sysv.S: If we don't have machine/asm.h and the pre-processor ++ has defined __USER_LABEL_PREFIX__, then use it in CNAME. ++ (ffi_call_SYSV): Handle soft-float. ++ ++2002-09-27 Bo Thorsen ++ ++ * include/ffi.h.in: Fix multilib x86-64 support. ++ ++2002-09-22 Kaveh R. Ghazi ++ ++ * Makefile.am (all-multi): Fix multilib parallel build. ++ ++2002-07-19 Kaz Kojima ++ ++ * configure.in (sh[34]*-*-linux*): Add brackets. ++ * configure: Regenerate. ++ ++2002-07-18 Kaz Kojima ++ ++ * Makefile.am: Add SH support. ++ * Makefile.in: Regenerate. ++ * configure.in (sh-*-linux*, sh[34]*-*-linux*): Add target. ++ * configure: Regenerate. ++ * include/ffi.h.in: Add SH support. ++ * src/sh/ffi.c: New file. ++ * src/sh/sysv.S: New file. ++ * src/types.c: Add SH support. ++ ++2002-07-16 Bo Thorsen ++ ++ * src/x86/ffi64.c: New file that adds x86-64 support. ++ * src/x86/unix64.S: New file that handles argument setup for ++ x86-64. ++ * src/x86/sysv.S: Don't use this on x86-64. ++ * src/x86/ffi.c: Don't use this on x86-64. ++ Remove unused vars. ++ * src/prep_cif.c (ffi_prep_cif): Don't do stack size calculation ++ for x86-64. ++ * src/ffitest.c (struct6): New test that tests a special case in ++ the x86-64 ABI. ++ (struct7): Likewise. ++ (struct8): Likewise. ++ (struct9): Likewise. ++ (closure_test_fn): Silence warning about this when it's not used. ++ (main): Add the new tests. ++ (main): Fix a couple of wrong casts and silence some compiler warnings. ++ * include/ffi.h.in: Add x86-64 ABI definition. ++ * fficonfig.h.in: Regenerate. ++ * Makefile.am: Add x86-64 support. ++ * configure.in: Likewise. ++ * Makefile.in: Regenerate. ++ * configure: Likewise. ++ ++2002-06-24 Bo Thorsen ++ ++ * src/types.c: Merge settings for similar architectures. ++ Add x86-64 sizes and alignments. ++ ++2002-06-23 Bo Thorsen ++ ++ * src/arm/ffi.c (ffi_prep_args): Remove unused vars. ++ * src/sparc/ffi.c (ffi_prep_args_v8): Likewise. ++ * src/mips/ffi.c (ffi_prep_args): Likewise. ++ * src/m68k/ffi.c (ffi_prep_args): Likewise. ++ ++2002-07-18 H.J. Lu (hjl@gnu.org) ++ ++ * Makefile.am (TARGET_SRC_MIPS_LINUX): New. ++ (libffi_la_SOURCES): Support MIPS_LINUX. ++ (libffi_convenience_la_SOURCES): Likewise. ++ * Makefile.in: Regenerated. ++ ++ * configure.in (mips64*-*): Skip. ++ (mips*-*-linux*): New. ++ * configure: Regenerated. ++ ++ * src/mips/ffi.c: Include . ++ ++2002-06-06 Ulrich Weigand ++ ++ * src/s390/sysv.S: Save/restore %r6. Add DWARF-2 unwind info. ++ ++2002-05-27 Roger Sayle ++ ++ * src/x86/ffi.c (ffi_prep_args): Remove reference to avn. ++ ++2002-05-27 Bo Thorsen ++ ++ * src/x86/ffi.c (ffi_prep_args): Remove unused variable and ++ fix formatting. ++ ++2002-05-13 Andreas Tobler ++ ++ * src/powerpc/ffi_darwin.c (ffi_prep_closure): Declare fd at ++ beginning of function (for older apple cc). ++ ++2002-05-08 Alexandre Oliva ++ ++ * configure.in (ORIGINAL_LD_FOR_MULTILIBS): Preserve LD at ++ script entry, and set LD to it when configuring multilibs. ++ * configure: Rebuilt. ++ ++2002-05-05 Jason Thorpe ++ ++ * configure.in (sparc64-*-netbsd*): Add target. ++ (sparc-*-netbsdelf*): Likewise. ++ * configure: Regenerate. ++ ++2002-04-28 David S. Miller ++ ++ * configure.in, configure: Fix SPARC test in previous change. ++ ++2002-04-29 Gerhard Tonn ++ ++ * Makefile.am: Add Linux for S/390 support. ++ * Makefile.in: Regenerate. ++ * configure.in: Add Linux for S/390 support. ++ * configure: Regenerate. ++ * include/ffi.h.in: Add Linux for S/390 support. ++ * src/s390/ffi.c: New file from libffi CVS tree. ++ * src/s390/sysv.S: New file from libffi CVS tree. ++ ++2002-04-28 Jakub Jelinek ++ ++ * configure.in (HAVE_AS_SPARC_UA_PCREL): Check for working ++ %r_disp32(). ++ * src/sparc/v8.S: Use it. ++ * src/sparc/v9.S: Likewise. ++ * fficonfig.h.in: Rebuilt. ++ * configure: Rebuilt. ++ ++2002-04-08 Hans Boehm ++ ++ * src/java_raw_api.c (ffi_java_raw_size): Handle FFI_TYPE_DOUBLE ++ correctly. ++ * src/ia64/unix.S: Add unwind information. Fix comments. ++ Save sp in a way that's compatible with unwind info. ++ (ffi_call_unix): Correctly restore sp in all cases. ++ * src/ia64/ffi.c: Add, fix comments. ++ ++2002-04-08 Jakub Jelinek ++ ++ * src/sparc/v8.S: Make .eh_frame dependent on target word size. ++ ++2002-04-06 Jason Thorpe ++ ++ * configure.in (alpha*-*-netbsd*): Add target. ++ * configure: Regenerate. ++ ++2002-04-04 Jeff Sturm ++ ++ * src/sparc/v8.S: Add unwind info. ++ * src/sparc/v9.S: Likewise. ++ ++2002-03-30 Krister Walfridsson ++ ++ * configure.in: Enable i*86-*-netbsdelf*. ++ * configure: Rebuilt. ++ ++2002-03-29 David Billinghurst ++ ++ PR other/2620 ++ * src/mips/n32.s: Delete ++ * src/mips/o32.s: Delete ++ ++2002-03-21 Loren J. Rittle ++ ++ * configure.in: Enable alpha*-*-freebsd*. ++ * configure: Rebuilt. ++ ++2002-03-17 Bryce McKinlay ++ ++ * Makefile.am: libfficonvenience -> libffi_convenience. ++ * Makefile.in: Rebuilt. ++ ++ * Makefile.am: Define ffitest_OBJECTS. ++ * Makefile.in: Rebuilt. ++ ++2002-03-07 Andreas Tobler ++ David Edelsohn ++ ++ * Makefile.am (EXTRA_DIST): Add Darwin and AIX closure files. ++ (TARGET_SRC_POWERPC_AIX): Add aix_closure.S. ++ (TARGET_SRC_POWERPC_DARWIN): Add darwin_closure.S. ++ * Makefile.in: Regenerate. ++ * include/ffi.h.in: Add AIX and Darwin closure definitions. ++ * src/powerpc/ffi_darwin.c (ffi_prep_closure): New function. ++ (flush_icache, flush_range): New functions. ++ (ffi_closure_helper_DARWIN): New function. ++ * src/powerpc/aix_closure.S: New file. ++ * src/powerpc/darwin_closure.S: New file. ++ ++2002-02-24 Jeff Sturm ++ ++ * include/ffi.h.in: Add typedef for ffi_arg. ++ * src/ffitest.c (main): Declare rint with ffi_arg. ++ ++2002-02-21 Andreas Tobler ++ ++ * src/powerpc/ffi_darwin.c (ffi_prep_args): Skip appropriate ++ number of GPRs for floating-point arguments. ++ ++2002-01-31 Anthony Green ++ ++ * configure: Rebuilt. ++ * configure.in: Replace CHECK_SIZEOF and endian tests with ++ cross-compiler friendly macros. ++ * aclocal.m4 (AC_COMPILE_CHECK_SIZEOF, AC_C_BIGENDIAN_CROSS): New ++ macros. ++ ++2002-01-18 David Edelsohn ++ ++ * src/powerpc/darwin.S (_ffi_call_AIX): New. ++ * src/powerpc/aix.S (ffi_call_DARWIN): New. ++ ++2002-01-17 David Edelsohn ++ ++ * Makefile.am (EXTRA_DIST): Add Darwin and AIX files. ++ (TARGET_SRC_POWERPC_AIX): New. ++ (POWERPC_AIX): New stanza. ++ * Makefile.in: Regenerate. ++ * configure.in: Add AIX case. ++ * configure: Regenerate. ++ * include/ffi.h.in (ffi_abi): Add FFI_AIX. ++ * src/powerpc/ffi_darwin.c (ffi_status): Use "long" to scale frame ++ size. Fix "long double" support. ++ (ffi_call): Add FFI_AIX case. ++ * src/powerpc/aix.S: New. ++ ++2001-10-09 John Hornkvist ++ ++ Implement Darwin PowerPC ABI. ++ * configure.in: Handle powerpc-*-darwin*. ++ * Makefile.am: Set source files for POWERPC_DARWIN. ++ * configure: Rebuilt. ++ * Makefile.in: Rebuilt. ++ * include/ffi.h.in: Define FFI_DARWIN and FFI_DEFAULT_ABI for ++ POWERPC_DARWIN. ++ * src/powerpc/darwin.S: New file. ++ * src/powerpc/ffi_darwin.c: New file. ++ ++2001-10-07 Joseph S. Myers ++ ++ * src/x86/ffi.c: Fix spelling error of "separate" as "seperate". ++ ++2001-07-16 Rainer Orth ++ ++ * src/x86/sysv.S: Avoid gas-only .balign directive. ++ Use C style comments. ++ ++2001-07-16 Rainer Orth ++ ++ * src/alpha/ffi.c (ffi_prep_closure): Avoid gas-only mnemonic. ++ Fixes PR bootstrap/3563. ++ ++2001-06-26 Rainer Orth ++ ++ * src/alpha/osf.S (ffi_closure_osf): Use .rdata for ECOFF. ++ ++2001-06-25 Rainer Orth ++ ++ * configure.in: Recognize sparc*-sun-* host. ++ * configure: Regenerate. ++ ++2001-06-06 Andrew Haley ++ ++ * src/alpha/osf.S (__FRAME_BEGIN__): Conditionalize for ELF. ++ ++2001-06-03 Andrew Haley ++ ++ * src/alpha/osf.S: Add unwind info. ++ * src/powerpc/sysv.S: Add unwind info. ++ * src/powerpc/ppc_closure.S: Likewise. ++ ++2000-05-31 Jeff Sturm ++ ++ * configure.in: Fix AC_ARG_ENABLE usage. ++ * configure: Rebuilt. ++ ++2001-05-06 Bryce McKinlay ++ ++ * configure.in: Remove warning about beta code. ++ * configure: Rebuilt. ++ ++2001-04-25 Hans Boehm ++ ++ * src/ia64/unix.S: Restore stack pointer when returning from ++ ffi_closure_UNIX. ++ * src/ia64/ffi.c: Fix typo in comment. ++ ++2001-04-18 Jim Wilson ++ ++ * src/ia64/unix.S: Delete unnecessary increment and decrement of loc2 ++ to eliminate RAW DV. ++ ++2001-04-12 Bryce McKinlay ++ ++ * Makefile.am: Make a libtool convenience library. ++ * Makefile.in: Rebuilt. ++ ++2001-03-29 Bryce McKinlay ++ ++ * configure.in: Use different syntax for subdirectory creation. ++ * configure: Rebuilt. ++ ++2001-03-27 Jon Beniston ++ ++ * configure.in: Added X86_WIN32 target (Win32, CygWin, MingW). ++ * configure: Rebuilt. ++ * Makefile.am: Added X86_WIN32 target support. ++ * Makefile.in: Rebuilt. ++ ++ * include/ffi.h.in: Added X86_WIN32 target support. ++ ++ * src/ffitest.c: Doesn't run structure tests for X86_WIN32 targets. ++ * src/types.c: Added X86_WIN32 target support. ++ ++ * src/x86/win32.S: New file. Based on sysv.S, but with EH ++ stuff removed and made to work with CygWin's gas. ++ ++2001-03-26 Bryce McKinlay ++ ++ * configure.in: Make target subdirectory in build dir. ++ * Makefile.am: Override suffix based rules to specify correct output ++ subdirectory. ++ * Makefile.in: Rebuilt. ++ * configure: Rebuilt. ++ ++2001-03-23 Kevin B Hendricks ++ ++ * src/powerpc/ppc_closure.S: New file. ++ * src/powerpc/ffi.c (ffi_prep_args): Fixed ABI compatibility bug ++ involving long long and register pairs. ++ (ffi_prep_closure): New function. ++ (flush_icache): Likewise. ++ (ffi_closure_helper_SYSV): Likewise. ++ * include/ffi.h.in (FFI_CLOSURES): Define on PPC. ++ (FFI_TRAMPOLINE_SIZE): Likewise. ++ (FFI_NATIVE_RAW_API): Likewise. ++ * Makefile.in: Rebuilt. ++ * Makefile.am (EXTRA_DIST): Added src/powerpc/ppc_closure.S. ++ (TARGET_SRC_POWERPC): Likewise. ++ ++2001-03-19 Tom Tromey ++ ++ * Makefile.in: Rebuilt. ++ * Makefile.am (ffitest_LDFLAGS): New macro. ++ ++2001-03-02 Nick Clifton ++ ++ * include/ffi.h.in: Remove RCS ident string. ++ * include/ffi_mips.h: Remove RCS ident string. ++ * src/debug.c: Remove RCS ident string. ++ * src/ffitest.c: Remove RCS ident string. ++ * src/prep_cif.c: Remove RCS ident string. ++ * src/types.c: Remove RCS ident string. ++ * src/alpha/ffi.c: Remove RCS ident string. ++ * src/alpha/osf.S: Remove RCS ident string. ++ * src/arm/ffi.c: Remove RCS ident string. ++ * src/arm/sysv.S: Remove RCS ident string. ++ * src/mips/ffi.c: Remove RCS ident string. ++ * src/mips/n32.S: Remove RCS ident string. ++ * src/mips/o32.S: Remove RCS ident string. ++ * src/sparc/ffi.c: Remove RCS ident string. ++ * src/sparc/v8.S: Remove RCS ident string. ++ * src/sparc/v9.S: Remove RCS ident string. ++ * src/x86/ffi.c: Remove RCS ident string. ++ * src/x86/sysv.S: Remove RCS ident string. ++ ++2001-02-08 Joseph S. Myers ++ ++ * include/ffi.h.in: Change sourceware.cygnus.com references to ++ gcc.gnu.org. ++ ++2000-12-09 Richard Henderson ++ ++ * src/alpha/ffi.c (ffi_call): Simplify struct return test. ++ (ffi_closure_osf_inner): Index rather than increment avalue ++ and arg_types. Give ffi_closure_osf the raw return value type. ++ * src/alpha/osf.S (ffi_closure_osf): Handle return value type ++ promotion. ++ ++2000-12-07 Richard Henderson ++ ++ * src/raw_api.c (ffi_translate_args): Fix typo. ++ (ffi_prep_closure): Likewise. ++ ++ * include/ffi.h.in [ALPHA]: Define FFI_CLOSURES and ++ FFI_TRAMPOLINE_SIZE. ++ * src/alpha/ffi.c (ffi_prep_cif_machdep): Adjust minimal ++ cif->bytes for new ffi_call_osf implementation. ++ (ffi_prep_args): Absorb into ... ++ (ffi_call): ... here. Do all stack allocation here and ++ avoid a callback function. ++ (ffi_prep_closure, ffi_closure_osf_inner): New. ++ * src/alpha/osf.S (ffi_call_osf): Reimplement with no callback. ++ (ffi_closure_osf): New. ++ ++2000-09-10 Alexandre Oliva ++ ++ * config.guess, config.sub, install-sh: Removed. ++ * ltconfig, ltmain.sh, missing, mkinstalldirs: Likewise. ++ * Makefile.in: Rebuilt. ++ ++ * acinclude.m4: Include libtool macros from the top level. ++ * aclocal.m4, configure: Rebuilt. ++ ++2000-08-22 Alexandre Oliva ++ ++ * configure.in [i*86-*-freebsd*] (TARGET, TARGETDIR): Set. ++ * configure: Rebuilt. ++ ++2000-05-11 Scott Bambrough ++ ++ * libffi/src/arm/sysv.S (ffi_call_SYSV): Doubles are not saved to ++ memory correctly. Use conditional instructions, not branches where ++ possible. ++ ++2000-05-04 Tom Tromey ++ ++ * configure: Rebuilt. ++ * configure.in: Match `arm*-*-linux-*'. ++ From Chris Dornan . ++ ++2000-04-28 Jakub Jelinek ++ ++ * Makefile.am (SUBDIRS): Define. ++ (AM_MAKEFLAGS): Likewise. ++ (Multilib support.): Add section. ++ * Makefile.in: Rebuilt. ++ * ltconfig (extra_compiler_flags, extra_compiler_flags_value): ++ New variables. Set for gcc using -print-multi-lib. Export them ++ to libtool. ++ (sparc64-*-linux-gnu*): Use libsuff 64 for search paths. ++ * ltmain.sh (B|b|V): Don't throw away gcc's -B, -b and -V options ++ for -shared links. ++ (extra_compiler_flags_value, extra_compiler_flags): Check these ++ for extra compiler options which need to be passed down in ++ compiler_flags. ++ ++2000-04-16 Anthony Green ++ ++ * configure: Rebuilt. ++ * configure.in: Change i*86-pc-linux* to i*86-*-linux*. ++ ++2000-04-14 Jakub Jelinek ++ ++ * include/ffi.h.in (SPARC64): Define for 64bit SPARC builds. ++ Set SPARC FFI_DEFAULT_ABI based on SPARC64 define. ++ * src/sparc/ffi.c (ffi_prep_args_v8): Renamed from ffi_prep_args. ++ Replace all void * sizeofs with sizeof(int). ++ Only compare type with FFI_TYPE_LONGDOUBLE if LONGDOUBLE is ++ different than DOUBLE. ++ Remove FFI_TYPE_SINT32 and FFI_TYPE_UINT32 cases (handled elsewhere). ++ (ffi_prep_args_v9): New function. ++ (ffi_prep_cif_machdep): Handle V9 ABI and long long on V8. ++ (ffi_V9_return_struct): New function. ++ (ffi_call): Handle FFI_V9 ABI from 64bit code and FFI_V8 ABI from ++ 32bit code (not yet cross-arch calls). ++ * src/sparc/v8.S: Add struct return delay nop. ++ Handle long long. ++ * src/sparc/v9.S: New file. ++ * src/prep_cif.c (ffi_prep_cif): Return structure pointer ++ is used on sparc64 only for structures larger than 32 bytes. ++ Pass by reference for structures is done for structure arguments ++ larger than 16 bytes. ++ * src/ffitest.c (main): Use 64bit rint on sparc64. ++ Run long long tests on sparc. ++ * src/types.c (FFI_TYPE_POINTER): Pointer is 64bit on alpha and ++ sparc64. ++ (FFI_TYPE_LONGDOUBLE): long double is 128 bit aligned to 128 bits ++ on sparc64. ++ * configure.in (sparc-*-linux*): New supported target. ++ (sparc64-*-linux*): Likewise. ++ * configure: Rebuilt. ++ * Makefile.am: Add v9.S to SPARC files. ++ * Makefile.in: Likewise. ++ (LINK): Surround $(CCLD) into double quotes, so that multilib ++ compiles work correctly. ++ ++2000-04-04 Alexandre Petit-Bianco ++ ++ * configure: Rebuilt. ++ * configure.in: (i*86-*-solaris*): New libffi target. Patch ++ proposed by Bryce McKinlay. ++ ++2000-03-20 Tom Tromey ++ ++ * Makefile.in: Hand edit for java_raw_api.lo. ++ ++2000-03-08 Bryce McKinlay ++ ++ * config.guess, config.sub: Update from the gcc tree. ++ Fix for PR libgcj/168. ++ ++2000-03-03 Tom Tromey ++ ++ * Makefile.in: Fixed ia64 by hand. ++ ++ * configure: Rebuilt. ++ * configure.in (--enable-multilib): New option. ++ (libffi_basedir): New subst. ++ (AC_OUTPUT): Added multilib code. ++ ++2000-03-02 Tom Tromey ++ ++ * Makefile.in: Rebuilt. ++ * Makefile.am (TARGET_SRC_IA64): Use `ia64', not `alpha', as ++ directory name. ++ ++2000-02-25 Hans Boehm ++ ++ * src/ia64/ffi.c, src/ia64/ia64_flags.h, src/ia64/unix.S: New ++ files. ++ * src/raw_api.c (ffi_translate_args): Fixed typo in argument ++ list. ++ (ffi_prep_raw_closure): Use ffi_translate_args, not ++ ffi_closure_translate. ++ * src/java_raw_api.c: New file. ++ * src/ffitest.c (closure_test_fn): New function. ++ (main): Define `rint' as long long on IA64. Added new test when ++ FFI_CLOSURES is defined. ++ * include/ffi.h.in (ALIGN): Use size_t, not unsigned. ++ (ffi_abi): Recognize IA64. ++ (ffi_raw): Added `flt' field. ++ Added "Java raw API" code. ++ * configure.in: Recognize ia64. ++ * Makefile.am (TARGET_SRC_IA64): New macro. ++ (libffi_la_common_SOURCES): Added java_raw_api.c. ++ (libffi_la_SOURCES): Define in IA64 case. ++ ++2000-01-04 Tom Tromey ++ ++ * Makefile.in: Rebuilt with newer automake. ++ ++1999-12-31 Tom Tromey ++ ++ * Makefile.am (INCLUDES): Added -I$(top_srcdir)/src. ++ ++1999-09-01 Tom Tromey ++ ++ * include/ffi.h.in: Removed PACKAGE and VERSION defines and ++ undefs. ++ * fficonfig.h.in: Rebuilt. ++ * configure: Rebuilt. ++ * configure.in: Pass 3rd argument to AM_INIT_AUTOMAKE. ++ Use AM_PROG_LIBTOOL (automake 1.4 compatibility). ++ * acconfig.h: Don't #undef PACKAGE or VERSION. ++ ++1999-08-09 Anthony Green ++ ++ * include/ffi.h.in: Try to work around messy header problem ++ with PACKAGE and VERSION. ++ ++ * configure: Rebuilt. ++ * configure.in: Change version to 2.00-beta. ++ ++ * fficonfig.h.in: Rebuilt. ++ * acconfig.h (FFI_NO_STRUCTS, FFI_NO_RAW_API): Define. ++ ++ * src/x86/ffi.c (ffi_raw_call): Rename. ++ ++1999-08-02 Kresten Krab Thorup ++ ++ * src/x86/ffi.c (ffi_closure_SYSV): New function. ++ (ffi_prep_incoming_args_SYSV): Ditto. ++ (ffi_prep_closure): Ditto. ++ (ffi_closure_raw_SYSV): Ditto. ++ (ffi_prep_raw_closure): More ditto. ++ (ffi_call_raw): Final ditto. ++ ++ * include/ffi.h.in: Add definitions for closure and raw API. ++ ++ * src/x86/ffi.c (ffi_prep_cif_machdep): Added case for ++ FFI_TYPE_UINT64. ++ ++ * Makefile.am (libffi_la_common_SOURCES): Added raw_api.c ++ ++ * src/raw_api.c: New file. ++ ++ * include/ffi.h.in (ffi_raw): New type. ++ (UINT_ARG, SINT_ARG): New defines. ++ (ffi_closure, ffi_raw_closure): New types. ++ (ffi_prep_closure, ffi_prep_raw_closure): New declarations. ++ ++ * configure.in: Add check for endianness and sizeof void*. ++ ++ * src/x86/sysv.S (ffi_call_SYSV): Call fixup routine via argument, ++ instead of directly. ++ ++ * configure: Rebuilt. ++ ++Thu Jul 8 14:28:42 1999 Anthony Green ++ ++ * configure.in: Add x86 and powerpc BeOS configurations. ++ From Makoto Kato . ++ ++1999-05-09 Anthony Green ++ ++ * configure.in: Add warning about this being beta code. ++ Remove src/Makefile.am from the picture. ++ * configure: Rebuilt. ++ ++ * Makefile.am: Move logic from src/Makefile.am. Add changes ++ to support libffi as a target library. ++ * Makefile.in: Rebuilt. ++ ++ * aclocal.m4, config.guess, config.sub, ltconfig, ltmain.sh: ++ Upgraded to new autoconf, automake, libtool. ++ ++ * README: Tweaks. ++ ++ * LICENSE: Update copyright date. ++ ++ * src/Makefile.am, src/Makefile.in: Removed. ++ ++1998-11-29 Anthony Green ++ ++ * include/ChangeLog: Removed. ++ * src/ChangeLog: Removed. ++ * src/mips/ChangeLog: Removed. ++ * src/sparc/ChangeLog: Remboved. ++ * src/x86/ChangeLog: Removed. ++ ++ * ChangeLog.v1: Created. +diff -r c0e311e010fc Modules/_ctypes/libffi/ChangeLog.v1 +--- a/Modules/_ctypes/libffi/ChangeLog.v1 ++++ b/Modules/_ctypes/libffi/ChangeLog.v1 +@@ -2,7 +2,7 @@ + + Version 1 of libffi had per-directory ChangeLogs. Current and future + versions have a single ChangeLog file in the root directory. The +-version 1 ChangeLogs have all been concatonated into this file for ++version 1 ChangeLogs have all been concatenated into this file for + future reference only. + + --- libffi ---------------------------------------------------------------- +diff -r c0e311e010fc Modules/_ctypes/libffi/LICENSE +--- a/Modules/_ctypes/libffi/LICENSE ++++ b/Modules/_ctypes/libffi/LICENSE +@@ -1,4 +1,4 @@ +-libffi - Copyright (c) 1996-2012 Anthony Green, Red Hat, Inc and others. ++libffi - Copyright (c) 1996-2014 Anthony Green, Red Hat, Inc and others. + See source files for details. + + Permission is hereby granted, free of charge, to any person obtaining +diff -r c0e311e010fc Modules/_ctypes/libffi/Makefile.am +--- a/Modules/_ctypes/libffi/Makefile.am ++++ b/Modules/_ctypes/libffi/Makefile.am +@@ -6,10 +6,11 @@ + + SUBDIRS = include testsuite man + +-EXTRA_DIST = LICENSE ChangeLog.v1 ChangeLog.libgcj configure.host \ ++EXTRA_DIST = LICENSE ChangeLog.v1 ChangeLog.libgcj \ + src/aarch64/ffi.c src/aarch64/ffitarget.h src/aarch64/sysv.S \ +- build-ios.sh src/alpha/ffi.c src/alpha/osf.S \ +- src/alpha/ffitarget.h src/arm/ffi.c src/arm/sysv.S \ ++ src/alpha/ffi.c src/alpha/osf.S \ ++ src/alpha/ffitarget.h src/arc/ffi.c src/arc/arcompact.S \ ++ src/arc/ffitarget.h src/arm/ffi.c src/arm/sysv.S \ + src/arm/ffitarget.h src/avr32/ffi.c src/avr32/sysv.S \ + src/avr32/ffitarget.h src/cris/ffi.c src/cris/sysv.S \ + src/cris/ffitarget.h src/ia64/ffi.c src/ia64/ffitarget.h \ +@@ -19,8 +20,12 @@ + src/moxie/ffitarget.h src/moxie/eabi.S src/mips/ffitarget.h \ + src/m32r/ffi.c src/m32r/sysv.S src/m32r/ffitarget.h \ + src/m68k/ffi.c src/m68k/sysv.S src/m68k/ffitarget.h \ ++ src/m88k/ffi.c src/m88k/obsd.S src/m88k/ffitarget.h \ + src/microblaze/ffi.c src/microblaze/sysv.S \ +- src/microblaze/ffitarget.h src/powerpc/ffi.c \ ++ src/microblaze/ffitarget.h \ ++ src/nios2/ffi.c src/nios2/ffitarget.h src/nios2/sysv.S \ ++ src/powerpc/ffi.c src/powerpc/ffi_powerpc.h \ ++ src/powerpc/ffi_sysv.c src/powerpc/ffi_linux64.c \ + src/powerpc/sysv.S src/powerpc/linux64.S \ + src/powerpc/linux64_closure.S src/powerpc/ppc_closure.S \ + src/powerpc/asm.h src/powerpc/aix.S src/powerpc/darwin.S \ +@@ -38,14 +43,14 @@ + src/bfin/ffitarget.h src/bfin/sysv.S src/frv/eabi.S \ + src/frv/ffitarget.h src/dlmalloc.c src/tile/ffi.c \ + src/tile/ffitarget.h src/tile/tile.S libtool-version \ ++ src/vax/ffi.c src/vax/ffitarget.h src/vax/elfbsd.S \ + src/xtensa/ffitarget.h src/xtensa/ffi.c src/xtensa/sysv.S \ + ChangeLog.libffi m4/libtool.m4 m4/lt~obsolete.m4 \ + m4/ltoptions.m4 m4/ltsugar.m4 m4/ltversion.m4 \ + m4/ltversion.m4 src/arm/gentramp.sh src/debug.c msvcc.sh \ +- generate-ios-source-and-headers.py \ +- generate-osx-source-and-headers.py \ ++ generate-darwin-source-and-headers.py \ + libffi.xcodeproj/project.pbxproj src/arm/trampoline.S \ +- libtool-ldflags ++ libtool-ldflags ChangeLog.libffi-3.1 + + info_TEXINFOS = doc/libffi.texi + +@@ -59,39 +64,39 @@ + # values defined in terms of make variables, as is the case for CC and + # friends when we are called from the top level Makefile. + AM_MAKEFLAGS = \ +- "AR_FLAGS=$(AR_FLAGS)" \ +- "CC_FOR_BUILD=$(CC_FOR_BUILD)" \ +- "CFLAGS=$(CFLAGS)" \ +- "CXXFLAGS=$(CXXFLAGS)" \ +- "CFLAGS_FOR_BUILD=$(CFLAGS_FOR_BUILD)" \ +- "CFLAGS_FOR_TARGET=$(CFLAGS_FOR_TARGET)" \ +- "INSTALL=$(INSTALL)" \ +- "INSTALL_DATA=$(INSTALL_DATA)" \ +- "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \ +- "INSTALL_SCRIPT=$(INSTALL_SCRIPT)" \ +- "JC1FLAGS=$(JC1FLAGS)" \ +- "LDFLAGS=$(LDFLAGS)" \ +- "LIBCFLAGS=$(LIBCFLAGS)" \ +- "LIBCFLAGS_FOR_TARGET=$(LIBCFLAGS_FOR_TARGET)" \ +- "MAKE=$(MAKE)" \ +- "MAKEINFO=$(MAKEINFO) $(MAKEINFOFLAGS)" \ +- "PICFLAG=$(PICFLAG)" \ +- "PICFLAG_FOR_TARGET=$(PICFLAG_FOR_TARGET)" \ +- "RUNTESTFLAGS=$(RUNTESTFLAGS)" \ +- "SHELL=$(SHELL)" \ +- "exec_prefix=$(exec_prefix)" \ +- "infodir=$(infodir)" \ +- "libdir=$(libdir)" \ +- "mandir=$(mandir)" \ +- "prefix=$(prefix)" \ +- "AR=$(AR)" \ +- "AS=$(AS)" \ +- "CC=$(CC)" \ +- "CXX=$(CXX)" \ +- "LD=$(LD)" \ +- "NM=$(NM)" \ +- "RANLIB=$(RANLIB)" \ +- "DESTDIR=$(DESTDIR)" ++ 'AR_FLAGS=$(AR_FLAGS)' \ ++ 'CC_FOR_BUILD=$(CC_FOR_BUILD)' \ ++ 'CFLAGS=$(CFLAGS)' \ ++ 'CXXFLAGS=$(CXXFLAGS)' \ ++ 'CFLAGS_FOR_BUILD=$(CFLAGS_FOR_BUILD)' \ ++ 'CFLAGS_FOR_TARGET=$(CFLAGS_FOR_TARGET)' \ ++ 'INSTALL=$(INSTALL)' \ ++ 'INSTALL_DATA=$(INSTALL_DATA)' \ ++ 'INSTALL_PROGRAM=$(INSTALL_PROGRAM)' \ ++ 'INSTALL_SCRIPT=$(INSTALL_SCRIPT)' \ ++ 'JC1FLAGS=$(JC1FLAGS)' \ ++ 'LDFLAGS=$(LDFLAGS)' \ ++ 'LIBCFLAGS=$(LIBCFLAGS)' \ ++ 'LIBCFLAGS_FOR_TARGET=$(LIBCFLAGS_FOR_TARGET)' \ ++ 'MAKE=$(MAKE)' \ ++ 'MAKEINFO=$(MAKEINFO) $(MAKEINFOFLAGS)' \ ++ 'PICFLAG=$(PICFLAG)' \ ++ 'PICFLAG_FOR_TARGET=$(PICFLAG_FOR_TARGET)' \ ++ 'RUNTESTFLAGS=$(RUNTESTFLAGS)' \ ++ 'SHELL=$(SHELL)' \ ++ 'exec_prefix=$(exec_prefix)' \ ++ 'infodir=$(infodir)' \ ++ 'libdir=$(libdir)' \ ++ 'mandir=$(mandir)' \ ++ 'prefix=$(prefix)' \ ++ 'AR=$(AR)' \ ++ 'AS=$(AS)' \ ++ 'CC=$(CC)' \ ++ 'CXX=$(CXX)' \ ++ 'LD=$(LD)' \ ++ 'NM=$(NM)' \ ++ 'RANLIB=$(RANLIB)' \ ++ 'DESTDIR=$(DESTDIR)' + + # Subdir rules rely on $(FLAGS_TO_PASS) + FLAGS_TO_PASS = $(AM_MAKEFLAGS) +@@ -120,10 +125,10 @@ + nodist_libffi_la_SOURCES += src/bfin/ffi.c src/bfin/sysv.S + endif + if X86 +-nodist_libffi_la_SOURCES += src/x86/ffi.c src/x86/sysv.S ++nodist_libffi_la_SOURCES += src/x86/ffi.c src/x86/sysv.S src/x86/win32.S + endif + if X86_FREEBSD +-nodist_libffi_la_SOURCES += src/x86/ffi.c src/x86/freebsd.S ++nodist_libffi_la_SOURCES += src/x86/ffi.c src/x86/freebsd.S src/x86/win32.S + endif + if X86_WIN32 + nodist_libffi_la_SOURCES += src/x86/ffi.c src/x86/win32.S +@@ -133,6 +138,9 @@ + endif + if X86_DARWIN + nodist_libffi_la_SOURCES += src/x86/ffi.c src/x86/darwin.S src/x86/ffi64.c src/x86/darwin64.S ++if X86_DARWIN32 ++nodist_libffi_la_SOURCES += src/x86/win32.S ++endif + endif + if SPARC + nodist_libffi_la_SOURCES += src/sparc/ffi.c src/sparc/v8.S src/sparc/v9.S +@@ -149,14 +157,20 @@ + if M68K + nodist_libffi_la_SOURCES += src/m68k/ffi.c src/m68k/sysv.S + endif ++if M88K ++nodist_libffi_la_SOURCES += src/m88k/ffi.c src/m88k/obsd.S ++endif + if MOXIE + nodist_libffi_la_SOURCES += src/moxie/ffi.c src/moxie/eabi.S + endif + if MICROBLAZE + nodist_libffi_la_SOURCES += src/microblaze/ffi.c src/microblaze/sysv.S + endif ++if NIOS2 ++nodist_libffi_la_SOURCES += src/nios2/sysv.S src/nios2/ffi.c ++endif + if POWERPC +-nodist_libffi_la_SOURCES += src/powerpc/ffi.c src/powerpc/sysv.S src/powerpc/ppc_closure.S src/powerpc/linux64.S src/powerpc/linux64_closure.S ++nodist_libffi_la_SOURCES += src/powerpc/ffi.c src/powerpc/ffi_sysv.c src/powerpc/ffi_linux64.c src/powerpc/sysv.S src/powerpc/ppc_closure.S src/powerpc/linux64.S src/powerpc/linux64_closure.S + endif + if POWERPC_AIX + nodist_libffi_la_SOURCES += src/powerpc/ffi_darwin.c src/powerpc/aix.S src/powerpc/aix_closure.S +@@ -165,11 +179,14 @@ + nodist_libffi_la_SOURCES += src/powerpc/ffi_darwin.c src/powerpc/darwin.S src/powerpc/darwin_closure.S + endif + if POWERPC_FREEBSD +-nodist_libffi_la_SOURCES += src/powerpc/ffi.c src/powerpc/sysv.S src/powerpc/ppc_closure.S ++nodist_libffi_la_SOURCES += src/powerpc/ffi.c src/powerpc/ffi_sysv.c src/powerpc/sysv.S src/powerpc/ppc_closure.S + endif + if AARCH64 + nodist_libffi_la_SOURCES += src/aarch64/sysv.S src/aarch64/ffi.c + endif ++if ARC ++nodist_libffi_la_SOURCES += src/arc/arcompact.S src/arc/ffi.c ++endif + if ARM + nodist_libffi_la_SOURCES += src/arm/sysv.S src/arm/ffi.c + if FFI_EXEC_TRAMPOLINE_TABLE +@@ -212,14 +229,26 @@ + if METAG + nodist_libffi_la_SOURCES += src/metag/sysv.S src/metag/ffi.c + endif ++if VAX ++nodist_libffi_la_SOURCES += src/vax/elfbsd.S src/vax/ffi.c ++endif + + libffi_convenience_la_SOURCES = $(libffi_la_SOURCES) + nodist_libffi_convenience_la_SOURCES = $(nodist_libffi_la_SOURCES) + + LTLDFLAGS = $(shell $(SHELL) $(top_srcdir)/libtool-ldflags $(LDFLAGS)) + ++AM_CFLAGS = ++if FFI_DEBUG ++# Build debug. Define FFI_DEBUG on the commandline so that, when building with ++# MSVC, it can link against the debug CRT. ++AM_CFLAGS += -DFFI_DEBUG ++endif ++ + libffi_la_LDFLAGS = -no-undefined -version-info `grep -v '^\#' $(srcdir)/libtool-version` $(LTLDFLAGS) $(AM_LTLDFLAGS) + + AM_CPPFLAGS = -I. -I$(top_srcdir)/include -Iinclude -I$(top_srcdir)/src + AM_CCASFLAGS = $(AM_CPPFLAGS) + ++dist-hook: ++ if [ -d $(top_srcdir)/.git ] ; then (cd $(top_srcdir); git log --no-decorate) ; else echo 'See git log for history.' ; fi > $(distdir)/ChangeLog +diff -r c0e311e010fc Modules/_ctypes/libffi/Makefile.in +--- a/Modules/_ctypes/libffi/Makefile.in ++++ b/Modules/_ctypes/libffi/Makefile.in +@@ -1,7 +1,7 @@ +-# Makefile.in generated by automake 1.12.2 from Makefile.am. ++# Makefile.in generated by automake 1.13.4 from Makefile.am. + # @configure_input@ + +-# Copyright (C) 1994-2012 Free Software Foundation, Inc. ++# Copyright (C) 1994-2013 Free Software Foundation, Inc. + + # This Makefile.in is free software; the Free Software Foundation + # gives unlimited permission to copy and/or distribute it, +@@ -16,23 +16,51 @@ + + + VPATH = @srcdir@ +-am__make_dryrun = \ +- { \ +- am__dry=no; \ ++am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' ++am__make_running_with_option = \ ++ case $${target_option-} in \ ++ ?) ;; \ ++ *) echo "am__make_running_with_option: internal error: invalid" \ ++ "target option '$${target_option-}' specified" >&2; \ ++ exit 1;; \ ++ esac; \ ++ has_opt=no; \ ++ sane_makeflags=$$MAKEFLAGS; \ ++ if $(am__is_gnu_make); then \ ++ sane_makeflags=$$MFLAGS; \ ++ else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ +- echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ +- | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ +- *) \ +- for am__flg in $$MAKEFLAGS; do \ +- case $$am__flg in \ +- *=*|--*) ;; \ +- *n*) am__dry=yes; break;; \ +- esac; \ +- done;; \ ++ bs=\\; \ ++ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ ++ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ +- test $$am__dry = yes; \ +- } ++ fi; \ ++ skip_next=no; \ ++ strip_trailopt () \ ++ { \ ++ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ ++ }; \ ++ for flg in $$sane_makeflags; do \ ++ test $$skip_next = yes && { skip_next=no; continue; }; \ ++ case $$flg in \ ++ *=*|--*) continue;; \ ++ -*I) strip_trailopt 'I'; skip_next=yes;; \ ++ -*I?*) strip_trailopt 'I';; \ ++ -*O) strip_trailopt 'O'; skip_next=yes;; \ ++ -*O?*) strip_trailopt 'O';; \ ++ -*l) strip_trailopt 'l'; skip_next=yes;; \ ++ -*l?*) strip_trailopt 'l';; \ ++ -[dEDm]) skip_next=yes;; \ ++ -[JT]) skip_next=yes;; \ ++ esac; \ ++ case $$flg in \ ++ *$$target_option*) has_opt=yes; break;; \ ++ esac; \ ++ done; \ ++ test $$has_opt = yes ++am__make_dryrun = (target_option=n; $(am__make_running_with_option)) ++am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) + pkgdatadir = $(datadir)/@PACKAGE@ + pkgincludedir = $(includedir)/@PACKAGE@ + pkglibdir = $(libdir)/@PACKAGE@ +@@ -55,44 +83,52 @@ + @FFI_DEBUG_TRUE@am__append_1 = src/debug.c + @MIPS_TRUE@am__append_2 = src/mips/ffi.c src/mips/o32.S src/mips/n32.S + @BFIN_TRUE@am__append_3 = src/bfin/ffi.c src/bfin/sysv.S +-@X86_TRUE@am__append_4 = src/x86/ffi.c src/x86/sysv.S +-@X86_FREEBSD_TRUE@am__append_5 = src/x86/ffi.c src/x86/freebsd.S ++@X86_TRUE@am__append_4 = src/x86/ffi.c src/x86/sysv.S src/x86/win32.S ++@X86_FREEBSD_TRUE@am__append_5 = src/x86/ffi.c src/x86/freebsd.S src/x86/win32.S + @X86_WIN32_TRUE@am__append_6 = src/x86/ffi.c src/x86/win32.S + @X86_WIN64_TRUE@am__append_7 = src/x86/ffi.c src/x86/win64.S + @X86_DARWIN_TRUE@am__append_8 = src/x86/ffi.c src/x86/darwin.S src/x86/ffi64.c src/x86/darwin64.S +-@SPARC_TRUE@am__append_9 = src/sparc/ffi.c src/sparc/v8.S src/sparc/v9.S +-@ALPHA_TRUE@am__append_10 = src/alpha/ffi.c src/alpha/osf.S +-@IA64_TRUE@am__append_11 = src/ia64/ffi.c src/ia64/unix.S +-@M32R_TRUE@am__append_12 = src/m32r/sysv.S src/m32r/ffi.c +-@M68K_TRUE@am__append_13 = src/m68k/ffi.c src/m68k/sysv.S +-@MOXIE_TRUE@am__append_14 = src/moxie/ffi.c src/moxie/eabi.S +-@MICROBLAZE_TRUE@am__append_15 = src/microblaze/ffi.c src/microblaze/sysv.S +-@POWERPC_TRUE@am__append_16 = src/powerpc/ffi.c src/powerpc/sysv.S src/powerpc/ppc_closure.S src/powerpc/linux64.S src/powerpc/linux64_closure.S +-@POWERPC_AIX_TRUE@am__append_17 = src/powerpc/ffi_darwin.c src/powerpc/aix.S src/powerpc/aix_closure.S +-@POWERPC_DARWIN_TRUE@am__append_18 = src/powerpc/ffi_darwin.c src/powerpc/darwin.S src/powerpc/darwin_closure.S +-@POWERPC_FREEBSD_TRUE@am__append_19 = src/powerpc/ffi.c src/powerpc/sysv.S src/powerpc/ppc_closure.S +-@AARCH64_TRUE@am__append_20 = src/aarch64/sysv.S src/aarch64/ffi.c +-@ARM_TRUE@am__append_21 = src/arm/sysv.S src/arm/ffi.c +-@ARM_TRUE@@FFI_EXEC_TRAMPOLINE_TABLE_TRUE@am__append_22 = src/arm/trampoline.S +-@AVR32_TRUE@am__append_23 = src/avr32/sysv.S src/avr32/ffi.c +-@LIBFFI_CRIS_TRUE@am__append_24 = src/cris/sysv.S src/cris/ffi.c +-@FRV_TRUE@am__append_25 = src/frv/eabi.S src/frv/ffi.c +-@S390_TRUE@am__append_26 = src/s390/sysv.S src/s390/ffi.c +-@X86_64_TRUE@am__append_27 = src/x86/ffi64.c src/x86/unix64.S src/x86/ffi.c src/x86/sysv.S +-@SH_TRUE@am__append_28 = src/sh/sysv.S src/sh/ffi.c +-@SH64_TRUE@am__append_29 = src/sh64/sysv.S src/sh64/ffi.c +-@PA_LINUX_TRUE@am__append_30 = src/pa/linux.S src/pa/ffi.c +-@PA_HPUX_TRUE@am__append_31 = src/pa/hpux32.S src/pa/ffi.c +-@TILE_TRUE@am__append_32 = src/tile/tile.S src/tile/ffi.c +-@XTENSA_TRUE@am__append_33 = src/xtensa/sysv.S src/xtensa/ffi.c +-@METAG_TRUE@am__append_34 = src/metag/sysv.S src/metag/ffi.c ++@X86_DARWIN32_TRUE@@X86_DARWIN_TRUE@am__append_9 = src/x86/win32.S ++@SPARC_TRUE@am__append_10 = src/sparc/ffi.c src/sparc/v8.S src/sparc/v9.S ++@ALPHA_TRUE@am__append_11 = src/alpha/ffi.c src/alpha/osf.S ++@IA64_TRUE@am__append_12 = src/ia64/ffi.c src/ia64/unix.S ++@M32R_TRUE@am__append_13 = src/m32r/sysv.S src/m32r/ffi.c ++@M68K_TRUE@am__append_14 = src/m68k/ffi.c src/m68k/sysv.S ++@M88K_TRUE@am__append_15 = src/m88k/ffi.c src/m88k/obsd.S ++@MOXIE_TRUE@am__append_16 = src/moxie/ffi.c src/moxie/eabi.S ++@MICROBLAZE_TRUE@am__append_17 = src/microblaze/ffi.c src/microblaze/sysv.S ++@NIOS2_TRUE@am__append_18 = src/nios2/sysv.S src/nios2/ffi.c ++@POWERPC_TRUE@am__append_19 = src/powerpc/ffi.c src/powerpc/ffi_sysv.c src/powerpc/ffi_linux64.c src/powerpc/sysv.S src/powerpc/ppc_closure.S src/powerpc/linux64.S src/powerpc/linux64_closure.S ++@POWERPC_AIX_TRUE@am__append_20 = src/powerpc/ffi_darwin.c src/powerpc/aix.S src/powerpc/aix_closure.S ++@POWERPC_DARWIN_TRUE@am__append_21 = src/powerpc/ffi_darwin.c src/powerpc/darwin.S src/powerpc/darwin_closure.S ++@POWERPC_FREEBSD_TRUE@am__append_22 = src/powerpc/ffi.c src/powerpc/ffi_sysv.c src/powerpc/sysv.S src/powerpc/ppc_closure.S ++@AARCH64_TRUE@am__append_23 = src/aarch64/sysv.S src/aarch64/ffi.c ++@ARC_TRUE@am__append_24 = src/arc/arcompact.S src/arc/ffi.c ++@ARM_TRUE@am__append_25 = src/arm/sysv.S src/arm/ffi.c ++@ARM_TRUE@@FFI_EXEC_TRAMPOLINE_TABLE_TRUE@am__append_26 = src/arm/trampoline.S ++@AVR32_TRUE@am__append_27 = src/avr32/sysv.S src/avr32/ffi.c ++@LIBFFI_CRIS_TRUE@am__append_28 = src/cris/sysv.S src/cris/ffi.c ++@FRV_TRUE@am__append_29 = src/frv/eabi.S src/frv/ffi.c ++@S390_TRUE@am__append_30 = src/s390/sysv.S src/s390/ffi.c ++@X86_64_TRUE@am__append_31 = src/x86/ffi64.c src/x86/unix64.S src/x86/ffi.c src/x86/sysv.S ++@SH_TRUE@am__append_32 = src/sh/sysv.S src/sh/ffi.c ++@SH64_TRUE@am__append_33 = src/sh64/sysv.S src/sh64/ffi.c ++@PA_LINUX_TRUE@am__append_34 = src/pa/linux.S src/pa/ffi.c ++@PA_HPUX_TRUE@am__append_35 = src/pa/hpux32.S src/pa/ffi.c ++@TILE_TRUE@am__append_36 = src/tile/tile.S src/tile/ffi.c ++@XTENSA_TRUE@am__append_37 = src/xtensa/sysv.S src/xtensa/ffi.c ++@METAG_TRUE@am__append_38 = src/metag/sysv.S src/metag/ffi.c ++@VAX_TRUE@am__append_39 = src/vax/elfbsd.S src/vax/ffi.c ++# Build debug. Define FFI_DEBUG on the commandline so that, when building with ++# MSVC, it can link against the debug CRT. ++@FFI_DEBUG_TRUE@am__append_40 = -DFFI_DEBUG + subdir = . +-DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \ +- $(srcdir)/Makefile.in $(srcdir)/doc/stamp-vti \ +- $(srcdir)/doc/version.texi $(srcdir)/fficonfig.h.in \ +- $(srcdir)/libffi.pc.in $(top_srcdir)/configure ChangeLog \ +- compile config.guess config.sub depcomp install-sh ltmain.sh \ +- mdate-sh missing texinfo.tex ++DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ ++ $(top_srcdir)/configure $(am__configure_deps) \ ++ $(srcdir)/fficonfig.h.in $(srcdir)/libffi.pc.in depcomp \ ++ mdate-sh $(srcdir)/doc/version.texi $(srcdir)/doc/stamp-vti \ ++ texinfo.tex README compile config.guess config.sub install-sh \ ++ missing ltmain.sh + ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 + am__aclocal_m4_deps = $(top_srcdir)/m4/asmcfi.m4 \ + $(top_srcdir)/m4/ax_append_flag.m4 \ +@@ -154,50 +190,60 @@ + @MIPS_TRUE@am__objects_2 = src/mips/ffi.lo src/mips/o32.lo \ + @MIPS_TRUE@ src/mips/n32.lo + @BFIN_TRUE@am__objects_3 = src/bfin/ffi.lo src/bfin/sysv.lo +-@X86_TRUE@am__objects_4 = src/x86/ffi.lo src/x86/sysv.lo +-@X86_FREEBSD_TRUE@am__objects_5 = src/x86/ffi.lo src/x86/freebsd.lo ++@X86_TRUE@am__objects_4 = src/x86/ffi.lo src/x86/sysv.lo \ ++@X86_TRUE@ src/x86/win32.lo ++@X86_FREEBSD_TRUE@am__objects_5 = src/x86/ffi.lo src/x86/freebsd.lo \ ++@X86_FREEBSD_TRUE@ src/x86/win32.lo + @X86_WIN32_TRUE@am__objects_6 = src/x86/ffi.lo src/x86/win32.lo + @X86_WIN64_TRUE@am__objects_7 = src/x86/ffi.lo src/x86/win64.lo + @X86_DARWIN_TRUE@am__objects_8 = src/x86/ffi.lo src/x86/darwin.lo \ + @X86_DARWIN_TRUE@ src/x86/ffi64.lo src/x86/darwin64.lo +-@SPARC_TRUE@am__objects_9 = src/sparc/ffi.lo src/sparc/v8.lo \ ++@X86_DARWIN32_TRUE@@X86_DARWIN_TRUE@am__objects_9 = src/x86/win32.lo ++@SPARC_TRUE@am__objects_10 = src/sparc/ffi.lo src/sparc/v8.lo \ + @SPARC_TRUE@ src/sparc/v9.lo +-@ALPHA_TRUE@am__objects_10 = src/alpha/ffi.lo src/alpha/osf.lo +-@IA64_TRUE@am__objects_11 = src/ia64/ffi.lo src/ia64/unix.lo +-@M32R_TRUE@am__objects_12 = src/m32r/sysv.lo src/m32r/ffi.lo +-@M68K_TRUE@am__objects_13 = src/m68k/ffi.lo src/m68k/sysv.lo +-@MOXIE_TRUE@am__objects_14 = src/moxie/ffi.lo src/moxie/eabi.lo +-@MICROBLAZE_TRUE@am__objects_15 = src/microblaze/ffi.lo \ ++@ALPHA_TRUE@am__objects_11 = src/alpha/ffi.lo src/alpha/osf.lo ++@IA64_TRUE@am__objects_12 = src/ia64/ffi.lo src/ia64/unix.lo ++@M32R_TRUE@am__objects_13 = src/m32r/sysv.lo src/m32r/ffi.lo ++@M68K_TRUE@am__objects_14 = src/m68k/ffi.lo src/m68k/sysv.lo ++@M88K_TRUE@am__objects_15 = src/m88k/ffi.lo src/m88k/obsd.lo ++@MOXIE_TRUE@am__objects_16 = src/moxie/ffi.lo src/moxie/eabi.lo ++@MICROBLAZE_TRUE@am__objects_17 = src/microblaze/ffi.lo \ + @MICROBLAZE_TRUE@ src/microblaze/sysv.lo +-@POWERPC_TRUE@am__objects_16 = src/powerpc/ffi.lo src/powerpc/sysv.lo \ ++@NIOS2_TRUE@am__objects_18 = src/nios2/sysv.lo src/nios2/ffi.lo ++@POWERPC_TRUE@am__objects_19 = src/powerpc/ffi.lo \ ++@POWERPC_TRUE@ src/powerpc/ffi_sysv.lo \ ++@POWERPC_TRUE@ src/powerpc/ffi_linux64.lo src/powerpc/sysv.lo \ + @POWERPC_TRUE@ src/powerpc/ppc_closure.lo \ + @POWERPC_TRUE@ src/powerpc/linux64.lo \ + @POWERPC_TRUE@ src/powerpc/linux64_closure.lo +-@POWERPC_AIX_TRUE@am__objects_17 = src/powerpc/ffi_darwin.lo \ ++@POWERPC_AIX_TRUE@am__objects_20 = src/powerpc/ffi_darwin.lo \ + @POWERPC_AIX_TRUE@ src/powerpc/aix.lo \ + @POWERPC_AIX_TRUE@ src/powerpc/aix_closure.lo +-@POWERPC_DARWIN_TRUE@am__objects_18 = src/powerpc/ffi_darwin.lo \ ++@POWERPC_DARWIN_TRUE@am__objects_21 = src/powerpc/ffi_darwin.lo \ + @POWERPC_DARWIN_TRUE@ src/powerpc/darwin.lo \ + @POWERPC_DARWIN_TRUE@ src/powerpc/darwin_closure.lo +-@POWERPC_FREEBSD_TRUE@am__objects_19 = src/powerpc/ffi.lo \ ++@POWERPC_FREEBSD_TRUE@am__objects_22 = src/powerpc/ffi.lo \ ++@POWERPC_FREEBSD_TRUE@ src/powerpc/ffi_sysv.lo \ + @POWERPC_FREEBSD_TRUE@ src/powerpc/sysv.lo \ + @POWERPC_FREEBSD_TRUE@ src/powerpc/ppc_closure.lo +-@AARCH64_TRUE@am__objects_20 = src/aarch64/sysv.lo src/aarch64/ffi.lo +-@ARM_TRUE@am__objects_21 = src/arm/sysv.lo src/arm/ffi.lo +-@ARM_TRUE@@FFI_EXEC_TRAMPOLINE_TABLE_TRUE@am__objects_22 = src/arm/trampoline.lo +-@AVR32_TRUE@am__objects_23 = src/avr32/sysv.lo src/avr32/ffi.lo +-@LIBFFI_CRIS_TRUE@am__objects_24 = src/cris/sysv.lo src/cris/ffi.lo +-@FRV_TRUE@am__objects_25 = src/frv/eabi.lo src/frv/ffi.lo +-@S390_TRUE@am__objects_26 = src/s390/sysv.lo src/s390/ffi.lo +-@X86_64_TRUE@am__objects_27 = src/x86/ffi64.lo src/x86/unix64.lo \ ++@AARCH64_TRUE@am__objects_23 = src/aarch64/sysv.lo src/aarch64/ffi.lo ++@ARC_TRUE@am__objects_24 = src/arc/arcompact.lo src/arc/ffi.lo ++@ARM_TRUE@am__objects_25 = src/arm/sysv.lo src/arm/ffi.lo ++@ARM_TRUE@@FFI_EXEC_TRAMPOLINE_TABLE_TRUE@am__objects_26 = src/arm/trampoline.lo ++@AVR32_TRUE@am__objects_27 = src/avr32/sysv.lo src/avr32/ffi.lo ++@LIBFFI_CRIS_TRUE@am__objects_28 = src/cris/sysv.lo src/cris/ffi.lo ++@FRV_TRUE@am__objects_29 = src/frv/eabi.lo src/frv/ffi.lo ++@S390_TRUE@am__objects_30 = src/s390/sysv.lo src/s390/ffi.lo ++@X86_64_TRUE@am__objects_31 = src/x86/ffi64.lo src/x86/unix64.lo \ + @X86_64_TRUE@ src/x86/ffi.lo src/x86/sysv.lo +-@SH_TRUE@am__objects_28 = src/sh/sysv.lo src/sh/ffi.lo +-@SH64_TRUE@am__objects_29 = src/sh64/sysv.lo src/sh64/ffi.lo +-@PA_LINUX_TRUE@am__objects_30 = src/pa/linux.lo src/pa/ffi.lo +-@PA_HPUX_TRUE@am__objects_31 = src/pa/hpux32.lo src/pa/ffi.lo +-@TILE_TRUE@am__objects_32 = src/tile/tile.lo src/tile/ffi.lo +-@XTENSA_TRUE@am__objects_33 = src/xtensa/sysv.lo src/xtensa/ffi.lo +-@METAG_TRUE@am__objects_34 = src/metag/sysv.lo src/metag/ffi.lo ++@SH_TRUE@am__objects_32 = src/sh/sysv.lo src/sh/ffi.lo ++@SH64_TRUE@am__objects_33 = src/sh64/sysv.lo src/sh64/ffi.lo ++@PA_LINUX_TRUE@am__objects_34 = src/pa/linux.lo src/pa/ffi.lo ++@PA_HPUX_TRUE@am__objects_35 = src/pa/hpux32.lo src/pa/ffi.lo ++@TILE_TRUE@am__objects_36 = src/tile/tile.lo src/tile/ffi.lo ++@XTENSA_TRUE@am__objects_37 = src/xtensa/sysv.lo src/xtensa/ffi.lo ++@METAG_TRUE@am__objects_38 = src/metag/sysv.lo src/metag/ffi.lo ++@VAX_TRUE@am__objects_39 = src/vax/elfbsd.lo src/vax/ffi.lo + nodist_libffi_la_OBJECTS = $(am__objects_1) $(am__objects_2) \ + $(am__objects_3) $(am__objects_4) $(am__objects_5) \ + $(am__objects_6) $(am__objects_7) $(am__objects_8) \ +@@ -209,17 +255,23 @@ + $(am__objects_24) $(am__objects_25) $(am__objects_26) \ + $(am__objects_27) $(am__objects_28) $(am__objects_29) \ + $(am__objects_30) $(am__objects_31) $(am__objects_32) \ +- $(am__objects_33) $(am__objects_34) ++ $(am__objects_33) $(am__objects_34) $(am__objects_35) \ ++ $(am__objects_36) $(am__objects_37) $(am__objects_38) \ ++ $(am__objects_39) + libffi_la_OBJECTS = $(am_libffi_la_OBJECTS) \ + $(nodist_libffi_la_OBJECTS) +-libffi_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ ++AM_V_lt = $(am__v_lt_@AM_V@) ++am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) ++am__v_lt_0 = --silent ++am__v_lt_1 = ++libffi_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(libffi_la_LDFLAGS) $(LDFLAGS) -o $@ + libffi_convenience_la_LIBADD = +-am__objects_35 = src/prep_cif.lo src/types.lo src/raw_api.lo \ ++am__objects_40 = src/prep_cif.lo src/types.lo src/raw_api.lo \ + src/java_raw_api.lo src/closures.lo +-am_libffi_convenience_la_OBJECTS = $(am__objects_35) +-am__objects_36 = $(am__objects_1) $(am__objects_2) $(am__objects_3) \ ++am_libffi_convenience_la_OBJECTS = $(am__objects_40) ++am__objects_41 = $(am__objects_1) $(am__objects_2) $(am__objects_3) \ + $(am__objects_4) $(am__objects_5) $(am__objects_6) \ + $(am__objects_7) $(am__objects_8) $(am__objects_9) \ + $(am__objects_10) $(am__objects_11) $(am__objects_12) \ +@@ -230,32 +282,87 @@ + $(am__objects_25) $(am__objects_26) $(am__objects_27) \ + $(am__objects_28) $(am__objects_29) $(am__objects_30) \ + $(am__objects_31) $(am__objects_32) $(am__objects_33) \ +- $(am__objects_34) +-nodist_libffi_convenience_la_OBJECTS = $(am__objects_36) ++ $(am__objects_34) $(am__objects_35) $(am__objects_36) \ ++ $(am__objects_37) $(am__objects_38) $(am__objects_39) ++nodist_libffi_convenience_la_OBJECTS = $(am__objects_41) + libffi_convenience_la_OBJECTS = $(am_libffi_convenience_la_OBJECTS) \ + $(nodist_libffi_convenience_la_OBJECTS) ++AM_V_P = $(am__v_P_@AM_V@) ++am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) ++am__v_P_0 = false ++am__v_P_1 = : ++AM_V_GEN = $(am__v_GEN_@AM_V@) ++am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) ++am__v_GEN_0 = @echo " GEN " $@; ++am__v_GEN_1 = ++AM_V_at = $(am__v_at_@AM_V@) ++am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) ++am__v_at_0 = @ ++am__v_at_1 = + DEFAULT_INCLUDES = -I.@am__isrc@ + depcomp = $(SHELL) $(top_srcdir)/depcomp + am__depfiles_maybe = depfiles + am__mv = mv -f + CPPASCOMPILE = $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) +-LTCPPASCOMPILE = $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ +- --mode=compile $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ +- $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) ++LTCPPASCOMPILE = $(LIBTOOL) $(AM_V_lt) $(AM_LIBTOOLFLAGS) \ ++ $(LIBTOOLFLAGS) --mode=compile $(CCAS) $(DEFS) \ ++ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ ++ $(AM_CCASFLAGS) $(CCASFLAGS) ++AM_V_CPPAS = $(am__v_CPPAS_@AM_V@) ++am__v_CPPAS_ = $(am__v_CPPAS_@AM_DEFAULT_V@) ++am__v_CPPAS_0 = @echo " CPPAS " $@; ++am__v_CPPAS_1 = + COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +-LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ +- --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ +- $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) ++LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ ++ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ ++ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ ++ $(AM_CFLAGS) $(CFLAGS) ++AM_V_CC = $(am__v_CC_@AM_V@) ++am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) ++am__v_CC_0 = @echo " CC " $@; ++am__v_CC_1 = + CCLD = $(CC) +-LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ +- --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ +- $(LDFLAGS) -o $@ ++LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ ++ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ ++ $(AM_LDFLAGS) $(LDFLAGS) -o $@ ++AM_V_CCLD = $(am__v_CCLD_@AM_V@) ++am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) ++am__v_CCLD_0 = @echo " CCLD " $@; ++am__v_CCLD_1 = + SOURCES = $(libffi_la_SOURCES) $(nodist_libffi_la_SOURCES) \ + $(libffi_convenience_la_SOURCES) \ + $(nodist_libffi_convenience_la_SOURCES) + DIST_SOURCES = $(libffi_la_SOURCES) $(libffi_convenience_la_SOURCES) ++AM_V_DVIPS = $(am__v_DVIPS_@AM_V@) ++am__v_DVIPS_ = $(am__v_DVIPS_@AM_DEFAULT_V@) ++am__v_DVIPS_0 = @echo " DVIPS " $@; ++am__v_DVIPS_1 = ++AM_V_MAKEINFO = $(am__v_MAKEINFO_@AM_V@) ++am__v_MAKEINFO_ = $(am__v_MAKEINFO_@AM_DEFAULT_V@) ++am__v_MAKEINFO_0 = @echo " MAKEINFO" $@; ++am__v_MAKEINFO_1 = ++AM_V_INFOHTML = $(am__v_INFOHTML_@AM_V@) ++am__v_INFOHTML_ = $(am__v_INFOHTML_@AM_DEFAULT_V@) ++am__v_INFOHTML_0 = @echo " INFOHTML" $@; ++am__v_INFOHTML_1 = ++AM_V_TEXI2DVI = $(am__v_TEXI2DVI_@AM_V@) ++am__v_TEXI2DVI_ = $(am__v_TEXI2DVI_@AM_DEFAULT_V@) ++am__v_TEXI2DVI_0 = @echo " TEXI2DVI" $@; ++am__v_TEXI2DVI_1 = ++AM_V_TEXI2PDF = $(am__v_TEXI2PDF_@AM_V@) ++am__v_TEXI2PDF_ = $(am__v_TEXI2PDF_@AM_DEFAULT_V@) ++am__v_TEXI2PDF_0 = @echo " TEXI2PDF" $@; ++am__v_TEXI2PDF_1 = ++AM_V_texinfo = $(am__v_texinfo_@AM_V@) ++am__v_texinfo_ = $(am__v_texinfo_@AM_DEFAULT_V@) ++am__v_texinfo_0 = -q ++am__v_texinfo_1 = ++AM_V_texidevnull = $(am__v_texidevnull_@AM_V@) ++am__v_texidevnull_ = $(am__v_texidevnull_@AM_DEFAULT_V@) ++am__v_texidevnull_0 = > /dev/null ++am__v_texidevnull_1 = + INFO_DEPS = $(srcdir)/doc/libffi.info + am__TEXINFO_TEX_DIR = $(srcdir) + DVIS = doc/libffi.dvi +@@ -268,13 +375,14 @@ + MAKEINFOHTML = $(MAKEINFO) --html + AM_MAKEINFOHTMLFLAGS = $(AM_MAKEINFOFLAGS) + DVIPS = dvips +-RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ +- html-recursive info-recursive install-data-recursive \ +- install-dvi-recursive install-exec-recursive \ +- install-html-recursive install-info-recursive \ +- install-pdf-recursive install-ps-recursive install-recursive \ +- installcheck-recursive installdirs-recursive pdf-recursive \ +- ps-recursive uninstall-recursive ++RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ++ ctags-recursive dvi-recursive html-recursive info-recursive \ ++ install-data-recursive install-dvi-recursive \ ++ install-exec-recursive install-html-recursive \ ++ install-info-recursive install-pdf-recursive \ ++ install-ps-recursive install-recursive installcheck-recursive \ ++ installdirs-recursive pdf-recursive ps-recursive \ ++ tags-recursive uninstall-recursive + am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ +@@ -283,9 +391,30 @@ + DATA = $(pkgconfig_DATA) + RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ + distclean-recursive maintainer-clean-recursive +-AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ +- $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ ++am__recursive_targets = \ ++ $(RECURSIVE_TARGETS) \ ++ $(RECURSIVE_CLEAN_TARGETS) \ ++ $(am__extra_recursive_targets) ++AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ + cscope distdir dist dist-all distcheck ++am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) \ ++ $(LISP)fficonfig.h.in ++# Read a list of newline-separated strings from the standard input, ++# and print each of them once, without duplicates. Input order is ++# *not* preserved. ++am__uniquify_input = $(AWK) '\ ++ BEGIN { nonempty = 0; } \ ++ { items[$$0] = 1; nonempty = 1; } \ ++ END { if (nonempty) { for (i in items) print i; }; } \ ++' ++# Make sure the list of sources is unique. This is necessary because, ++# e.g., the same source file might be shared among _SOURCES variables ++# for different programs/libraries. ++am__define_uniq_tagged_files = \ ++ list='$(am__tagged_files)'; \ ++ unique=`for i in $$list; do \ ++ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ ++ done | $(am__uniquify_input)` + ETAGS = etags + CTAGS = ctags + CSCOPE = cscope +@@ -335,6 +464,7 @@ + ACLOCAL = @ACLOCAL@ + ALLOCA = @ALLOCA@ + AMTAR = @AMTAR@ ++AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ + AM_LTLDFLAGS = @AM_LTLDFLAGS@ + AM_RUNTESTFLAGS = @AM_RUNTESTFLAGS@ + AR = @AR@ +@@ -350,6 +480,10 @@ + CFLAGS = @CFLAGS@ + CPP = @CPP@ + CPPFLAGS = @CPPFLAGS@ ++CXX = @CXX@ ++CXXCPP = @CXXCPP@ ++CXXDEPMODE = @CXXDEPMODE@ ++CXXFLAGS = @CXXFLAGS@ + CYGPATH_W = @CYGPATH_W@ + DEFS = @DEFS@ + DEPDIR = @DEPDIR@ +@@ -365,6 +499,7 @@ + FGREP = @FGREP@ + GREP = @GREP@ + HAVE_LONG_DOUBLE = @HAVE_LONG_DOUBLE@ ++HAVE_LONG_DOUBLE_VARIANT = @HAVE_LONG_DOUBLE_VARIANT@ + INSTALL = @INSTALL@ + INSTALL_DATA = @INSTALL_DATA@ + INSTALL_PROGRAM = @INSTALL_PROGRAM@ +@@ -411,6 +546,7 @@ + abs_top_srcdir = @abs_top_srcdir@ + ac_ct_AR = @ac_ct_AR@ + ac_ct_CC = @ac_ct_CC@ ++ac_ct_CXX = @ac_ct_CXX@ + ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ + am__include = @am__include@ + am__leading_dot = @am__leading_dot@ +@@ -468,10 +604,11 @@ + AUTOMAKE_OPTIONS = foreign subdir-objects + ACLOCAL_AMFLAGS = -I m4 + SUBDIRS = include testsuite man +-EXTRA_DIST = LICENSE ChangeLog.v1 ChangeLog.libgcj configure.host \ ++EXTRA_DIST = LICENSE ChangeLog.v1 ChangeLog.libgcj \ + src/aarch64/ffi.c src/aarch64/ffitarget.h src/aarch64/sysv.S \ +- build-ios.sh src/alpha/ffi.c src/alpha/osf.S \ +- src/alpha/ffitarget.h src/arm/ffi.c src/arm/sysv.S \ ++ src/alpha/ffi.c src/alpha/osf.S \ ++ src/alpha/ffitarget.h src/arc/ffi.c src/arc/arcompact.S \ ++ src/arc/ffitarget.h src/arm/ffi.c src/arm/sysv.S \ + src/arm/ffitarget.h src/avr32/ffi.c src/avr32/sysv.S \ + src/avr32/ffitarget.h src/cris/ffi.c src/cris/sysv.S \ + src/cris/ffitarget.h src/ia64/ffi.c src/ia64/ffitarget.h \ +@@ -481,8 +618,12 @@ + src/moxie/ffitarget.h src/moxie/eabi.S src/mips/ffitarget.h \ + src/m32r/ffi.c src/m32r/sysv.S src/m32r/ffitarget.h \ + src/m68k/ffi.c src/m68k/sysv.S src/m68k/ffitarget.h \ ++ src/m88k/ffi.c src/m88k/obsd.S src/m88k/ffitarget.h \ + src/microblaze/ffi.c src/microblaze/sysv.S \ +- src/microblaze/ffitarget.h src/powerpc/ffi.c \ ++ src/microblaze/ffitarget.h \ ++ src/nios2/ffi.c src/nios2/ffitarget.h src/nios2/sysv.S \ ++ src/powerpc/ffi.c src/powerpc/ffi_powerpc.h \ ++ src/powerpc/ffi_sysv.c src/powerpc/ffi_linux64.c \ + src/powerpc/sysv.S src/powerpc/linux64.S \ + src/powerpc/linux64_closure.S src/powerpc/ppc_closure.S \ + src/powerpc/asm.h src/powerpc/aix.S src/powerpc/darwin.S \ +@@ -500,14 +641,14 @@ + src/bfin/ffitarget.h src/bfin/sysv.S src/frv/eabi.S \ + src/frv/ffitarget.h src/dlmalloc.c src/tile/ffi.c \ + src/tile/ffitarget.h src/tile/tile.S libtool-version \ ++ src/vax/ffi.c src/vax/ffitarget.h src/vax/elfbsd.S \ + src/xtensa/ffitarget.h src/xtensa/ffi.c src/xtensa/sysv.S \ + ChangeLog.libffi m4/libtool.m4 m4/lt~obsolete.m4 \ + m4/ltoptions.m4 m4/ltsugar.m4 m4/ltversion.m4 \ + m4/ltversion.m4 src/arm/gentramp.sh src/debug.c msvcc.sh \ +- generate-ios-source-and-headers.py \ +- generate-osx-source-and-headers.py \ ++ generate-darwin-source-and-headers.py \ + libffi.xcodeproj/project.pbxproj src/arm/trampoline.S \ +- libtool-ldflags ++ libtool-ldflags ChangeLog.libffi-3.1 + + info_TEXINFOS = doc/libffi.texi + +@@ -515,39 +656,39 @@ + # values defined in terms of make variables, as is the case for CC and + # friends when we are called from the top level Makefile. + AM_MAKEFLAGS = \ +- "AR_FLAGS=$(AR_FLAGS)" \ +- "CC_FOR_BUILD=$(CC_FOR_BUILD)" \ +- "CFLAGS=$(CFLAGS)" \ +- "CXXFLAGS=$(CXXFLAGS)" \ +- "CFLAGS_FOR_BUILD=$(CFLAGS_FOR_BUILD)" \ +- "CFLAGS_FOR_TARGET=$(CFLAGS_FOR_TARGET)" \ +- "INSTALL=$(INSTALL)" \ +- "INSTALL_DATA=$(INSTALL_DATA)" \ +- "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \ +- "INSTALL_SCRIPT=$(INSTALL_SCRIPT)" \ +- "JC1FLAGS=$(JC1FLAGS)" \ +- "LDFLAGS=$(LDFLAGS)" \ +- "LIBCFLAGS=$(LIBCFLAGS)" \ +- "LIBCFLAGS_FOR_TARGET=$(LIBCFLAGS_FOR_TARGET)" \ +- "MAKE=$(MAKE)" \ +- "MAKEINFO=$(MAKEINFO) $(MAKEINFOFLAGS)" \ +- "PICFLAG=$(PICFLAG)" \ +- "PICFLAG_FOR_TARGET=$(PICFLAG_FOR_TARGET)" \ +- "RUNTESTFLAGS=$(RUNTESTFLAGS)" \ +- "SHELL=$(SHELL)" \ +- "exec_prefix=$(exec_prefix)" \ +- "infodir=$(infodir)" \ +- "libdir=$(libdir)" \ +- "mandir=$(mandir)" \ +- "prefix=$(prefix)" \ +- "AR=$(AR)" \ +- "AS=$(AS)" \ +- "CC=$(CC)" \ +- "CXX=$(CXX)" \ +- "LD=$(LD)" \ +- "NM=$(NM)" \ +- "RANLIB=$(RANLIB)" \ +- "DESTDIR=$(DESTDIR)" ++ 'AR_FLAGS=$(AR_FLAGS)' \ ++ 'CC_FOR_BUILD=$(CC_FOR_BUILD)' \ ++ 'CFLAGS=$(CFLAGS)' \ ++ 'CXXFLAGS=$(CXXFLAGS)' \ ++ 'CFLAGS_FOR_BUILD=$(CFLAGS_FOR_BUILD)' \ ++ 'CFLAGS_FOR_TARGET=$(CFLAGS_FOR_TARGET)' \ ++ 'INSTALL=$(INSTALL)' \ ++ 'INSTALL_DATA=$(INSTALL_DATA)' \ ++ 'INSTALL_PROGRAM=$(INSTALL_PROGRAM)' \ ++ 'INSTALL_SCRIPT=$(INSTALL_SCRIPT)' \ ++ 'JC1FLAGS=$(JC1FLAGS)' \ ++ 'LDFLAGS=$(LDFLAGS)' \ ++ 'LIBCFLAGS=$(LIBCFLAGS)' \ ++ 'LIBCFLAGS_FOR_TARGET=$(LIBCFLAGS_FOR_TARGET)' \ ++ 'MAKE=$(MAKE)' \ ++ 'MAKEINFO=$(MAKEINFO) $(MAKEINFOFLAGS)' \ ++ 'PICFLAG=$(PICFLAG)' \ ++ 'PICFLAG_FOR_TARGET=$(PICFLAG_FOR_TARGET)' \ ++ 'RUNTESTFLAGS=$(RUNTESTFLAGS)' \ ++ 'SHELL=$(SHELL)' \ ++ 'exec_prefix=$(exec_prefix)' \ ++ 'infodir=$(infodir)' \ ++ 'libdir=$(libdir)' \ ++ 'mandir=$(mandir)' \ ++ 'prefix=$(prefix)' \ ++ 'AR=$(AR)' \ ++ 'AS=$(AS)' \ ++ 'CC=$(CC)' \ ++ 'CXX=$(CXX)' \ ++ 'LD=$(LD)' \ ++ 'NM=$(NM)' \ ++ 'RANLIB=$(RANLIB)' \ ++ 'DESTDIR=$(DESTDIR)' + + + # Subdir rules rely on $(FLAGS_TO_PASS) +@@ -571,10 +712,13 @@ + $(am__append_24) $(am__append_25) $(am__append_26) \ + $(am__append_27) $(am__append_28) $(am__append_29) \ + $(am__append_30) $(am__append_31) $(am__append_32) \ +- $(am__append_33) $(am__append_34) ++ $(am__append_33) $(am__append_34) $(am__append_35) \ ++ $(am__append_36) $(am__append_37) $(am__append_38) \ ++ $(am__append_39) + libffi_convenience_la_SOURCES = $(libffi_la_SOURCES) + nodist_libffi_convenience_la_SOURCES = $(nodist_libffi_la_SOURCES) + LTLDFLAGS = $(shell $(SHELL) $(top_srcdir)/libtool-ldflags $(LDFLAGS)) ++AM_CFLAGS = $(am__append_40) + libffi_la_LDFLAGS = -no-undefined -version-info `grep -v '^\#' $(srcdir)/libtool-version` $(LTLDFLAGS) $(AM_LTLDFLAGS) + AM_CPPFLAGS = -I. -I$(top_srcdir)/include -Iinclude -I$(top_srcdir)/src + AM_CCASFLAGS = $(AM_CPPFLAGS) +@@ -645,6 +789,7 @@ + echo rm -f $${locs}; \ + rm -f $${locs}; \ + } ++ + install-toolexeclibLTLIBRARIES: $(toolexeclib_LTLIBRARIES) + @$(NORMAL_INSTALL) + @list='$(toolexeclib_LTLIBRARIES)'; test -n "$(toolexeclibdir)" || list=; \ +@@ -723,10 +868,10 @@ + src/x86/$(DEPDIR)/$(am__dirstamp) + src/x86/sysv.lo: src/x86/$(am__dirstamp) \ + src/x86/$(DEPDIR)/$(am__dirstamp) ++src/x86/win32.lo: src/x86/$(am__dirstamp) \ ++ src/x86/$(DEPDIR)/$(am__dirstamp) + src/x86/freebsd.lo: src/x86/$(am__dirstamp) \ + src/x86/$(DEPDIR)/$(am__dirstamp) +-src/x86/win32.lo: src/x86/$(am__dirstamp) \ +- src/x86/$(DEPDIR)/$(am__dirstamp) + src/x86/win64.lo: src/x86/$(am__dirstamp) \ + src/x86/$(DEPDIR)/$(am__dirstamp) + src/x86/darwin.lo: src/x86/$(am__dirstamp) \ +@@ -787,6 +932,16 @@ + src/m68k/$(DEPDIR)/$(am__dirstamp) + src/m68k/sysv.lo: src/m68k/$(am__dirstamp) \ + src/m68k/$(DEPDIR)/$(am__dirstamp) ++src/m88k/$(am__dirstamp): ++ @$(MKDIR_P) src/m88k ++ @: > src/m88k/$(am__dirstamp) ++src/m88k/$(DEPDIR)/$(am__dirstamp): ++ @$(MKDIR_P) src/m88k/$(DEPDIR) ++ @: > src/m88k/$(DEPDIR)/$(am__dirstamp) ++src/m88k/ffi.lo: src/m88k/$(am__dirstamp) \ ++ src/m88k/$(DEPDIR)/$(am__dirstamp) ++src/m88k/obsd.lo: src/m88k/$(am__dirstamp) \ ++ src/m88k/$(DEPDIR)/$(am__dirstamp) + src/moxie/$(am__dirstamp): + @$(MKDIR_P) src/moxie + @: > src/moxie/$(am__dirstamp) +@@ -807,6 +962,16 @@ + src/microblaze/$(DEPDIR)/$(am__dirstamp) + src/microblaze/sysv.lo: src/microblaze/$(am__dirstamp) \ + src/microblaze/$(DEPDIR)/$(am__dirstamp) ++src/nios2/$(am__dirstamp): ++ @$(MKDIR_P) src/nios2 ++ @: > src/nios2/$(am__dirstamp) ++src/nios2/$(DEPDIR)/$(am__dirstamp): ++ @$(MKDIR_P) src/nios2/$(DEPDIR) ++ @: > src/nios2/$(DEPDIR)/$(am__dirstamp) ++src/nios2/sysv.lo: src/nios2/$(am__dirstamp) \ ++ src/nios2/$(DEPDIR)/$(am__dirstamp) ++src/nios2/ffi.lo: src/nios2/$(am__dirstamp) \ ++ src/nios2/$(DEPDIR)/$(am__dirstamp) + src/powerpc/$(am__dirstamp): + @$(MKDIR_P) src/powerpc + @: > src/powerpc/$(am__dirstamp) +@@ -815,6 +980,10 @@ + @: > src/powerpc/$(DEPDIR)/$(am__dirstamp) + src/powerpc/ffi.lo: src/powerpc/$(am__dirstamp) \ + src/powerpc/$(DEPDIR)/$(am__dirstamp) ++src/powerpc/ffi_sysv.lo: src/powerpc/$(am__dirstamp) \ ++ src/powerpc/$(DEPDIR)/$(am__dirstamp) ++src/powerpc/ffi_linux64.lo: src/powerpc/$(am__dirstamp) \ ++ src/powerpc/$(DEPDIR)/$(am__dirstamp) + src/powerpc/sysv.lo: src/powerpc/$(am__dirstamp) \ + src/powerpc/$(DEPDIR)/$(am__dirstamp) + src/powerpc/ppc_closure.lo: src/powerpc/$(am__dirstamp) \ +@@ -843,6 +1012,16 @@ + src/aarch64/$(DEPDIR)/$(am__dirstamp) + src/aarch64/ffi.lo: src/aarch64/$(am__dirstamp) \ + src/aarch64/$(DEPDIR)/$(am__dirstamp) ++src/arc/$(am__dirstamp): ++ @$(MKDIR_P) src/arc ++ @: > src/arc/$(am__dirstamp) ++src/arc/$(DEPDIR)/$(am__dirstamp): ++ @$(MKDIR_P) src/arc/$(DEPDIR) ++ @: > src/arc/$(DEPDIR)/$(am__dirstamp) ++src/arc/arcompact.lo: src/arc/$(am__dirstamp) \ ++ src/arc/$(DEPDIR)/$(am__dirstamp) ++src/arc/ffi.lo: src/arc/$(am__dirstamp) \ ++ src/arc/$(DEPDIR)/$(am__dirstamp) + src/arm/$(am__dirstamp): + @$(MKDIR_P) src/arm + @: > src/arm/$(am__dirstamp) +@@ -957,10 +1136,22 @@ + src/metag/$(DEPDIR)/$(am__dirstamp) + src/metag/ffi.lo: src/metag/$(am__dirstamp) \ + src/metag/$(DEPDIR)/$(am__dirstamp) ++src/vax/$(am__dirstamp): ++ @$(MKDIR_P) src/vax ++ @: > src/vax/$(am__dirstamp) ++src/vax/$(DEPDIR)/$(am__dirstamp): ++ @$(MKDIR_P) src/vax/$(DEPDIR) ++ @: > src/vax/$(DEPDIR)/$(am__dirstamp) ++src/vax/elfbsd.lo: src/vax/$(am__dirstamp) \ ++ src/vax/$(DEPDIR)/$(am__dirstamp) ++src/vax/ffi.lo: src/vax/$(am__dirstamp) \ ++ src/vax/$(DEPDIR)/$(am__dirstamp) ++ + libffi.la: $(libffi_la_OBJECTS) $(libffi_la_DEPENDENCIES) $(EXTRA_libffi_la_DEPENDENCIES) +- $(libffi_la_LINK) -rpath $(toolexeclibdir) $(libffi_la_OBJECTS) $(libffi_la_LIBADD) $(LIBS) ++ $(AM_V_CCLD)$(libffi_la_LINK) -rpath $(toolexeclibdir) $(libffi_la_OBJECTS) $(libffi_la_LIBADD) $(LIBS) ++ + libffi_convenience.la: $(libffi_convenience_la_OBJECTS) $(libffi_convenience_la_DEPENDENCIES) $(EXTRA_libffi_convenience_la_DEPENDENCIES) +- $(LINK) $(libffi_convenience_la_OBJECTS) $(libffi_convenience_la_LIBADD) $(LIBS) ++ $(AM_V_CCLD)$(LINK) $(libffi_convenience_la_OBJECTS) $(libffi_convenience_la_LIBADD) $(LIBS) + + mostlyclean-compile: + -rm -f *.$(OBJEXT) +@@ -970,6 +1161,8 @@ + -rm -f src/aarch64/*.lo + -rm -f src/alpha/*.$(OBJEXT) + -rm -f src/alpha/*.lo ++ -rm -f src/arc/*.$(OBJEXT) ++ -rm -f src/arc/*.lo + -rm -f src/arm/*.$(OBJEXT) + -rm -f src/arm/*.lo + -rm -f src/avr32/*.$(OBJEXT) +@@ -986,6 +1179,8 @@ + -rm -f src/m32r/*.lo + -rm -f src/m68k/*.$(OBJEXT) + -rm -f src/m68k/*.lo ++ -rm -f src/m88k/*.$(OBJEXT) ++ -rm -f src/m88k/*.lo + -rm -f src/metag/*.$(OBJEXT) + -rm -f src/metag/*.lo + -rm -f src/microblaze/*.$(OBJEXT) +@@ -994,6 +1189,8 @@ + -rm -f src/mips/*.lo + -rm -f src/moxie/*.$(OBJEXT) + -rm -f src/moxie/*.lo ++ -rm -f src/nios2/*.$(OBJEXT) ++ -rm -f src/nios2/*.lo + -rm -f src/pa/*.$(OBJEXT) + -rm -f src/pa/*.lo + -rm -f src/powerpc/*.$(OBJEXT) +@@ -1008,6 +1205,8 @@ + -rm -f src/sparc/*.lo + -rm -f src/tile/*.$(OBJEXT) + -rm -f src/tile/*.lo ++ -rm -f src/vax/*.$(OBJEXT) ++ -rm -f src/vax/*.lo + -rm -f src/x86/*.$(OBJEXT) + -rm -f src/x86/*.lo + -rm -f src/xtensa/*.$(OBJEXT) +@@ -1026,6 +1225,8 @@ + @AMDEP_TRUE@@am__include@ @am__quote@src/aarch64/$(DEPDIR)/sysv.Plo@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@src/alpha/$(DEPDIR)/ffi.Plo@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@src/alpha/$(DEPDIR)/osf.Plo@am__quote@ ++@AMDEP_TRUE@@am__include@ @am__quote@src/arc/$(DEPDIR)/arcompact.Plo@am__quote@ ++@AMDEP_TRUE@@am__include@ @am__quote@src/arc/$(DEPDIR)/ffi.Plo@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@src/arm/$(DEPDIR)/ffi.Plo@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@src/arm/$(DEPDIR)/sysv.Plo@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@src/arm/$(DEPDIR)/trampoline.Plo@am__quote@ +@@ -1043,6 +1244,8 @@ + @AMDEP_TRUE@@am__include@ @am__quote@src/m32r/$(DEPDIR)/sysv.Plo@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@src/m68k/$(DEPDIR)/ffi.Plo@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@src/m68k/$(DEPDIR)/sysv.Plo@am__quote@ ++@AMDEP_TRUE@@am__include@ @am__quote@src/m88k/$(DEPDIR)/ffi.Plo@am__quote@ ++@AMDEP_TRUE@@am__include@ @am__quote@src/m88k/$(DEPDIR)/obsd.Plo@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@src/metag/$(DEPDIR)/ffi.Plo@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@src/metag/$(DEPDIR)/sysv.Plo@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@src/microblaze/$(DEPDIR)/ffi.Plo@am__quote@ +@@ -1052,6 +1255,8 @@ + @AMDEP_TRUE@@am__include@ @am__quote@src/mips/$(DEPDIR)/o32.Plo@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@src/moxie/$(DEPDIR)/eabi.Plo@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@src/moxie/$(DEPDIR)/ffi.Plo@am__quote@ ++@AMDEP_TRUE@@am__include@ @am__quote@src/nios2/$(DEPDIR)/ffi.Plo@am__quote@ ++@AMDEP_TRUE@@am__include@ @am__quote@src/nios2/$(DEPDIR)/sysv.Plo@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@src/pa/$(DEPDIR)/ffi.Plo@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@src/pa/$(DEPDIR)/hpux32.Plo@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@src/pa/$(DEPDIR)/linux.Plo@am__quote@ +@@ -1061,6 +1266,8 @@ + @AMDEP_TRUE@@am__include@ @am__quote@src/powerpc/$(DEPDIR)/darwin_closure.Plo@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@src/powerpc/$(DEPDIR)/ffi.Plo@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@src/powerpc/$(DEPDIR)/ffi_darwin.Plo@am__quote@ ++@AMDEP_TRUE@@am__include@ @am__quote@src/powerpc/$(DEPDIR)/ffi_linux64.Plo@am__quote@ ++@AMDEP_TRUE@@am__include@ @am__quote@src/powerpc/$(DEPDIR)/ffi_sysv.Plo@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@src/powerpc/$(DEPDIR)/linux64.Plo@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@src/powerpc/$(DEPDIR)/linux64_closure.Plo@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@src/powerpc/$(DEPDIR)/ppc_closure.Plo@am__quote@ +@@ -1076,6 +1283,8 @@ + @AMDEP_TRUE@@am__include@ @am__quote@src/sparc/$(DEPDIR)/v9.Plo@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@src/tile/$(DEPDIR)/ffi.Plo@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@src/tile/$(DEPDIR)/tile.Plo@am__quote@ ++@AMDEP_TRUE@@am__include@ @am__quote@src/vax/$(DEPDIR)/elfbsd.Plo@am__quote@ ++@AMDEP_TRUE@@am__include@ @am__quote@src/vax/$(DEPDIR)/ffi.Plo@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@src/x86/$(DEPDIR)/darwin.Plo@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@src/x86/$(DEPDIR)/darwin64.Plo@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@src/x86/$(DEPDIR)/ffi.Plo@am__quote@ +@@ -1089,52 +1298,52 @@ + @AMDEP_TRUE@@am__include@ @am__quote@src/xtensa/$(DEPDIR)/sysv.Plo@am__quote@ + + .S.o: +-@am__fastdepCCAS_TRUE@ depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ ++@am__fastdepCCAS_TRUE@ $(AM_V_CPPAS)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ + @am__fastdepCCAS_TRUE@ $(CPPASCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ + @am__fastdepCCAS_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +-@AMDEP_TRUE@@am__fastdepCCAS_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ ++@AMDEP_TRUE@@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ + @AMDEP_TRUE@@am__fastdepCCAS_FALSE@ DEPDIR=$(DEPDIR) $(CCASDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +-@am__fastdepCCAS_FALSE@ $(CPPASCOMPILE) -c -o $@ $< ++@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS@am__nodep@)$(CPPASCOMPILE) -c -o $@ $< + + .S.obj: +-@am__fastdepCCAS_TRUE@ depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ ++@am__fastdepCCAS_TRUE@ $(AM_V_CPPAS)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ + @am__fastdepCCAS_TRUE@ $(CPPASCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ + @am__fastdepCCAS_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +-@AMDEP_TRUE@@am__fastdepCCAS_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ ++@AMDEP_TRUE@@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ + @AMDEP_TRUE@@am__fastdepCCAS_FALSE@ DEPDIR=$(DEPDIR) $(CCASDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +-@am__fastdepCCAS_FALSE@ $(CPPASCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` ++@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS@am__nodep@)$(CPPASCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + + .S.lo: +-@am__fastdepCCAS_TRUE@ depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ ++@am__fastdepCCAS_TRUE@ $(AM_V_CPPAS)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ + @am__fastdepCCAS_TRUE@ $(LTCPPASCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ + @am__fastdepCCAS_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo +-@AMDEP_TRUE@@am__fastdepCCAS_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ ++@AMDEP_TRUE@@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ + @AMDEP_TRUE@@am__fastdepCCAS_FALSE@ DEPDIR=$(DEPDIR) $(CCASDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +-@am__fastdepCCAS_FALSE@ $(LTCPPASCOMPILE) -c -o $@ $< ++@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS@am__nodep@)$(LTCPPASCOMPILE) -c -o $@ $< + + .c.o: +-@am__fastdepCC_TRUE@ depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ ++@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ + @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ + @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ ++@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ + @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +-@am__fastdepCC_FALSE@ $(COMPILE) -c -o $@ $< ++@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< + + .c.obj: +-@am__fastdepCC_TRUE@ depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ ++@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ + @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ + @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ ++@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ + @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +-@am__fastdepCC_FALSE@ $(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` ++@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + + .c.lo: +-@am__fastdepCC_TRUE@ depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ ++@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ + @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ + @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo +-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ ++@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ + @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +-@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< ++@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< + + mostlyclean-libtool: + -rm -f *.lo +@@ -1144,6 +1353,7 @@ + -rm -rf src/.libs src/_libs + -rm -rf src/aarch64/.libs src/aarch64/_libs + -rm -rf src/alpha/.libs src/alpha/_libs ++ -rm -rf src/arc/.libs src/arc/_libs + -rm -rf src/arm/.libs src/arm/_libs + -rm -rf src/avr32/.libs src/avr32/_libs + -rm -rf src/bfin/.libs src/bfin/_libs +@@ -1152,10 +1362,12 @@ + -rm -rf src/ia64/.libs src/ia64/_libs + -rm -rf src/m32r/.libs src/m32r/_libs + -rm -rf src/m68k/.libs src/m68k/_libs ++ -rm -rf src/m88k/.libs src/m88k/_libs + -rm -rf src/metag/.libs src/metag/_libs + -rm -rf src/microblaze/.libs src/microblaze/_libs + -rm -rf src/mips/.libs src/mips/_libs + -rm -rf src/moxie/.libs src/moxie/_libs ++ -rm -rf src/nios2/.libs src/nios2/_libs + -rm -rf src/pa/.libs src/pa/_libs + -rm -rf src/powerpc/.libs src/powerpc/_libs + -rm -rf src/s390/.libs src/s390/_libs +@@ -1163,6 +1375,7 @@ + -rm -rf src/sh64/.libs src/sh64/_libs + -rm -rf src/sparc/.libs src/sparc/_libs + -rm -rf src/tile/.libs src/tile/_libs ++ -rm -rf src/vax/.libs src/vax/_libs + -rm -rf src/x86/.libs src/x86/_libs + -rm -rf src/xtensa/.libs src/xtensa/_libs + +@@ -1173,7 +1386,7 @@ + @: > doc/$(am__dirstamp) + + $(srcdir)/doc/libffi.info: doc/libffi.texi $(srcdir)/doc/version.texi +- restore=: && backupdir="$(am__leading_dot)am$$$$" && \ ++ $(AM_V_MAKEINFO)restore=: && backupdir="$(am__leading_dot)am$$$$" && \ + am__cwd=`pwd` && $(am__cd) $(srcdir) && \ + rm -rf $$backupdir && mkdir $$backupdir && \ + if ($(MAKEINFO) --version) >/dev/null 2>&1; then \ +@@ -1195,18 +1408,20 @@ + rm -rf $$backupdir; exit $$rc + + doc/libffi.dvi: doc/libffi.texi $(srcdir)/doc/version.texi doc/$(am__dirstamp) +- TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \ ++ $(AM_V_TEXI2DVI)TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \ + MAKEINFO='$(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I doc -I $(srcdir)/doc' \ +- $(TEXI2DVI) --clean -o $@ `test -f 'doc/libffi.texi' || echo '$(srcdir)/'`doc/libffi.texi ++ $(TEXI2DVI) $(AM_V_texinfo) --build-dir=$(@:.dvi=.t2d) -o $@ $(AM_V_texidevnull) \ ++ `test -f 'doc/libffi.texi' || echo '$(srcdir)/'`doc/libffi.texi + + doc/libffi.pdf: doc/libffi.texi $(srcdir)/doc/version.texi doc/$(am__dirstamp) +- TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \ ++ $(AM_V_TEXI2PDF)TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \ + MAKEINFO='$(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I doc -I $(srcdir)/doc' \ +- $(TEXI2PDF) --clean -o $@ `test -f 'doc/libffi.texi' || echo '$(srcdir)/'`doc/libffi.texi ++ $(TEXI2PDF) $(AM_V_texinfo) --build-dir=$(@:.pdf=.t2p) -o $@ $(AM_V_texidevnull) \ ++ `test -f 'doc/libffi.texi' || echo '$(srcdir)/'`doc/libffi.texi + + doc/libffi.html: doc/libffi.texi $(srcdir)/doc/version.texi doc/$(am__dirstamp) +- rm -rf $(@:.html=.htp) +- if $(MAKEINFOHTML) $(AM_MAKEINFOHTMLFLAGS) $(MAKEINFOFLAGS) -I doc -I $(srcdir)/doc \ ++ $(AM_V_MAKEINFO)rm -rf $(@:.html=.htp) ++ $(AM_V_at)if $(MAKEINFOHTML) $(AM_MAKEINFOHTMLFLAGS) $(MAKEINFOFLAGS) -I doc -I $(srcdir)/doc \ + -o $(@:.html=.htp) `test -f 'doc/libffi.texi' || echo '$(srcdir)/'`doc/libffi.texi; \ + then \ + rm -rf $@; \ +@@ -1238,8 +1453,8 @@ + maintainer-clean-vti: + @MAINTAINER_MODE_TRUE@ -rm -f $(srcdir)/doc/stamp-vti $(srcdir)/doc/version.texi + .dvi.ps: +- TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \ +- $(DVIPS) -o $@ $< ++ $(AM_V_DVIPS)TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \ ++ $(DVIPS) $(AM_V_texinfo) -o $@ $< + + uninstall-dvi-am: + @$(NORMAL_UNINSTALL) +@@ -1318,8 +1533,7 @@ + done + + mostlyclean-aminfo: +- -rm -rf libffi.aux libffi.cp libffi.cps libffi.fn libffi.ky libffi.log \ +- libffi.pg libffi.tmp libffi.toc libffi.tp libffi.vr ++ -rm -rf doc/libffi.t2d doc/libffi.t2p + + clean-aminfo: + -test -z "doc/libffi.dvi doc/libffi.pdf doc/libffi.ps doc/libffi.html" \ +@@ -1359,14 +1573,13 @@ + # (1) if the variable is set in 'config.status', edit 'config.status' + # (which will cause the Makefiles to be regenerated when you run 'make'); + # (2) otherwise, pass the desired values on the 'make' command line. +-$(RECURSIVE_TARGETS) $(RECURSIVE_CLEAN_TARGETS): +- @fail= failcom='exit 1'; \ +- for f in x $$MAKEFLAGS; do \ +- case $$f in \ +- *=* | --[!k]*);; \ +- *k*) failcom='fail=yes';; \ +- esac; \ +- done; \ ++$(am__recursive_targets): ++ @fail=; \ ++ if $(am__make_keepgoing); then \ ++ failcom='fail=yes'; \ ++ else \ ++ failcom='exit 1'; \ ++ fi; \ + dot_seen=no; \ + target=`echo $@ | sed s/-recursive//`; \ + case "$@" in \ +@@ -1387,31 +1600,13 @@ + if test "$$dot_seen" = "no"; then \ + $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ + fi; test -z "$$fail" +-tags-recursive: +- list='$(SUBDIRS)'; for subdir in $$list; do \ +- test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ +- done +-ctags-recursive: +- list='$(SUBDIRS)'; for subdir in $$list; do \ +- test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ +- done +-cscopelist-recursive: +- list='$(SUBDIRS)'; for subdir in $$list; do \ +- test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) cscopelist); \ +- done + +-ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) +- list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ +- unique=`for i in $$list; do \ +- if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ +- done | \ +- $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ +- END { if (nonempty) { for (i in files) print i; }; }'`; \ +- mkid -fID $$unique +-tags: TAGS ++ID: $(am__tagged_files) ++ $(am__define_uniq_tagged_files); mkid -fID $$unique ++tags: tags-recursive ++TAGS: tags + +-TAGS: tags-recursive $(HEADERS) $(SOURCES) fficonfig.h.in $(TAGS_DEPENDENCIES) \ +- $(TAGS_FILES) $(LISP) ++tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + set x; \ + here=`pwd`; \ + if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ +@@ -1427,12 +1622,7 @@ + set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ + fi; \ + done; \ +- list='$(SOURCES) $(HEADERS) fficonfig.h.in $(LISP) $(TAGS_FILES)'; \ +- unique=`for i in $$list; do \ +- if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ +- done | \ +- $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ +- END { if (nonempty) { for (i in files) print i; }; }'`; \ ++ $(am__define_uniq_tagged_files); \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ +@@ -1444,15 +1634,11 @@ + $$unique; \ + fi; \ + fi +-ctags: CTAGS +-CTAGS: ctags-recursive $(HEADERS) $(SOURCES) fficonfig.h.in $(TAGS_DEPENDENCIES) \ +- $(TAGS_FILES) $(LISP) +- list='$(SOURCES) $(HEADERS) fficonfig.h.in $(LISP) $(TAGS_FILES)'; \ +- unique=`for i in $$list; do \ +- if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ +- done | \ +- $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ +- END { if (nonempty) { for (i in files) print i; }; }'`; \ ++ctags: ctags-recursive ++ ++CTAGS: ctags ++ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) ++ $(am__define_uniq_tagged_files); \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique +@@ -1461,18 +1647,16 @@ + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" +- + cscope: cscope.files + test ! -s cscope.files \ + || $(CSCOPE) -b -q $(AM_CSCOPEFLAGS) $(CSCOPEFLAGS) -i cscope.files $(CSCOPE_ARGS) +- + clean-cscope: + -rm -f cscope.files ++cscope.files: clean-cscope cscopelist ++cscopelist: cscopelist-recursive + +-cscope.files: clean-cscope cscopelist-recursive cscopelist +- +-cscopelist: cscopelist-recursive $(HEADERS) $(SOURCES) $(LISP) +- list='$(SOURCES) $(HEADERS) $(LISP)'; \ ++cscopelist-am: $(am__tagged_files) ++ list='$(am__tagged_files)'; \ + case "$(srcdir)" in \ + [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ + *) sdir=$(subdir)/$(srcdir) ;; \ +@@ -1548,7 +1732,7 @@ + done + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$(top_distdir)" distdir="$(distdir)" \ +- dist-info ++ dist-info dist-hook + -test -n "$(am__skip_mode_fix)" \ + || find "$(distdir)" -type d ! -perm -755 \ + -exec chmod u+rwx,go+rx {} \; -o \ +@@ -1609,9 +1793,9 @@ + *.zip*) \ + unzip $(distdir).zip ;;\ + esac +- chmod -R a-w $(distdir); chmod u+w $(distdir) +- mkdir $(distdir)/_build +- mkdir $(distdir)/_inst ++ chmod -R a-w $(distdir) ++ chmod u+w $(distdir) ++ mkdir $(distdir)/_build $(distdir)/_inst + chmod a-w $(distdir) + test -d $(distdir)/_build || exit 0; \ + dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ +@@ -1714,6 +1898,8 @@ + -rm -f src/aarch64/$(am__dirstamp) + -rm -f src/alpha/$(DEPDIR)/$(am__dirstamp) + -rm -f src/alpha/$(am__dirstamp) ++ -rm -f src/arc/$(DEPDIR)/$(am__dirstamp) ++ -rm -f src/arc/$(am__dirstamp) + -rm -f src/arm/$(DEPDIR)/$(am__dirstamp) + -rm -f src/arm/$(am__dirstamp) + -rm -f src/avr32/$(DEPDIR)/$(am__dirstamp) +@@ -1730,6 +1916,8 @@ + -rm -f src/m32r/$(am__dirstamp) + -rm -f src/m68k/$(DEPDIR)/$(am__dirstamp) + -rm -f src/m68k/$(am__dirstamp) ++ -rm -f src/m88k/$(DEPDIR)/$(am__dirstamp) ++ -rm -f src/m88k/$(am__dirstamp) + -rm -f src/metag/$(DEPDIR)/$(am__dirstamp) + -rm -f src/metag/$(am__dirstamp) + -rm -f src/microblaze/$(DEPDIR)/$(am__dirstamp) +@@ -1738,6 +1926,8 @@ + -rm -f src/mips/$(am__dirstamp) + -rm -f src/moxie/$(DEPDIR)/$(am__dirstamp) + -rm -f src/moxie/$(am__dirstamp) ++ -rm -f src/nios2/$(DEPDIR)/$(am__dirstamp) ++ -rm -f src/nios2/$(am__dirstamp) + -rm -f src/pa/$(DEPDIR)/$(am__dirstamp) + -rm -f src/pa/$(am__dirstamp) + -rm -f src/powerpc/$(DEPDIR)/$(am__dirstamp) +@@ -1752,6 +1942,8 @@ + -rm -f src/sparc/$(am__dirstamp) + -rm -f src/tile/$(DEPDIR)/$(am__dirstamp) + -rm -f src/tile/$(am__dirstamp) ++ -rm -f src/vax/$(DEPDIR)/$(am__dirstamp) ++ -rm -f src/vax/$(am__dirstamp) + -rm -f src/x86/$(DEPDIR)/$(am__dirstamp) + -rm -f src/x86/$(am__dirstamp) + -rm -f src/xtensa/$(DEPDIR)/$(am__dirstamp) +@@ -1768,7 +1960,7 @@ + + distclean: distclean-recursive + -rm -f $(am__CONFIG_DISTCLEAN_FILES) +- -rm -rf src/$(DEPDIR) src/aarch64/$(DEPDIR) src/alpha/$(DEPDIR) src/arm/$(DEPDIR) src/avr32/$(DEPDIR) src/bfin/$(DEPDIR) src/cris/$(DEPDIR) src/frv/$(DEPDIR) src/ia64/$(DEPDIR) src/m32r/$(DEPDIR) src/m68k/$(DEPDIR) src/metag/$(DEPDIR) src/microblaze/$(DEPDIR) src/mips/$(DEPDIR) src/moxie/$(DEPDIR) src/pa/$(DEPDIR) src/powerpc/$(DEPDIR) src/s390/$(DEPDIR) src/sh/$(DEPDIR) src/sh64/$(DEPDIR) src/sparc/$(DEPDIR) src/tile/$(DEPDIR) src/x86/$(DEPDIR) src/xtensa/$(DEPDIR) ++ -rm -rf src/$(DEPDIR) src/aarch64/$(DEPDIR) src/alpha/$(DEPDIR) src/arc/$(DEPDIR) src/arm/$(DEPDIR) src/avr32/$(DEPDIR) src/bfin/$(DEPDIR) src/cris/$(DEPDIR) src/frv/$(DEPDIR) src/ia64/$(DEPDIR) src/m32r/$(DEPDIR) src/m68k/$(DEPDIR) src/m88k/$(DEPDIR) src/metag/$(DEPDIR) src/microblaze/$(DEPDIR) src/mips/$(DEPDIR) src/moxie/$(DEPDIR) src/nios2/$(DEPDIR) src/pa/$(DEPDIR) src/powerpc/$(DEPDIR) src/s390/$(DEPDIR) src/sh/$(DEPDIR) src/sh64/$(DEPDIR) src/sparc/$(DEPDIR) src/tile/$(DEPDIR) src/vax/$(DEPDIR) src/x86/$(DEPDIR) src/xtensa/$(DEPDIR) + -rm -f Makefile + distclean-am: clean-am distclean-compile distclean-generic \ + distclean-hdr distclean-libtool distclean-tags +@@ -1907,7 +2099,7 @@ + maintainer-clean: maintainer-clean-recursive + -rm -f $(am__CONFIG_DISTCLEAN_FILES) + -rm -rf $(top_srcdir)/autom4te.cache +- -rm -rf src/$(DEPDIR) src/aarch64/$(DEPDIR) src/alpha/$(DEPDIR) src/arm/$(DEPDIR) src/avr32/$(DEPDIR) src/bfin/$(DEPDIR) src/cris/$(DEPDIR) src/frv/$(DEPDIR) src/ia64/$(DEPDIR) src/m32r/$(DEPDIR) src/m68k/$(DEPDIR) src/metag/$(DEPDIR) src/microblaze/$(DEPDIR) src/mips/$(DEPDIR) src/moxie/$(DEPDIR) src/pa/$(DEPDIR) src/powerpc/$(DEPDIR) src/s390/$(DEPDIR) src/sh/$(DEPDIR) src/sh64/$(DEPDIR) src/sparc/$(DEPDIR) src/tile/$(DEPDIR) src/x86/$(DEPDIR) src/xtensa/$(DEPDIR) ++ -rm -rf src/$(DEPDIR) src/aarch64/$(DEPDIR) src/alpha/$(DEPDIR) src/arc/$(DEPDIR) src/arm/$(DEPDIR) src/avr32/$(DEPDIR) src/bfin/$(DEPDIR) src/cris/$(DEPDIR) src/frv/$(DEPDIR) src/ia64/$(DEPDIR) src/m32r/$(DEPDIR) src/m68k/$(DEPDIR) src/m88k/$(DEPDIR) src/metag/$(DEPDIR) src/microblaze/$(DEPDIR) src/mips/$(DEPDIR) src/moxie/$(DEPDIR) src/nios2/$(DEPDIR) src/pa/$(DEPDIR) src/powerpc/$(DEPDIR) src/s390/$(DEPDIR) src/sh/$(DEPDIR) src/sh64/$(DEPDIR) src/sparc/$(DEPDIR) src/tile/$(DEPDIR) src/vax/$(DEPDIR) src/x86/$(DEPDIR) src/xtensa/$(DEPDIR) + -rm -f Makefile + maintainer-clean-am: distclean-am maintainer-clean-aminfo \ + maintainer-clean-generic maintainer-clean-vti +@@ -1929,36 +2121,36 @@ + uninstall-pdf-am uninstall-pkgconfigDATA uninstall-ps-am \ + uninstall-toolexeclibLTLIBRARIES + +-.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) all \ +- cscopelist-recursive ctags-recursive install-am install-strip \ +- tags-recursive ++.MAKE: $(am__recursive_targets) all install-am install-strip + +-.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ +- all all-am am--refresh check check-am clean clean-aminfo \ +- clean-cscope clean-generic clean-libtool \ +- clean-noinstLTLIBRARIES clean-toolexeclibLTLIBRARIES cscope \ +- cscopelist cscopelist-recursive ctags ctags-recursive dist \ +- dist-all dist-bzip2 dist-gzip dist-info dist-lzip dist-shar \ +- dist-tarZ dist-xz dist-zip distcheck distclean \ +- distclean-compile distclean-generic distclean-hdr \ +- distclean-libtool distclean-tags distcleancheck distdir \ +- distuninstallcheck dvi dvi-am html html-am info info-am \ +- install install-am install-data install-data-am install-dvi \ +- install-dvi-am install-exec install-exec-am install-html \ +- install-html-am install-info install-info-am install-man \ +- install-pdf install-pdf-am install-pkgconfigDATA install-ps \ +- install-ps-am install-strip install-toolexeclibLTLIBRARIES \ +- installcheck installcheck-am installdirs installdirs-am \ +- maintainer-clean maintainer-clean-aminfo \ +- maintainer-clean-generic maintainer-clean-vti mostlyclean \ +- mostlyclean-aminfo mostlyclean-compile mostlyclean-generic \ +- mostlyclean-libtool mostlyclean-vti pdf pdf-am ps ps-am tags \ +- tags-recursive uninstall uninstall-am uninstall-dvi-am \ +- uninstall-html-am uninstall-info-am uninstall-pdf-am \ +- uninstall-pkgconfigDATA uninstall-ps-am \ +- uninstall-toolexeclibLTLIBRARIES ++.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am \ ++ am--refresh check check-am clean clean-aminfo clean-cscope \ ++ clean-generic clean-libtool clean-noinstLTLIBRARIES \ ++ clean-toolexeclibLTLIBRARIES cscope cscopelist-am ctags \ ++ ctags-am dist dist-all dist-bzip2 dist-gzip dist-hook \ ++ dist-info dist-lzip dist-shar dist-tarZ dist-xz dist-zip \ ++ distcheck distclean distclean-compile distclean-generic \ ++ distclean-hdr distclean-libtool distclean-tags distcleancheck \ ++ distdir distuninstallcheck dvi dvi-am html html-am info \ ++ info-am install install-am install-data install-data-am \ ++ install-dvi install-dvi-am install-exec install-exec-am \ ++ install-html install-html-am install-info install-info-am \ ++ install-man install-pdf install-pdf-am install-pkgconfigDATA \ ++ install-ps install-ps-am install-strip \ ++ install-toolexeclibLTLIBRARIES installcheck installcheck-am \ ++ installdirs installdirs-am maintainer-clean \ ++ maintainer-clean-aminfo maintainer-clean-generic \ ++ maintainer-clean-vti mostlyclean mostlyclean-aminfo \ ++ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ ++ mostlyclean-vti pdf pdf-am ps ps-am tags tags-am uninstall \ ++ uninstall-am uninstall-dvi-am uninstall-html-am \ ++ uninstall-info-am uninstall-pdf-am uninstall-pkgconfigDATA \ ++ uninstall-ps-am uninstall-toolexeclibLTLIBRARIES + + ++dist-hook: ++ if [ -d $(top_srcdir)/.git ] ; then (cd $(top_srcdir); git log --no-decorate) ; else echo 'See git log for history.' ; fi > $(distdir)/ChangeLog ++ + # Tell versions [3.59,3.63) of GNU make to not export all variables. + # Otherwise a system limit (for SysV at least) may be exceeded. + .NOEXPORT: +diff -r c0e311e010fc Modules/_ctypes/libffi/README +--- a/Modules/_ctypes/libffi/README ++++ b/Modules/_ctypes/libffi/README +@@ -1,8 +1,8 @@ + Status + ====== + +-libffi-3.0.13 was released on March 17, 2013. Check the libffi web +-page for updates: . ++libffi-3.1 was released on May 19, 2014. Check the libffi web page ++for updates: . + + + What is libffi? +@@ -43,7 +43,7 @@ + For specific configuration details and testing status, please + refer to the wiki page here: + +- http://www.moxielogic.org/wiki/index.php?title=Libffi_3.0.13 ++ http://www.moxielogic.org/wiki/index.php?title=Libffi_3.1 + + At the time of release, the following basic configurations have been + tested: +@@ -51,9 +51,11 @@ + |-----------------+------------------+-------------------------| + | Architecture | Operating System | Compiler | + |-----------------+------------------+-------------------------| ++| AArch64 (ARM64) | iOS | Clang | + | AArch64 | Linux | GCC | + | Alpha | Linux | GCC | + | Alpha | Tru64 | GCC | ++| ARC | Linux | GCC | + | ARM | Linux | GCC | + | ARM | iOS | GCC | + | AVR32 | Linux | GCC | +@@ -61,15 +63,17 @@ + | HPPA | HPUX | GCC | + | IA-64 | Linux | GCC | + | M68K | FreeMiNT | GCC | +-| M68K | Linux | GCC | ++| M68K | Linux | GCC | + | M68K | RTEMS | GCC | ++| M88K | OpenBSD/mvme88k | GCC | + | Meta | Linux | GCC | + | MicroBlaze | Linux | GCC | + | MIPS | IRIX | GCC | + | MIPS | Linux | GCC | + | MIPS | RTEMS | GCC | + | MIPS64 | Linux | GCC | +-| Moxie | Bare metal | GCC ++| Moxie | Bare metal | GCC | ++| Nios II | Linux | GCC | + | PowerPC 32-bit | AIX | IBM XL C | + | PowerPC 64-bit | AIX | IBM XL C | + | PowerPC | AMIGA | GCC | +@@ -77,7 +81,8 @@ + | PowerPC | Mac OSX | GCC | + | PowerPC | FreeBSD | GCC | + | PowerPC 64-bit | FreeBSD | GCC | +-| PowerPC 64-bit | Linux | GCC | ++| PowerPC 64-bit | Linux ELFv1 | GCC | ++| PowerPC 64-bit | Linux ELFv2 | GCC | + | S390 | Linux | GCC | + | S390X | Linux | GCC | + | SPARC | Linux | GCC | +@@ -87,6 +92,7 @@ + | SPARC64 | FreeBSD | GCC | + | SPARC64 | Solaris | Oracle Solaris Studio C | + | TILE-Gx/TILEPro | Linux | GCC | ++| VAX | OpenBSD/vax | GCC | + | X86 | FreeBSD | GCC | + | X86 | GNU HURD | GCC | + | X86 | Interix | GCC | +@@ -120,6 +126,9 @@ + "configure" program found in the root directory of the libffi source + distribution. + ++If you're building libffi directly from version control, configure won't ++exist yet; run ./autogen.sh first. ++ + You may want to tell configure where to install the libffi library and + header files. To do that, use the --prefix configure switch. Libffi + will install under /usr/local by default. +@@ -137,13 +146,16 @@ + Microsoft's Visual C++ compiler. In this case, use the msvcc.sh + wrapper script during configuration like so: + +-path/to/configure CC=path/to/msvcc.sh LD=link CPP=\"cl -nologo -EP\" ++path/to/configure CC=path/to/msvcc.sh CXX=path/to/msvcc.sh LD=link CPP=\"cl -nologo -EP\" + +-For 64-bit Windows builds, use CC="path/to/msvcc.sh -m64". +-You may also need to specify --build appropriately. When building with MSVC +-under a MingW environment, you may need to remove the line in configure +-that sets 'fix_srcfile_path' to a 'cygpath' command. ('cygpath' is not +-present in MingW, and is not required when using MingW-style paths.) ++For 64-bit Windows builds, use CC="path/to/msvcc.sh -m64" and ++CXX="path/to/msvcc.sh -m64". You may also need to specify --build ++appropriately. ++ ++When building with MSVC under a MingW environment, you may need to ++remove the line in configure that sets 'fix_srcfile_path' to a 'cygpath' ++command. ('cygpath' is not present in MingW, and is not required when ++using MingW-style paths.) + + For iOS builds, the 'libffi.xcodeproj' Xcode project is available. + +@@ -161,7 +173,20 @@ + History + ======= + +-See the ChangeLog files for details. ++See the git log for details at http://github.com/atgreen/libffi. ++ ++3.1 May-19-14 ++ Add AArch64 (ARM64) iOS support. ++ Add Nios II support. ++ Add m88k and DEC VAX support. ++ Add support for stdcall, thiscall, and fastcall on non-Windows ++ 32-bit x86 targets such as Linux. ++ Various Android, MIPS N32, x86, FreeBSD and UltraSPARC IIi ++ fixes. ++ Make the testsuite more robust: eliminate several spurious ++ failures, and respect the $CC and $CXX environment variables. ++ Archive off the manually maintained ChangeLog in favor of git ++ log. + + 3.0.13 Mar-17-13 + Add Meta support. +@@ -187,7 +212,6 @@ + + 3.0.11 Apr-11-12 + Lots of build fixes. +- Add Amiga newer MacOS support. + Add support for variadic functions (ffi_prep_cif_var). + Add Linux/x32 support. + Add thiscall, fastcall and MSVC cdecl support on Windows. +@@ -339,7 +363,7 @@ + Authors & Credits + ================= + +-libffi was originally written by Anthony Green . ++libffi was originally written by Anthony Green . + + The developers of the GNU Compiler Collection project have made + innumerable valuable contributions. See the ChangeLog file for +@@ -363,10 +387,12 @@ + ia64 Hans Boehm + m32r Kazuhiro Inaoka + m68k Andreas Schwab ++m88k Miod Vallat + microblaze Nathan Rossi + mips Anthony Green, Casey Marshall + mips64 David Daney + moxie Anthony Green ++nios ii Sandra Loosemore + pa Randolph Chung, Dave Anglin, Andreas Tobler + powerpc Geoffrey Keating, Andreas Tobler, + David Edelsohn, John Hornkvist +@@ -376,6 +402,7 @@ + sh64 Kaz Kojima + sparc Anthony Green, Gordon Irlam + tile-gx/tilepro Walter Lee ++vax Miod Vallat + x86 Anthony Green, Jon Beniston + x86-64 Bo Thorsen + xtensa Chris Zankel +diff -r c0e311e010fc Modules/_ctypes/libffi/aclocal.m4 +--- a/Modules/_ctypes/libffi/aclocal.m4 ++++ b/Modules/_ctypes/libffi/aclocal.m4 +@@ -1,6 +1,6 @@ +-# generated automatically by aclocal 1.12.2 -*- Autoconf -*- ++# generated automatically by aclocal 1.13.4 -*- Autoconf -*- + +-# Copyright (C) 1996-2012 Free Software Foundation, Inc. ++# Copyright (C) 1996-2013 Free Software Foundation, Inc. + + # This file is free software; the Free Software Foundation + # gives unlimited permission to copy and/or distribute it, +@@ -11,6 +11,7 @@ + # even the implied warranty of MERCHANTABILITY or FITNESS FOR A + # PARTICULAR PURPOSE. + ++m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])]) + m4_ifndef([AC_AUTOCONF_VERSION], + [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl + m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],, +@@ -837,24 +838,22 @@ + dnl aclocal-1.4 backwards compatibility: + dnl AC_DEFUN([AC_LTDL_DLSYM_USCORE], []) + +-# Copyright (C) 2002-2012 Free Software Foundation, Inc. ++# Copyright (C) 2002-2013 Free Software Foundation, Inc. + # + # This file is free software; the Free Software Foundation + # gives unlimited permission to copy and/or distribute it, + # with or without modifications, as long as this notice is preserved. + +-# serial 8 +- + # AM_AUTOMAKE_VERSION(VERSION) + # ---------------------------- + # Automake X.Y traces this macro to ensure aclocal.m4 has been + # generated from the m4 files accompanying Automake X.Y. + # (This private macro should not be called outside this file.) + AC_DEFUN([AM_AUTOMAKE_VERSION], +-[am__api_version='1.12' ++[am__api_version='1.13' + dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to + dnl require some minimum version. Point them to the right macro. +-m4_if([$1], [1.12.2], [], ++m4_if([$1], [1.13.4], [], + [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl + ]) + +@@ -870,21 +869,19 @@ + # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. + # This function is AC_REQUIREd by AM_INIT_AUTOMAKE. + AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], +-[AM_AUTOMAKE_VERSION([1.12.2])dnl ++[AM_AUTOMAKE_VERSION([1.13.4])dnl + m4_ifndef([AC_AUTOCONF_VERSION], + [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl + _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) + + # Figure out how to run the assembler. -*- Autoconf -*- + +-# Copyright (C) 2001-2012 Free Software Foundation, Inc. ++# Copyright (C) 2001-2013 Free Software Foundation, Inc. + # + # This file is free software; the Free Software Foundation + # gives unlimited permission to copy and/or distribute it, + # with or without modifications, as long as this notice is preserved. + +-# serial 5 +- + # AM_PROG_AS + # ---------- + AC_DEFUN([AM_PROG_AS], +@@ -899,14 +896,12 @@ + + # AM_AUX_DIR_EXPAND -*- Autoconf -*- + +-# Copyright (C) 2001-2012 Free Software Foundation, Inc. ++# Copyright (C) 2001-2013 Free Software Foundation, Inc. + # + # This file is free software; the Free Software Foundation + # gives unlimited permission to copy and/or distribute it, + # with or without modifications, as long as this notice is preserved. + +-# serial 2 +- + # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets + # $ac_aux_dir to '$srcdir/foo'. In other projects, it is set to + # '$srcdir', '$srcdir/..', or '$srcdir/../..'. +@@ -954,14 +949,12 @@ + + # AM_CONDITIONAL -*- Autoconf -*- + +-# Copyright (C) 1997-2012 Free Software Foundation, Inc. ++# Copyright (C) 1997-2013 Free Software Foundation, Inc. + # + # This file is free software; the Free Software Foundation + # gives unlimited permission to copy and/or distribute it, + # with or without modifications, as long as this notice is preserved. + +-# serial 10 +- + # AM_CONDITIONAL(NAME, SHELL-CONDITION) + # ------------------------------------- + # Define a conditional. +@@ -987,13 +980,12 @@ + Usually this means the macro was only invoked conditionally.]]) + fi])]) + +-# Copyright (C) 1999-2012 Free Software Foundation, Inc. ++# Copyright (C) 1999-2013 Free Software Foundation, Inc. + # + # This file is free software; the Free Software Foundation + # gives unlimited permission to copy and/or distribute it, + # with or without modifications, as long as this notice is preserved. + +-# serial 17 + + # There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be + # written in clear, in which case automake, when reading aclocal.m4, +@@ -1179,19 +1171,18 @@ + + # Generate code to set up dependency tracking. -*- Autoconf -*- + +-# Copyright (C) 1999-2012 Free Software Foundation, Inc. ++# Copyright (C) 1999-2013 Free Software Foundation, Inc. + # + # This file is free software; the Free Software Foundation + # gives unlimited permission to copy and/or distribute it, + # with or without modifications, as long as this notice is preserved. + +-# serial 6 + + # _AM_OUTPUT_DEPENDENCY_COMMANDS + # ------------------------------ + AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], + [{ +- # Autoconf 2.62 quotes --file arguments for eval, but not when files ++ # Older Autoconf quotes --file arguments for eval, but not when files + # are listed without --file. Let's play safe and only enable the eval + # if we detect the quoting. + case $CONFIG_FILES in +@@ -1220,7 +1211,7 @@ + DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` + test -z "$DEPDIR" && continue + am__include=`sed -n 's/^am__include = //p' < "$mf"` +- test -z "am__include" && continue ++ test -z "$am__include" && continue + am__quote=`sed -n 's/^am__quote = //p' < "$mf"` + # Find all dependency output files, they are included files with + # $(DEPDIR) in their names. We invoke sed twice because it is the +@@ -1256,14 +1247,12 @@ + + # Do all the work for Automake. -*- Autoconf -*- + +-# Copyright (C) 1996-2012 Free Software Foundation, Inc. ++# Copyright (C) 1996-2013 Free Software Foundation, Inc. + # + # This file is free software; the Free Software Foundation + # gives unlimited permission to copy and/or distribute it, + # with or without modifications, as long as this notice is preserved. + +-# serial 19 +- + # This macro actually does too much. Some checks are only needed if + # your package does certain things. But this isn't really a big deal. + +@@ -1279,7 +1268,7 @@ + # arguments mandatory, and then we can depend on a new Autoconf + # release and drop the old call support. + AC_DEFUN([AM_INIT_AUTOMAKE], +-[AC_PREREQ([2.62])dnl ++[AC_PREREQ([2.65])dnl + dnl Autoconf wants to disallow AM_ names. We explicitly allow + dnl the ones we care about. + m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl +@@ -1309,8 +1298,7 @@ + dnl Distinguish between old-style and new-style calls. + m4_ifval([$2], + [AC_DIAGNOSE([obsolete], +-[$0: two- and three-arguments forms are deprecated. For more info, see: +-http://www.gnu.org/software/automake/manual/automake.html#Modernize-AM_INIT_AUTOMAKE-invocation]) ++ [$0: two- and three-arguments forms are deprecated.]) + m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl + AC_SUBST([PACKAGE], [$1])dnl + AC_SUBST([VERSION], [$2])], +@@ -1364,18 +1352,15 @@ + [_AM_DEPENDENCIES([OBJC])], + [m4_define([AC_PROG_OBJC], + m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl +-dnl Support for Objective C++ was only introduced in Autoconf 2.65, +-dnl but we still cater to Autoconf 2.62. +-m4_ifdef([AC_PROG_OBJCXX], +-[AC_PROVIDE_IFELSE([AC_PROG_OBJCXX], ++AC_PROVIDE_IFELSE([AC_PROG_OBJCXX], + [_AM_DEPENDENCIES([OBJCXX])], + [m4_define([AC_PROG_OBJCXX], +- m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])])dnl ++ m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl + ]) +-_AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl +-dnl The 'parallel-tests' driver may need to know about EXEEXT, so add the +-dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This macro +-dnl is hooked onto _AC_COMPILER_EXEEXT early, see below. ++AC_REQUIRE([AM_SILENT_RULES])dnl ++dnl The testsuite driver may need to know about EXEEXT, so add the ++dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This ++dnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below. + AC_CONFIG_COMMANDS_PRE(dnl + [m4_provide_if([_AM_COMPILER_EXEEXT], + [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl +@@ -1409,14 +1394,12 @@ + done + echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) + +-# Copyright (C) 2001-2012 Free Software Foundation, Inc. ++# Copyright (C) 2001-2013 Free Software Foundation, Inc. + # + # This file is free software; the Free Software Foundation + # gives unlimited permission to copy and/or distribute it, + # with or without modifications, as long as this notice is preserved. + +-# serial 8 +- + # AM_PROG_INSTALL_SH + # ------------------ + # Define $install_sh. +@@ -1432,14 +1415,12 @@ + fi + AC_SUBST([install_sh])]) + +-# Copyright (C) 2003-2012 Free Software Foundation, Inc. ++# Copyright (C) 2003-2013 Free Software Foundation, Inc. + # + # This file is free software; the Free Software Foundation + # gives unlimited permission to copy and/or distribute it, + # with or without modifications, as long as this notice is preserved. + +-# serial 2 +- + # Check whether the underlying file-system supports filenames + # with a leading dot. For instance MS-DOS doesn't. + AC_DEFUN([AM_SET_LEADING_DOT], +@@ -1456,14 +1437,12 @@ + # Add --enable-maintainer-mode option to configure. -*- Autoconf -*- + # From Jim Meyering + +-# Copyright (C) 1996-2012 Free Software Foundation, Inc. ++# Copyright (C) 1996-2013 Free Software Foundation, Inc. + # + # This file is free software; the Free Software Foundation + # gives unlimited permission to copy and/or distribute it, + # with or without modifications, as long as this notice is preserved. + +-# serial 7 +- + # AM_MAINTAINER_MODE([DEFAULT-MODE]) + # ---------------------------------- + # Control maintainer-specific portions of Makefiles. +@@ -1491,18 +1470,14 @@ + ] + ) + +-AU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE]) +- + # Check to see how 'make' treats includes. -*- Autoconf -*- + +-# Copyright (C) 2001-2012 Free Software Foundation, Inc. ++# Copyright (C) 2001-2013 Free Software Foundation, Inc. + # + # This file is free software; the Free Software Foundation + # gives unlimited permission to copy and/or distribute it, + # with or without modifications, as long as this notice is preserved. + +-# serial 5 +- + # AM_MAKE_INCLUDE() + # ----------------- + # Check to see how make treats includes. +@@ -1545,14 +1520,12 @@ + rm -f confinc confmf + ]) + +-# Copyright (C) 1999-2012 Free Software Foundation, Inc. ++# Copyright (C) 1999-2013 Free Software Foundation, Inc. + # + # This file is free software; the Free Software Foundation + # gives unlimited permission to copy and/or distribute it, + # with or without modifications, as long as this notice is preserved. + +-# serial 6 +- + # AM_PROG_CC_C_O + # -------------- + # Like AC_PROG_CC_C_O, but changed for automake. +@@ -1581,14 +1554,12 @@ + + # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- + +-# Copyright (C) 1997-2012 Free Software Foundation, Inc. ++# Copyright (C) 1997-2013 Free Software Foundation, Inc. + # + # This file is free software; the Free Software Foundation + # gives unlimited permission to copy and/or distribute it, + # with or without modifications, as long as this notice is preserved. + +-# serial 7 +- + # AM_MISSING_PROG(NAME, PROGRAM) + # ------------------------------ + AC_DEFUN([AM_MISSING_PROG], +@@ -1596,11 +1567,10 @@ + $1=${$1-"${am_missing_run}$2"} + AC_SUBST($1)]) + +- + # AM_MISSING_HAS_RUN + # ------------------ +-# Define MISSING if not defined so far and test if it supports --run. +-# If it does, set am_missing_run to use it, otherwise, to nothing. ++# Define MISSING if not defined so far and test if it is modern enough. ++# If it is, set am_missing_run to use it, otherwise, to nothing. + AC_DEFUN([AM_MISSING_HAS_RUN], + [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl + AC_REQUIRE_AUX_FILE([missing])dnl +@@ -1613,8 +1583,8 @@ + esac + fi + # Use eval to expand $SHELL +-if eval "$MISSING --run true"; then +- am_missing_run="$MISSING --run " ++if eval "$MISSING --is-lightweight"; then ++ am_missing_run="$MISSING " + else + am_missing_run= + AC_MSG_WARN(['missing' script is too old or missing]) +@@ -1623,14 +1593,12 @@ + + # Helper functions for option handling. -*- Autoconf -*- + +-# Copyright (C) 2001-2012 Free Software Foundation, Inc. ++# Copyright (C) 2001-2013 Free Software Foundation, Inc. + # + # This file is free software; the Free Software Foundation + # gives unlimited permission to copy and/or distribute it, + # with or without modifications, as long as this notice is preserved. + +-# serial 6 +- + # _AM_MANGLE_OPTION(NAME) + # ----------------------- + AC_DEFUN([_AM_MANGLE_OPTION], +@@ -1656,14 +1624,12 @@ + + # Check to make sure that the build environment is sane. -*- Autoconf -*- + +-# Copyright (C) 1996-2012 Free Software Foundation, Inc. ++# Copyright (C) 1996-2013 Free Software Foundation, Inc. + # + # This file is free software; the Free Software Foundation + # gives unlimited permission to copy and/or distribute it, + # with or without modifications, as long as this notice is preserved. + +-# serial 9 +- + # AM_SANITY_CHECK + # --------------- + AC_DEFUN([AM_SANITY_CHECK], +@@ -1739,13 +1705,71 @@ + rm -f conftest.file + ]) + +-# Copyright (C) 2001-2012 Free Software Foundation, Inc. ++# Copyright (C) 2009-2013 Free Software Foundation, Inc. + # + # This file is free software; the Free Software Foundation + # gives unlimited permission to copy and/or distribute it, + # with or without modifications, as long as this notice is preserved. + +-# serial 2 ++# AM_SILENT_RULES([DEFAULT]) ++# -------------------------- ++# Enable less verbose build rules; with the default set to DEFAULT ++# ("yes" being less verbose, "no" or empty being verbose). ++AC_DEFUN([AM_SILENT_RULES], ++[AC_ARG_ENABLE([silent-rules], [dnl ++AS_HELP_STRING( ++ [--enable-silent-rules], ++ [less verbose build output (undo: "make V=1")]) ++AS_HELP_STRING( ++ [--disable-silent-rules], ++ [verbose build output (undo: "make V=0")])dnl ++]) ++case $enable_silent_rules in @%:@ ((( ++ yes) AM_DEFAULT_VERBOSITY=0;; ++ no) AM_DEFAULT_VERBOSITY=1;; ++ *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);; ++esac ++dnl ++dnl A few 'make' implementations (e.g., NonStop OS and NextStep) ++dnl do not support nested variable expansions. ++dnl See automake bug#9928 and bug#10237. ++am_make=${MAKE-make} ++AC_CACHE_CHECK([whether $am_make supports nested variables], ++ [am_cv_make_support_nested_variables], ++ [if AS_ECHO([['TRUE=$(BAR$(V)) ++BAR0=false ++BAR1=true ++V=1 ++am__doit: ++ @$(TRUE) ++.PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then ++ am_cv_make_support_nested_variables=yes ++else ++ am_cv_make_support_nested_variables=no ++fi]) ++if test $am_cv_make_support_nested_variables = yes; then ++ dnl Using '$V' instead of '$(V)' breaks IRIX make. ++ AM_V='$(V)' ++ AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' ++else ++ AM_V=$AM_DEFAULT_VERBOSITY ++ AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY ++fi ++AC_SUBST([AM_V])dnl ++AM_SUBST_NOTMAKE([AM_V])dnl ++AC_SUBST([AM_DEFAULT_V])dnl ++AM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl ++AC_SUBST([AM_DEFAULT_VERBOSITY])dnl ++AM_BACKSLASH='\' ++AC_SUBST([AM_BACKSLASH])dnl ++_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl ++]) ++ ++# Copyright (C) 2001-2013 Free Software Foundation, Inc. ++# ++# This file is free software; the Free Software Foundation ++# gives unlimited permission to copy and/or distribute it, ++# with or without modifications, as long as this notice is preserved. + + # AM_PROG_INSTALL_STRIP + # --------------------- +@@ -1769,14 +1793,12 @@ + INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" + AC_SUBST([INSTALL_STRIP_PROGRAM])]) + +-# Copyright (C) 2006-2012 Free Software Foundation, Inc. ++# Copyright (C) 2006-2013 Free Software Foundation, Inc. + # + # This file is free software; the Free Software Foundation + # gives unlimited permission to copy and/or distribute it, + # with or without modifications, as long as this notice is preserved. + +-# serial 3 +- + # _AM_SUBST_NOTMAKE(VARIABLE) + # --------------------------- + # Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. +@@ -1790,14 +1812,12 @@ + + # Check how to create a tarball. -*- Autoconf -*- + +-# Copyright (C) 2004-2012 Free Software Foundation, Inc. ++# Copyright (C) 2004-2013 Free Software Foundation, Inc. + # + # This file is free software; the Free Software Foundation + # gives unlimited permission to copy and/or distribute it, + # with or without modifications, as long as this notice is preserved. + +-# serial 3 +- + # _AM_PROG_TAR(FORMAT) + # -------------------- + # Check how to create a tarball in format FORMAT. +@@ -1811,76 +1831,114 @@ + # Substitute a variable $(am__untar) that extract such + # a tarball read from stdin. + # $(am__untar) < result.tar ++# + AC_DEFUN([_AM_PROG_TAR], + [# Always define AMTAR for backward compatibility. Yes, it's still used + # in the wild :-( We should find a proper way to deprecate it ... + AC_SUBST([AMTAR], ['$${TAR-tar}']) ++ ++# We'll loop over all known methods to create a tar archive until one works. ++_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' ++ + m4_if([$1], [v7], +- [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'], +- [m4_case([$1], [ustar],, [pax],, +- [m4_fatal([Unknown tar format])]) +-AC_MSG_CHECKING([how to create a $1 tar archive]) +-# Loop over all known methods to create a tar archive until one works. +-_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' +-_am_tools=${am_cv_prog_tar_$1-$_am_tools} +-# Do not fold the above two line into one, because Tru64 sh and +-# Solaris sh will not grok spaces in the rhs of '-'. +-for _am_tool in $_am_tools +-do +- case $_am_tool in +- gnutar) +- for _am_tar in tar gnutar gtar; +- do +- AM_RUN_LOG([$_am_tar --version]) && break +- done +- am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' +- am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' +- am__untar="$_am_tar -xf -" +- ;; +- plaintar) +- # Must skip GNU tar: if it does not support --format= it doesn't create +- # ustar tarball either. +- (tar --version) >/dev/null 2>&1 && continue +- am__tar='tar chf - "$$tardir"' +- am__tar_='tar chf - "$tardir"' +- am__untar='tar xf -' +- ;; +- pax) +- am__tar='pax -L -x $1 -w "$$tardir"' +- am__tar_='pax -L -x $1 -w "$tardir"' +- am__untar='pax -r' +- ;; +- cpio) +- am__tar='find "$$tardir" -print | cpio -o -H $1 -L' +- am__tar_='find "$tardir" -print | cpio -o -H $1 -L' +- am__untar='cpio -i -H $1 -d' +- ;; +- none) +- am__tar=false +- am__tar_=false +- am__untar=false +- ;; +- esac ++ [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'], + +- # If the value was cached, stop now. We just wanted to have am__tar +- # and am__untar set. +- test -n "${am_cv_prog_tar_$1}" && break ++ [m4_case([$1], ++ [ustar], ++ [# The POSIX 1988 'ustar' format is defined with fixed-size fields. ++ # There is notably a 21 bits limit for the UID and the GID. In fact, ++ # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343 ++ # and bug#13588). ++ am_max_uid=2097151 # 2^21 - 1 ++ am_max_gid=$am_max_uid ++ # The $UID and $GID variables are not portable, so we need to resort ++ # to the POSIX-mandated id(1) utility. Errors in the 'id' calls ++ # below are definitely unexpected, so allow the users to see them ++ # (that is, avoid stderr redirection). ++ am_uid=`id -u || echo unknown` ++ am_gid=`id -g || echo unknown` ++ AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format]) ++ if test $am_uid -le $am_max_uid; then ++ AC_MSG_RESULT([yes]) ++ else ++ AC_MSG_RESULT([no]) ++ _am_tools=none ++ fi ++ AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format]) ++ if test $am_gid -le $am_max_gid; then ++ AC_MSG_RESULT([yes]) ++ else ++ AC_MSG_RESULT([no]) ++ _am_tools=none ++ fi], + +- # tar/untar a dummy directory, and stop if the command works ++ [pax], ++ [], ++ ++ [m4_fatal([Unknown tar format])]) ++ ++ AC_MSG_CHECKING([how to create a $1 tar archive]) ++ ++ # Go ahead even if we have the value already cached. We do so because we ++ # need to set the values for the 'am__tar' and 'am__untar' variables. ++ _am_tools=${am_cv_prog_tar_$1-$_am_tools} ++ ++ for _am_tool in $_am_tools; do ++ case $_am_tool in ++ gnutar) ++ for _am_tar in tar gnutar gtar; do ++ AM_RUN_LOG([$_am_tar --version]) && break ++ done ++ am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' ++ am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' ++ am__untar="$_am_tar -xf -" ++ ;; ++ plaintar) ++ # Must skip GNU tar: if it does not support --format= it doesn't create ++ # ustar tarball either. ++ (tar --version) >/dev/null 2>&1 && continue ++ am__tar='tar chf - "$$tardir"' ++ am__tar_='tar chf - "$tardir"' ++ am__untar='tar xf -' ++ ;; ++ pax) ++ am__tar='pax -L -x $1 -w "$$tardir"' ++ am__tar_='pax -L -x $1 -w "$tardir"' ++ am__untar='pax -r' ++ ;; ++ cpio) ++ am__tar='find "$$tardir" -print | cpio -o -H $1 -L' ++ am__tar_='find "$tardir" -print | cpio -o -H $1 -L' ++ am__untar='cpio -i -H $1 -d' ++ ;; ++ none) ++ am__tar=false ++ am__tar_=false ++ am__untar=false ++ ;; ++ esac ++ ++ # If the value was cached, stop now. We just wanted to have am__tar ++ # and am__untar set. ++ test -n "${am_cv_prog_tar_$1}" && break ++ ++ # tar/untar a dummy directory, and stop if the command works. ++ rm -rf conftest.dir ++ mkdir conftest.dir ++ echo GrepMe > conftest.dir/file ++ AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) ++ rm -rf conftest.dir ++ if test -s conftest.tar; then ++ AM_RUN_LOG([$am__untar /dev/null 2>&1 && break ++ fi ++ done + rm -rf conftest.dir +- mkdir conftest.dir +- echo GrepMe > conftest.dir/file +- AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) +- rm -rf conftest.dir +- if test -s conftest.tar; then +- AM_RUN_LOG([$am__untar /dev/null 2>&1 && break +- fi +-done +-rm -rf conftest.dir + +-AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) +-AC_MSG_RESULT([$am_cv_prog_tar_$1])]) ++ AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) ++ AC_MSG_RESULT([$am_cv_prog_tar_$1])]) ++ + AC_SUBST([am__tar]) + AC_SUBST([am__untar]) + ]) # _AM_PROG_TAR +diff -r c0e311e010fc Modules/_ctypes/libffi/build-ios.sh +--- a/Modules/_ctypes/libffi/build-ios.sh ++++ /dev/null +@@ -1,67 +0,0 @@ +-#!/bin/sh +- +-PLATFORM_IOS=/Developer/Platforms/iPhoneOS.platform/ +-PLATFORM_IOS_SIM=/Developer/Platforms/iPhoneSimulator.platform/ +-SDK_IOS_VERSION="4.2" +-MIN_IOS_VERSION="3.0" +-OUTPUT_DIR="universal-ios" +- +-build_target () { +- local platform=$1 +- local sdk=$2 +- local arch=$3 +- local triple=$4 +- local builddir=$5 +- +- mkdir -p "${builddir}" +- pushd "${builddir}" +- export CC="${platform}"/Developer/usr/bin/gcc-4.2 +- export CFLAGS="-arch ${arch} -isysroot ${sdk} -miphoneos-version-min=${MIN_IOS_VERSION}" +- ../configure --host=${triple} && make +- popd +-} +- +-# Build all targets +-build_target "${PLATFORM_IOS}" "${PLATFORM_IOS}/Developer/SDKs/iPhoneOS${SDK_IOS_VERSION}.sdk/" armv6 arm-apple-darwin10 armv6-ios +-build_target "${PLATFORM_IOS}" "${PLATFORM_IOS}/Developer/SDKs/iPhoneOS${SDK_IOS_VERSION}.sdk/" armv7 arm-apple-darwin10 armv7-ios +-build_target "${PLATFORM_IOS_SIM}" "${PLATFORM_IOS_SIM}/Developer/SDKs/iPhoneSimulator${SDK_IOS_VERSION}.sdk/" i386 i386-apple-darwin10 i386-ios-sim +- +-# Create universal output directories +-mkdir -p "${OUTPUT_DIR}" +-mkdir -p "${OUTPUT_DIR}/include" +-mkdir -p "${OUTPUT_DIR}/include/armv6" +-mkdir -p "${OUTPUT_DIR}/include/armv7" +-mkdir -p "${OUTPUT_DIR}/include/i386" +- +-# Create the universal binary +-lipo -create armv6-ios/.libs/libffi.a armv7-ios/.libs/libffi.a i386-ios-sim/.libs/libffi.a -output "${OUTPUT_DIR}/libffi.a" +- +-# Copy in the headers +-copy_headers () { +- local src=$1 +- local dest=$2 +- +- # Fix non-relative header reference +- sed 's//"ffitarget.h"/' < "${src}/include/ffi.h" > "${dest}/ffi.h" +- cp "${src}/include/ffitarget.h" "${dest}" +-} +- +-copy_headers armv6-ios "${OUTPUT_DIR}/include/armv6" +-copy_headers armv7-ios "${OUTPUT_DIR}/include/armv7" +-copy_headers i386-ios-sim "${OUTPUT_DIR}/include/i386" +- +-# Create top-level header +-( +-cat << EOF +-#ifdef __arm__ +- #include +- #ifdef _ARM_ARCH_6 +- #include "include/armv6/ffi.h" +- #elif _ARM_ARCH_7 +- #include "include/armv7/ffi.h" +- #endif +-#elif defined(__i386__) +- #include "include/i386/ffi.h" +-#endif +-EOF +-) > "${OUTPUT_DIR}/ffi.h" +diff -r c0e311e010fc Modules/_ctypes/libffi/compile +--- a/Modules/_ctypes/libffi/compile ++++ b/Modules/_ctypes/libffi/compile +@@ -1,10 +1,9 @@ + #! /bin/sh +-# Wrapper for compilers which do not understand `-c -o'. ++# Wrapper for compilers which do not understand '-c -o'. + +-scriptversion=2009-10-06.20; # UTC ++scriptversion=2012-10-14.11; # UTC + +-# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2009 Free Software +-# Foundation, Inc. ++# Copyright (C) 1999-2013 Free Software Foundation, Inc. + # Written by Tom Tromey . + # + # This program is free software; you can redistribute it and/or modify +@@ -29,21 +28,224 @@ + # bugs to or send patches to + # . + ++nl=' ++' ++ ++# We need space, tab and new line, in precisely that order. Quoting is ++# there to prevent tools from complaining about whitespace usage. ++IFS=" "" $nl" ++ ++file_conv= ++ ++# func_file_conv build_file lazy ++# Convert a $build file to $host form and store it in $file ++# Currently only supports Windows hosts. If the determined conversion ++# type is listed in (the comma separated) LAZY, no conversion will ++# take place. ++func_file_conv () ++{ ++ file=$1 ++ case $file in ++ / | /[!/]*) # absolute file, and not a UNC file ++ if test -z "$file_conv"; then ++ # lazily determine how to convert abs files ++ case `uname -s` in ++ MINGW*) ++ file_conv=mingw ++ ;; ++ CYGWIN*) ++ file_conv=cygwin ++ ;; ++ *) ++ file_conv=wine ++ ;; ++ esac ++ fi ++ case $file_conv/,$2, in ++ *,$file_conv,*) ++ ;; ++ mingw/*) ++ file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'` ++ ;; ++ cygwin/*) ++ file=`cygpath -m "$file" || echo "$file"` ++ ;; ++ wine/*) ++ file=`winepath -w "$file" || echo "$file"` ++ ;; ++ esac ++ ;; ++ esac ++} ++ ++# func_cl_dashL linkdir ++# Make cl look for libraries in LINKDIR ++func_cl_dashL () ++{ ++ func_file_conv "$1" ++ if test -z "$lib_path"; then ++ lib_path=$file ++ else ++ lib_path="$lib_path;$file" ++ fi ++ linker_opts="$linker_opts -LIBPATH:$file" ++} ++ ++# func_cl_dashl library ++# Do a library search-path lookup for cl ++func_cl_dashl () ++{ ++ lib=$1 ++ found=no ++ save_IFS=$IFS ++ IFS=';' ++ for dir in $lib_path $LIB ++ do ++ IFS=$save_IFS ++ if $shared && test -f "$dir/$lib.dll.lib"; then ++ found=yes ++ lib=$dir/$lib.dll.lib ++ break ++ fi ++ if test -f "$dir/$lib.lib"; then ++ found=yes ++ lib=$dir/$lib.lib ++ break ++ fi ++ if test -f "$dir/lib$lib.a"; then ++ found=yes ++ lib=$dir/lib$lib.a ++ break ++ fi ++ done ++ IFS=$save_IFS ++ ++ if test "$found" != yes; then ++ lib=$lib.lib ++ fi ++} ++ ++# func_cl_wrapper cl arg... ++# Adjust compile command to suit cl ++func_cl_wrapper () ++{ ++ # Assume a capable shell ++ lib_path= ++ shared=: ++ linker_opts= ++ for arg ++ do ++ if test -n "$eat"; then ++ eat= ++ else ++ case $1 in ++ -o) ++ # configure might choose to run compile as 'compile cc -o foo foo.c'. ++ eat=1 ++ case $2 in ++ *.o | *.[oO][bB][jJ]) ++ func_file_conv "$2" ++ set x "$@" -Fo"$file" ++ shift ++ ;; ++ *) ++ func_file_conv "$2" ++ set x "$@" -Fe"$file" ++ shift ++ ;; ++ esac ++ ;; ++ -I) ++ eat=1 ++ func_file_conv "$2" mingw ++ set x "$@" -I"$file" ++ shift ++ ;; ++ -I*) ++ func_file_conv "${1#-I}" mingw ++ set x "$@" -I"$file" ++ shift ++ ;; ++ -l) ++ eat=1 ++ func_cl_dashl "$2" ++ set x "$@" "$lib" ++ shift ++ ;; ++ -l*) ++ func_cl_dashl "${1#-l}" ++ set x "$@" "$lib" ++ shift ++ ;; ++ -L) ++ eat=1 ++ func_cl_dashL "$2" ++ ;; ++ -L*) ++ func_cl_dashL "${1#-L}" ++ ;; ++ -static) ++ shared=false ++ ;; ++ -Wl,*) ++ arg=${1#-Wl,} ++ save_ifs="$IFS"; IFS=',' ++ for flag in $arg; do ++ IFS="$save_ifs" ++ linker_opts="$linker_opts $flag" ++ done ++ IFS="$save_ifs" ++ ;; ++ -Xlinker) ++ eat=1 ++ linker_opts="$linker_opts $2" ++ ;; ++ -*) ++ set x "$@" "$1" ++ shift ++ ;; ++ *.cc | *.CC | *.cxx | *.CXX | *.[cC]++) ++ func_file_conv "$1" ++ set x "$@" -Tp"$file" ++ shift ++ ;; ++ *.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO]) ++ func_file_conv "$1" mingw ++ set x "$@" "$file" ++ shift ++ ;; ++ *) ++ set x "$@" "$1" ++ shift ++ ;; ++ esac ++ fi ++ shift ++ done ++ if test -n "$linker_opts"; then ++ linker_opts="-link$linker_opts" ++ fi ++ exec "$@" $linker_opts ++ exit 1 ++} ++ ++eat= ++ + case $1 in + '') +- echo "$0: No command. Try \`$0 --help' for more information." 1>&2 ++ echo "$0: No command. Try '$0 --help' for more information." 1>&2 + exit 1; + ;; + -h | --h*) + cat <<\EOF + Usage: compile [--help] [--version] PROGRAM [ARGS] + +-Wrapper for compilers which do not understand `-c -o'. +-Remove `-o dest.o' from ARGS, run PROGRAM with the remaining ++Wrapper for compilers which do not understand '-c -o'. ++Remove '-o dest.o' from ARGS, run PROGRAM with the remaining + arguments, and rename the output as expected. + + If you are trying to build a whole package this is not the +-right script to run: please start by reading the file `INSTALL'. ++right script to run: please start by reading the file 'INSTALL'. + + Report bugs to . + EOF +@@ -53,11 +255,13 @@ + echo "compile $scriptversion" + exit $? + ;; ++ cl | *[/\\]cl | cl.exe | *[/\\]cl.exe ) ++ func_cl_wrapper "$@" # Doesn't return... ++ ;; + esac + + ofile= + cfile= +-eat= + + for arg + do +@@ -66,8 +270,8 @@ + else + case $1 in + -o) +- # configure might choose to run compile as `compile cc -o foo foo.c'. +- # So we strip `-o arg' only if arg is an object. ++ # configure might choose to run compile as 'compile cc -o foo foo.c'. ++ # So we strip '-o arg' only if arg is an object. + eat=1 + case $2 in + *.o | *.obj) +@@ -94,10 +298,10 @@ + done + + if test -z "$ofile" || test -z "$cfile"; then +- # If no `-o' option was seen then we might have been invoked from a ++ # If no '-o' option was seen then we might have been invoked from a + # pattern rule where we don't need one. That is ok -- this is a + # normal compilation that the losing compiler can handle. If no +- # `.c' file was seen then we are probably linking. That is also ++ # '.c' file was seen then we are probably linking. That is also + # ok. + exec "$@" + fi +@@ -106,7 +310,7 @@ + cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'` + + # Create the lock directory. +-# Note: use `[/\\:.-]' here to ensure that we don't use the same name ++# Note: use '[/\\:.-]' here to ensure that we don't use the same name + # that we are using for the .o file. Also, base the name on the expected + # object file name, since that is what matters with a parallel build. + lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d +diff -r c0e311e010fc Modules/_ctypes/libffi/config.guess +--- a/Modules/_ctypes/libffi/config.guess ++++ b/Modules/_ctypes/libffi/config.guess +@@ -1,10 +1,8 @@ + #! /bin/sh + # Attempt to guess a canonical system name. +-# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, +-# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, +-# 2011, 2012, 2013 Free Software Foundation, Inc. ++# Copyright 1992-2013 Free Software Foundation, Inc. + +-timestamp='2012-12-29' ++timestamp='2013-06-10' + + # This file is free software; you can redistribute it and/or modify it + # under the terms of the GNU General Public License as published by +@@ -26,7 +24,7 @@ + # program. This Exception is an additional permission under section 7 + # of the GNU General Public License, version 3 ("GPLv3"). + # +-# Originally written by Per Bothner. ++# Originally written by Per Bothner. + # + # You can get the latest version of this script from: + # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD +@@ -52,9 +50,7 @@ + GNU config.guess ($timestamp) + + Originally written by Per Bothner. +-Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, +-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, +-2012, 2013 Free Software Foundation, Inc. ++Copyright 1992-2013 Free Software Foundation, Inc. + + This is free software; see the source for copying conditions. There is NO + warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." +@@ -136,6 +132,27 @@ + UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown + UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown + ++case "${UNAME_SYSTEM}" in ++Linux|GNU|GNU/*) ++ # If the system lacks a compiler, then just pick glibc. ++ # We could probably try harder. ++ LIBC=gnu ++ ++ eval $set_cc_for_build ++ cat <<-EOF > $dummy.c ++ #include ++ #if defined(__UCLIBC__) ++ LIBC=uclibc ++ #elif defined(__dietlibc__) ++ LIBC=dietlibc ++ #else ++ LIBC=gnu ++ #endif ++ EOF ++ eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'` ++ ;; ++esac ++ + # Note: order is significant - the case branches are not exclusive. + + case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in +@@ -857,21 +874,21 @@ + exit ;; + *:GNU:*:*) + # the GNU system +- echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` ++ echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-${LIBC}`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` + exit ;; + *:GNU/*:*:*) + # other systems with GNU libc and userland +- echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu ++ echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC} + exit ;; + i*86:Minix:*:*) + echo ${UNAME_MACHINE}-pc-minix + exit ;; + aarch64:Linux:*:*) +- echo ${UNAME_MACHINE}-unknown-linux-gnu ++ echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + aarch64_be:Linux:*:*) + UNAME_MACHINE=aarch64_be +- echo ${UNAME_MACHINE}-unknown-linux-gnu ++ echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + alpha:Linux:*:*) + case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in +@@ -884,59 +901,54 @@ + EV68*) UNAME_MACHINE=alphaev68 ;; + esac + objdump --private-headers /bin/sh | grep -q ld.so.1 +- if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi +- echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} ++ if test "$?" = 0 ; then LIBC="gnulibc1" ; fi ++ echo ${UNAME_MACHINE}-unknown-linux-${LIBC} ++ exit ;; ++ arc:Linux:*:* | arceb:Linux:*:*) ++ echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + arm*:Linux:*:*) + eval $set_cc_for_build + if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep -q __ARM_EABI__ + then +- echo ${UNAME_MACHINE}-unknown-linux-gnu ++ echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + else + if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep -q __ARM_PCS_VFP + then +- echo ${UNAME_MACHINE}-unknown-linux-gnueabi ++ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabi + else +- echo ${UNAME_MACHINE}-unknown-linux-gnueabihf ++ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabihf + fi + fi + exit ;; + avr32*:Linux:*:*) +- echo ${UNAME_MACHINE}-unknown-linux-gnu ++ echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + cris:Linux:*:*) +- echo ${UNAME_MACHINE}-axis-linux-gnu ++ echo ${UNAME_MACHINE}-axis-linux-${LIBC} + exit ;; + crisv32:Linux:*:*) +- echo ${UNAME_MACHINE}-axis-linux-gnu ++ echo ${UNAME_MACHINE}-axis-linux-${LIBC} + exit ;; + frv:Linux:*:*) +- echo ${UNAME_MACHINE}-unknown-linux-gnu ++ echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + hexagon:Linux:*:*) +- echo ${UNAME_MACHINE}-unknown-linux-gnu ++ echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + i*86:Linux:*:*) +- LIBC=gnu +- eval $set_cc_for_build +- sed 's/^ //' << EOF >$dummy.c +- #ifdef __dietlibc__ +- LIBC=dietlibc +- #endif +-EOF +- eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'` +- echo "${UNAME_MACHINE}-pc-linux-${LIBC}" ++ echo ${UNAME_MACHINE}-pc-linux-${LIBC} + exit ;; + ia64:Linux:*:*) +- echo ${UNAME_MACHINE}-unknown-linux-gnu ++ echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + m32r*:Linux:*:*) +- echo ${UNAME_MACHINE}-unknown-linux-gnu ++ echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + m68*:Linux:*:*) +- echo ${UNAME_MACHINE}-unknown-linux-gnu ++ echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + mips:Linux:*:* | mips64:Linux:*:*) + eval $set_cc_for_build +@@ -955,54 +967,63 @@ + #endif + EOF + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'` +- test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } ++ test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; } + ;; ++ or1k:Linux:*:*) ++ echo ${UNAME_MACHINE}-unknown-linux-${LIBC} ++ exit ;; + or32:Linux:*:*) +- echo ${UNAME_MACHINE}-unknown-linux-gnu ++ echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + padre:Linux:*:*) +- echo sparc-unknown-linux-gnu ++ echo sparc-unknown-linux-${LIBC} + exit ;; + parisc64:Linux:*:* | hppa64:Linux:*:*) +- echo hppa64-unknown-linux-gnu ++ echo hppa64-unknown-linux-${LIBC} + exit ;; + parisc:Linux:*:* | hppa:Linux:*:*) + # Look for CPU level + case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in +- PA7*) echo hppa1.1-unknown-linux-gnu ;; +- PA8*) echo hppa2.0-unknown-linux-gnu ;; +- *) echo hppa-unknown-linux-gnu ;; ++ PA7*) echo hppa1.1-unknown-linux-${LIBC} ;; ++ PA8*) echo hppa2.0-unknown-linux-${LIBC} ;; ++ *) echo hppa-unknown-linux-${LIBC} ;; + esac + exit ;; + ppc64:Linux:*:*) +- echo powerpc64-unknown-linux-gnu ++ echo powerpc64-unknown-linux-${LIBC} + exit ;; + ppc:Linux:*:*) +- echo powerpc-unknown-linux-gnu ++ echo powerpc-unknown-linux-${LIBC} ++ exit ;; ++ ppc64le:Linux:*:*) ++ echo powerpc64le-unknown-linux-${LIBC} ++ exit ;; ++ ppcle:Linux:*:*) ++ echo powerpcle-unknown-linux-${LIBC} + exit ;; + s390:Linux:*:* | s390x:Linux:*:*) +- echo ${UNAME_MACHINE}-ibm-linux ++ echo ${UNAME_MACHINE}-ibm-linux-${LIBC} + exit ;; + sh64*:Linux:*:*) +- echo ${UNAME_MACHINE}-unknown-linux-gnu ++ echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + sh*:Linux:*:*) +- echo ${UNAME_MACHINE}-unknown-linux-gnu ++ echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + sparc:Linux:*:* | sparc64:Linux:*:*) +- echo ${UNAME_MACHINE}-unknown-linux-gnu ++ echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + tile*:Linux:*:*) +- echo ${UNAME_MACHINE}-unknown-linux-gnu ++ echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + vax:Linux:*:*) +- echo ${UNAME_MACHINE}-dec-linux-gnu ++ echo ${UNAME_MACHINE}-dec-linux-${LIBC} + exit ;; + x86_64:Linux:*:*) +- echo ${UNAME_MACHINE}-unknown-linux-gnu ++ echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + xtensa*:Linux:*:*) +- echo ${UNAME_MACHINE}-unknown-linux-gnu ++ echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + i*86:DYNIX/ptx:4*:*) + # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. +@@ -1235,19 +1256,21 @@ + exit ;; + *:Darwin:*:*) + UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown +- case $UNAME_PROCESSOR in +- i386) +- eval $set_cc_for_build +- if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then +- if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ +- (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ +- grep IS_64BIT_ARCH >/dev/null +- then +- UNAME_PROCESSOR="x86_64" +- fi +- fi ;; +- unknown) UNAME_PROCESSOR=powerpc ;; +- esac ++ eval $set_cc_for_build ++ if test "$UNAME_PROCESSOR" = unknown ; then ++ UNAME_PROCESSOR=powerpc ++ fi ++ if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then ++ if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ ++ (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ ++ grep IS_64BIT_ARCH >/dev/null ++ then ++ case $UNAME_PROCESSOR in ++ i386) UNAME_PROCESSOR=x86_64 ;; ++ powerpc) UNAME_PROCESSOR=powerpc64 ;; ++ esac ++ fi ++ fi + echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} + exit ;; + *:procnto*:*:* | *:QNX:[0123456789]*:*) +diff -r c0e311e010fc Modules/_ctypes/libffi/config.sub +--- a/Modules/_ctypes/libffi/config.sub ++++ b/Modules/_ctypes/libffi/config.sub +@@ -1,10 +1,8 @@ + #! /bin/sh + # Configuration validation subroutine script. +-# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, +-# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, +-# 2011, 2012, 2013 Free Software Foundation, Inc. ++# Copyright 1992-2013 Free Software Foundation, Inc. + +-timestamp='2012-12-29' ++timestamp='2013-04-24' + + # This file is free software; you can redistribute it and/or modify it + # under the terms of the GNU General Public License as published by +@@ -70,9 +68,7 @@ + version="\ + GNU config.sub ($timestamp) + +-Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, +-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, +-2012, 2013 Free Software Foundation, Inc. ++Copyright 1992-2013 Free Software Foundation, Inc. + + This is free software; see the source for copying conditions. There is NO + warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." +@@ -256,7 +252,7 @@ + | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ + | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ + | am33_2.0 \ +- | arc \ ++ | arc | arceb \ + | arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \ + | avr | avr32 \ + | be32 | be64 \ +@@ -290,16 +286,17 @@ + | mipsisa64r2 | mipsisa64r2el \ + | mipsisa64sb1 | mipsisa64sb1el \ + | mipsisa64sr71k | mipsisa64sr71kel \ ++ | mipsr5900 | mipsr5900el \ + | mipstx39 | mipstx39el \ + | mn10200 | mn10300 \ + | moxie \ + | mt \ + | msp430 \ + | nds32 | nds32le | nds32be \ +- | nios | nios2 \ ++ | nios | nios2 | nios2eb | nios2el \ + | ns16k | ns32k \ + | open8 \ +- | or32 \ ++ | or1k | or32 \ + | pdp10 | pdp11 | pj | pjl \ + | powerpc | powerpc64 | powerpc64le | powerpcle \ + | pyramid \ +@@ -369,7 +366,7 @@ + | aarch64-* | aarch64_be-* \ + | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ + | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ +- | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ ++ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \ + | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ + | avr-* | avr32-* \ + | be32-* | be64-* \ +@@ -407,12 +404,13 @@ + | mipsisa64r2-* | mipsisa64r2el-* \ + | mipsisa64sb1-* | mipsisa64sb1el-* \ + | mipsisa64sr71k-* | mipsisa64sr71kel-* \ ++ | mipsr5900-* | mipsr5900el-* \ + | mipstx39-* | mipstx39el-* \ + | mmix-* \ + | mt-* \ + | msp430-* \ + | nds32-* | nds32le-* | nds32be-* \ +- | nios-* | nios2-* \ ++ | nios-* | nios2-* | nios2eb-* | nios2el-* \ + | none-* | np1-* | ns16k-* | ns32k-* \ + | open8-* \ + | orion-* \ +@@ -1008,7 +1006,7 @@ + ;; + ppc64) basic_machine=powerpc64-unknown + ;; +- ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` ++ ppc64-* | ppc64p7-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppc64le | powerpc64little | ppc64-le | powerpc64-little) + basic_machine=powerpc64le-unknown +@@ -1354,7 +1352,7 @@ + -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ + | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\ + | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \ +- | -sym* | -kopensolaris* \ ++ | -sym* | -kopensolaris* | -plan9* \ + | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ + | -aos* | -aros* \ + | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ +@@ -1500,9 +1498,6 @@ + -aros*) + os=-aros + ;; +- -kaos*) +- os=-kaos +- ;; + -zvmoe) + os=-zvmoe + ;; +@@ -1594,6 +1589,9 @@ + mips*-*) + os=-elf + ;; ++ or1k-*) ++ os=-elf ++ ;; + or32-*) + os=-coff + ;; +diff -r c0e311e010fc Modules/_ctypes/libffi/configure +--- a/Modules/_ctypes/libffi/configure ++++ b/Modules/_ctypes/libffi/configure +@@ -1,6 +1,6 @@ + #! /bin/sh + # Guess values for system-dependent variables and create Makefiles. +-# Generated by GNU Autoconf 2.69 for libffi 3.0.13. ++# Generated by GNU Autoconf 2.69 for libffi 3.1. + # + # Report bugs to . + # +@@ -590,8 +590,8 @@ + # Identity of this package. + PACKAGE_NAME='libffi' + PACKAGE_TARNAME='libffi' +-PACKAGE_VERSION='3.0.13' +-PACKAGE_STRING='libffi 3.0.13' ++PACKAGE_VERSION='3.1' ++PACKAGE_STRING='libffi 3.1' + PACKAGE_BUGREPORT='http://github.com/atgreen/libffi/issues' + PACKAGE_URL='' + +@@ -645,10 +645,13 @@ + FFI_EXEC_TRAMPOLINE_TABLE_FALSE + FFI_EXEC_TRAMPOLINE_TABLE_TRUE + sys_symbol_underscore ++HAVE_LONG_DOUBLE_VARIANT + HAVE_LONG_DOUBLE + ALLOCA + XTENSA_FALSE + XTENSA_TRUE ++VAX_FALSE ++VAX_TRUE + TILE_FALSE + TILE_TRUE + PA64_HPUX_FALSE +@@ -673,6 +676,8 @@ + AVR32_TRUE + ARM_FALSE + ARM_TRUE ++ARC_FALSE ++ARC_TRUE + AARCH64_FALSE + AARCH64_TRUE + POWERPC_FREEBSD_FALSE +@@ -683,12 +688,16 @@ + POWERPC_AIX_TRUE + POWERPC_FALSE + POWERPC_TRUE ++NIOS2_FALSE ++NIOS2_TRUE + MOXIE_FALSE + MOXIE_TRUE + METAG_FALSE + METAG_TRUE + MICROBLAZE_FALSE + MICROBLAZE_TRUE ++M88K_FALSE ++M88K_TRUE + M68K_FALSE + M68K_TRUE + M32R_FALSE +@@ -697,6 +706,10 @@ + IA64_TRUE + ALPHA_FALSE + ALPHA_TRUE ++X86_DARWIN64_FALSE ++X86_DARWIN64_TRUE ++X86_DARWIN32_FALSE ++X86_DARWIN32_TRUE + X86_DARWIN_FALSE + X86_DARWIN_TRUE + X86_WIN64_FALSE +@@ -721,6 +734,7 @@ + MAINTAINER_MODE_FALSE + MAINTAINER_MODE_TRUE + PRTDIAG ++CXXCPP + CPP + OTOOL64 + OTOOL +@@ -748,6 +762,12 @@ + CCASDEPMODE + CCASFLAGS + CCAS ++am__fastdepCXX_FALSE ++am__fastdepCXX_TRUE ++CXXDEPMODE ++ac_ct_CXX ++CXXFLAGS ++CXX + am__fastdepCC_FALSE + am__fastdepCC_TRUE + CCDEPMODE +@@ -765,6 +785,10 @@ + LDFLAGS + CFLAGS + CC ++AM_BACKSLASH ++AM_DEFAULT_VERBOSITY ++AM_DEFAULT_V ++AM_V + am__untar + am__tar + AMTAR +@@ -843,6 +867,7 @@ + ac_user_opts=' + enable_option_checking + enable_builddir ++enable_silent_rules + enable_dependency_tracking + enable_shared + enable_static +@@ -866,7 +891,8 @@ + CCAS + CCASFLAGS + CPP +-CPPFLAGS' ++CPPFLAGS ++CXXCPP' + + + # Initialize some variables set by options. +@@ -1407,7 +1433,7 @@ + # Omit some internal or obsolete options to make the list less imposing. + # This message is too long to be a string in the A/UX 3.1 sh. + cat <<_ACEOF +-\`configure' configures libffi 3.0.13 to adapt to many kinds of systems. ++\`configure' configures libffi 3.1 to adapt to many kinds of systems. + + Usage: $0 [OPTION]... [VAR=VALUE]... + +@@ -1478,7 +1504,7 @@ + + if test -n "$ac_init_help"; then + case $ac_init_help in +- short | recursive ) echo "Configuration of libffi 3.0.13:";; ++ short | recursive ) echo "Configuration of libffi 3.1:";; + esac + cat <<\_ACEOF + +@@ -1488,6 +1514,8 @@ + --enable-FEATURE[=ARG] include FEATURE [ARG=yes] + --disable-builddir disable automatic build in subdir of sources + ++ --enable-silent-rules less verbose build output (undo: "make V=1") ++ --disable-silent-rules verbose build output (undo: "make V=0") + --enable-dependency-tracking + do not reject slow dependency extractors + --disable-dependency-tracking +@@ -1515,8 +1543,8 @@ + --with-pic[=PKGS] try to use only PIC/non-PIC objects [default=use + both] + --with-gnu-ld assume the C compiler uses GNU ld [default=no] +- --with-sysroot=DIR Search for dependent libraries within DIR +- (or the compiler's sysroot if not specified). ++ --with-sysroot[=DIR] Search for dependent libraries within DIR (or the ++ compiler's sysroot if not specified). + --with-gcc-arch= use architecture for gcc -march/-mtune, + instead of guessing + +@@ -1528,9 +1556,12 @@ + LIBS libraries to pass to the linker, e.g. -l + CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if + you have headers in a nonstandard directory ++ CXX C++ compiler command ++ CXXFLAGS C++ compiler flags + CCAS assembler compiler command (defaults to CC) + CCASFLAGS assembler compiler flags (defaults to CFLAGS) + CPP C preprocessor ++ CXXCPP C++ preprocessor + + Use these variables to override the choices made by `configure' or to help + it to find libraries and programs with nonstandard names/locations. +@@ -1598,7 +1629,7 @@ + test -n "$ac_init_help" && exit $ac_status + if $ac_init_version; then + cat <<\_ACEOF +-libffi configure 3.0.13 ++libffi configure 3.1 + generated by GNU Autoconf 2.69 + + Copyright (C) 2012 Free Software Foundation, Inc. +@@ -1650,6 +1681,44 @@ + + } # ac_fn_c_try_compile + ++# ac_fn_cxx_try_compile LINENO ++# ---------------------------- ++# Try to compile conftest.$ac_ext, and return whether this succeeded. ++ac_fn_cxx_try_compile () ++{ ++ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack ++ 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:${as_lineno-$LINENO}: $ac_try_echo\"" ++$as_echo "$ac_try_echo"; } >&5 ++ (eval "$ac_compile") 2>conftest.err ++ ac_status=$? ++ if test -s conftest.err; then ++ grep -v '^ *+' conftest.err >conftest.er1 ++ cat conftest.er1 >&5 ++ mv -f conftest.er1 conftest.err ++ fi ++ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 ++ test $ac_status = 0; } && { ++ test -z "$ac_cxx_werror_flag" || ++ test ! -s conftest.err ++ } && test -s conftest.$ac_objext; then : ++ ac_retval=0 ++else ++ $as_echo "$as_me: failed program was:" >&5 ++sed 's/^/| /' conftest.$ac_ext >&5 ++ ++ ac_retval=1 ++fi ++ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno ++ as_fn_set_status $ac_retval ++ ++} # ac_fn_cxx_try_compile ++ + # ac_fn_c_try_link LINENO + # ----------------------- + # Try to link conftest.$ac_ext, and return whether this succeeded. +@@ -1873,6 +1942,89 @@ + + } # ac_fn_c_check_func + ++# ac_fn_cxx_try_cpp LINENO ++# ------------------------ ++# Try to preprocess conftest.$ac_ext, and return whether this succeeded. ++ac_fn_cxx_try_cpp () ++{ ++ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack ++ 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:${as_lineno-$LINENO}: $ac_try_echo\"" ++$as_echo "$ac_try_echo"; } >&5 ++ (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err ++ ac_status=$? ++ if test -s conftest.err; then ++ grep -v '^ *+' conftest.err >conftest.er1 ++ cat conftest.er1 >&5 ++ mv -f conftest.er1 conftest.err ++ fi ++ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 ++ test $ac_status = 0; } > conftest.i && { ++ test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || ++ test ! -s conftest.err ++ }; then : ++ ac_retval=0 ++else ++ $as_echo "$as_me: failed program was:" >&5 ++sed 's/^/| /' conftest.$ac_ext >&5 ++ ++ ac_retval=1 ++fi ++ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno ++ as_fn_set_status $ac_retval ++ ++} # ac_fn_cxx_try_cpp ++ ++# ac_fn_cxx_try_link LINENO ++# ------------------------- ++# Try to link conftest.$ac_ext, and return whether this succeeded. ++ac_fn_cxx_try_link () ++{ ++ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack ++ rm -f conftest.$ac_objext 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:${as_lineno-$LINENO}: $ac_try_echo\"" ++$as_echo "$ac_try_echo"; } >&5 ++ (eval "$ac_link") 2>conftest.err ++ ac_status=$? ++ if test -s conftest.err; then ++ grep -v '^ *+' conftest.err >conftest.er1 ++ cat conftest.er1 >&5 ++ mv -f conftest.er1 conftest.err ++ fi ++ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 ++ test $ac_status = 0; } && { ++ test -z "$ac_cxx_werror_flag" || ++ test ! -s conftest.err ++ } && test -s conftest$ac_exeext && { ++ test "$cross_compiling" = yes || ++ test -x conftest$ac_exeext ++ }; then : ++ ac_retval=0 ++else ++ $as_echo "$as_me: failed program was:" >&5 ++sed 's/^/| /' conftest.$ac_ext >&5 ++ ++ ac_retval=1 ++fi ++ # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information ++ # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would ++ # interfere with the next link command; also delete a directory that is ++ # left behind by Apple's compiler. We do this before executing the actions. ++ rm -rf conftest.dSYM conftest_ipa8_conftest.oo ++ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno ++ as_fn_set_status $ac_retval ++ ++} # ac_fn_cxx_try_link ++ + # ac_fn_c_compute_int LINENO EXPR VAR INCLUDES + # -------------------------------------------- + # Tries to find the compile-time value of EXPR in a program that includes +@@ -2204,7 +2356,7 @@ + This file contains any messages produced by compilers while + running configure, to aid debugging if configure makes a mistake. + +-It was created by libffi $as_me 3.0.13, which was ++It was created by libffi $as_me 3.1, which was + generated by GNU Autoconf 2.69. Invocation command line was + + $ $0 $@ +@@ -2697,7 +2849,11 @@ + + target_alias=${target_alias-$host_alias} + +-. ${srcdir}/configure.host ++case "${host}" in ++ frv*-elf) ++ LDFLAGS=`echo $LDFLAGS | sed "s/\-B^ *libgloss\/frv\///"`\ -B`pwd`/../libgloss/frv/ ++ ;; ++esac + + + # [$]@ is unsable in 2.60+ but earlier autoconf had no ac_configure_args +@@ -2803,7 +2959,7 @@ + ac_config_commands="$ac_config_commands buildir" + + +-am__api_version='1.12' ++am__api_version='1.13' + + # Find a good install program. We prefer a C program (faster), + # so one script is as good as another. But avoid the broken or +@@ -2984,8 +3140,8 @@ + esac + fi + # Use eval to expand $SHELL +-if eval "$MISSING --run true"; then +- am_missing_run="$MISSING --run " ++if eval "$MISSING --is-lightweight"; then ++ am_missing_run="$MISSING " + else + am_missing_run= + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5 +@@ -3225,6 +3381,45 @@ + fi + rmdir .tst 2>/dev/null + ++# Check whether --enable-silent-rules was given. ++if test "${enable_silent_rules+set}" = set; then : ++ enableval=$enable_silent_rules; ++fi ++ ++case $enable_silent_rules in # ((( ++ yes) AM_DEFAULT_VERBOSITY=0;; ++ no) AM_DEFAULT_VERBOSITY=1;; ++ *) AM_DEFAULT_VERBOSITY=1;; ++esac ++am_make=${MAKE-make} ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5 ++$as_echo_n "checking whether $am_make supports nested variables... " >&6; } ++if ${am_cv_make_support_nested_variables+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ if $as_echo 'TRUE=$(BAR$(V)) ++BAR0=false ++BAR1=true ++V=1 ++am__doit: ++ @$(TRUE) ++.PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then ++ am_cv_make_support_nested_variables=yes ++else ++ am_cv_make_support_nested_variables=no ++fi ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5 ++$as_echo "$am_cv_make_support_nested_variables" >&6; } ++if test $am_cv_make_support_nested_variables = yes; then ++ AM_V='$(V)' ++ AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' ++else ++ AM_V=$AM_DEFAULT_VERBOSITY ++ AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY ++fi ++AM_BACKSLASH='\' ++ + if test "`cd $srcdir && pwd`" != "`pwd`"; then + # Use -I$(srcdir) only when $(srcdir) != ., so that make's output + # is not polluted with repeated "-I." +@@ -3247,7 +3442,7 @@ + + # Define the identity of the package. + PACKAGE='libffi' +- VERSION='3.0.13' ++ VERSION='3.1' + + + cat >>confdefs.h <<_ACEOF +@@ -3287,6 +3482,10 @@ + # in the wild :-( We should find a proper way to deprecate it ... + AMTAR='$${TAR-tar}' + ++ ++# We'll loop over all known methods to create a tar archive until one works. ++_am_tools='gnutar pax cpio none' ++ + am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -' + + +@@ -3294,6 +3493,7 @@ + + + ++ + # The same as in boehm-gc and libstdc++. Have to borrow it from there. + # We must force CC to /not/ be precious variables; otherwise + # the wrong, non-multilib-adjusted value will be used in multilibs. +@@ -4284,6 +4484,391 @@ + fi + + ++ac_ext=cpp ++ac_cpp='$CXXCPP $CPPFLAGS' ++ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ++ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ++ac_compiler_gnu=$ac_cv_cxx_compiler_gnu ++if test -z "$CXX"; then ++ if test -n "$CCC"; then ++ CXX=$CCC ++ else ++ if test -n "$ac_tool_prefix"; then ++ for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC ++ 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 ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 ++$as_echo_n "checking for $ac_word... " >&6; } ++if ${ac_cv_prog_CXX+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ if test -n "$CXX"; then ++ ac_cv_prog_CXX="$CXX" # Let the user override the test. ++else ++as_save_IFS=$IFS; IFS=$PATH_SEPARATOR ++for as_dir in $PATH ++do ++ IFS=$as_save_IFS ++ test -z "$as_dir" && as_dir=. ++ for ac_exec_ext in '' $ac_executable_extensions; do ++ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ++ ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" ++ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 ++ break 2 ++ fi ++done ++ done ++IFS=$as_save_IFS ++ ++fi ++fi ++CXX=$ac_cv_prog_CXX ++if test -n "$CXX"; then ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5 ++$as_echo "$CXX" >&6; } ++else ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 ++$as_echo "no" >&6; } ++fi ++ ++ ++ test -n "$CXX" && break ++ done ++fi ++if test -z "$CXX"; then ++ ac_ct_CXX=$CXX ++ for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC ++do ++ # Extract the first word of "$ac_prog", so it can be a program name with args. ++set dummy $ac_prog; ac_word=$2 ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 ++$as_echo_n "checking for $ac_word... " >&6; } ++if ${ac_cv_prog_ac_ct_CXX+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ if test -n "$ac_ct_CXX"; then ++ ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test. ++else ++as_save_IFS=$IFS; IFS=$PATH_SEPARATOR ++for as_dir in $PATH ++do ++ IFS=$as_save_IFS ++ test -z "$as_dir" && as_dir=. ++ for ac_exec_ext in '' $ac_executable_extensions; do ++ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ++ ac_cv_prog_ac_ct_CXX="$ac_prog" ++ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 ++ break 2 ++ fi ++done ++ done ++IFS=$as_save_IFS ++ ++fi ++fi ++ac_ct_CXX=$ac_cv_prog_ac_ct_CXX ++if test -n "$ac_ct_CXX"; then ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CXX" >&5 ++$as_echo "$ac_ct_CXX" >&6; } ++else ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 ++$as_echo "no" >&6; } ++fi ++ ++ ++ test -n "$ac_ct_CXX" && break ++done ++ ++ if test "x$ac_ct_CXX" = x; then ++ CXX="g++" ++ else ++ case $cross_compiling:$ac_tool_warned in ++yes:) ++{ $as_echo "$as_me:${as_lineno-$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 ++ CXX=$ac_ct_CXX ++ fi ++fi ++ ++ fi ++fi ++# Provide some information about the compiler. ++$as_echo "$as_me:${as_lineno-$LINENO}: checking for C++ compiler version" >&5 ++set X $ac_compile ++ac_compiler=$2 ++for ac_option in --version -v -V -qversion; do ++ { { ac_try="$ac_compiler $ac_option >&5" ++case "(($ac_try" in ++ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; ++ *) ac_try_echo=$ac_try;; ++esac ++eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" ++$as_echo "$ac_try_echo"; } >&5 ++ (eval "$ac_compiler $ac_option >&5") 2>conftest.err ++ ac_status=$? ++ if test -s conftest.err; then ++ sed '10a\ ++... rest of stderr output deleted ... ++ 10q' conftest.err >conftest.er1 ++ cat conftest.er1 >&5 ++ fi ++ rm -f conftest.er1 conftest.err ++ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 ++ test $ac_status = 0; } ++done ++ ++{ $as_echo "$as_me:${as_lineno-$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 ${ac_cv_cxx_compiler_gnu+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++ ++int ++main () ++{ ++#ifndef __GNUC__ ++ choke me ++#endif ++ ++ ; ++ return 0; ++} ++_ACEOF ++if ac_fn_cxx_try_compile "$LINENO"; then : ++ ac_compiler_gnu=yes ++else ++ ac_compiler_gnu=no ++fi ++rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ++ac_cv_cxx_compiler_gnu=$ac_compiler_gnu ++ ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_compiler_gnu" >&5 ++$as_echo "$ac_cv_cxx_compiler_gnu" >&6; } ++if test $ac_compiler_gnu = yes; then ++ GXX=yes ++else ++ GXX= ++fi ++ac_test_CXXFLAGS=${CXXFLAGS+set} ++ac_save_CXXFLAGS=$CXXFLAGS ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX accepts -g" >&5 ++$as_echo_n "checking whether $CXX accepts -g... " >&6; } ++if ${ac_cv_prog_cxx_g+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ ac_save_cxx_werror_flag=$ac_cxx_werror_flag ++ ac_cxx_werror_flag=yes ++ ac_cv_prog_cxx_g=no ++ CXXFLAGS="-g" ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++ ++int ++main () ++{ ++ ++ ; ++ return 0; ++} ++_ACEOF ++if ac_fn_cxx_try_compile "$LINENO"; then : ++ ac_cv_prog_cxx_g=yes ++else ++ CXXFLAGS="" ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++ ++int ++main () ++{ ++ ++ ; ++ return 0; ++} ++_ACEOF ++if ac_fn_cxx_try_compile "$LINENO"; then : ++ ++else ++ ac_cxx_werror_flag=$ac_save_cxx_werror_flag ++ CXXFLAGS="-g" ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++ ++int ++main () ++{ ++ ++ ; ++ return 0; ++} ++_ACEOF ++if ac_fn_cxx_try_compile "$LINENO"; then : ++ ac_cv_prog_cxx_g=yes ++fi ++rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ++fi ++rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ++fi ++rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ++ ac_cxx_werror_flag=$ac_save_cxx_werror_flag ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_g" >&5 ++$as_echo "$ac_cv_prog_cxx_g" >&6; } ++if test "$ac_test_CXXFLAGS" = set; then ++ CXXFLAGS=$ac_save_CXXFLAGS ++elif test $ac_cv_prog_cxx_g = yes; then ++ if test "$GXX" = yes; then ++ CXXFLAGS="-g -O2" ++ else ++ CXXFLAGS="-g" ++ fi ++else ++ if test "$GXX" = yes; then ++ CXXFLAGS="-O2" ++ else ++ CXXFLAGS= ++ fi ++fi ++ac_ext=c ++ac_cpp='$CPP $CPPFLAGS' ++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 ++ ++depcc="$CXX" am_compiler_list= ++ ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 ++$as_echo_n "checking dependency style of $depcc... " >&6; } ++if ${am_cv_CXX_dependencies_compiler_type+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then ++ # We make a subdir and do the tests there. Otherwise we can end up ++ # making bogus files that we don't know about and never remove. For ++ # instance it was reported that on HP-UX the gcc test will end up ++ # making a dummy file named 'D' -- because '-MD' means "put the output ++ # in D". ++ rm -rf conftest.dir ++ mkdir conftest.dir ++ # Copy depcomp to subdir because otherwise we won't find it if we're ++ # using a relative directory. ++ cp "$am_depcomp" conftest.dir ++ cd conftest.dir ++ # We will build objects and dependencies in a subdirectory because ++ # it helps to detect inapplicable dependency modes. For instance ++ # both Tru64's cc and ICC support -MD to output dependencies as a ++ # side effect of compilation, but ICC will put the dependencies in ++ # the current directory while Tru64 will put them in the object ++ # directory. ++ mkdir sub ++ ++ am_cv_CXX_dependencies_compiler_type=none ++ if test "$am_compiler_list" = ""; then ++ am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` ++ fi ++ am__universal=false ++ case " $depcc " in #( ++ *\ -arch\ *\ -arch\ *) am__universal=true ;; ++ esac ++ ++ for depmode in $am_compiler_list; do ++ # Setup a source with many dependencies, because some compilers ++ # like to wrap large dependency lists on column 80 (with \), and ++ # we should not choose a depcomp mode which is confused by this. ++ # ++ # We need to recreate these files for each test, as the compiler may ++ # overwrite some of them when testing with obscure command lines. ++ # This happens at least with the AIX C compiler. ++ : > sub/conftest.c ++ for i in 1 2 3 4 5 6; do ++ echo '#include "conftst'$i'.h"' >> sub/conftest.c ++ # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with ++ # Solaris 10 /bin/sh. ++ echo '/* dummy */' > sub/conftst$i.h ++ done ++ echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf ++ ++ # We check with '-c' and '-o' for the sake of the "dashmstdout" ++ # mode. It turns out that the SunPro C++ compiler does not properly ++ # handle '-M -o', and we need to detect this. Also, some Intel ++ # versions had trouble with output in subdirs. ++ am__obj=sub/conftest.${OBJEXT-o} ++ am__minus_obj="-o $am__obj" ++ case $depmode in ++ gcc) ++ # This depmode causes a compiler race in universal mode. ++ test "$am__universal" = false || continue ++ ;; ++ nosideeffect) ++ # After this tag, mechanisms are not by side-effect, so they'll ++ # only be used when explicitly requested. ++ if test "x$enable_dependency_tracking" = xyes; then ++ continue ++ else ++ break ++ fi ++ ;; ++ msvc7 | msvc7msys | msvisualcpp | msvcmsys) ++ # This compiler won't grok '-c -o', but also, the minuso test has ++ # not run yet. These depmodes are late enough in the game, and ++ # so weak that their functioning should not be impacted. ++ am__obj=conftest.${OBJEXT-o} ++ am__minus_obj= ++ ;; ++ none) break ;; ++ esac ++ if depmode=$depmode \ ++ source=sub/conftest.c object=$am__obj \ ++ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ ++ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ ++ >/dev/null 2>conftest.err && ++ grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && ++ grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && ++ grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ++ ${MAKE-make} -s -f confmf > /dev/null 2>&1; then ++ # icc doesn't choke on unknown options, it will just issue warnings ++ # or remarks (even with -Werror). So we grep stderr for any message ++ # that says an option was ignored or not supported. ++ # When given -MP, icc 7.0 and 7.1 complain thusly: ++ # icc: Command line warning: ignoring option '-M'; no argument required ++ # The diagnosis changed in icc 8.0: ++ # icc: Command line remark: option '-MP' not supported ++ if (grep 'ignoring option' conftest.err || ++ grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else ++ am_cv_CXX_dependencies_compiler_type=$depmode ++ break ++ fi ++ fi ++ done ++ ++ cd .. ++ rm -rf conftest.dir ++else ++ am_cv_CXX_dependencies_compiler_type=none ++fi ++ ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CXX_dependencies_compiler_type" >&5 ++$as_echo "$am_cv_CXX_dependencies_compiler_type" >&6; } ++CXXDEPMODE=depmode=$am_cv_CXX_dependencies_compiler_type ++ ++ if ++ test "x$enable_dependency_tracking" != xno \ ++ && test "$am_cv_CXX_dependencies_compiler_type" = gcc3; then ++ am__fastdepCXX_TRUE= ++ am__fastdepCXX_FALSE='#' ++else ++ am__fastdepCXX_TRUE='#' ++ am__fastdepCXX_FALSE= ++fi ++ ++ + CFLAGS=$save_CFLAGS + + +@@ -4557,22 +5142,22 @@ + + + +-macro_version='2.4.2' +-macro_revision='1.3337' +- +- +- +- +- +- +- +- +- +- +- +- +- +-ltmain="$ac_aux_dir/ltmain.sh" ++macro_version='2.4.2.418' ++macro_revision='2.4.2.418' ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ltmain=$ac_aux_dir/ltmain.sh + + # Backslashify metacharacters that are still active within + # double-quoted strings. +@@ -4621,7 +5206,7 @@ + $ECHO "" + } + +-case "$ECHO" in ++case $ECHO in + printf*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: printf" >&5 + $as_echo "printf" >&6; } ;; + print*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: print -r" >&5 +@@ -4944,19 +5529,19 @@ + + # Check whether --with-gnu-ld was given. + if test "${with_gnu_ld+set}" = set; then : +- withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes ++ withval=$with_gnu_ld; test no = "$withval" || with_gnu_ld=yes + else + with_gnu_ld=no + fi + + ac_prog=ld +-if test "$GCC" = yes; then ++if test yes = "$GCC"; then + # Check if gcc -print-prog-name=ld gives a path. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 + $as_echo_n "checking for ld used by $CC... " >&6; } + case $host in + *-*-mingw*) +- # gcc leaves a trailing carriage return which upsets mingw ++ # gcc leaves a trailing carriage return, which upsets mingw + ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; + *) + ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; +@@ -4970,7 +5555,7 @@ + while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do + ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` + done +- test -z "$LD" && LD="$ac_prog" ++ test -z "$LD" && LD=$ac_prog + ;; + "") + # If it fails, then pretend we aren't using GCC. +@@ -4981,7 +5566,7 @@ + with_gnu_ld=unknown + ;; + esac +-elif test "$with_gnu_ld" = yes; then ++elif test yes = "$with_gnu_ld"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 + $as_echo_n "checking for GNU ld... " >&6; } + else +@@ -4992,32 +5577,32 @@ + $as_echo_n "(cached) " >&6 + else + if test -z "$LD"; then +- lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR ++ lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR + for ac_dir in $PATH; do +- IFS="$lt_save_ifs" ++ IFS=$lt_save_ifs + test -z "$ac_dir" && ac_dir=. + if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then +- lt_cv_path_LD="$ac_dir/$ac_prog" ++ lt_cv_path_LD=$ac_dir/$ac_prog + # Check to see if the program is GNU ld. I'd rather use --version, + # but apparently some variants of GNU ld only accept -v. + # Break only if it was the GNU/non-GNU ld that we prefer. + case `"$lt_cv_path_LD" -v 2>&1 &5 + $as_echo "$LD" >&6; } +@@ -5060,33 +5645,33 @@ + else + if test -n "$NM"; then + # Let the user override the test. +- lt_cv_path_NM="$NM" +-else +- lt_nm_to_check="${ac_tool_prefix}nm" ++ lt_cv_path_NM=$NM ++else ++ lt_nm_to_check=${ac_tool_prefix}nm + if test -n "$ac_tool_prefix" && test "$build" = "$host"; then + lt_nm_to_check="$lt_nm_to_check nm" + fi + for lt_tmp_nm in $lt_nm_to_check; do +- lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR ++ lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR + for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do +- IFS="$lt_save_ifs" ++ IFS=$lt_save_ifs + test -z "$ac_dir" && ac_dir=. +- tmp_nm="$ac_dir/$lt_tmp_nm" +- if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then ++ tmp_nm=$ac_dir/$lt_tmp_nm ++ if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext"; then + # Check to see if the nm accepts a BSD-compat flag. +- # Adding the `sed 1q' prevents false positives on HP-UX, which says: ++ # Adding the 'sed 1q' prevents false positives on HP-UX, which says: + # nm: unknown option "B" ignored + # Tru64's nm complains that /dev/null is an invalid object file + case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in + */dev/null* | *'Invalid file or object type'*) + lt_cv_path_NM="$tmp_nm -B" +- break ++ break 2 + ;; + *) + case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in + */dev/null*) + lt_cv_path_NM="$tmp_nm -p" +- break ++ break 2 + ;; + *) + lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but +@@ -5097,15 +5682,15 @@ + esac + fi + done +- IFS="$lt_save_ifs" ++ IFS=$lt_save_ifs + done + : ${lt_cv_path_NM=no} + fi + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5 + $as_echo "$lt_cv_path_NM" >&6; } +-if test "$lt_cv_path_NM" != "no"; then +- NM="$lt_cv_path_NM" ++if test no != "$lt_cv_path_NM"; then ++ NM=$lt_cv_path_NM + else + # Didn't find any BSD compatible name lister, look for dumpbin. + if test -n "$DUMPBIN"; then : +@@ -5211,9 +5796,9 @@ + fi + fi + +- case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in ++ case `$DUMPBIN -symbols -headers /dev/null 2>&1 | sed '1q'` in + *COFF*) +- DUMPBIN="$DUMPBIN -symbols" ++ DUMPBIN="$DUMPBIN -symbols -headers" + ;; + *) + DUMPBIN=: +@@ -5221,8 +5806,8 @@ + esac + fi + +- if test "$DUMPBIN" != ":"; then +- NM="$DUMPBIN" ++ if test : != "$DUMPBIN"; then ++ NM=$DUMPBIN + fi + fi + test -z "$NM" && NM=nm +@@ -5273,7 +5858,7 @@ + $as_echo_n "(cached) " >&6 + else + i=0 +- teststring="ABCD" ++ teststring=ABCD + + case $build_os in + msdosdjgpp*) +@@ -5313,7 +5898,7 @@ + lt_cv_sys_max_cmd_len=8192; + ;; + +- netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) ++ bitrig* | darwin* | dragonfly* | freebsd* | netbsd* | openbsd*) + # This has been around since 386BSD, at least. Likely further. + if test -x /sbin/sysctl; then + lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` +@@ -5364,22 +5949,22 @@ + *) + lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` + if test -n "$lt_cv_sys_max_cmd_len" && \ +- test undefined != "$lt_cv_sys_max_cmd_len"; then ++ test undefined != "$lt_cv_sys_max_cmd_len"; then + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` + else + # Make teststring a little bigger before we do anything with it. + # a 1K string should be a reasonable start. +- for i in 1 2 3 4 5 6 7 8 ; do ++ for i in 1 2 3 4 5 6 7 8; do + teststring=$teststring$teststring + done + SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} + # If test is not a shell built-in, we'll probably end up computing a + # maximum length that is only half of the actual maximum length, but + # we can't tell. +- while { test "X"`env echo "$teststring$teststring" 2>/dev/null` \ ++ while { test X`env echo "$teststring$teststring" 2>/dev/null` \ + = "X$teststring$teststring"; } >/dev/null 2>&1 && +- test $i != 17 # 1/2 MB should be enough ++ test 17 != "$i" # 1/2 MB should be enough + do + i=`expr $i + 1` + teststring=$teststring$teststring +@@ -5397,7 +5982,7 @@ + + fi + +-if test -n $lt_cv_sys_max_cmd_len ; then ++if test -n "$lt_cv_sys_max_cmd_len"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_max_cmd_len" >&5 + $as_echo "$lt_cv_sys_max_cmd_len" >&6; } + else +@@ -5415,30 +6000,6 @@ + : ${MV="mv -f"} + : ${RM="rm -f"} + +-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands some XSI constructs" >&5 +-$as_echo_n "checking whether the shell understands some XSI constructs... " >&6; } +-# Try some XSI features +-xsi_shell=no +-( _lt_dummy="a/b/c" +- test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \ +- = c,a/b,b/c, \ +- && eval 'test $(( 1 + 1 )) -eq 2 \ +- && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \ +- && xsi_shell=yes +-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $xsi_shell" >&5 +-$as_echo "$xsi_shell" >&6; } +- +- +-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands \"+=\"" >&5 +-$as_echo_n "checking whether the shell understands \"+=\"... " >&6; } +-lt_shell_append=no +-( foo=bar; set foo baz; eval "$1+=\$2" && test "$foo" = barbaz ) \ +- >/dev/null 2>&1 \ +- && lt_shell_append=yes +-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_shell_append" >&5 +-$as_echo "$lt_shell_append" >&6; } +- +- + if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then + lt_unset=unset + else +@@ -5561,13 +6122,13 @@ + reload_cmds='$LD$reload_flag -o $output$reload_objs' + case $host_os in + cygwin* | mingw* | pw32* | cegcc*) +- if test "$GCC" != yes; then ++ if test yes != "$GCC"; then + reload_cmds=false + fi + ;; + darwin*) +- if test "$GCC" = yes; then +- reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs' ++ if test yes = "$GCC"; then ++ reload_cmds='$LTCC $LTCFLAGS -nostdlib $wl-r -o $output$reload_objs' + else + reload_cmds='$LD$reload_flag -o $output$reload_objs' + fi +@@ -5695,13 +6256,13 @@ + # Need to set the preceding variable on all platforms that support + # interlibrary dependencies. + # 'none' -- dependencies not supported. +-# `unknown' -- same as none, but documents that we really don't know. ++# 'unknown' -- same as none, but documents that we really don't know. + # 'pass_all' -- all dependencies passed with no checks. + # 'test_compile' -- check by making test program. + # 'file_magic [[regex]]' -- check by looking for files in library path +-# which responds to the $file_magic_cmd with a given extended regex. +-# If you have `file' or equivalent on your system and you're not sure +-# whether `pass_all' will *always* work, you probably want this one. ++# that responds to the $file_magic_cmd with a given extended regex. ++# If you have 'file' or equivalent on your system and you're not sure ++# whether 'pass_all' will *always* work, you probably want this one. + + case $host_os in + aix[4-9]*) +@@ -5728,8 +6289,7 @@ + # Base MSYS/MinGW do not provide the 'file' command needed by + # func_win32_libid shell function, so use a weaker test based on 'objdump', + # unless we find 'file', for example because we are cross-compiling. +- # func_win32_libid assumes BSD nm, so disallow it if using MS dumpbin. +- if ( test "$lt_cv_nm_interface" = "BSD nm" && file / ) >/dev/null 2>&1; then ++ if ( file / ) >/dev/null 2>&1; then + lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' + lt_cv_file_magic_cmd='func_win32_libid' + else +@@ -5765,10 +6325,6 @@ + fi + ;; + +-gnu*) +- lt_cv_deplibs_check_method=pass_all +- ;; +- + haiku*) + lt_cv_deplibs_check_method=pass_all + ;; +@@ -5807,7 +6363,7 @@ + ;; + + # This must be glibc/ELF. +-linux* | k*bsd*-gnu | kopensolaris*-gnu) ++linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) + lt_cv_deplibs_check_method=pass_all + ;; + +@@ -5829,8 +6385,8 @@ + lt_cv_deplibs_check_method=pass_all + ;; + +-openbsd*) +- if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then ++openbsd* | bitrig*) ++ if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$' + else + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' +@@ -6040,8 +6596,8 @@ + + case $host_os in + cygwin* | mingw* | pw32* | cegcc*) +- # two different shell functions defined in ltmain.sh +- # decide which to use based on capabilities of $DLLTOOL ++ # two different shell functions defined in ltmain.sh; ++ # decide which one to use based on capabilities of $DLLTOOL + case `$DLLTOOL --help 2>&1` in + *--identify-strict*) + lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib +@@ -6053,7 +6609,7 @@ + ;; + *) + # fallback: assume linklib IS sharedlib +- lt_cv_sharedlib_from_linklib_cmd="$ECHO" ++ lt_cv_sharedlib_from_linklib_cmd=$ECHO + ;; + esac + +@@ -6208,7 +6764,7 @@ + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +- if test "$ac_status" -eq 0; then ++ if test 0 -eq "$ac_status"; then + # Ensure the archiver fails upon bogus file names. + rm -f conftest.$ac_objext libconftest.a + { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 +@@ -6216,7 +6772,7 @@ + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +- if test "$ac_status" -ne 0; then ++ if test 0 -ne "$ac_status"; then + lt_cv_ar_at_file=@ + fi + fi +@@ -6229,7 +6785,7 @@ + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file" >&5 + $as_echo "$lt_cv_ar_at_file" >&6; } + +-if test "x$lt_cv_ar_at_file" = xno; then ++if test no = "$lt_cv_ar_at_file"; then + archiver_list_spec= + else + archiver_list_spec=$lt_cv_ar_at_file +@@ -6446,7 +7002,7 @@ + + if test -n "$RANLIB"; then + case $host_os in +- openbsd*) ++ bitrig* | openbsd*) + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib" + ;; + *) +@@ -6536,7 +7092,7 @@ + symcode='[ABCDGISTW]' + ;; + hpux*) +- if test "$host_cpu" = ia64; then ++ if test ia64 = "$host_cpu"; then + symcode='[ABCDEGRST]' + fi + ;; +@@ -6569,14 +7125,44 @@ + symcode='[ABCDGIRSTW]' ;; + esac + ++if test "$lt_cv_nm_interface" = "MS dumpbin"; then ++ # Gets list of data symbols to import. ++ lt_cv_sys_global_symbol_to_import="sed -n -e 's/^I .* \(.*\)$/\1/p'" ++ # Adjust the below global symbol transforms to fixup imported variables. ++ lt_cdecl_hook=" -e 's/^I .* \(.*\)$/extern __declspec(dllimport) char \1;/p'" ++ lt_c_name_hook=" -e 's/^I .* \(.*\)$/ {\"\1\", (void *) 0},/p'" ++ lt_c_name_lib_hook="\ ++ -e 's/^I .* \(lib.*\)$/ {\"\1\", (void *) 0},/p'\ ++ -e 's/^I .* \(.*\)$/ {\"lib\1\", (void *) 0},/p'" ++else ++ # Disable hooks by default. ++ lt_cv_sys_global_symbol_to_import= ++ lt_cdecl_hook= ++ lt_c_name_hook= ++ lt_c_name_lib_hook= ++fi ++ + # Transform an extracted symbol line into a proper C declaration. + # Some systems (esp. on ia64) link data and code symbols differently, + # so use this general approach. +-lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" ++lt_cv_sys_global_symbol_to_cdecl="sed -n"\ ++$lt_cdecl_hook\ ++" -e 's/^T .* \(.*\)$/extern int \1();/p'"\ ++" -e 's/^$symcode$symcode* .* \(.*\)$/extern char \1;/p'" + + # Transform an extracted symbol line into symbol name and symbol address +-lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\)[ ]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (void *) \&\2},/p'" +-lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([^ ]*\)[ ]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \(lib[^ ]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"lib\2\", (void *) \&\2},/p'" ++lt_cv_sys_global_symbol_to_c_name_address="sed -n"\ ++$lt_c_name_hook\ ++" -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ ++" -e 's/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/p'" ++ ++# Transform an extracted symbol line into symbol name with lib prefix and ++# symbol address. ++lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n"\ ++$lt_c_name_lib_hook\ ++" -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ ++" -e 's/^$symcode$symcode* .* \(lib.*\)$/ {\"\1\", (void *) \&\1},/p'"\ ++" -e 's/^$symcode$symcode* .* \(.*\)$/ {\"lib\1\", (void *) \&\1},/p'" + + # Handle CRLF in mingw tool chain + opt_cr= +@@ -6594,21 +7180,24 @@ + + # Write the raw and C identifiers. + if test "$lt_cv_nm_interface" = "MS dumpbin"; then +- # Fake it for dumpbin and say T for any non-static function +- # and D for any global variable. ++ # Fake it for dumpbin and say T for any non-static function, ++ # D for any global variable and I for any imported variable. + # Also find C++ and __fastcall symbols from MSVC++, + # which start with @ or ?. + lt_cv_sys_global_symbol_pipe="$AWK '"\ + " {last_section=section; section=\$ 3};"\ + " /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\ + " /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ ++" /^ *Symbol name *: /{split(\$ 0,sn,\":\"); si=substr(sn[2],2)};"\ ++" /^ *Type *: code/{print \"T\",si,substr(si,length(prfx))};"\ ++" /^ *Type *: data/{print \"I\",si,substr(si,length(prfx))};"\ + " \$ 0!~/External *\|/{next};"\ + " / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ + " {if(hide[section]) next};"\ +-" {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\ +-" {split(\$ 0, a, /\||\r/); split(a[2], s)};"\ +-" s[1]~/^[@?]/{print s[1], s[1]; next};"\ +-" s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\ ++" {f=\"D\"}; \$ 0~/\(\).*\|/{f=\"T\"};"\ ++" {split(\$ 0,a,/\||\r/); split(a[2],s)};"\ ++" s[1]~/^[@?]/{print f,s[1],s[1]; next};"\ ++" s[1]~prfx {split(s[1],t,\"@\"); print f,t[1],substr(t[1],length(prfx))}"\ + " ' prfx=^$ac_symprfx" + else + lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" +@@ -6656,11 +7245,11 @@ + if $GREP ' nm_test_func$' "$nlist" >/dev/null; then + cat <<_LT_EOF > conftest.$ac_ext + /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ +-#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) +-/* DATA imports from DLLs on WIN32 con't be const, because runtime ++#if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE ++/* DATA imports from DLLs on WIN32 can't be const, because runtime + relocations are performed -- see ld's documentation on pseudo-relocs. */ + # define LT_DLSYM_CONST +-#elif defined(__osf__) ++#elif defined __osf__ + /* This system does not cope well with relocations in const data. */ + # define LT_DLSYM_CONST + #else +@@ -6686,7 +7275,7 @@ + { + { "@PROGRAM@", (void *) 0 }, + _LT_EOF +- $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext ++ $SED "s/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext + cat <<\_LT_EOF >> conftest.$ac_ext + {0, (void *) 0} + }; +@@ -6706,13 +7295,13 @@ + mv conftest.$ac_objext conftstm.$ac_objext + lt_globsym_save_LIBS=$LIBS + lt_globsym_save_CFLAGS=$CFLAGS +- LIBS="conftstm.$ac_objext" ++ LIBS=conftstm.$ac_objext + CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag" + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 +- test $ac_status = 0; } && test -s conftest${ac_exeext}; then ++ test $ac_status = 0; } && test -s conftest$ac_exeext; then + pipe_works=yes + fi + LIBS=$lt_globsym_save_LIBS +@@ -6733,7 +7322,7 @@ + rm -rf conftest* conftst* + + # Do not use the global_symbol_pipe unless it works. +- if test "$pipe_works" = yes; then ++ if test yes = "$pipe_works"; then + break + else + lt_cv_sys_global_symbol_pipe= +@@ -6786,6 +7375,16 @@ + + + ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5 + $as_echo_n "checking for sysroot... " >&6; } + +@@ -6798,9 +7397,9 @@ + + + lt_sysroot= +-case ${with_sysroot} in #( ++case $with_sysroot in #( + yes) +- if test "$GCC" = yes; then ++ if test yes = "$GCC"; then + lt_sysroot=`$CC --print-sysroot 2>/dev/null` + fi + ;; #( +@@ -6810,8 +7409,8 @@ + no|'') + ;; #( + *) +- { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${with_sysroot}" >&5 +-$as_echo "${with_sysroot}" >&6; } ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_sysroot" >&5 ++$as_echo "$with_sysroot" >&6; } + as_fn_error $? "The sysroot must be an absolute path." "$LINENO" 5 + ;; + esac +@@ -6828,13 +7427,14 @@ + enableval=$enable_libtool_lock; + fi + +-test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes ++test no = "$enable_libtool_lock" || enable_libtool_lock=yes + + # Some flags need to be propagated to the compiler or linker for good + # libtool support. + case $host in + ia64-*-hpux*) +- # Find out which ABI we are using. ++ # Find out what ABI is being produced by ac_compile, and set mode ++ # options accordingly. + echo 'int i;' > conftest.$ac_ext + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 +@@ -6843,24 +7443,25 @@ + test $ac_status = 0; }; then + case `/usr/bin/file conftest.$ac_objext` in + *ELF-32*) +- HPUX_IA64_MODE="32" ++ HPUX_IA64_MODE=32 + ;; + *ELF-64*) +- HPUX_IA64_MODE="64" ++ HPUX_IA64_MODE=64 + ;; + esac + fi + rm -rf conftest* + ;; + *-*-irix6*) +- # Find out which ABI we are using. ++ # Find out what ABI is being produced by ac_compile, and set linker ++ # options accordingly. + echo '#line '$LINENO' "configure"' > conftest.$ac_ext + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then +- if test "$lt_cv_prog_gnu_ld" = yes; then ++ if test yes = "$lt_cv_prog_gnu_ld"; then + case `/usr/bin/file conftest.$ac_objext` in + *32-bit*) + LD="${LD-ld} -melf32bsmip" +@@ -6889,9 +7490,50 @@ + rm -rf conftest* + ;; + +-x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \ ++mips64*-*linux*) ++ # Find out what ABI is being produced by ac_compile, and set linker ++ # options accordingly. ++ echo '#line '$LINENO' "configure"' > conftest.$ac_ext ++ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 ++ (eval $ac_compile) 2>&5 ++ ac_status=$? ++ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 ++ test $ac_status = 0; }; then ++ emul=elf ++ case `/usr/bin/file conftest.$ac_objext` in ++ *32-bit*) ++ emul="${emul}32" ++ ;; ++ *64-bit*) ++ emul="${emul}64" ++ ;; ++ esac ++ case `/usr/bin/file conftest.$ac_objext` in ++ *MSB*) ++ emul="${emul}btsmip" ++ ;; ++ *LSB*) ++ emul="${emul}ltsmip" ++ ;; ++ esac ++ case `/usr/bin/file conftest.$ac_objext` in ++ *N32*) ++ emul="${emul}n32" ++ ;; ++ esac ++ LD="${LD-ld} -m $emul" ++ fi ++ rm -rf conftest* ++ ;; ++ ++x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \ + s390*-*linux*|s390*-*tpf*|sparc*-*linux*) +- # Find out which ABI we are using. ++ # Find out what ABI is being produced by ac_compile, and set linker ++ # options accordingly. Note that the listed cases only cover the ++ # situations where additional linker options are needed (such as when ++ # doing 32-bit compilation for a host where ld defaults to 64-bit, or ++ # vice versa); the common cases where no linker options are needed do ++ # not appear in the list. + echo 'int i;' > conftest.$ac_ext + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 +@@ -6907,14 +7549,17 @@ + x86_64-*linux*) + case `/usr/bin/file conftest.o` in + *x86-64*) +- LD="${LD-ld} -m elf32_x86_64" +- ;; ++ LD="${LD-ld} -m elf32_x86_64" ++ ;; + *) +- LD="${LD-ld} -m elf_i386" +- ;; ++ LD="${LD-ld} -m elf_i386" ++ ;; + esac + ;; +- ppc64-*linux*|powerpc64-*linux*) ++ powerpc64le-*linux*) ++ LD="${LD-ld} -m elf32lppclinux" ++ ;; ++ powerpc64-*linux*) + LD="${LD-ld} -m elf32ppclinux" + ;; + s390x-*linux*) +@@ -6933,7 +7578,10 @@ + x86_64-*linux*) + LD="${LD-ld} -m elf_x86_64" + ;; +- ppc*-*linux*|powerpc*-*linux*) ++ powerpcle-*linux*) ++ LD="${LD-ld} -m elf64lppc" ++ ;; ++ powerpc-*linux*) + LD="${LD-ld} -m elf64ppc" + ;; + s390*-*linux*|s390*-*tpf*) +@@ -6951,7 +7599,7 @@ + + *-*-sco3.2v5*) + # On SCO OpenServer 5, we need -belf to get full-featured binaries. +- SAVE_CFLAGS="$CFLAGS" ++ SAVE_CFLAGS=$CFLAGS + CFLAGS="$CFLAGS -belf" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler needs -belf" >&5 + $as_echo_n "checking whether the C compiler needs -belf... " >&6; } +@@ -6991,13 +7639,14 @@ + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_cc_needs_belf" >&5 + $as_echo "$lt_cv_cc_needs_belf" >&6; } +- if test x"$lt_cv_cc_needs_belf" != x"yes"; then ++ if test yes != "$lt_cv_cc_needs_belf"; then + # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf +- CFLAGS="$SAVE_CFLAGS" ++ CFLAGS=$SAVE_CFLAGS + fi + ;; + *-*solaris*) +- # Find out which ABI we are using. ++ # Find out what ABI is being produced by ac_compile, and set linker ++ # options accordingly. + echo 'int i;' > conftest.$ac_ext + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 +@@ -7009,7 +7658,7 @@ + case $lt_cv_prog_gnu_ld in + yes*) + case $host in +- i?86-*-solaris*) ++ i?86-*-solaris*|x86_64-*-solaris*) + LD="${LD-ld} -m elf_x86_64" + ;; + sparc*-*-solaris*) +@@ -7018,7 +7667,7 @@ + esac + # GNU ld 2.21 introduced _sol2 emulations. Use them if available. + if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then +- LD="${LD-ld}_sol2" ++ LD=${LD-ld}_sol2 + fi + ;; + *) +@@ -7034,7 +7683,7 @@ + ;; + esac + +-need_locks="$enable_libtool_lock" ++need_locks=$enable_libtool_lock + + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}mt", so it can be a program name with args. +@@ -7145,7 +7794,7 @@ + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_mainfest_tool" >&5 + $as_echo "$lt_cv_path_mainfest_tool" >&6; } +-if test "x$lt_cv_path_mainfest_tool" != xyes; then ++if test yes != "$lt_cv_path_mainfest_tool"; then + MANIFEST_TOOL=: + fi + +@@ -7648,7 +8297,7 @@ + $as_echo_n "(cached) " >&6 + else + lt_cv_apple_cc_single_mod=no +- if test -z "${LT_MULTI_MODULE}"; then ++ if test -z "$LT_MULTI_MODULE"; then + # By default we will add the -single_module flag. You can override + # by either setting the environment variable LT_MULTI_MODULE + # non-empty at configure time, or by adding -multi_module to the +@@ -7666,7 +8315,7 @@ + cat conftest.err >&5 + # Otherwise, if the output was created with a 0 exit code from + # the compiler, it worked. +- elif test -f libconftest.dylib && test $_lt_result -eq 0; then ++ elif test -f libconftest.dylib && test 0 = "$_lt_result"; then + lt_cv_apple_cc_single_mod=yes + else + cat conftest.err >&5 +@@ -7705,7 +8354,7 @@ + fi + rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +- LDFLAGS="$save_LDFLAGS" ++ LDFLAGS=$save_LDFLAGS + + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5 +@@ -7734,7 +8383,7 @@ + _lt_result=$? + if test -s conftest.err && $GREP force_load conftest.err; then + cat conftest.err >&5 +- elif test -f conftest && test $_lt_result -eq 0 && $GREP forced_load conftest >/dev/null 2>&1 ; then ++ elif test -f conftest && test 0 = "$_lt_result" && $GREP forced_load conftest >/dev/null 2>&1; then + lt_cv_ld_force_load=yes + else + cat conftest.err >&5 +@@ -7747,32 +8396,32 @@ + $as_echo "$lt_cv_ld_force_load" >&6; } + case $host_os in + rhapsody* | darwin1.[012]) +- _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;; ++ _lt_dar_allow_undefined='$wl-undefined ${wl}suppress' ;; + darwin1.*) +- _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; ++ _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; + darwin*) # darwin 5.x on + # if running on 10.5 or later, the deployment target defaults + # to the OS version, if on x86, and 10.4, the deployment + # target defaults to 10.4. Don't you love it? + case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in + 10.0,*86*-darwin8*|10.0,*-darwin[91]*) +- _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; ++ _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; + 10.[012]*) +- _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; ++ _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; + 10.*) +- _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; ++ _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; + esac + ;; + esac +- if test "$lt_cv_apple_cc_single_mod" = "yes"; then ++ if test yes = "$lt_cv_apple_cc_single_mod"; then + _lt_dar_single_mod='$single_module' + fi +- if test "$lt_cv_ld_exported_symbols_list" = "yes"; then +- _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym' ++ if test yes = "$lt_cv_ld_exported_symbols_list"; then ++ _lt_dar_export_syms=' $wl-exported_symbols_list,$output_objdir/$libname-symbols.expsym' + else +- _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}' +- fi +- if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then ++ _lt_dar_export_syms='~$NMEDIT -s $output_objdir/$libname-symbols.expsym $lib' ++ fi ++ if test : != "$DSYMUTIL" && test no = "$lt_cv_ld_force_load"; then + _lt_dsymutil='~$DSYMUTIL $lib || :' + else + _lt_dsymutil= +@@ -8063,6 +8712,17 @@ + + + ++func_stripname_cnf () ++{ ++ case $2 in ++ .*) func_stripname_result=`$ECHO "$3" | $SED "s%^$1%%; s%\\\\$2\$%%"`;; ++ *) func_stripname_result=`$ECHO "$3" | $SED "s%^$1%%; s%$2\$%%"`;; ++ esac ++} # func_stripname_cnf ++ ++ ++ ++ + + # Set options + +@@ -8083,14 +8743,14 @@ + *) + enable_shared=no + # Look at the argument we got. We use all the common list separators. +- lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," ++ lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, + for pkg in $enableval; do +- IFS="$lt_save_ifs" ++ IFS=$lt_save_ifs + if test "X$pkg" = "X$p"; then + enable_shared=yes + fi + done +- IFS="$lt_save_ifs" ++ IFS=$lt_save_ifs + ;; + esac + else +@@ -8114,14 +8774,14 @@ + *) + enable_static=no + # Look at the argument we got. We use all the common list separators. +- lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," ++ lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, + for pkg in $enableval; do +- IFS="$lt_save_ifs" ++ IFS=$lt_save_ifs + if test "X$pkg" = "X$p"; then + enable_static=yes + fi + done +- IFS="$lt_save_ifs" ++ IFS=$lt_save_ifs + ;; + esac + else +@@ -8145,14 +8805,14 @@ + *) + pic_mode=default + # Look at the argument we got. We use all the common list separators. +- lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," ++ lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, + for lt_pkg in $withval; do +- IFS="$lt_save_ifs" ++ IFS=$lt_save_ifs + if test "X$lt_pkg" = "X$lt_p"; then + pic_mode=yes + fi + done +- IFS="$lt_save_ifs" ++ IFS=$lt_save_ifs + ;; + esac + else +@@ -8160,8 +8820,6 @@ + fi + + +-test -z "$pic_mode" && pic_mode=default +- + + + +@@ -8177,14 +8835,14 @@ + *) + enable_fast_install=no + # Look at the argument we got. We use all the common list separators. +- lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," ++ lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, + for pkg in $enableval; do +- IFS="$lt_save_ifs" ++ IFS=$lt_save_ifs + if test "X$pkg" = "X$p"; then + enable_fast_install=yes + fi + done +- IFS="$lt_save_ifs" ++ IFS=$lt_save_ifs + ;; + esac + else +@@ -8202,7 +8860,7 @@ + + + # This can be used to rebuild libtool when needed +-LIBTOOL_DEPS="$ltmain" ++LIBTOOL_DEPS=$ltmain + + # Always use our own libtool. + LIBTOOL='$(SHELL) $(top_builddir)/libtool' +@@ -8251,7 +8909,7 @@ + + + +-if test -n "${ZSH_VERSION+set}" ; then ++if test -n "${ZSH_VERSION+set}"; then + setopt NO_GLOB_SUBST + fi + +@@ -8290,7 +8948,7 @@ + # AIX sometimes has problems with the GCC collect2 program. For some + # reason, if we set the COLLECT_NAMES environment variable, the problems + # vanish in a puff of smoke. +- if test "X${COLLECT_NAMES+set}" != Xset; then ++ if test set != "${COLLECT_NAMES+set}"; then + COLLECT_NAMES= + export COLLECT_NAMES + fi +@@ -8301,14 +8959,14 @@ + ofile=libtool + can_build_shared=yes + +-# All known linkers require a `.a' archive for static linking (except MSVC, ++# All known linkers require a '.a' archive for static linking (except MSVC, + # which needs '.lib'). + libext=a + +-with_gnu_ld="$lt_cv_prog_gnu_ld" +- +-old_CC="$CC" +-old_CFLAGS="$CFLAGS" ++with_gnu_ld=$lt_cv_prog_gnu_ld ++ ++old_CC=$CC ++old_CFLAGS=$CFLAGS + + # Set sane defaults for various variables + test -z "$CC" && CC=cc +@@ -8340,22 +8998,22 @@ + else + case $MAGIC_CMD in + [\\/*] | ?:[\\/]*) +- lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. ++ lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path. + ;; + *) +- lt_save_MAGIC_CMD="$MAGIC_CMD" +- lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR ++ lt_save_MAGIC_CMD=$MAGIC_CMD ++ lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR + ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" + for ac_dir in $ac_dummy; do +- IFS="$lt_save_ifs" ++ IFS=$lt_save_ifs + test -z "$ac_dir" && ac_dir=. +- if test -f $ac_dir/${ac_tool_prefix}file; then +- lt_cv_path_MAGIC_CMD="$ac_dir/${ac_tool_prefix}file" ++ if test -f "$ac_dir/${ac_tool_prefix}file"; then ++ lt_cv_path_MAGIC_CMD=$ac_dir/"${ac_tool_prefix}file" + if test -n "$file_magic_test_file"; then + case $deplibs_check_method in + "file_magic "*) + file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` +- MAGIC_CMD="$lt_cv_path_MAGIC_CMD" ++ MAGIC_CMD=$lt_cv_path_MAGIC_CMD + if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | + $EGREP "$file_magic_regex" > /dev/null; then + : +@@ -8378,13 +9036,13 @@ + break + fi + done +- IFS="$lt_save_ifs" +- MAGIC_CMD="$lt_save_MAGIC_CMD" +- ;; +-esac +-fi +- +-MAGIC_CMD="$lt_cv_path_MAGIC_CMD" ++ IFS=$lt_save_ifs ++ MAGIC_CMD=$lt_save_MAGIC_CMD ++ ;; ++esac ++fi ++ ++MAGIC_CMD=$lt_cv_path_MAGIC_CMD + if test -n "$MAGIC_CMD"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 + $as_echo "$MAGIC_CMD" >&6; } +@@ -8406,22 +9064,22 @@ + else + case $MAGIC_CMD in + [\\/*] | ?:[\\/]*) +- lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. ++ lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path. + ;; + *) +- lt_save_MAGIC_CMD="$MAGIC_CMD" +- lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR ++ lt_save_MAGIC_CMD=$MAGIC_CMD ++ lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR + ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" + for ac_dir in $ac_dummy; do +- IFS="$lt_save_ifs" ++ IFS=$lt_save_ifs + test -z "$ac_dir" && ac_dir=. +- if test -f $ac_dir/file; then +- lt_cv_path_MAGIC_CMD="$ac_dir/file" ++ if test -f "$ac_dir/file"; then ++ lt_cv_path_MAGIC_CMD=$ac_dir/"file" + if test -n "$file_magic_test_file"; then + case $deplibs_check_method in + "file_magic "*) + file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` +- MAGIC_CMD="$lt_cv_path_MAGIC_CMD" ++ MAGIC_CMD=$lt_cv_path_MAGIC_CMD + if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | + $EGREP "$file_magic_regex" > /dev/null; then + : +@@ -8444,13 +9102,13 @@ + break + fi + done +- IFS="$lt_save_ifs" +- MAGIC_CMD="$lt_save_MAGIC_CMD" +- ;; +-esac +-fi +- +-MAGIC_CMD="$lt_cv_path_MAGIC_CMD" ++ IFS=$lt_save_ifs ++ MAGIC_CMD=$lt_save_MAGIC_CMD ++ ;; ++esac ++fi ++ ++MAGIC_CMD=$lt_cv_path_MAGIC_CMD + if test -n "$MAGIC_CMD"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 + $as_echo "$MAGIC_CMD" >&6; } +@@ -8471,7 +9129,7 @@ + + # Use C for the default configuration in the libtool script + +-lt_save_CC="$CC" ++lt_save_CC=$CC + ac_ext=c + ac_cpp='$CPP $CPPFLAGS' + ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +@@ -8533,7 +9191,7 @@ + + lt_prog_compiler_no_builtin_flag= + +-if test "$GCC" = yes; then ++if test yes = "$GCC"; then + case $cc_basename in + nvcc*) + lt_prog_compiler_no_builtin_flag=' -Xcompiler -fno-builtin' ;; +@@ -8549,7 +9207,7 @@ + lt_cv_prog_compiler_rtti_exceptions=no + ac_outfile=conftest.$ac_objext + echo "$lt_simple_compile_test_code" > conftest.$ac_ext +- lt_compiler_flag="-fno-rtti -fno-exceptions" ++ lt_compiler_flag="-fno-rtti -fno-exceptions" ## exclude from sc_useless_quotes_in_assignment + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins +@@ -8579,7 +9237,7 @@ + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 + $as_echo "$lt_cv_prog_compiler_rtti_exceptions" >&6; } + +-if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then ++if test yes = "$lt_cv_prog_compiler_rtti_exceptions"; then + lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions" + else + : +@@ -8597,17 +9255,18 @@ + lt_prog_compiler_static= + + +- if test "$GCC" = yes; then ++ if test yes = "$GCC"; then + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_static='-static' + + case $host_os in + aix*) + # All AIX code is PIC. +- if test "$host_cpu" = ia64; then ++ if test ia64 = "$host_cpu"; then + # AIX 5 now supports IA64 processor + lt_prog_compiler_static='-Bstatic' + fi ++ lt_prog_compiler_pic='-fPIC' + ;; + + amigaos*) +@@ -8618,8 +9277,8 @@ + ;; + m68k) + # FIXME: we need at least 68020 code to build shared libraries, but +- # adding the `-m68020' flag to GCC prevents building anything better, +- # like `-m68040'. ++ # adding the '-m68020' flag to GCC prevents building anything better, ++ # like '-m68040'. + lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4' + ;; + esac +@@ -8705,7 +9364,7 @@ + case $host_os in + aix*) + lt_prog_compiler_wl='-Wl,' +- if test "$host_cpu" = ia64; then ++ if test ia64 = "$host_cpu"; then + # AIX 5 now supports IA64 processor + lt_prog_compiler_static='-Bstatic' + else +@@ -8713,6 +9372,20 @@ + fi + ;; + ++ darwin* | rhapsody*) ++ # PIC is the default on this platform ++ # Common symbols not allowed in MH_DYLIB files ++ lt_prog_compiler_pic='-fno-common' ++ case $cc_basename in ++ nagfor*) ++ # NAG Fortran compiler ++ lt_prog_compiler_wl='-Wl,-Wl,,' ++ lt_prog_compiler_pic='-PIC' ++ lt_prog_compiler_static='-Bstatic' ++ ;; ++ esac ++ ;; ++ + mingw* | cygwin* | pw32* | os2* | cegcc*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). +@@ -8732,7 +9405,7 @@ + ;; + esac + # Is there a better lt_prog_compiler_static that works with the bundled CC? +- lt_prog_compiler_static='${wl}-a ${wl}archive' ++ lt_prog_compiler_static='$wl-a ${wl}archive' + ;; + + irix5* | irix6* | nonstopux*) +@@ -8741,9 +9414,9 @@ + lt_prog_compiler_static='-non_shared' + ;; + +- linux* | k*bsd*-gnu | kopensolaris*-gnu) ++ linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) + case $cc_basename in +- # old Intel for x86_64 which still supported -KPIC. ++ # old Intel for x86_64, which still supported -KPIC. + ecc*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-KPIC' +@@ -8768,6 +9441,12 @@ + lt_prog_compiler_pic='-PIC' + lt_prog_compiler_static='-Bstatic' + ;; ++ tcc*) ++ # Fabrice Bellard et al's Tiny C Compiler ++ lt_prog_compiler_wl='-Wl,' ++ lt_prog_compiler_pic='-fPIC' ++ lt_prog_compiler_static='-static' ++ ;; + pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) + # Portland Group compilers (*not* the Pentium gcc compiler, + # which looks to be a dead project) +@@ -8865,7 +9544,7 @@ + ;; + + sysv4*MP*) +- if test -d /usr/nec ;then ++ if test -d /usr/nec; then + lt_prog_compiler_pic='-Kconform_pic' + lt_prog_compiler_static='-Bstatic' + fi +@@ -8894,7 +9573,7 @@ + fi + + case $host_os in +- # For platforms which do not support PIC, -DPIC is meaningless: ++ # For platforms that do not support PIC, -DPIC is meaningless: + *djgpp*) + lt_prog_compiler_pic= + ;; +@@ -8926,7 +9605,7 @@ + lt_cv_prog_compiler_pic_works=no + ac_outfile=conftest.$ac_objext + echo "$lt_simple_compile_test_code" > conftest.$ac_ext +- lt_compiler_flag="$lt_prog_compiler_pic -DPIC" ++ lt_compiler_flag="$lt_prog_compiler_pic -DPIC" ## exclude from sc_useless_quotes_in_assignment + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins +@@ -8956,7 +9635,7 @@ + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works" >&5 + $as_echo "$lt_cv_prog_compiler_pic_works" >&6; } + +-if test x"$lt_cv_prog_compiler_pic_works" = xyes; then ++if test yes = "$lt_cv_prog_compiler_pic_works"; then + case $lt_prog_compiler_pic in + "" | " "*) ;; + *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;; +@@ -8988,7 +9667,7 @@ + $as_echo_n "(cached) " >&6 + else + lt_cv_prog_compiler_static_works=no +- save_LDFLAGS="$LDFLAGS" ++ save_LDFLAGS=$LDFLAGS + LDFLAGS="$LDFLAGS $lt_tmp_static_flag" + echo "$lt_simple_link_test_code" > conftest.$ac_ext + if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then +@@ -9007,13 +9686,13 @@ + fi + fi + $RM -r conftest* +- LDFLAGS="$save_LDFLAGS" ++ LDFLAGS=$save_LDFLAGS + + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works" >&5 + $as_echo "$lt_cv_prog_compiler_static_works" >&6; } + +-if test x"$lt_cv_prog_compiler_static_works" = xyes; then ++if test yes = "$lt_cv_prog_compiler_static_works"; then + : + else + lt_prog_compiler_static= +@@ -9133,8 +9812,8 @@ + + + +-hard_links="nottested" +-if test "$lt_cv_prog_compiler_c_o" = no && test "$need_locks" != no; then ++hard_links=nottested ++if test no = "$lt_cv_prog_compiler_c_o" && test no != "$need_locks"; then + # do not overwrite the value of need_locks provided by the user + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5 + $as_echo_n "checking if we can lock with hard links... " >&6; } +@@ -9146,9 +9825,9 @@ + ln conftest.a conftest.b 2>/dev/null && hard_links=no + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5 + $as_echo "$hard_links" >&6; } +- if test "$hard_links" = no; then +- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 +-$as_echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} ++ if test no = "$hard_links"; then ++ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&5 ++$as_echo "$as_me: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&2;} + need_locks=warn + fi + else +@@ -9191,9 +9870,9 @@ + # included in the symbol list + include_expsyms= + # exclude_expsyms can be an extended regexp of symbols to exclude +- # it will be wrapped by ` (' and `)$', so one must not match beginning or +- # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', +- # as well as any symbol that contains `d'. ++ # it will be wrapped by ' (' and ')$', so one must not match beginning or ++ # end of line. Example: 'a|bc|.*d.*' will exclude the symbols 'a' and 'bc', ++ # as well as any symbol that contains 'd'. + exclude_expsyms='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*' + # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out + # platforms (ab)use it in PIC code, but their linkers get confused if +@@ -9208,7 +9887,7 @@ + # FIXME: the MSVC++ port hasn't been tested in a loooong time + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. +- if test "$GCC" != yes; then ++ if test yes != "$GCC"; then + with_gnu_ld=no + fi + ;; +@@ -9216,7 +9895,7 @@ + # we just hope/assume this is gcc and not c89 (= MSVC++) + with_gnu_ld=yes + ;; +- openbsd*) ++ openbsd* | bitrig*) + with_gnu_ld=no + ;; + esac +@@ -9226,7 +9905,7 @@ + # On some targets, GNU ld is compatible enough with the native linker + # that we're better off using the native interface for both. + lt_use_gnu_ld_interface=no +- if test "$with_gnu_ld" = yes; then ++ if test yes = "$with_gnu_ld"; then + case $host_os in + aix*) + # The AIX port of GNU ld has always aspired to compatibility +@@ -9248,24 +9927,24 @@ + esac + fi + +- if test "$lt_use_gnu_ld_interface" = yes; then ++ if test yes = "$lt_use_gnu_ld_interface"; then + # If archive_cmds runs LD, not CC, wlarc should be empty +- wlarc='${wl}' ++ wlarc='$wl' + + # Set some defaults for GNU ld with shared library support. These + # are reset later if shared libraries are not supported. Putting them + # here allows them to be overridden if necessary. + runpath_var=LD_RUN_PATH +- hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' +- export_dynamic_flag_spec='${wl}--export-dynamic' ++ hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' ++ export_dynamic_flag_spec='$wl--export-dynamic' + # ancient GNU ld didn't support --whole-archive et. al. + if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then +- whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' ++ whole_archive_flag_spec=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive' + else + whole_archive_flag_spec= + fi + supports_anon_versioning=no +- case `$LD -v 2>&1` in ++ case `$LD -v | $SED -e 's/(^)\+)\s\+//' 2>&1` in + *GNU\ gold*) supports_anon_versioning=yes ;; + *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 + *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... +@@ -9278,7 +9957,7 @@ + case $host_os in + aix[3-9]*) + # On AIX/PPC, the GNU linker is very broken +- if test "$host_cpu" != ia64; then ++ if test ia64 != "$host_cpu"; then + ld_shlibs=no + cat <<_LT_EOF 1>&2 + +@@ -9297,7 +9976,7 @@ + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support +- archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' ++ archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + archive_expsym_cmds='' + ;; + m68k) +@@ -9313,7 +9992,7 @@ + allow_undefined_flag=unsupported + # Joseph Beckenbach says some releases of gcc + # support --undefined. This deserves some investigation. FIXME +- archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' ++ archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + else + ld_shlibs=no + fi +@@ -9323,7 +10002,7 @@ + # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless, + # as there is no search path for DLLs. + hardcode_libdir_flag_spec='-L$libdir' +- export_dynamic_flag_spec='${wl}--export-all-symbols' ++ export_dynamic_flag_spec='$wl--export-all-symbols' + allow_undefined_flag=unsupported + always_export_symbols=no + enable_shared_with_static_runtimes=yes +@@ -9331,61 +10010,61 @@ + exclude_expsyms='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname' + + if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then +- archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' +- # If the export-symbols file already is a .def file (1st line +- # is EXPORTS), use it as is; otherwise, prepend... +- archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then +- cp $export_symbols $output_objdir/$soname.def; +- else +- echo EXPORTS > $output_objdir/$soname.def; +- cat $export_symbols >> $output_objdir/$soname.def; +- fi~ +- $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' ++ archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' ++ # If the export-symbols file already is a .def file, use it as ++ # is; otherwise, prepend EXPORTS... ++ archive_expsym_cmds='if test DEF = "`$SED -n -e '\''s/^[ ]*//'\'' -e '\''/^\(;.*\)*$/d'\'' -e '\''s/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p'\'' -e q $export_symbols`" ; then ++ cp $export_symbols $output_objdir/$soname.def; ++ else ++ echo EXPORTS > $output_objdir/$soname.def; ++ cat $export_symbols >> $output_objdir/$soname.def; ++ fi~ ++ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + else + ld_shlibs=no + fi + ;; + + haiku*) +- archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' ++ archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + link_all_deplibs=yes + ;; + + interix[3-9]*) + hardcode_direct=no + hardcode_shlibpath_var=no +- hardcode_libdir_flag_spec='${wl}-rpath,$libdir' +- export_dynamic_flag_spec='${wl}-E' ++ hardcode_libdir_flag_spec='$wl-rpath,$libdir' ++ export_dynamic_flag_spec='$wl-E' + # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. + # Instead, shared libraries are loaded at an image base (0x10000000 by + # default) and relocated if they conflict, which is a slow very memory + # consuming and fragmenting process. To avoid this, we pick a random, + # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link + # time. Moving up from 0x10000000 also allows more sbrk(2) space. +- archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' +- archive_expsym_cmds='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ++ archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ++ archive_expsym_cmds='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + ;; + + gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) + tmp_diet=no +- if test "$host_os" = linux-dietlibc; then ++ if test linux-dietlibc = "$host_os"; then + case $cc_basename in + diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) + esac + fi + if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ +- && test "$tmp_diet" = no ++ && test no = "$tmp_diet" + then + tmp_addflag=' $pic_flag' + tmp_sharedflag='-shared' + case $cc_basename,$host_cpu in + pgcc*) # Portland Group C compiler +- whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' ++ whole_archive_flag_spec='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' + tmp_addflag=' $pic_flag' + ;; + pgf77* | pgf90* | pgf95* | pgfortran*) + # Portland Group f77 and f90 compilers +- whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' ++ whole_archive_flag_spec='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' + tmp_addflag=' $pic_flag -Mnomain' ;; + ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 + tmp_addflag=' -i_dynamic' ;; +@@ -9396,42 +10075,44 @@ + lf95*) # Lahey Fortran 8.1 + whole_archive_flag_spec= + tmp_sharedflag='--shared' ;; ++ nagfor*) # NAGFOR 5.3 ++ tmp_sharedflag='-Wl,-shared' ;; + xl[cC]* | bgxl[cC]* | mpixl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below) + tmp_sharedflag='-qmkshrobj' + tmp_addflag= ;; + nvcc*) # Cuda Compiler Driver 2.2 +- whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' ++ whole_archive_flag_spec='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' + compiler_needs_object=yes + ;; + esac + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) # Sun C 5.9 +- whole_archive_flag_spec='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' ++ whole_archive_flag_spec='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' + compiler_needs_object=yes + tmp_sharedflag='-G' ;; + *Sun\ F*) # Sun Fortran 8.3 + tmp_sharedflag='-G' ;; + esac +- archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' +- +- if test "x$supports_anon_versioning" = xyes; then ++ archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' ++ ++ if test yes = "$supports_anon_versioning"; then + archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ +- cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ +- echo "local: *; };" >> $output_objdir/$libname.ver~ +- $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' ++ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ ++ echo "local: *; };" >> $output_objdir/$libname.ver~ ++ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib' + fi + + case $cc_basename in + xlf* | bgf* | bgxlf* | mpixlf*) + # IBM XL Fortran 10.1 on PPC cannot create shared libs itself + whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive' +- hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' ++ hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' + archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' +- if test "x$supports_anon_versioning" = xyes; then ++ if test yes = "$supports_anon_versioning"; then + archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ +- cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ +- echo "local: *; };" >> $output_objdir/$libname.ver~ +- $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' ++ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ ++ echo "local: *; };" >> $output_objdir/$libname.ver~ ++ $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' + fi + ;; + esac +@@ -9445,8 +10126,8 @@ + archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' + wlarc= + else +- archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' +- archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' ++ archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' ++ archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' + fi + ;; + +@@ -9464,8 +10145,8 @@ + + _LT_EOF + elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then +- archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' +- archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' ++ archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' ++ archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' + else + ld_shlibs=no + fi +@@ -9477,7 +10158,7 @@ + ld_shlibs=no + cat <<_LT_EOF 1>&2 + +-*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not ++*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 cannot + *** reliably create shared libraries on SCO systems. Therefore, libtool + *** is disabling shared libraries support. We urge you to upgrade GNU + *** binutils to release 2.16.91.0.3 or newer. Another option is to modify +@@ -9492,9 +10173,9 @@ + # DT_RUNPATH tag from executables and libraries. But doing so + # requires that you compile everything twice, which is a pain. + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then +- hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' +- archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' +- archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' ++ hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' ++ archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' ++ archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' + else + ld_shlibs=no + fi +@@ -9511,15 +10192,15 @@ + + *) + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then +- archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' +- archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' ++ archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' ++ archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' + else + ld_shlibs=no + fi + ;; + esac + +- if test "$ld_shlibs" = no; then ++ if test no = "$ld_shlibs"; then + runpath_var= + hardcode_libdir_flag_spec= + export_dynamic_flag_spec= +@@ -9535,7 +10216,7 @@ + # Note: this linker hardcodes the directories in LIBPATH if there + # are no directories specified by -L. + hardcode_minus_L=yes +- if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then ++ if test yes = "$GCC" && test -z "$lt_prog_compiler_static"; then + # Neither direct hardcoding nor static linking is supported with a + # broken collect2. + hardcode_direct=unsupported +@@ -9543,12 +10224,12 @@ + ;; + + aix[4-9]*) +- if test "$host_cpu" = ia64; then ++ if test ia64 = "$host_cpu"; then + # On IA64, the linker does run time linking by default, so we don't + # have to do anything special. + aix_use_runtimelinking=no + exp_sym_flag='-Bexport' +- no_entry_flag="" ++ no_entry_flag= + else + # If we're using GNU nm, then we don't want the "-C" option. + # -C means demangle to AIX nm, but means don't demangle with GNU nm +@@ -9566,7 +10247,7 @@ + # need to do runtime linking. + case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) + for ld_flag in $LDFLAGS; do +- if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then ++ if (test x-brtl = "x$ld_flag" || test x-Wl,-brtl = "x$ld_flag"); then + aix_use_runtimelinking=yes + break + fi +@@ -9589,13 +10270,13 @@ + hardcode_direct_absolute=yes + hardcode_libdir_separator=':' + link_all_deplibs=yes +- file_list_spec='${wl}-f,' +- +- if test "$GCC" = yes; then ++ file_list_spec='$wl-f,' ++ ++ if test yes = "$GCC"; then + case $host_os in aix4.[012]|aix4.[012].*) + # We only want to do this on AIX 4.2 and lower, the check + # below for broken collect2 doesn't work under 4.3+ +- collect2name=`${CC} -print-prog-name=collect2` ++ collect2name=`$CC -print-prog-name=collect2` + if test -f "$collect2name" && + strings "$collect2name" | $GREP resolve_lib_name >/dev/null + then +@@ -9614,35 +10295,35 @@ + ;; + esac + shared_flag='-shared' +- if test "$aix_use_runtimelinking" = yes; then +- shared_flag="$shared_flag "'${wl}-G' ++ if test yes = "$aix_use_runtimelinking"; then ++ shared_flag="$shared_flag "'$wl-G' + fi + else + # not using gcc +- if test "$host_cpu" = ia64; then ++ if test ia64 = "$host_cpu"; then + # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release + # chokes on -Wl,-G. The following line is correct: + shared_flag='-G' + else +- if test "$aix_use_runtimelinking" = yes; then +- shared_flag='${wl}-G' ++ if test yes = "$aix_use_runtimelinking"; then ++ shared_flag='$wl-G' + else +- shared_flag='${wl}-bM:SRE' ++ shared_flag='$wl-bM:SRE' + fi + fi + fi + +- export_dynamic_flag_spec='${wl}-bexpall' ++ export_dynamic_flag_spec='$wl-bexpall' + # It seems that -bexpall does not export symbols beginning with + # underscore (_), so it is better to generate a list of symbols to export. + always_export_symbols=yes +- if test "$aix_use_runtimelinking" = yes; then ++ if test yes = "$aix_use_runtimelinking"; then + # Warning - without using the other runtime loading flags (-brtl), + # -berok will link without error, but may produce a broken library. + allow_undefined_flag='-berok' + # Determine the default libpath from the value encoded in an + # empty executable. +- if test "${lt_cv_aix_libpath+set}" = set; then ++ if test set = "${lt_cv_aix_libpath+set}"; then + aix_libpath=$lt_cv_aix_libpath + else + if ${lt_cv_aix_libpath_+:} false; then : +@@ -9677,7 +10358,7 @@ + rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + if test -z "$lt_cv_aix_libpath_"; then +- lt_cv_aix_libpath_="/usr/lib:/lib" ++ lt_cv_aix_libpath_=/usr/lib:/lib + fi + + fi +@@ -9685,17 +10366,17 @@ + aix_libpath=$lt_cv_aix_libpath_ + fi + +- hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" +- archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" ++ hardcode_libdir_flag_spec='$wl-blibpath:$libdir:'"$aix_libpath" ++ archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag + else +- if test "$host_cpu" = ia64; then +- hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib' ++ if test ia64 = "$host_cpu"; then ++ hardcode_libdir_flag_spec='$wl-R $libdir:/usr/lib:/lib' + allow_undefined_flag="-z nodefs" +- archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" ++ archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\$wl$no_entry_flag"' $compiler_flags $wl$allow_undefined_flag '"\$wl$exp_sym_flag:\$export_symbols" + else + # Determine the default libpath from the value encoded in an + # empty executable. +- if test "${lt_cv_aix_libpath+set}" = set; then ++ if test set = "${lt_cv_aix_libpath+set}"; then + aix_libpath=$lt_cv_aix_libpath + else + if ${lt_cv_aix_libpath_+:} false; then : +@@ -9730,7 +10411,7 @@ + rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + if test -z "$lt_cv_aix_libpath_"; then +- lt_cv_aix_libpath_="/usr/lib:/lib" ++ lt_cv_aix_libpath_=/usr/lib:/lib + fi + + fi +@@ -9738,21 +10419,21 @@ + aix_libpath=$lt_cv_aix_libpath_ + fi + +- hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" ++ hardcode_libdir_flag_spec='$wl-blibpath:$libdir:'"$aix_libpath" + # Warning - without using the other run time loading flags, + # -berok will link without error, but may produce a broken library. +- no_undefined_flag=' ${wl}-bernotok' +- allow_undefined_flag=' ${wl}-berok' +- if test "$with_gnu_ld" = yes; then ++ no_undefined_flag=' $wl-bernotok' ++ allow_undefined_flag=' $wl-berok' ++ if test yes = "$with_gnu_ld"; then + # We only use this code for GNU lds that support --whole-archive. +- whole_archive_flag_spec='${wl}--whole-archive$convenience ${wl}--no-whole-archive' ++ whole_archive_flag_spec='$wl--whole-archive$convenience $wl--no-whole-archive' + else + # Exported symbols can be pulled into shared objects from archives + whole_archive_flag_spec='$convenience' + fi + archive_cmds_need_lc=yes + # This is similar to how AIX traditionally builds its shared libraries. +- archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' ++ archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $wl-bnoentry $compiler_flags $wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + fi + fi + ;; +@@ -9761,7 +10442,7 @@ + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support +- archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' ++ archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + archive_expsym_cmds='' + ;; + m68k) +@@ -9791,16 +10472,17 @@ + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. +- shrext_cmds=".dll" ++ shrext_cmds=.dll + # FIXME: Setting linknames here is a bad hack. +- archive_cmds='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' +- archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then +- sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; +- else +- sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; +- fi~ +- $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ +- linknames=' ++ archive_cmds='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames=' ++ archive_expsym_cmds='if test DEF = "`$SED -n -e '\''s/^[ ]*//'\'' -e '\''/^\(;.*\)*$/d'\'' -e '\''s/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p'\'' -e q $export_symbols`" ; then ++ cp "$export_symbols" "$output_objdir/$soname.def"; ++ echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp"; ++ else ++ $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp; ++ fi~ ++ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ ++ linknames=' + # The linker will not automatically build a static lib if we build a DLL. + # _LT_TAGVAR(old_archive_from_new_cmds, )='true' + enable_shared_with_static_runtimes=yes +@@ -9809,18 +10491,18 @@ + # Don't use ranlib + old_postinstall_cmds='chmod 644 $oldlib' + postlink_cmds='lt_outputfile="@OUTPUT@"~ +- lt_tool_outputfile="@TOOL_OUTPUT@"~ +- case $lt_outputfile in +- *.exe|*.EXE) ;; +- *) +- lt_outputfile="$lt_outputfile.exe" +- lt_tool_outputfile="$lt_tool_outputfile.exe" +- ;; +- esac~ +- if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then +- $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; +- $RM "$lt_outputfile.manifest"; +- fi' ++ lt_tool_outputfile="@TOOL_OUTPUT@"~ ++ case $lt_outputfile in ++ *.exe|*.EXE) ;; ++ *) ++ lt_outputfile=$lt_outputfile.exe ++ lt_tool_outputfile=$lt_tool_outputfile.exe ++ ;; ++ esac~ ++ if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then ++ $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; ++ $RM "$lt_outputfile.manifest"; ++ fi' + ;; + *) + # Assume MSVC wrapper +@@ -9829,7 +10511,7 @@ + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. +- shrext_cmds=".dll" ++ shrext_cmds=.dll + # FIXME: Setting linknames here is a bad hack. + archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' + # The linker will automatically build a .lib file if we build a DLL. +@@ -9848,24 +10530,24 @@ + hardcode_direct=no + hardcode_automatic=yes + hardcode_shlibpath_var=unsupported +- if test "$lt_cv_ld_force_load" = "yes"; then +- whole_archive_flag_spec='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' ++ if test yes = "$lt_cv_ld_force_load"; then ++ whole_archive_flag_spec='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience $wl-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' + + else + whole_archive_flag_spec='' + fi + link_all_deplibs=yes +- allow_undefined_flag="$_lt_dar_allow_undefined" ++ allow_undefined_flag=$_lt_dar_allow_undefined + case $cc_basename in +- ifort*) _lt_dar_can_shared=yes ;; ++ ifort*|nagfor*) _lt_dar_can_shared=yes ;; + *) _lt_dar_can_shared=$GCC ;; + esac +- if test "$_lt_dar_can_shared" = "yes"; then ++ if test yes = "$_lt_dar_can_shared"; then + output_verbose_link_cmd=func_echo_all +- archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" +- module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" +- archive_expsym_cmds="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" +- module_expsym_cmds="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" ++ archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dsymutil" ++ module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dsymutil" ++ archive_expsym_cmds="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil" ++ module_expsym_cmds="sed -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil" + + else + ld_shlibs=no +@@ -9907,33 +10589,33 @@ + ;; + + hpux9*) +- if test "$GCC" = yes; then +- archive_cmds='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' ++ if test yes = "$GCC"; then ++ archive_cmds='$RM $output_objdir/$soname~$CC -shared $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' + else +- archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' +- fi +- hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' ++ archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' ++ fi ++ hardcode_libdir_flag_spec='$wl+b $wl$libdir' + hardcode_libdir_separator=: + hardcode_direct=yes + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L=yes +- export_dynamic_flag_spec='${wl}-E' ++ export_dynamic_flag_spec='$wl-E' + ;; + + hpux10*) +- if test "$GCC" = yes && test "$with_gnu_ld" = no; then +- archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ++ if test yes,no = "$GCC,$with_gnu_ld"; then ++ archive_cmds='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' + fi +- if test "$with_gnu_ld" = no; then +- hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' ++ if test no = "$with_gnu_ld"; then ++ hardcode_libdir_flag_spec='$wl+b $wl$libdir' + hardcode_libdir_separator=: + hardcode_direct=yes + hardcode_direct_absolute=yes +- export_dynamic_flag_spec='${wl}-E' ++ export_dynamic_flag_spec='$wl-E' + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L=yes +@@ -9941,25 +10623,25 @@ + ;; + + hpux11*) +- if test "$GCC" = yes && test "$with_gnu_ld" = no; then ++ if test yes,no = "$GCC,$with_gnu_ld"; then + case $host_cpu in + hppa*64*) +- archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ++ archive_cmds='$CC -shared $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) +- archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ++ archive_cmds='$CC -shared $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) +- archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ++ archive_cmds='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + else + case $host_cpu in + hppa*64*) +- archive_cmds='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ++ archive_cmds='$CC -b $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) +- archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ++ archive_cmds='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + +@@ -9971,7 +10653,7 @@ + $as_echo_n "(cached) " >&6 + else + lt_cv_prog_compiler__b=no +- save_LDFLAGS="$LDFLAGS" ++ save_LDFLAGS=$LDFLAGS + LDFLAGS="$LDFLAGS -b" + echo "$lt_simple_link_test_code" > conftest.$ac_ext + if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then +@@ -9990,14 +10672,14 @@ + fi + fi + $RM -r conftest* +- LDFLAGS="$save_LDFLAGS" ++ LDFLAGS=$save_LDFLAGS + + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler__b" >&5 + $as_echo "$lt_cv_prog_compiler__b" >&6; } + +-if test x"$lt_cv_prog_compiler__b" = xyes; then +- archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ++if test yes = "$lt_cv_prog_compiler__b"; then ++ archive_cmds='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' + fi +@@ -10005,8 +10687,8 @@ + ;; + esac + fi +- if test "$with_gnu_ld" = no; then +- hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' ++ if test no = "$with_gnu_ld"; then ++ hardcode_libdir_flag_spec='$wl+b $wl$libdir' + hardcode_libdir_separator=: + + case $host_cpu in +@@ -10017,7 +10699,7 @@ + *) + hardcode_direct=yes + hardcode_direct_absolute=yes +- export_dynamic_flag_spec='${wl}-E' ++ export_dynamic_flag_spec='$wl-E' + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. +@@ -10028,8 +10710,8 @@ + ;; + + irix5* | irix6* | nonstopux*) +- if test "$GCC" = yes; then +- archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' ++ if test yes = "$GCC"; then ++ archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' + # Try to use the -exported_symbol ld option, if it does not + # work, assume that -exports_file does not work either and + # implicitly export all symbols. +@@ -10039,8 +10721,8 @@ + if ${lt_cv_irix_exported_symbol+:} false; then : + $as_echo_n "(cached) " >&6 + else +- save_LDFLAGS="$LDFLAGS" +- LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" ++ save_LDFLAGS=$LDFLAGS ++ LDFLAGS="$LDFLAGS -shared $wl-exported_symbol ${wl}foo $wl-update_registry $wl/dev/null" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext + /* end confdefs.h. */ + int foo (void) { return 0; } +@@ -10052,19 +10734,19 @@ + fi + rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +- LDFLAGS="$save_LDFLAGS" ++ LDFLAGS=$save_LDFLAGS + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5 + $as_echo "$lt_cv_irix_exported_symbol" >&6; } +- if test "$lt_cv_irix_exported_symbol" = yes; then +- archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' ++ if test yes = "$lt_cv_irix_exported_symbol"; then ++ archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations $wl-exports_file $wl$export_symbols -o $lib' + fi + else +- archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' +- archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' ++ archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' ++ archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -exports_file $export_symbols -o $lib' + fi + archive_cmds_need_lc='no' +- hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' ++ hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' + hardcode_libdir_separator=: + inherit_rpath=yes + link_all_deplibs=yes +@@ -10084,7 +10766,7 @@ + newsos6) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct=yes +- hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' ++ hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' + hardcode_libdir_separator=: + hardcode_shlibpath_var=no + ;; +@@ -10092,27 +10774,19 @@ + *nto* | *qnx*) + ;; + +- openbsd*) ++ openbsd* | bitrig*) + if test -f /usr/libexec/ld.so; then + hardcode_direct=yes + hardcode_shlibpath_var=no + hardcode_direct_absolute=yes +- if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then ++ if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then + archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' +- archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' +- hardcode_libdir_flag_spec='${wl}-rpath,$libdir' +- export_dynamic_flag_spec='${wl}-E' ++ archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags $wl-retain-symbols-file,$export_symbols' ++ hardcode_libdir_flag_spec='$wl-rpath,$libdir' ++ export_dynamic_flag_spec='$wl-E' + else +- case $host_os in +- openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) +- archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' +- hardcode_libdir_flag_spec='-R$libdir' +- ;; +- *) +- archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' +- hardcode_libdir_flag_spec='${wl}-rpath,$libdir' +- ;; +- esac ++ archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' ++ hardcode_libdir_flag_spec='$wl-rpath,$libdir' + fi + else + ld_shlibs=no +@@ -10128,28 +10802,28 @@ + ;; + + osf3*) +- if test "$GCC" = yes; then +- allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' +- archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' ++ if test yes = "$GCC"; then ++ allow_undefined_flag=' $wl-expect_unresolved $wl\*' ++ archive_cmds='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' + else + allow_undefined_flag=' -expect_unresolved \*' +- archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' ++ archive_cmds='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' + fi + archive_cmds_need_lc='no' +- hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' ++ hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' + hardcode_libdir_separator=: + ;; + + osf4* | osf5*) # as osf3* with the addition of -msym flag +- if test "$GCC" = yes; then +- allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' +- archive_cmds='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' +- hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' ++ if test yes = "$GCC"; then ++ allow_undefined_flag=' $wl-expect_unresolved $wl\*' ++ archive_cmds='$CC -shared$allow_undefined_flag $pic_flag $libobjs $deplibs $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' ++ hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' + else + allow_undefined_flag=' -expect_unresolved \*' +- archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' ++ archive_cmds='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' + archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ +- $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp' ++ $CC -shared$allow_undefined_flag $wl-input $wl$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib~$RM $lib.exp' + + # Both c and cxx compiler support -rpath directly + hardcode_libdir_flag_spec='-rpath $libdir' +@@ -10160,24 +10834,24 @@ + + solaris*) + no_undefined_flag=' -z defs' +- if test "$GCC" = yes; then +- wlarc='${wl}' +- archive_cmds='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ++ if test yes = "$GCC"; then ++ wlarc='$wl' ++ archive_cmds='$CC -shared $pic_flag $wl-z ${wl}text $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ +- $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' ++ $CC -shared $pic_flag $wl-z ${wl}text $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' + else + case `$CC -V 2>&1` in + *"Compilers 5.0"*) + wlarc='' +- archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' ++ archive_cmds='$LD -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $linker_flags' + archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ +- $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' ++ $LD -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' + ;; + *) +- wlarc='${wl}' +- archive_cmds='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags' ++ wlarc='$wl' ++ archive_cmds='$CC -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ +- $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' ++ $CC -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' + ;; + esac + fi +@@ -10187,11 +10861,11 @@ + solaris2.[0-5] | solaris2.[0-5].*) ;; + *) + # The compiler driver will combine and reorder linker options, +- # but understands `-z linker_flag'. GCC discards it without `$wl', ++ # but understands '-z linker_flag'. GCC discards it without '$wl', + # but is careful enough not to reorder. + # Supported since Solaris 2.6 (maybe 2.5.1?) +- if test "$GCC" = yes; then +- whole_archive_flag_spec='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' ++ if test yes = "$GCC"; then ++ whole_archive_flag_spec='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract' + else + whole_archive_flag_spec='-z allextract$convenience -z defaultextract' + fi +@@ -10201,10 +10875,10 @@ + ;; + + sunos4*) +- if test "x$host_vendor" = xsequent; then ++ if test sequent = "$host_vendor"; then + # Use $CC to link under sequent, because it throws in some extra .o + # files that make .init and .fini sections work. +- archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' ++ archive_cmds='$CC -G $wl-h $soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' + fi +@@ -10253,43 +10927,43 @@ + ;; + + sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) +- no_undefined_flag='${wl}-z,text' ++ no_undefined_flag='$wl-z,text' + archive_cmds_need_lc=no + hardcode_shlibpath_var=no + runpath_var='LD_RUN_PATH' + +- if test "$GCC" = yes; then +- archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' +- archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ++ if test yes = "$GCC"; then ++ archive_cmds='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ++ archive_expsym_cmds='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + else +- archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' +- archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ++ archive_cmds='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ++ archive_expsym_cmds='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + ;; + + sysv5* | sco3.2v5* | sco5v6*) +- # Note: We can NOT use -z defs as we might desire, because we do not ++ # Note: We CANNOT use -z defs as we might desire, because we do not + # link with -lc, and that would cause any symbols used from libc to + # always be unresolved, which means just about no library would + # ever link correctly. If we're not using GNU ld we use -z text + # though, which does catch some bad symbols but isn't as heavy-handed + # as -z defs. +- no_undefined_flag='${wl}-z,text' +- allow_undefined_flag='${wl}-z,nodefs' ++ no_undefined_flag='$wl-z,text' ++ allow_undefined_flag='$wl-z,nodefs' + archive_cmds_need_lc=no + hardcode_shlibpath_var=no +- hardcode_libdir_flag_spec='${wl}-R,$libdir' ++ hardcode_libdir_flag_spec='$wl-R,$libdir' + hardcode_libdir_separator=':' + link_all_deplibs=yes +- export_dynamic_flag_spec='${wl}-Bexport' ++ export_dynamic_flag_spec='$wl-Bexport' + runpath_var='LD_RUN_PATH' + +- if test "$GCC" = yes; then +- archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' +- archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ++ if test yes = "$GCC"; then ++ archive_cmds='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ++ archive_expsym_cmds='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + else +- archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' +- archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ++ archive_cmds='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ++ archive_expsym_cmds='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + ;; + +@@ -10304,10 +10978,10 @@ + ;; + esac + +- if test x$host_vendor = xsni; then ++ if test sni = "$host_vendor"; then + case $host in + sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) +- export_dynamic_flag_spec='${wl}-Blargedynsym' ++ export_dynamic_flag_spec='$wl-Blargedynsym' + ;; + esac + fi +@@ -10315,7 +10989,7 @@ + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs" >&5 + $as_echo "$ld_shlibs" >&6; } +-test "$ld_shlibs" = no && can_build_shared=no ++test no = "$ld_shlibs" && can_build_shared=no + + with_gnu_ld=$with_gnu_ld + +@@ -10341,7 +11015,7 @@ + # Assume -lc should be added + archive_cmds_need_lc=yes + +- if test "$enable_shared" = yes && test "$GCC" = yes; then ++ if test yes,yes = "$GCC,$enable_shared"; then + case $archive_cmds in + *'~'*) + # FIXME: we may have to deal with multi-command sequences. +@@ -10556,14 +11230,14 @@ + { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5 + $as_echo_n "checking dynamic linker characteristics... " >&6; } + +-if test "$GCC" = yes; then ++if test yes = "$GCC"; then + case $host_os in +- darwin*) lt_awk_arg="/^libraries:/,/LR/" ;; +- *) lt_awk_arg="/^libraries:/" ;; ++ darwin*) lt_awk_arg='/^libraries:/,/LR/' ;; ++ *) lt_awk_arg='/^libraries:/' ;; + esac + case $host_os in +- mingw* | cegcc*) lt_sed_strip_eq="s,=\([A-Za-z]:\),\1,g" ;; +- *) lt_sed_strip_eq="s,=/,/,g" ;; ++ mingw* | cegcc*) lt_sed_strip_eq='s|=\([A-Za-z]:\)|\1|g' ;; ++ *) lt_sed_strip_eq='s|=/|/|g' ;; + esac + lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` + case $lt_search_path_spec in +@@ -10579,28 +11253,35 @@ + ;; + esac + # Ok, now we have the path, separated by spaces, we can step through it +- # and add multilib dir if necessary. ++ # and add multilib dir if necessary... + lt_tmp_lt_search_path_spec= +- lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` ++ lt_multi_os_dir=/`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` ++ # ...but if some path component already ends with the multilib dir we assume ++ # that all is fine and trust -print-search-dirs as is (GCC 4.2? or newer). ++ case "$lt_multi_os_dir; $lt_search_path_spec " in ++ "/; "* | "/.; "* | "/./; "* | *"$lt_multi_os_dir "* | *"$lt_multi_os_dir/ "*) ++ lt_multi_os_dir= ++ ;; ++ esac + for lt_sys_path in $lt_search_path_spec; do +- if test -d "$lt_sys_path/$lt_multi_os_dir"; then +- lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir" +- else ++ if test -d "$lt_sys_path$lt_multi_os_dir"; then ++ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path$lt_multi_os_dir" ++ elif test -n "$lt_multi_os_dir"; then + test -d "$lt_sys_path" && \ + lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" + fi + done + lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' +-BEGIN {RS=" "; FS="/|\n";} { +- lt_foo=""; +- lt_count=0; ++BEGIN {RS = " "; FS = "/|\n";} { ++ lt_foo = ""; ++ lt_count = 0; + for (lt_i = NF; lt_i > 0; lt_i--) { + if ($lt_i != "" && $lt_i != ".") { + if ($lt_i == "..") { + lt_count++; + } else { + if (lt_count == 0) { +- lt_foo="/" $lt_i lt_foo; ++ lt_foo = "/" $lt_i lt_foo; + } else { + lt_count--; + } +@@ -10614,7 +11295,7 @@ + # for these hosts. + case $host_os in + mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ +- $SED 's,/\([A-Za-z]:\),\1,g'` ;; ++ $SED 's|/\([A-Za-z]:\)|\1|g'` ;; + esac + sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` + else +@@ -10623,7 +11304,7 @@ + library_names_spec= + libname_spec='lib$name' + soname_spec= +-shrext_cmds=".so" ++shrext_cmds=.so + postinstall_cmds= + postuninstall_cmds= + finish_cmds= +@@ -10643,11 +11324,11 @@ + case $host_os in + aix3*) + version_type=linux # correct to gnu/linux during the next big refactor +- library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' ++ library_names_spec='$libname$release$shared_ext$versuffix $libname.a' + shlibpath_var=LIBPATH + + # AIX 3 has no versioning support, so we append a major version to the name. +- soname_spec='${libname}${release}${shared_ext}$major' ++ soname_spec='$libname$release$shared_ext$major' + ;; + + aix[4-9]*) +@@ -10655,40 +11336,40 @@ + need_lib_prefix=no + need_version=no + hardcode_into_libs=yes +- if test "$host_cpu" = ia64; then ++ if test ia64 = "$host_cpu"; then + # AIX 5 supports IA64 +- library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' ++ library_names_spec='$libname$release$shared_ext$major $libname$release$shared_ext$versuffix $libname$shared_ext' + shlibpath_var=LD_LIBRARY_PATH + else + # With GCC up to 2.95.x, collect2 would create an import file + # for dependence libraries. The import file would start with +- # the line `#! .'. This would cause the generated library to +- # depend on `.', always an invalid library. This was fixed in ++ # the line '#! .'. This would cause the generated library to ++ # depend on '.', always an invalid library. This was fixed in + # development snapshots of GCC prior to 3.0. + case $host_os in + aix4 | aix4.[01] | aix4.[01].*) + if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' + echo ' yes ' +- echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then ++ echo '#endif'; } | $CC -E - | $GREP yes > /dev/null; then + : + else + can_build_shared=no + fi + ;; + esac +- # AIX (on Power*) has no versioning support, so currently we can not hardcode correct ++ # AIX (on Power*) has no versioning support, so currently we cannot hardcode correct + # soname into executable. Probably we can add versioning support to + # collect2, so additional links can be useful in future. +- if test "$aix_use_runtimelinking" = yes; then ++ if test yes = "$aix_use_runtimelinking"; then + # If using run time linking (on AIX 4.2 or later) use lib.so + # instead of lib.a to let people know that these are not + # typical AIX shared libraries. +- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' ++ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + else + # We preserve .a as extension for shared libraries through AIX4.2 + # and later when we are not doing run time linking. +- library_names_spec='${libname}${release}.a $libname.a' +- soname_spec='${libname}${release}${shared_ext}$major' ++ library_names_spec='$libname$release.a $libname.a' ++ soname_spec='$libname$release$shared_ext$major' + fi + shlibpath_var=LIBPATH + fi +@@ -10699,18 +11380,18 @@ + powerpc) + # Since July 2007 AmigaOS4 officially supports .so libraries. + # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. +- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' ++ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + ;; + m68k) + library_names_spec='$libname.ixlibrary $libname.a' + # Create ${libname}_ixlibrary.a entries in /sys/libs. +- finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ++ finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' + ;; + esac + ;; + + beos*) +- library_names_spec='${libname}${shared_ext}' ++ library_names_spec='$libname$shared_ext' + dynamic_linker="$host_os ld.so" + shlibpath_var=LIBRARY_PATH + ;; +@@ -10718,8 +11399,8 @@ + bsdi[45]*) + version_type=linux # correct to gnu/linux during the next big refactor + need_version=no +- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' +- soname_spec='${libname}${release}${shared_ext}$major' ++ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' ++ soname_spec='$libname$release$shared_ext$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" +@@ -10731,7 +11412,7 @@ + + cygwin* | mingw* | pw32* | cegcc*) + version_type=windows +- shrext_cmds=".dll" ++ shrext_cmds=.dll + need_version=no + need_lib_prefix=no + +@@ -10740,8 +11421,8 @@ + # gcc + library_names_spec='$libname.dll.a' + # DLL is installed to $(libdir)/../bin by postinstall_cmds +- postinstall_cmds='base_file=`basename \${file}`~ +- dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ ++ postinstall_cmds='base_file=`basename \$file`~ ++ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname~ +@@ -10757,17 +11438,17 @@ + case $host_os in + cygwin*) + # Cygwin DLLs use 'cyg' prefix rather than 'lib' +- soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' ++ soname_spec='`echo $libname | sed -e 's/^lib/cyg/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' + + sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api" + ;; + mingw* | cegcc*) + # MinGW DLLs use traditional 'lib' prefix +- soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' ++ soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' + ;; + pw32*) + # pw32 DLLs use 'pw' prefix rather than 'lib' +- library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' ++ library_names_spec='`echo $libname | sed -e 's/^lib/pw/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' + ;; + esac + dynamic_linker='Win32 ld.exe' +@@ -10776,8 +11457,8 @@ + *,cl*) + # Native MSVC + libname_spec='$name' +- soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' +- library_names_spec='${libname}.dll.lib' ++ soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' ++ library_names_spec='$libname.dll.lib' + + case $build_os in + mingw*) +@@ -10804,7 +11485,7 @@ + sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + ;; + *) +- sys_lib_search_path_spec="$LIB" ++ sys_lib_search_path_spec=$LIB + if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then + # It is most probably a Windows format PATH. + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` +@@ -10817,8 +11498,8 @@ + esac + + # DLL is installed to $(libdir)/../bin by postinstall_cmds +- postinstall_cmds='base_file=`basename \${file}`~ +- dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ ++ postinstall_cmds='base_file=`basename \$file`~ ++ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname' +@@ -10831,7 +11512,7 @@ + + *) + # Assume MSVC wrapper +- library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' ++ library_names_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext $libname.lib' + dynamic_linker='Win32 ld.exe' + ;; + esac +@@ -10844,8 +11525,8 @@ + version_type=darwin + need_lib_prefix=no + need_version=no +- library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext' +- soname_spec='${libname}${release}${major}$shared_ext' ++ library_names_spec='$libname$release$major$shared_ext $libname$shared_ext' ++ soname_spec='$libname$release$major$shared_ext' + shlibpath_overrides_runpath=yes + shlibpath_var=DYLD_LIBRARY_PATH + shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' +@@ -10858,8 +11539,8 @@ + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no +- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' +- soname_spec='${libname}${release}${shared_ext}$major' ++ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' ++ soname_spec='$libname$release$shared_ext$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +@@ -10877,12 +11558,12 @@ + version_type=freebsd-$objformat + case $version_type in + freebsd-elf*) +- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' ++ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext $libname$shared_ext' + need_version=no + need_lib_prefix=no + ;; + freebsd-*) +- library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' ++ library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' + need_version=yes + ;; + esac +@@ -10907,26 +11588,15 @@ + esac + ;; + +-gnu*) +- version_type=linux # correct to gnu/linux during the next big refactor +- need_lib_prefix=no +- need_version=no +- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' +- soname_spec='${libname}${release}${shared_ext}$major' +- shlibpath_var=LD_LIBRARY_PATH +- shlibpath_overrides_runpath=no +- hardcode_into_libs=yes +- ;; +- + haiku*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + dynamic_linker="$host_os runtime_loader" +- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' +- soname_spec='${libname}${release}${shared_ext}$major' ++ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' ++ soname_spec='$libname$release$shared_ext$major' + shlibpath_var=LIBRARY_PATH +- shlibpath_overrides_runpath=yes ++ shlibpath_overrides_runpath=no + sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' + hardcode_into_libs=yes + ;; +@@ -10944,9 +11614,9 @@ + dynamic_linker="$host_os dld.so" + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. +- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' +- soname_spec='${libname}${release}${shared_ext}$major' +- if test "X$HPUX_IA64_MODE" = X32; then ++ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' ++ soname_spec='$libname$release$shared_ext$major' ++ if test 32 = "$HPUX_IA64_MODE"; then + sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" + else + sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" +@@ -10959,8 +11629,8 @@ + dynamic_linker="$host_os dld.sl" + shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. +- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' +- soname_spec='${libname}${release}${shared_ext}$major' ++ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' ++ soname_spec='$libname$release$shared_ext$major' + sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; +@@ -10969,8 +11639,8 @@ + dynamic_linker="$host_os dld.sl" + shlibpath_var=SHLIB_PATH + shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH +- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' +- soname_spec='${libname}${release}${shared_ext}$major' ++ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' ++ soname_spec='$libname$release$shared_ext$major' + ;; + esac + # HP-UX runs *really* slowly unless shared libraries are mode 555, ... +@@ -10983,8 +11653,8 @@ + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no +- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' +- soname_spec='${libname}${release}${shared_ext}$major' ++ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' ++ soname_spec='$libname$release$shared_ext$major' + dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no +@@ -10995,7 +11665,7 @@ + case $host_os in + nonstopux*) version_type=nonstopux ;; + *) +- if test "$lt_cv_prog_gnu_ld" = yes; then ++ if test yes = "$lt_cv_prog_gnu_ld"; then + version_type=linux # correct to gnu/linux during the next big refactor + else + version_type=irix +@@ -11003,8 +11673,8 @@ + esac + need_lib_prefix=no + need_version=no +- soname_spec='${libname}${release}${shared_ext}$major' +- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' ++ soname_spec='$libname$release$shared_ext$major' ++ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$release$shared_ext $libname$shared_ext' + case $host_os in + irix5* | nonstopux*) + libsuff= shlibsuff= +@@ -11023,8 +11693,8 @@ + esac + shlibpath_var=LD_LIBRARY${shlibsuff}_PATH + shlibpath_overrides_runpath=no +- sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" +- sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" ++ sys_lib_search_path_spec="/usr/lib$libsuff /lib$libsuff /usr/local/lib$libsuff" ++ sys_lib_dlsearch_path_spec="/usr/lib$libsuff /lib$libsuff" + hardcode_into_libs=yes + ;; + +@@ -11033,13 +11703,33 @@ + dynamic_linker=no + ;; + ++linux*android*) ++ version_type=none # Android doesn't support versioned libraries. ++ need_lib_prefix=no ++ need_version=no ++ library_names_spec='$libname$release$shared_ext' ++ soname_spec='$libname$release$shared_ext' ++ finish_cmds= ++ shlibpath_var=LD_LIBRARY_PATH ++ shlibpath_overrides_runpath=yes ++ ++ # This implies no fast_install, which is unacceptable. ++ # Some rework will be needed to allow for fast_install ++ # before this can be enabled. ++ hardcode_into_libs=yes ++ ++ dynamic_linker='Android linker' ++ # Don't embed -rpath directories since the linker doesn't support them. ++ hardcode_libdir_flag_spec='-L$libdir' ++ ;; ++ + # This must be glibc/ELF. +-linux* | k*bsd*-gnu | kopensolaris*-gnu) ++linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no +- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' +- soname_spec='${libname}${release}${shared_ext}$major' ++ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' ++ soname_spec='$libname$release$shared_ext$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no +@@ -11083,14 +11773,10 @@ + # before this can be enabled. + hardcode_into_libs=yes + +- # Add ABI-specific directories to the system library path. +- sys_lib_dlsearch_path_spec="/lib64 /usr/lib64 /lib /usr/lib" +- + # Append ld.so.conf contents to the search path + if test -f /etc/ld.so.conf; then + lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` +- sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec $lt_ld_extra" +- ++ sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" + fi + + # We used to test for /lib/ld.so.1 and disable shared libraries on +@@ -11107,12 +11793,12 @@ + need_lib_prefix=no + need_version=no + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then +- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' ++ library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + dynamic_linker='NetBSD (a.out) ld.so' + else +- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' +- soname_spec='${libname}${release}${shared_ext}$major' ++ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' ++ soname_spec='$libname$release$shared_ext$major' + dynamic_linker='NetBSD ld.elf_so' + fi + shlibpath_var=LD_LIBRARY_PATH +@@ -11122,7 +11808,7 @@ + + newsos6) + version_type=linux # correct to gnu/linux during the next big refactor +- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' ++ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; +@@ -11131,45 +11817,34 @@ + version_type=qnx + need_lib_prefix=no + need_version=no +- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' +- soname_spec='${libname}${release}${shared_ext}$major' ++ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' ++ soname_spec='$libname$release$shared_ext$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='ldqnx.so' + ;; + +-openbsd*) ++openbsd* | bitrig*) + version_type=sunos +- sys_lib_dlsearch_path_spec="/usr/lib" ++ sys_lib_dlsearch_path_spec=/usr/lib + need_lib_prefix=no +- # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. +- case $host_os in +- openbsd3.3 | openbsd3.3.*) need_version=yes ;; +- *) need_version=no ;; +- esac +- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' ++ if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then ++ need_version=no ++ else ++ need_version=yes ++ fi ++ library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + shlibpath_var=LD_LIBRARY_PATH +- if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then +- case $host_os in +- openbsd2.[89] | openbsd2.[89].*) +- shlibpath_overrides_runpath=no +- ;; +- *) +- shlibpath_overrides_runpath=yes +- ;; +- esac +- else +- shlibpath_overrides_runpath=yes +- fi ++ shlibpath_overrides_runpath=yes + ;; + + os2*) + libname_spec='$name' +- shrext_cmds=".dll" ++ shrext_cmds=.dll + need_lib_prefix=no +- library_names_spec='$libname${shared_ext} $libname.a' ++ library_names_spec='$libname$shared_ext $libname.a' + dynamic_linker='OS/2 ld.exe' + shlibpath_var=LIBPATH + ;; +@@ -11178,11 +11853,11 @@ + version_type=osf + need_lib_prefix=no + need_version=no +- soname_spec='${libname}${release}${shared_ext}$major' +- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' ++ soname_spec='$libname$release$shared_ext$major' ++ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" +- sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ++ sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + + rdos*) +@@ -11193,8 +11868,8 @@ + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no +- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' +- soname_spec='${libname}${release}${shared_ext}$major' ++ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' ++ soname_spec='$libname$release$shared_ext$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes +@@ -11204,11 +11879,11 @@ + + sunos4*) + version_type=sunos +- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' ++ library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' + finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes +- if test "$with_gnu_ld" = yes; then ++ if test yes = "$with_gnu_ld"; then + need_lib_prefix=no + fi + need_version=yes +@@ -11216,8 +11891,8 @@ + + sysv4 | sysv4.3*) + version_type=linux # correct to gnu/linux during the next big refactor +- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' +- soname_spec='${libname}${release}${shared_ext}$major' ++ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' ++ soname_spec='$libname$release$shared_ext$major' + shlibpath_var=LD_LIBRARY_PATH + case $host_vendor in + sni) +@@ -11238,10 +11913,10 @@ + ;; + + sysv4*MP*) +- if test -d /usr/nec ;then ++ if test -d /usr/nec; then + version_type=linux # correct to gnu/linux during the next big refactor +- library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' +- soname_spec='$libname${shared_ext}.$major' ++ library_names_spec='$libname$shared_ext.$versuffix $libname$shared_ext.$major $libname$shared_ext' ++ soname_spec='$libname$shared_ext.$major' + shlibpath_var=LD_LIBRARY_PATH + fi + ;; +@@ -11250,12 +11925,12 @@ + version_type=freebsd-elf + need_lib_prefix=no + need_version=no +- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' +- soname_spec='${libname}${release}${shared_ext}$major' ++ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext $libname$shared_ext' ++ soname_spec='$libname$release$shared_ext$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes +- if test "$with_gnu_ld" = yes; then ++ if test yes = "$with_gnu_ld"; then + sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' + else + sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' +@@ -11273,7 +11948,7 @@ + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no +- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' ++ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes +@@ -11281,8 +11956,8 @@ + + uts4*) + version_type=linux # correct to gnu/linux during the next big refactor +- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' +- soname_spec='${libname}${release}${shared_ext}$major' ++ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' ++ soname_spec='$libname$release$shared_ext$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +@@ -11292,18 +11967,18 @@ + esac + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5 + $as_echo "$dynamic_linker" >&6; } +-test "$dynamic_linker" = no && can_build_shared=no ++test no = "$dynamic_linker" && can_build_shared=no + + variables_saved_for_relink="PATH $shlibpath_var $runpath_var" +-if test "$GCC" = yes; then ++if test yes = "$GCC"; then + variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" + fi + +-if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then +- sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" +-fi +-if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then +- sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" ++if test set = "${lt_cv_sys_lib_search_path_spec+set}"; then ++ sys_lib_search_path_spec=$lt_cv_sys_lib_search_path_spec ++fi ++if test set = "${lt_cv_sys_lib_dlsearch_path_spec+set}"; then ++ sys_lib_dlsearch_path_spec=$lt_cv_sys_lib_dlsearch_path_spec + fi + + +@@ -11402,15 +12077,15 @@ + hardcode_action= + if test -n "$hardcode_libdir_flag_spec" || + test -n "$runpath_var" || +- test "X$hardcode_automatic" = "Xyes" ; then ++ test yes = "$hardcode_automatic"; then + + # We can hardcode non-existent directories. +- if test "$hardcode_direct" != no && ++ if test no != "$hardcode_direct" && + # If the only mechanism to avoid hardcoding is shlibpath_var, we + # have to relink, otherwise we might link with an installed library + # when we should be linking with a yet-to-be-installed one +- ## test "$_LT_TAGVAR(hardcode_shlibpath_var, )" != no && +- test "$hardcode_minus_L" != no; then ++ ## test no != "$_LT_TAGVAR(hardcode_shlibpath_var, )" && ++ test no != "$hardcode_minus_L"; then + # Linking always hardcodes the temporary library directory. + hardcode_action=relink + else +@@ -11425,12 +12100,12 @@ + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action" >&5 + $as_echo "$hardcode_action" >&6; } + +-if test "$hardcode_action" = relink || +- test "$inherit_rpath" = yes; then ++if test relink = "$hardcode_action" || ++ test yes = "$inherit_rpath"; then + # Fast installation is not supported + enable_fast_install=no +-elif test "$shlibpath_overrides_runpath" = yes || +- test "$enable_shared" = no; then ++elif test yes = "$shlibpath_overrides_runpath" || ++ test no = "$enable_shared"; then + # Fast installation is not necessary + enable_fast_install=needless + fi +@@ -11440,7 +12115,7 @@ + + + +- if test "x$enable_dlopen" != xyes; then ++ if test yes != "$enable_dlopen"; then + enable_dlopen=unknown + enable_dlopen_self=unknown + enable_dlopen_self_static=unknown +@@ -11450,23 +12125,23 @@ + + case $host_os in + beos*) +- lt_cv_dlopen="load_add_on" ++ lt_cv_dlopen=load_add_on + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes + ;; + + mingw* | pw32* | cegcc*) +- lt_cv_dlopen="LoadLibrary" ++ lt_cv_dlopen=LoadLibrary + lt_cv_dlopen_libs= + ;; + + cygwin*) +- lt_cv_dlopen="dlopen" ++ lt_cv_dlopen=dlopen + lt_cv_dlopen_libs= + ;; + + darwin*) +- # if libdl is installed we need to link against it ++ # if libdl is installed we need to link against it + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 + $as_echo_n "checking for dlopen in -ldl... " >&6; } + if ${ac_cv_lib_dl_dlopen+:} false; then : +@@ -11504,10 +12179,10 @@ + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 + $as_echo "$ac_cv_lib_dl_dlopen" >&6; } + if test "x$ac_cv_lib_dl_dlopen" = xyes; then : +- lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" +-else +- +- lt_cv_dlopen="dyld" ++ lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl ++else ++ ++ lt_cv_dlopen=dyld + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes + +@@ -11515,10 +12190,18 @@ + + ;; + ++ tpf*) ++ # Don't try to run any link tests for TPF. We know it's impossible ++ # because TPF is a cross-compiler, and we know how we open DSOs. ++ lt_cv_dlopen=dlopen ++ lt_cv_dlopen_libs= ++ lt_cv_dlopen_self=no ++ ;; ++ + *) + ac_fn_c_check_func "$LINENO" "shl_load" "ac_cv_func_shl_load" + if test "x$ac_cv_func_shl_load" = xyes; then : +- lt_cv_dlopen="shl_load" ++ lt_cv_dlopen=shl_load + else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5 + $as_echo_n "checking for shl_load in -ldld... " >&6; } +@@ -11557,11 +12240,11 @@ + { $as_echo "$as_me:${as_lineno-$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" = xyes; then : +- lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld" ++ lt_cv_dlopen=shl_load lt_cv_dlopen_libs=-ldld + else + ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen" + if test "x$ac_cv_func_dlopen" = xyes; then : +- lt_cv_dlopen="dlopen" ++ lt_cv_dlopen=dlopen + else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 + $as_echo_n "checking for dlopen in -ldl... " >&6; } +@@ -11600,7 +12283,7 @@ + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 + $as_echo "$ac_cv_lib_dl_dlopen" >&6; } + if test "x$ac_cv_lib_dl_dlopen" = xyes; then : +- lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" ++ lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl + else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5 + $as_echo_n "checking for dlopen in -lsvld... " >&6; } +@@ -11639,7 +12322,7 @@ + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen" >&5 + $as_echo "$ac_cv_lib_svld_dlopen" >&6; } + if test "x$ac_cv_lib_svld_dlopen" = xyes; then : +- lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld" ++ lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-lsvld + else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5 + $as_echo_n "checking for dld_link in -ldld... " >&6; } +@@ -11678,42 +12361,42 @@ + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_dld_link" >&5 + $as_echo "$ac_cv_lib_dld_dld_link" >&6; } + if test "x$ac_cv_lib_dld_dld_link" = xyes; then : +- lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld" +-fi +- +- +-fi +- +- +-fi +- +- +-fi +- +- +-fi +- +- +-fi +- +- ;; +- esac +- +- if test "x$lt_cv_dlopen" != xno; then ++ lt_cv_dlopen=dld_link lt_cv_dlopen_libs=-ldld ++fi ++ ++ ++fi ++ ++ ++fi ++ ++ ++fi ++ ++ ++fi ++ ++ ++fi ++ ++ ;; ++ esac ++ ++ if test no = "$lt_cv_dlopen"; then ++ enable_dlopen=no ++ else + enable_dlopen=yes +- else +- enable_dlopen=no + fi + + case $lt_cv_dlopen in + dlopen) +- save_CPPFLAGS="$CPPFLAGS" +- test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" +- +- save_LDFLAGS="$LDFLAGS" ++ save_CPPFLAGS=$CPPFLAGS ++ test yes = "$ac_cv_header_dlfcn_h" && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" ++ ++ save_LDFLAGS=$LDFLAGS + wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" + +- save_LIBS="$LIBS" ++ save_LIBS=$LIBS + LIBS="$lt_cv_dlopen_libs $LIBS" + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a program can dlopen itself" >&5 +@@ -11721,7 +12404,7 @@ + if ${lt_cv_dlopen_self+:} false; then : + $as_echo_n "(cached) " >&6 + else +- if test "$cross_compiling" = yes; then : ++ if test yes = "$cross_compiling"; then : + lt_cv_dlopen_self=cross + else + lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 +@@ -11770,7 +12453,7 @@ + + /* When -fvisbility=hidden is used, assume the code has been annotated + correspondingly for the symbols needed. */ +-#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) ++#if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) + int fnord () __attribute__((visibility("default"))); + #endif + +@@ -11800,7 +12483,7 @@ + (eval $ac_link) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 +- test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then ++ test $ac_status = 0; } && test -s "conftest$ac_exeext" 2>/dev/null; then + (./conftest; exit; ) >&5 2>/dev/null + lt_status=$? + case x$lt_status in +@@ -11820,14 +12503,14 @@ + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self" >&5 + $as_echo "$lt_cv_dlopen_self" >&6; } + +- if test "x$lt_cv_dlopen_self" = xyes; then ++ if test yes = "$lt_cv_dlopen_self"; then + wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a statically linked program can dlopen itself" >&5 + $as_echo_n "checking whether a statically linked program can dlopen itself... " >&6; } + if ${lt_cv_dlopen_self_static+:} false; then : + $as_echo_n "(cached) " >&6 + else +- if test "$cross_compiling" = yes; then : ++ if test yes = "$cross_compiling"; then : + lt_cv_dlopen_self_static=cross + else + lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 +@@ -11876,7 +12559,7 @@ + + /* When -fvisbility=hidden is used, assume the code has been annotated + correspondingly for the symbols needed. */ +-#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) ++#if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) + int fnord () __attribute__((visibility("default"))); + #endif + +@@ -11906,7 +12589,7 @@ + (eval $ac_link) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 +- test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then ++ test $ac_status = 0; } && test -s "conftest$ac_exeext" 2>/dev/null; then + (./conftest; exit; ) >&5 2>/dev/null + lt_status=$? + case x$lt_status in +@@ -11927,9 +12610,9 @@ + $as_echo "$lt_cv_dlopen_self_static" >&6; } + fi + +- CPPFLAGS="$save_CPPFLAGS" +- LDFLAGS="$save_LDFLAGS" +- LIBS="$save_LIBS" ++ CPPFLAGS=$save_CPPFLAGS ++ LDFLAGS=$save_LDFLAGS ++ LIBS=$save_LIBS + ;; + esac + +@@ -11973,7 +12656,7 @@ + # FIXME - insert some real tests, host_os isn't really good enough + case $host_os in + darwin*) +- if test -n "$STRIP" ; then ++ if test -n "$STRIP"; then + striplib="$STRIP -x" + old_striplib="$STRIP -S" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +@@ -12001,7 +12684,7 @@ + + + +- # Report which library types will actually be built ++ # Report what library types will actually be built + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if libtool supports shared libraries" >&5 + $as_echo_n "checking if libtool supports shared libraries... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $can_build_shared" >&5 +@@ -12009,13 +12692,13 @@ + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries" >&5 + $as_echo_n "checking whether to build shared libraries... " >&6; } +- test "$can_build_shared" = "no" && enable_shared=no ++ test no = "$can_build_shared" && enable_shared=no + + # On AIX, shared libraries and static libraries use the same namespace, and + # are all built from PIC. + case $host_os in + aix3*) +- test "$enable_shared" = yes && enable_static=no ++ test yes = "$enable_shared" && enable_static=no + if test -n "$RANLIB"; then + archive_cmds="$archive_cmds~\$RANLIB \$lib" + postinstall_cmds='$RANLIB $lib' +@@ -12023,8 +12706,8 @@ + ;; + + aix[4-9]*) +- if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then +- test "$enable_shared" = yes && enable_static=no ++ if test ia64 != "$host_cpu" && test no = "$aix_use_runtimelinking"; then ++ test yes = "$enable_shared" && enable_static=no + fi + ;; + esac +@@ -12034,7 +12717,7 @@ + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries" >&5 + $as_echo_n "checking whether to build static libraries... " >&6; } + # Make sure either enable_shared or enable_static is yes. +- test "$enable_shared" = yes || enable_static=yes ++ test yes = "$enable_shared" || enable_static=yes + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5 + $as_echo "$enable_static" >&6; } + +@@ -12048,7 +12731,3187 @@ + ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' + ac_compiler_gnu=$ac_cv_c_compiler_gnu + +-CC="$lt_save_CC" ++CC=$lt_save_CC ++ ++ if test -n "$CXX" && ( test no != "$CXX" && ++ ( (test g++ = "$CXX" && `g++ -v >/dev/null 2>&1` ) || ++ (test g++ != "$CXX"))); then ++ ac_ext=cpp ++ac_cpp='$CXXCPP $CPPFLAGS' ++ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ++ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ++ac_compiler_gnu=$ac_cv_cxx_compiler_gnu ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C++ preprocessor" >&5 ++$as_echo_n "checking how to run the C++ preprocessor... " >&6; } ++if test -z "$CXXCPP"; then ++ if ${ac_cv_prog_CXXCPP+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ # Double quotes because CXXCPP needs to be expanded ++ for CXXCPP in "$CXX -E" "/lib/cpp" ++ do ++ ac_preproc_ok=false ++for ac_cxx_preproc_warn_flag in '' yes ++do ++ # Use a header file that comes with gcc, so configuring glibc ++ # with a fresh cross-compiler works. ++ # Prefer to if __STDC__ is defined, since ++ # exists even on freestanding compilers. ++ # On the NeXT, cc -E runs the code through the compiler's parser, ++ # not just through cpp. "Syntax error" is here to catch this case. ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++#ifdef __STDC__ ++# include ++#else ++# include ++#endif ++ Syntax error ++_ACEOF ++if ac_fn_cxx_try_cpp "$LINENO"; then : ++ ++else ++ # Broken: fails on valid input. ++continue ++fi ++rm -f conftest.err conftest.i conftest.$ac_ext ++ ++ # OK, works on sane cases. Now check whether nonexistent headers ++ # can be detected and how. ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++#include ++_ACEOF ++if ac_fn_cxx_try_cpp "$LINENO"; then : ++ # Broken: success on invalid input. ++continue ++else ++ # Passes both tests. ++ac_preproc_ok=: ++break ++fi ++rm -f conftest.err conftest.i conftest.$ac_ext ++ ++done ++# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. ++rm -f conftest.i conftest.err conftest.$ac_ext ++if $ac_preproc_ok; then : ++ break ++fi ++ ++ done ++ ac_cv_prog_CXXCPP=$CXXCPP ++ ++fi ++ CXXCPP=$ac_cv_prog_CXXCPP ++else ++ ac_cv_prog_CXXCPP=$CXXCPP ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXXCPP" >&5 ++$as_echo "$CXXCPP" >&6; } ++ac_preproc_ok=false ++for ac_cxx_preproc_warn_flag in '' yes ++do ++ # Use a header file that comes with gcc, so configuring glibc ++ # with a fresh cross-compiler works. ++ # Prefer to if __STDC__ is defined, since ++ # exists even on freestanding compilers. ++ # On the NeXT, cc -E runs the code through the compiler's parser, ++ # not just through cpp. "Syntax error" is here to catch this case. ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++#ifdef __STDC__ ++# include ++#else ++# include ++#endif ++ Syntax error ++_ACEOF ++if ac_fn_cxx_try_cpp "$LINENO"; then : ++ ++else ++ # Broken: fails on valid input. ++continue ++fi ++rm -f conftest.err conftest.i conftest.$ac_ext ++ ++ # OK, works on sane cases. Now check whether nonexistent headers ++ # can be detected and how. ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++#include ++_ACEOF ++if ac_fn_cxx_try_cpp "$LINENO"; then : ++ # Broken: success on invalid input. ++continue ++else ++ # Passes both tests. ++ac_preproc_ok=: ++break ++fi ++rm -f conftest.err conftest.i conftest.$ac_ext ++ ++done ++# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. ++rm -f conftest.i conftest.err conftest.$ac_ext ++if $ac_preproc_ok; then : ++ ++else ++ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 ++$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} ++as_fn_error $? "C++ preprocessor \"$CXXCPP\" fails sanity check ++See \`config.log' for more details" "$LINENO" 5; } ++fi ++ ++ac_ext=c ++ac_cpp='$CPP $CPPFLAGS' ++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 ++ ++else ++ _lt_caught_CXX_error=yes ++fi ++ ++ac_ext=cpp ++ac_cpp='$CXXCPP $CPPFLAGS' ++ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ++ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ++ac_compiler_gnu=$ac_cv_cxx_compiler_gnu ++ ++archive_cmds_need_lc_CXX=no ++allow_undefined_flag_CXX= ++always_export_symbols_CXX=no ++archive_expsym_cmds_CXX= ++compiler_needs_object_CXX=no ++export_dynamic_flag_spec_CXX= ++hardcode_direct_CXX=no ++hardcode_direct_absolute_CXX=no ++hardcode_libdir_flag_spec_CXX= ++hardcode_libdir_separator_CXX= ++hardcode_minus_L_CXX=no ++hardcode_shlibpath_var_CXX=unsupported ++hardcode_automatic_CXX=no ++inherit_rpath_CXX=no ++module_cmds_CXX= ++module_expsym_cmds_CXX= ++link_all_deplibs_CXX=unknown ++old_archive_cmds_CXX=$old_archive_cmds ++reload_flag_CXX=$reload_flag ++reload_cmds_CXX=$reload_cmds ++no_undefined_flag_CXX= ++whole_archive_flag_spec_CXX= ++enable_shared_with_static_runtimes_CXX=no ++ ++# Source file extension for C++ test sources. ++ac_ext=cpp ++ ++# Object file extension for compiled C++ test sources. ++objext=o ++objext_CXX=$objext ++ ++# No sense in running all these tests if we already determined that ++# the CXX compiler isn't working. Some variables (like enable_shared) ++# are currently assumed to apply to all compilers on this platform, ++# and will be corrupted by setting them based on a non-working compiler. ++if test yes != "$_lt_caught_CXX_error"; then ++ # Code to be used in simple compile tests ++ lt_simple_compile_test_code="int some_variable = 0;" ++ ++ # Code to be used in simple link tests ++ lt_simple_link_test_code='int main(int, char *[]) { return(0); }' ++ ++ # ltmain only uses $CC for tagged configurations so make sure $CC is set. ++ ++ ++ ++ ++ ++ ++# If no C compiler was specified, use CC. ++LTCC=${LTCC-"$CC"} ++ ++# If no C compiler flags were specified, use CFLAGS. ++LTCFLAGS=${LTCFLAGS-"$CFLAGS"} ++ ++# Allow CC to be a program name with arguments. ++compiler=$CC ++ ++ ++ # save warnings/boilerplate of simple test code ++ ac_outfile=conftest.$ac_objext ++echo "$lt_simple_compile_test_code" >conftest.$ac_ext ++eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err ++_lt_compiler_boilerplate=`cat conftest.err` ++$RM conftest* ++ ++ ac_outfile=conftest.$ac_objext ++echo "$lt_simple_link_test_code" >conftest.$ac_ext ++eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err ++_lt_linker_boilerplate=`cat conftest.err` ++$RM -r conftest* ++ ++ ++ # Allow CC to be a program name with arguments. ++ lt_save_CC=$CC ++ lt_save_CFLAGS=$CFLAGS ++ lt_save_LD=$LD ++ lt_save_GCC=$GCC ++ GCC=$GXX ++ lt_save_with_gnu_ld=$with_gnu_ld ++ lt_save_path_LD=$lt_cv_path_LD ++ if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then ++ lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx ++ else ++ $as_unset lt_cv_prog_gnu_ld ++ fi ++ if test -n "${lt_cv_path_LDCXX+set}"; then ++ lt_cv_path_LD=$lt_cv_path_LDCXX ++ else ++ $as_unset lt_cv_path_LD ++ fi ++ test -z "${LDCXX+set}" || LD=$LDCXX ++ CC=${CXX-"c++"} ++ CFLAGS=$CXXFLAGS ++ compiler=$CC ++ compiler_CXX=$CC ++ for cc_temp in $compiler""; do ++ case $cc_temp in ++ compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; ++ distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; ++ \-*) ;; ++ *) break;; ++ esac ++done ++cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` ++ ++ ++ if test -n "$compiler"; then ++ # We don't want -fno-exception when compiling C++ code, so set the ++ # no_builtin_flag separately ++ if test yes = "$GXX"; then ++ lt_prog_compiler_no_builtin_flag_CXX=' -fno-builtin' ++ else ++ lt_prog_compiler_no_builtin_flag_CXX= ++ fi ++ ++ if test yes = "$GXX"; then ++ # Set up default GNU C++ configuration ++ ++ ++ ++# Check whether --with-gnu-ld was given. ++if test "${with_gnu_ld+set}" = set; then : ++ withval=$with_gnu_ld; test no = "$withval" || with_gnu_ld=yes ++else ++ with_gnu_ld=no ++fi ++ ++ac_prog=ld ++if test yes = "$GCC"; then ++ # Check if gcc -print-prog-name=ld gives a path. ++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 ++$as_echo_n "checking for ld used by $CC... " >&6; } ++ case $host in ++ *-*-mingw*) ++ # gcc leaves a trailing carriage return, which upsets mingw ++ ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; ++ *) ++ ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; ++ esac ++ case $ac_prog in ++ # Accept absolute paths. ++ [\\/]* | ?:[\\/]*) ++ re_direlt='/[^/][^/]*/\.\./' ++ # Canonicalize the pathname of ld ++ ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` ++ while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do ++ ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` ++ done ++ test -z "$LD" && LD=$ac_prog ++ ;; ++ "") ++ # If it fails, then pretend we aren't using GCC. ++ ac_prog=ld ++ ;; ++ *) ++ # If it is relative, then search for the first ld in PATH. ++ with_gnu_ld=unknown ++ ;; ++ esac ++elif test yes = "$with_gnu_ld"; then ++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 ++$as_echo_n "checking for GNU ld... " >&6; } ++else ++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 ++$as_echo_n "checking for non-GNU ld... " >&6; } ++fi ++if ${lt_cv_path_LD+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ if test -z "$LD"; then ++ lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR ++ for ac_dir in $PATH; do ++ IFS=$lt_save_ifs ++ test -z "$ac_dir" && ac_dir=. ++ if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then ++ lt_cv_path_LD=$ac_dir/$ac_prog ++ # Check to see if the program is GNU ld. I'd rather use --version, ++ # but apparently some variants of GNU ld only accept -v. ++ # Break only if it was the GNU/non-GNU ld that we prefer. ++ case `"$lt_cv_path_LD" -v 2>&1 &5 ++$as_echo "$LD" >&6; } ++else ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 ++$as_echo "no" >&6; } ++fi ++test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 ++$as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } ++if ${lt_cv_prog_gnu_ld+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ # I'd rather use --version here, but apparently some GNU lds only accept -v. ++case `$LD -v 2>&1 &5 ++$as_echo "$lt_cv_prog_gnu_ld" >&6; } ++with_gnu_ld=$lt_cv_prog_gnu_ld ++ ++ ++ ++ ++ ++ ++ ++ # Check if GNU C++ uses GNU ld as the underlying linker, since the ++ # archiving commands below assume that GNU ld is being used. ++ if test yes = "$with_gnu_ld"; then ++ archive_cmds_CXX='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' ++ archive_expsym_cmds_CXX='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' ++ ++ hardcode_libdir_flag_spec_CXX='$wl-rpath $wl$libdir' ++ export_dynamic_flag_spec_CXX='$wl--export-dynamic' ++ ++ # If archive_cmds runs LD, not CC, wlarc should be empty ++ # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to ++ # investigate it a little bit more. (MM) ++ wlarc='$wl' ++ ++ # ancient GNU ld didn't support --whole-archive et. al. ++ if eval "`$CC -print-prog-name=ld` --help 2>&1" | ++ $GREP 'no-whole-archive' > /dev/null; then ++ whole_archive_flag_spec_CXX=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive' ++ else ++ whole_archive_flag_spec_CXX= ++ fi ++ else ++ with_gnu_ld=no ++ wlarc= ++ ++ # A generic and very simple default shared library creation ++ # command for GNU C++ for the case where it uses the native ++ # linker, instead of GNU ld. If possible, this setting should ++ # overridden to take advantage of the native linker features on ++ # the platform it is being used on. ++ archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' ++ fi ++ ++ # Commands to make compiler produce verbose output that lists ++ # what "hidden" libraries, object files and flags are used when ++ # linking a shared library. ++ output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' ++ ++ else ++ GXX=no ++ with_gnu_ld=no ++ wlarc= ++ fi ++ ++ # PORTME: fill in a description of your system's C++ link characteristics ++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 ++$as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } ++ ld_shlibs_CXX=yes ++ case $host_os in ++ aix3*) ++ # FIXME: insert proper C++ library support ++ ld_shlibs_CXX=no ++ ;; ++ aix[4-9]*) ++ if test ia64 = "$host_cpu"; then ++ # On IA64, the linker does run time linking by default, so we don't ++ # have to do anything special. ++ aix_use_runtimelinking=no ++ exp_sym_flag='-Bexport' ++ no_entry_flag= ++ else ++ aix_use_runtimelinking=no ++ ++ # Test if we are trying to use run time linking or normal ++ # AIX style linking. If -brtl is somewhere in LDFLAGS, we ++ # need to do runtime linking. ++ case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) ++ for ld_flag in $LDFLAGS; do ++ case $ld_flag in ++ *-brtl*) ++ aix_use_runtimelinking=yes ++ break ++ ;; ++ esac ++ done ++ ;; ++ esac ++ ++ exp_sym_flag='-bexport' ++ no_entry_flag='-bnoentry' ++ fi ++ ++ # When large executables or shared objects are built, AIX ld can ++ # have problems creating the table of contents. If linking a library ++ # or program results in "error TOC overflow" add -mminimal-toc to ++ # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not ++ # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. ++ ++ archive_cmds_CXX='' ++ hardcode_direct_CXX=yes ++ hardcode_direct_absolute_CXX=yes ++ hardcode_libdir_separator_CXX=':' ++ link_all_deplibs_CXX=yes ++ file_list_spec_CXX='$wl-f,' ++ ++ if test yes = "$GXX"; then ++ case $host_os in aix4.[012]|aix4.[012].*) ++ # We only want to do this on AIX 4.2 and lower, the check ++ # below for broken collect2 doesn't work under 4.3+ ++ collect2name=`$CC -print-prog-name=collect2` ++ if test -f "$collect2name" && ++ strings "$collect2name" | $GREP resolve_lib_name >/dev/null ++ then ++ # We have reworked collect2 ++ : ++ else ++ # We have old collect2 ++ hardcode_direct_CXX=unsupported ++ # It fails to find uninstalled libraries when the uninstalled ++ # path is not listed in the libpath. Setting hardcode_minus_L ++ # to unsupported forces relinking ++ hardcode_minus_L_CXX=yes ++ hardcode_libdir_flag_spec_CXX='-L$libdir' ++ hardcode_libdir_separator_CXX= ++ fi ++ esac ++ shared_flag='-shared' ++ if test yes = "$aix_use_runtimelinking"; then ++ shared_flag=$shared_flag' $wl-G' ++ fi ++ else ++ # not using gcc ++ if test ia64 = "$host_cpu"; then ++ # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release ++ # chokes on -Wl,-G. The following line is correct: ++ shared_flag='-G' ++ else ++ if test yes = "$aix_use_runtimelinking"; then ++ shared_flag='$wl-G' ++ else ++ shared_flag='$wl-bM:SRE' ++ fi ++ fi ++ fi ++ ++ export_dynamic_flag_spec_CXX='$wl-bexpall' ++ # It seems that -bexpall does not export symbols beginning with ++ # underscore (_), so it is better to generate a list of symbols to ++ # export. ++ always_export_symbols_CXX=yes ++ if test yes = "$aix_use_runtimelinking"; then ++ # Warning - without using the other runtime loading flags (-brtl), ++ # -berok will link without error, but may produce a broken library. ++ allow_undefined_flag_CXX='-berok' ++ # Determine the default libpath from the value encoded in an empty ++ # executable. ++ if test set = "${lt_cv_aix_libpath+set}"; then ++ aix_libpath=$lt_cv_aix_libpath ++else ++ if ${lt_cv_aix_libpath__CXX+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++ ++int ++main () ++{ ++ ++ ; ++ return 0; ++} ++_ACEOF ++if ac_fn_cxx_try_link "$LINENO"; then : ++ ++ lt_aix_libpath_sed=' ++ /Import File Strings/,/^$/ { ++ /^0/ { ++ s/^0 *\([^ ]*\) *$/\1/ ++ p ++ } ++ }' ++ lt_cv_aix_libpath__CXX=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` ++ # Check for a 64-bit object if we didn't find anything. ++ if test -z "$lt_cv_aix_libpath__CXX"; then ++ lt_cv_aix_libpath__CXX=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` ++ fi ++fi ++rm -f core conftest.err conftest.$ac_objext \ ++ conftest$ac_exeext conftest.$ac_ext ++ if test -z "$lt_cv_aix_libpath__CXX"; then ++ lt_cv_aix_libpath__CXX=/usr/lib:/lib ++ fi ++ ++fi ++ ++ aix_libpath=$lt_cv_aix_libpath__CXX ++fi ++ ++ hardcode_libdir_flag_spec_CXX='$wl-blibpath:$libdir:'"$aix_libpath" ++ ++ archive_expsym_cmds_CXX='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag ++ else ++ if test ia64 = "$host_cpu"; then ++ hardcode_libdir_flag_spec_CXX='$wl-R $libdir:/usr/lib:/lib' ++ allow_undefined_flag_CXX="-z nodefs" ++ archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\$wl$no_entry_flag"' $compiler_flags $wl$allow_undefined_flag '"\$wl$exp_sym_flag:\$export_symbols" ++ else ++ # Determine the default libpath from the value encoded in an ++ # empty executable. ++ if test set = "${lt_cv_aix_libpath+set}"; then ++ aix_libpath=$lt_cv_aix_libpath ++else ++ if ${lt_cv_aix_libpath__CXX+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++ ++int ++main () ++{ ++ ++ ; ++ return 0; ++} ++_ACEOF ++if ac_fn_cxx_try_link "$LINENO"; then : ++ ++ lt_aix_libpath_sed=' ++ /Import File Strings/,/^$/ { ++ /^0/ { ++ s/^0 *\([^ ]*\) *$/\1/ ++ p ++ } ++ }' ++ lt_cv_aix_libpath__CXX=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` ++ # Check for a 64-bit object if we didn't find anything. ++ if test -z "$lt_cv_aix_libpath__CXX"; then ++ lt_cv_aix_libpath__CXX=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` ++ fi ++fi ++rm -f core conftest.err conftest.$ac_objext \ ++ conftest$ac_exeext conftest.$ac_ext ++ if test -z "$lt_cv_aix_libpath__CXX"; then ++ lt_cv_aix_libpath__CXX=/usr/lib:/lib ++ fi ++ ++fi ++ ++ aix_libpath=$lt_cv_aix_libpath__CXX ++fi ++ ++ hardcode_libdir_flag_spec_CXX='$wl-blibpath:$libdir:'"$aix_libpath" ++ # Warning - without using the other run time loading flags, ++ # -berok will link without error, but may produce a broken library. ++ no_undefined_flag_CXX=' $wl-bernotok' ++ allow_undefined_flag_CXX=' $wl-berok' ++ if test yes = "$with_gnu_ld"; then ++ # We only use this code for GNU lds that support --whole-archive. ++ whole_archive_flag_spec_CXX='$wl--whole-archive$convenience $wl--no-whole-archive' ++ else ++ # Exported symbols can be pulled into shared objects from archives ++ whole_archive_flag_spec_CXX='$convenience' ++ fi ++ archive_cmds_need_lc_CXX=yes ++ # This is similar to how AIX traditionally builds its shared ++ # libraries. ++ archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $wl-bnoentry $compiler_flags $wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' ++ fi ++ fi ++ ;; ++ ++ beos*) ++ if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then ++ allow_undefined_flag_CXX=unsupported ++ # Joseph Beckenbach says some releases of gcc ++ # support --undefined. This deserves some investigation. FIXME ++ archive_cmds_CXX='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' ++ else ++ ld_shlibs_CXX=no ++ fi ++ ;; ++ ++ chorus*) ++ case $cc_basename in ++ *) ++ # FIXME: insert proper C++ library support ++ ld_shlibs_CXX=no ++ ;; ++ esac ++ ;; ++ ++ cygwin* | mingw* | pw32* | cegcc*) ++ case $GXX,$cc_basename in ++ ,cl* | no,cl*) ++ # Native MSVC ++ # hardcode_libdir_flag_spec is actually meaningless, as there is ++ # no search path for DLLs. ++ hardcode_libdir_flag_spec_CXX=' ' ++ allow_undefined_flag_CXX=unsupported ++ always_export_symbols_CXX=yes ++ file_list_spec_CXX='@' ++ # Tell ltmain to make .lib files, not .a files. ++ libext=lib ++ # Tell ltmain to make .dll files, not .so files. ++ shrext_cmds=.dll ++ # FIXME: Setting linknames here is a bad hack. ++ archive_cmds_CXX='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames=' ++ archive_expsym_cmds_CXX='if test DEF = "`$SED -n -e '\''s/^[ ]*//'\'' -e '\''/^\(;.*\)*$/d'\'' -e '\''s/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p'\'' -e q $export_symbols`" ; then ++ cp "$export_symbols" "$output_objdir/$soname.def"; ++ echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp"; ++ else ++ $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp; ++ fi~ ++ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ ++ linknames=' ++ # The linker will not automatically build a static lib if we build a DLL. ++ # _LT_TAGVAR(old_archive_from_new_cmds, CXX)='true' ++ enable_shared_with_static_runtimes_CXX=yes ++ # Don't use ranlib ++ old_postinstall_cmds_CXX='chmod 644 $oldlib' ++ postlink_cmds_CXX='lt_outputfile="@OUTPUT@"~ ++ lt_tool_outputfile="@TOOL_OUTPUT@"~ ++ case $lt_outputfile in ++ *.exe|*.EXE) ;; ++ *) ++ lt_outputfile=$lt_outputfile.exe ++ lt_tool_outputfile=$lt_tool_outputfile.exe ++ ;; ++ esac~ ++ func_to_tool_file "$lt_outputfile"~ ++ if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then ++ $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; ++ $RM "$lt_outputfile.manifest"; ++ fi' ++ ;; ++ *) ++ # g++ ++ # _LT_TAGVAR(hardcode_libdir_flag_spec, CXX) is actually meaningless, ++ # as there is no search path for DLLs. ++ hardcode_libdir_flag_spec_CXX='-L$libdir' ++ export_dynamic_flag_spec_CXX='$wl--export-all-symbols' ++ allow_undefined_flag_CXX=unsupported ++ always_export_symbols_CXX=no ++ enable_shared_with_static_runtimes_CXX=yes ++ ++ if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then ++ archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' ++ # If the export-symbols file already is a .def file, use it as ++ # is; otherwise, prepend EXPORTS... ++ archive_expsym_cmds_CXX='if test DEF = "`$SED -n -e '\''s/^[ ]*//'\'' -e '\''/^\(;.*\)*$/d'\'' -e '\''s/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p'\'' -e q $export_symbols`" ; then ++ cp $export_symbols $output_objdir/$soname.def; ++ else ++ echo EXPORTS > $output_objdir/$soname.def; ++ cat $export_symbols >> $output_objdir/$soname.def; ++ fi~ ++ $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' ++ else ++ ld_shlibs_CXX=no ++ fi ++ ;; ++ esac ++ ;; ++ darwin* | rhapsody*) ++ ++ ++ archive_cmds_need_lc_CXX=no ++ hardcode_direct_CXX=no ++ hardcode_automatic_CXX=yes ++ hardcode_shlibpath_var_CXX=unsupported ++ if test yes = "$lt_cv_ld_force_load"; then ++ whole_archive_flag_spec_CXX='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience $wl-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' ++ ++ else ++ whole_archive_flag_spec_CXX='' ++ fi ++ link_all_deplibs_CXX=yes ++ allow_undefined_flag_CXX=$_lt_dar_allow_undefined ++ case $cc_basename in ++ ifort*|nagfor*) _lt_dar_can_shared=yes ;; ++ *) _lt_dar_can_shared=$GCC ;; ++ esac ++ if test yes = "$_lt_dar_can_shared"; then ++ output_verbose_link_cmd=func_echo_all ++ archive_cmds_CXX="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dsymutil" ++ module_cmds_CXX="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dsymutil" ++ archive_expsym_cmds_CXX="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil" ++ module_expsym_cmds_CXX="sed -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil" ++ if test yes != "$lt_cv_apple_cc_single_mod"; then ++ archive_cmds_CXX="\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dsymutil" ++ archive_expsym_cmds_CXX="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dar_export_syms$_lt_dsymutil" ++ fi ++ ++ else ++ ld_shlibs_CXX=no ++ fi ++ ++ ;; ++ ++ dgux*) ++ case $cc_basename in ++ ec++*) ++ # FIXME: insert proper C++ library support ++ ld_shlibs_CXX=no ++ ;; ++ ghcx*) ++ # Green Hills C++ Compiler ++ # FIXME: insert proper C++ library support ++ ld_shlibs_CXX=no ++ ;; ++ *) ++ # FIXME: insert proper C++ library support ++ ld_shlibs_CXX=no ++ ;; ++ esac ++ ;; ++ ++ freebsd2.*) ++ # C++ shared libraries reported to be fairly broken before ++ # switch to ELF ++ ld_shlibs_CXX=no ++ ;; ++ ++ freebsd-elf*) ++ archive_cmds_need_lc_CXX=no ++ ;; ++ ++ freebsd* | dragonfly*) ++ # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF ++ # conventions ++ ld_shlibs_CXX=yes ++ ;; ++ ++ haiku*) ++ archive_cmds_CXX='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' ++ link_all_deplibs_CXX=yes ++ ;; ++ ++ hpux9*) ++ hardcode_libdir_flag_spec_CXX='$wl+b $wl$libdir' ++ hardcode_libdir_separator_CXX=: ++ export_dynamic_flag_spec_CXX='$wl-E' ++ hardcode_direct_CXX=yes ++ hardcode_minus_L_CXX=yes # Not in the search PATH, ++ # but as the default ++ # location of the library. ++ ++ case $cc_basename in ++ CC*) ++ # FIXME: insert proper C++ library support ++ ld_shlibs_CXX=no ++ ;; ++ aCC*) ++ archive_cmds_CXX='$RM $output_objdir/$soname~$CC -b $wl+b $wl$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' ++ # Commands to make compiler produce verbose output that lists ++ # what "hidden" libraries, object files and flags are used when ++ # linking a shared library. ++ # ++ # There doesn't appear to be a way to prevent this compiler from ++ # explicitly linking system object files so we need to strip them ++ # from the output so that they don't get included in the library ++ # dependencies. ++ output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ++ ;; ++ *) ++ if test yes = "$GXX"; then ++ archive_cmds_CXX='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' ++ else ++ # FIXME: insert proper C++ library support ++ ld_shlibs_CXX=no ++ fi ++ ;; ++ esac ++ ;; ++ ++ hpux10*|hpux11*) ++ if test no = "$with_gnu_ld"; then ++ hardcode_libdir_flag_spec_CXX='$wl+b $wl$libdir' ++ hardcode_libdir_separator_CXX=: ++ ++ case $host_cpu in ++ hppa*64*|ia64*) ++ ;; ++ *) ++ export_dynamic_flag_spec_CXX='$wl-E' ++ ;; ++ esac ++ fi ++ case $host_cpu in ++ hppa*64*|ia64*) ++ hardcode_direct_CXX=no ++ hardcode_shlibpath_var_CXX=no ++ ;; ++ *) ++ hardcode_direct_CXX=yes ++ hardcode_direct_absolute_CXX=yes ++ hardcode_minus_L_CXX=yes # Not in the search PATH, ++ # but as the default ++ # location of the library. ++ ;; ++ esac ++ ++ case $cc_basename in ++ CC*) ++ # FIXME: insert proper C++ library support ++ ld_shlibs_CXX=no ++ ;; ++ aCC*) ++ case $host_cpu in ++ hppa*64*) ++ archive_cmds_CXX='$CC -b $wl+h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ++ ;; ++ ia64*) ++ archive_cmds_CXX='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ++ ;; ++ *) ++ archive_cmds_CXX='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ++ ;; ++ esac ++ # Commands to make compiler produce verbose output that lists ++ # what "hidden" libraries, object files and flags are used when ++ # linking a shared library. ++ # ++ # There doesn't appear to be a way to prevent this compiler from ++ # explicitly linking system object files so we need to strip them ++ # from the output so that they don't get included in the library ++ # dependencies. ++ output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ++ ;; ++ *) ++ if test yes = "$GXX"; then ++ if test no = "$with_gnu_ld"; then ++ case $host_cpu in ++ hppa*64*) ++ archive_cmds_CXX='$CC -shared -nostdlib -fPIC $wl+h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ++ ;; ++ ia64*) ++ archive_cmds_CXX='$CC -shared -nostdlib $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ++ ;; ++ *) ++ archive_cmds_CXX='$CC -shared -nostdlib $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ++ ;; ++ esac ++ fi ++ else ++ # FIXME: insert proper C++ library support ++ ld_shlibs_CXX=no ++ fi ++ ;; ++ esac ++ ;; ++ ++ interix[3-9]*) ++ hardcode_direct_CXX=no ++ hardcode_shlibpath_var_CXX=no ++ hardcode_libdir_flag_spec_CXX='$wl-rpath,$libdir' ++ export_dynamic_flag_spec_CXX='$wl-E' ++ # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. ++ # Instead, shared libraries are loaded at an image base (0x10000000 by ++ # default) and relocated if they conflict, which is a slow very memory ++ # consuming and fragmenting process. To avoid this, we pick a random, ++ # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link ++ # time. Moving up from 0x10000000 also allows more sbrk(2) space. ++ archive_cmds_CXX='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ++ archive_expsym_cmds_CXX='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ++ ;; ++ irix5* | irix6*) ++ case $cc_basename in ++ CC*) ++ # SGI C++ ++ archive_cmds_CXX='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' ++ ++ # Archives containing C++ object files must be created using ++ # "CC -ar", where "CC" is the IRIX C++ compiler. This is ++ # necessary to make sure instantiated templates are included ++ # in the archive. ++ old_archive_cmds_CXX='$CC -ar -WR,-u -o $oldlib $oldobjs' ++ ;; ++ *) ++ if test yes = "$GXX"; then ++ if test no = "$with_gnu_ld"; then ++ archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' ++ else ++ archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` -o $lib' ++ fi ++ fi ++ link_all_deplibs_CXX=yes ++ ;; ++ esac ++ hardcode_libdir_flag_spec_CXX='$wl-rpath $wl$libdir' ++ hardcode_libdir_separator_CXX=: ++ inherit_rpath_CXX=yes ++ ;; ++ ++ linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) ++ case $cc_basename in ++ KCC*) ++ # Kuck and Associates, Inc. (KAI) C++ Compiler ++ ++ # KCC will only create a shared library if the output file ++ # ends with ".so" (or ".sl" for HP-UX), so rename the library ++ # to its proper name (with version) after linking. ++ archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' ++ archive_expsym_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib $wl-retain-symbols-file,$export_symbols; mv \$templib $lib' ++ # Commands to make compiler produce verbose output that lists ++ # what "hidden" libraries, object files and flags are used when ++ # linking a shared library. ++ # ++ # There doesn't appear to be a way to prevent this compiler from ++ # explicitly linking system object files so we need to strip them ++ # from the output so that they don't get included in the library ++ # dependencies. ++ output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ++ ++ hardcode_libdir_flag_spec_CXX='$wl-rpath,$libdir' ++ export_dynamic_flag_spec_CXX='$wl--export-dynamic' ++ ++ # Archives containing C++ object files must be created using ++ # "CC -Bstatic", where "CC" is the KAI C++ compiler. ++ old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs' ++ ;; ++ icpc* | ecpc* ) ++ # Intel C++ ++ with_gnu_ld=yes ++ # version 8.0 and above of icpc choke on multiply defined symbols ++ # if we add $predep_objects and $postdep_objects, however 7.1 and ++ # earlier do not add the objects themselves. ++ case `$CC -V 2>&1` in ++ *"Version 7."*) ++ archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' ++ archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' ++ ;; ++ *) # Version 8.0 or newer ++ tmp_idyn= ++ case $host_cpu in ++ ia64*) tmp_idyn=' -i_dynamic';; ++ esac ++ archive_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' ++ archive_expsym_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' ++ ;; ++ esac ++ archive_cmds_need_lc_CXX=no ++ hardcode_libdir_flag_spec_CXX='$wl-rpath,$libdir' ++ export_dynamic_flag_spec_CXX='$wl--export-dynamic' ++ whole_archive_flag_spec_CXX='$wl--whole-archive$convenience $wl--no-whole-archive' ++ ;; ++ pgCC* | pgcpp*) ++ # Portland Group C++ compiler ++ case `$CC -V` in ++ *pgCC\ [1-5].* | *pgcpp\ [1-5].*) ++ prelink_cmds_CXX='tpldir=Template.dir~ ++ rm -rf $tpldir~ ++ $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~ ++ compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"' ++ old_archive_cmds_CXX='tpldir=Template.dir~ ++ rm -rf $tpldir~ ++ $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~ ++ $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~ ++ $RANLIB $oldlib' ++ archive_cmds_CXX='tpldir=Template.dir~ ++ rm -rf $tpldir~ ++ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ ++ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' ++ archive_expsym_cmds_CXX='tpldir=Template.dir~ ++ rm -rf $tpldir~ ++ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ ++ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' ++ ;; ++ *) # Version 6 and above use weak symbols ++ archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' ++ archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' ++ ;; ++ esac ++ ++ hardcode_libdir_flag_spec_CXX='$wl--rpath $wl$libdir' ++ export_dynamic_flag_spec_CXX='$wl--export-dynamic' ++ whole_archive_flag_spec_CXX='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' ++ ;; ++ cxx*) ++ # Compaq C++ ++ archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' ++ archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib $wl-retain-symbols-file $wl$export_symbols' ++ ++ runpath_var=LD_RUN_PATH ++ hardcode_libdir_flag_spec_CXX='-rpath $libdir' ++ hardcode_libdir_separator_CXX=: ++ ++ # Commands to make compiler produce verbose output that lists ++ # what "hidden" libraries, object files and flags are used when ++ # linking a shared library. ++ # ++ # There doesn't appear to be a way to prevent this compiler from ++ # explicitly linking system object files so we need to strip them ++ # from the output so that they don't get included in the library ++ # dependencies. ++ output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed' ++ ;; ++ xl* | mpixl* | bgxl*) ++ # IBM XL 8.0 on PPC, with GNU ld ++ hardcode_libdir_flag_spec_CXX='$wl-rpath $wl$libdir' ++ export_dynamic_flag_spec_CXX='$wl--export-dynamic' ++ archive_cmds_CXX='$CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' ++ if test yes = "$supports_anon_versioning"; then ++ archive_expsym_cmds_CXX='echo "{ global:" > $output_objdir/$libname.ver~ ++ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ ++ echo "local: *; };" >> $output_objdir/$libname.ver~ ++ $CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib' ++ fi ++ ;; ++ *) ++ case `$CC -V 2>&1 | sed 5q` in ++ *Sun\ C*) ++ # Sun C++ 5.9 ++ no_undefined_flag_CXX=' -zdefs' ++ archive_cmds_CXX='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ++ archive_expsym_cmds_CXX='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-retain-symbols-file $wl$export_symbols' ++ hardcode_libdir_flag_spec_CXX='-R$libdir' ++ whole_archive_flag_spec_CXX='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' ++ compiler_needs_object_CXX=yes ++ ++ # Not sure whether something based on ++ # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 ++ # would be better. ++ output_verbose_link_cmd='func_echo_all' ++ ++ # Archives containing C++ object files must be created using ++ # "CC -xar", where "CC" is the Sun C++ compiler. This is ++ # necessary to make sure instantiated templates are included ++ # in the archive. ++ old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs' ++ ;; ++ esac ++ ;; ++ esac ++ ;; ++ ++ lynxos*) ++ # FIXME: insert proper C++ library support ++ ld_shlibs_CXX=no ++ ;; ++ ++ m88k*) ++ # FIXME: insert proper C++ library support ++ ld_shlibs_CXX=no ++ ;; ++ ++ mvs*) ++ case $cc_basename in ++ cxx*) ++ # FIXME: insert proper C++ library support ++ ld_shlibs_CXX=no ++ ;; ++ *) ++ # FIXME: insert proper C++ library support ++ ld_shlibs_CXX=no ++ ;; ++ esac ++ ;; ++ ++ netbsd*) ++ if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then ++ archive_cmds_CXX='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' ++ wlarc= ++ hardcode_libdir_flag_spec_CXX='-R$libdir' ++ hardcode_direct_CXX=yes ++ hardcode_shlibpath_var_CXX=no ++ fi ++ # Workaround some broken pre-1.5 toolchains ++ output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' ++ ;; ++ ++ *nto* | *qnx*) ++ ld_shlibs_CXX=yes ++ ;; ++ ++ openbsd* | bitrig*) ++ if test -f /usr/libexec/ld.so; then ++ hardcode_direct_CXX=yes ++ hardcode_shlibpath_var_CXX=no ++ hardcode_direct_absolute_CXX=yes ++ archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' ++ hardcode_libdir_flag_spec_CXX='$wl-rpath,$libdir' ++ if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`"; then ++ archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-retain-symbols-file,$export_symbols -o $lib' ++ export_dynamic_flag_spec_CXX='$wl-E' ++ whole_archive_flag_spec_CXX=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive' ++ fi ++ output_verbose_link_cmd=func_echo_all ++ else ++ ld_shlibs_CXX=no ++ fi ++ ;; ++ ++ osf3* | osf4* | osf5*) ++ case $cc_basename in ++ KCC*) ++ # Kuck and Associates, Inc. (KAI) C++ Compiler ++ ++ # KCC will only create a shared library if the output file ++ # ends with ".so" (or ".sl" for HP-UX), so rename the library ++ # to its proper name (with version) after linking. ++ archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' ++ ++ hardcode_libdir_flag_spec_CXX='$wl-rpath,$libdir' ++ hardcode_libdir_separator_CXX=: ++ ++ # Archives containing C++ object files must be created using ++ # the KAI C++ compiler. ++ case $host in ++ osf3*) old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs' ;; ++ *) old_archive_cmds_CXX='$CC -o $oldlib $oldobjs' ;; ++ esac ++ ;; ++ RCC*) ++ # Rational C++ 2.4.1 ++ # FIXME: insert proper C++ library support ++ ld_shlibs_CXX=no ++ ;; ++ cxx*) ++ case $host in ++ osf3*) ++ allow_undefined_flag_CXX=' $wl-expect_unresolved $wl\*' ++ archive_cmds_CXX='$CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $soname `test -n "$verstring" && func_echo_all "$wl-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' ++ hardcode_libdir_flag_spec_CXX='$wl-rpath $wl$libdir' ++ ;; ++ *) ++ allow_undefined_flag_CXX=' -expect_unresolved \*' ++ archive_cmds_CXX='$CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' ++ archive_expsym_cmds_CXX='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ ++ echo "-hidden">> $lib.exp~ ++ $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname $wl-input $wl$lib.exp `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib~ ++ $RM $lib.exp' ++ hardcode_libdir_flag_spec_CXX='-rpath $libdir' ++ ;; ++ esac ++ ++ hardcode_libdir_separator_CXX=: ++ ++ # Commands to make compiler produce verbose output that lists ++ # what "hidden" libraries, object files and flags are used when ++ # linking a shared library. ++ # ++ # There doesn't appear to be a way to prevent this compiler from ++ # explicitly linking system object files so we need to strip them ++ # from the output so that they don't get included in the library ++ # dependencies. ++ output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ++ ;; ++ *) ++ if test yes,no = "$GXX,$with_gnu_ld"; then ++ allow_undefined_flag_CXX=' $wl-expect_unresolved $wl\*' ++ case $host in ++ osf3*) ++ archive_cmds_CXX='$CC -shared -nostdlib $allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' ++ ;; ++ *) ++ archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' ++ ;; ++ esac ++ ++ hardcode_libdir_flag_spec_CXX='$wl-rpath $wl$libdir' ++ hardcode_libdir_separator_CXX=: ++ ++ # Commands to make compiler produce verbose output that lists ++ # what "hidden" libraries, object files and flags are used when ++ # linking a shared library. ++ output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' ++ ++ else ++ # FIXME: insert proper C++ library support ++ ld_shlibs_CXX=no ++ fi ++ ;; ++ esac ++ ;; ++ ++ psos*) ++ # FIXME: insert proper C++ library support ++ ld_shlibs_CXX=no ++ ;; ++ ++ sunos4*) ++ case $cc_basename in ++ CC*) ++ # Sun C++ 4.x ++ # FIXME: insert proper C++ library support ++ ld_shlibs_CXX=no ++ ;; ++ lcc*) ++ # Lucid ++ # FIXME: insert proper C++ library support ++ ld_shlibs_CXX=no ++ ;; ++ *) ++ # FIXME: insert proper C++ library support ++ ld_shlibs_CXX=no ++ ;; ++ esac ++ ;; ++ ++ solaris*) ++ case $cc_basename in ++ CC* | sunCC*) ++ # Sun C++ 4.2, 5.x and Centerline C++ ++ archive_cmds_need_lc_CXX=yes ++ no_undefined_flag_CXX=' -zdefs' ++ archive_cmds_CXX='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ++ archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ ++ $CC -G$allow_undefined_flag $wl-M $wl$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' ++ ++ hardcode_libdir_flag_spec_CXX='-R$libdir' ++ hardcode_shlibpath_var_CXX=no ++ case $host_os in ++ solaris2.[0-5] | solaris2.[0-5].*) ;; ++ *) ++ # The compiler driver will combine and reorder linker options, ++ # but understands '-z linker_flag'. ++ # Supported since Solaris 2.6 (maybe 2.5.1?) ++ whole_archive_flag_spec_CXX='-z allextract$convenience -z defaultextract' ++ ;; ++ esac ++ link_all_deplibs_CXX=yes ++ ++ output_verbose_link_cmd='func_echo_all' ++ ++ # Archives containing C++ object files must be created using ++ # "CC -xar", where "CC" is the Sun C++ compiler. This is ++ # necessary to make sure instantiated templates are included ++ # in the archive. ++ old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs' ++ ;; ++ gcx*) ++ # Green Hills C++ Compiler ++ archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib' ++ ++ # The C++ compiler must be used to create the archive. ++ old_archive_cmds_CXX='$CC $LDFLAGS -archive -o $oldlib $oldobjs' ++ ;; ++ *) ++ # GNU C++ compiler with Solaris linker ++ if test yes,no = "$GXX,$with_gnu_ld"; then ++ no_undefined_flag_CXX=' $wl-z ${wl}defs' ++ if $CC --version | $GREP -v '^2\.7' > /dev/null; then ++ archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib' ++ archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ ++ $CC -shared $pic_flag -nostdlib $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' ++ ++ # Commands to make compiler produce verbose output that lists ++ # what "hidden" libraries, object files and flags are used when ++ # linking a shared library. ++ output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' ++ else ++ # g++ 2.7 appears to require '-G' NOT '-shared' on this ++ # platform. ++ archive_cmds_CXX='$CC -G -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib' ++ archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ ++ $CC -G -nostdlib $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' ++ ++ # Commands to make compiler produce verbose output that lists ++ # what "hidden" libraries, object files and flags are used when ++ # linking a shared library. ++ output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' ++ fi ++ ++ hardcode_libdir_flag_spec_CXX='$wl-R $wl$libdir' ++ case $host_os in ++ solaris2.[0-5] | solaris2.[0-5].*) ;; ++ *) ++ whole_archive_flag_spec_CXX='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract' ++ ;; ++ esac ++ fi ++ ;; ++ esac ++ ;; ++ ++ sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) ++ no_undefined_flag_CXX='$wl-z,text' ++ archive_cmds_need_lc_CXX=no ++ hardcode_shlibpath_var_CXX=no ++ runpath_var='LD_RUN_PATH' ++ ++ case $cc_basename in ++ CC*) ++ archive_cmds_CXX='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ++ archive_expsym_cmds_CXX='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ++ ;; ++ *) ++ archive_cmds_CXX='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ++ archive_expsym_cmds_CXX='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ++ ;; ++ esac ++ ;; ++ ++ sysv5* | sco3.2v5* | sco5v6*) ++ # Note: We CANNOT use -z defs as we might desire, because we do not ++ # link with -lc, and that would cause any symbols used from libc to ++ # always be unresolved, which means just about no library would ++ # ever link correctly. If we're not using GNU ld we use -z text ++ # though, which does catch some bad symbols but isn't as heavy-handed ++ # as -z defs. ++ no_undefined_flag_CXX='$wl-z,text' ++ allow_undefined_flag_CXX='$wl-z,nodefs' ++ archive_cmds_need_lc_CXX=no ++ hardcode_shlibpath_var_CXX=no ++ hardcode_libdir_flag_spec_CXX='$wl-R,$libdir' ++ hardcode_libdir_separator_CXX=':' ++ link_all_deplibs_CXX=yes ++ export_dynamic_flag_spec_CXX='$wl-Bexport' ++ runpath_var='LD_RUN_PATH' ++ ++ case $cc_basename in ++ CC*) ++ archive_cmds_CXX='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ++ archive_expsym_cmds_CXX='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ++ old_archive_cmds_CXX='$CC -Tprelink_objects $oldobjs~ ++ '"$old_archive_cmds_CXX" ++ reload_cmds_CXX='$CC -Tprelink_objects $reload_objs~ ++ '"$reload_cmds_CXX" ++ ;; ++ *) ++ archive_cmds_CXX='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ++ archive_expsym_cmds_CXX='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ++ ;; ++ esac ++ ;; ++ ++ tandem*) ++ case $cc_basename in ++ NCC*) ++ # NonStop-UX NCC 3.20 ++ # FIXME: insert proper C++ library support ++ ld_shlibs_CXX=no ++ ;; ++ *) ++ # FIXME: insert proper C++ library support ++ ld_shlibs_CXX=no ++ ;; ++ esac ++ ;; ++ ++ vxworks*) ++ # FIXME: insert proper C++ library support ++ ld_shlibs_CXX=no ++ ;; ++ ++ *) ++ # FIXME: insert proper C++ library support ++ ld_shlibs_CXX=no ++ ;; ++ esac ++ ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs_CXX" >&5 ++$as_echo "$ld_shlibs_CXX" >&6; } ++ test no = "$ld_shlibs_CXX" && can_build_shared=no ++ ++ GCC_CXX=$GXX ++ LD_CXX=$LD ++ ++ ## CAVEAT EMPTOR: ++ ## There is no encapsulation within the following macros, do not change ++ ## the running order or otherwise move them around unless you know exactly ++ ## what you are doing... ++ # Dependencies to place before and after the object being linked: ++predep_objects_CXX= ++postdep_objects_CXX= ++predeps_CXX= ++postdeps_CXX= ++compiler_lib_search_path_CXX= ++ ++cat > conftest.$ac_ext <<_LT_EOF ++class Foo ++{ ++public: ++ Foo (void) { a = 0; } ++private: ++ int a; ++}; ++_LT_EOF ++ ++ ++_lt_libdeps_save_CFLAGS=$CFLAGS ++case "$CC $CFLAGS " in #( ++*\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;; ++*\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;; ++*\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;; ++esac ++ ++if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 ++ (eval $ac_compile) 2>&5 ++ ac_status=$? ++ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 ++ test $ac_status = 0; }; then ++ # Parse the compiler output and extract the necessary ++ # objects, libraries and library flags. ++ ++ # Sentinel used to keep track of whether or not we are before ++ # the conftest object file. ++ pre_test_object_deps_done=no ++ ++ for p in `eval "$output_verbose_link_cmd"`; do ++ case $prev$p in ++ ++ -L* | -R* | -l*) ++ # Some compilers place space between "-{L,R}" and the path. ++ # Remove the space. ++ if test x-L = "$p" || ++ test x-R = "$p"; then ++ prev=$p ++ continue ++ fi ++ ++ # Expand the sysroot to ease extracting the directories later. ++ if test -z "$prev"; then ++ case $p in ++ -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;; ++ -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;; ++ -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;; ++ esac ++ fi ++ case $p in ++ =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;; ++ esac ++ if test no = "$pre_test_object_deps_done"; then ++ case $prev in ++ -L | -R) ++ # Internal compiler library paths should come after those ++ # provided the user. The postdeps already come after the ++ # user supplied libs so there is no need to process them. ++ if test -z "$compiler_lib_search_path_CXX"; then ++ compiler_lib_search_path_CXX=$prev$p ++ else ++ compiler_lib_search_path_CXX="${compiler_lib_search_path_CXX} $prev$p" ++ fi ++ ;; ++ # The "-l" case would never come before the object being ++ # linked, so don't bother handling this case. ++ esac ++ else ++ if test -z "$postdeps_CXX"; then ++ postdeps_CXX=$prev$p ++ else ++ postdeps_CXX="${postdeps_CXX} $prev$p" ++ fi ++ fi ++ prev= ++ ;; ++ ++ *.lto.$objext) ;; # Ignore GCC LTO objects ++ *.$objext) ++ # This assumes that the test object file only shows up ++ # once in the compiler output. ++ if test "$p" = "conftest.$objext"; then ++ pre_test_object_deps_done=yes ++ continue ++ fi ++ ++ if test no = "$pre_test_object_deps_done"; then ++ if test -z "$predep_objects_CXX"; then ++ predep_objects_CXX=$p ++ else ++ predep_objects_CXX="$predep_objects_CXX $p" ++ fi ++ else ++ if test -z "$postdep_objects_CXX"; then ++ postdep_objects_CXX=$p ++ else ++ postdep_objects_CXX="$postdep_objects_CXX $p" ++ fi ++ fi ++ ;; ++ ++ *) ;; # Ignore the rest. ++ ++ esac ++ done ++ ++ # Clean up. ++ rm -f a.out a.exe ++else ++ echo "libtool.m4: error: problem compiling CXX test program" ++fi ++ ++$RM -f confest.$objext ++CFLAGS=$_lt_libdeps_save_CFLAGS ++ ++# PORTME: override above test on systems where it is broken ++case $host_os in ++interix[3-9]*) ++ # Interix 3.5 installs completely hosed .la files for C++, so rather than ++ # hack all around it, let's just trust "g++" to DTRT. ++ predep_objects_CXX= ++ postdep_objects_CXX= ++ postdeps_CXX= ++ ;; ++ ++linux*) ++ case `$CC -V 2>&1 | sed 5q` in ++ *Sun\ C*) ++ # Sun C++ 5.9 ++ ++ # The more standards-conforming stlport4 library is ++ # incompatible with the Cstd library. Avoid specifying ++ # it if it's in CXXFLAGS. Ignore libCrun as ++ # -library=stlport4 depends on it. ++ case " $CXX $CXXFLAGS " in ++ *" -library=stlport4 "*) ++ solaris_use_stlport4=yes ++ ;; ++ esac ++ ++ if test yes != "$solaris_use_stlport4"; then ++ postdeps_CXX='-library=Cstd -library=Crun' ++ fi ++ ;; ++ esac ++ ;; ++ ++solaris*) ++ case $cc_basename in ++ CC* | sunCC*) ++ # The more standards-conforming stlport4 library is ++ # incompatible with the Cstd library. Avoid specifying ++ # it if it's in CXXFLAGS. Ignore libCrun as ++ # -library=stlport4 depends on it. ++ case " $CXX $CXXFLAGS " in ++ *" -library=stlport4 "*) ++ solaris_use_stlport4=yes ++ ;; ++ esac ++ ++ # Adding this requires a known-good setup of shared libraries for ++ # Sun compiler versions before 5.6, else PIC objects from an old ++ # archive will be linked into the output, leading to subtle bugs. ++ if test yes != "$solaris_use_stlport4"; then ++ postdeps_CXX='-library=Cstd -library=Crun' ++ fi ++ ;; ++ esac ++ ;; ++esac ++ ++ ++case " $postdeps_CXX " in ++*" -lc "*) archive_cmds_need_lc_CXX=no ;; ++esac ++ compiler_lib_search_dirs_CXX= ++if test -n "${compiler_lib_search_path_CXX}"; then ++ compiler_lib_search_dirs_CXX=`echo " ${compiler_lib_search_path_CXX}" | $SED -e 's! -L! !g' -e 's!^ !!'` ++fi ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ lt_prog_compiler_wl_CXX= ++lt_prog_compiler_pic_CXX= ++lt_prog_compiler_static_CXX= ++ ++ ++ # C++ specific cases for pic, static, wl, etc. ++ if test yes = "$GXX"; then ++ lt_prog_compiler_wl_CXX='-Wl,' ++ lt_prog_compiler_static_CXX='-static' ++ ++ case $host_os in ++ aix*) ++ # All AIX code is PIC. ++ if test ia64 = "$host_cpu"; then ++ # AIX 5 now supports IA64 processor ++ lt_prog_compiler_static_CXX='-Bstatic' ++ fi ++ lt_prog_compiler_pic_CXX='-fPIC' ++ ;; ++ ++ amigaos*) ++ case $host_cpu in ++ powerpc) ++ # see comment about AmigaOS4 .so support ++ lt_prog_compiler_pic_CXX='-fPIC' ++ ;; ++ m68k) ++ # FIXME: we need at least 68020 code to build shared libraries, but ++ # adding the '-m68020' flag to GCC prevents building anything better, ++ # like '-m68040'. ++ lt_prog_compiler_pic_CXX='-m68020 -resident32 -malways-restore-a4' ++ ;; ++ esac ++ ;; ++ ++ beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) ++ # PIC is the default for these OSes. ++ ;; ++ mingw* | cygwin* | os2* | pw32* | cegcc*) ++ # This hack is so that the source file can tell whether it is being ++ # built for inclusion in a dll (and should export symbols for example). ++ # Although the cygwin gcc ignores -fPIC, still need this for old-style ++ # (--disable-auto-import) libraries ++ lt_prog_compiler_pic_CXX='-DDLL_EXPORT' ++ ;; ++ darwin* | rhapsody*) ++ # PIC is the default on this platform ++ # Common symbols not allowed in MH_DYLIB files ++ lt_prog_compiler_pic_CXX='-fno-common' ++ ;; ++ *djgpp*) ++ # DJGPP does not support shared libraries at all ++ lt_prog_compiler_pic_CXX= ++ ;; ++ haiku*) ++ # PIC is the default for Haiku. ++ # The "-static" flag exists, but is broken. ++ lt_prog_compiler_static_CXX= ++ ;; ++ interix[3-9]*) ++ # Interix 3.x gcc -fpic/-fPIC options generate broken code. ++ # Instead, we relocate shared libraries at runtime. ++ ;; ++ sysv4*MP*) ++ if test -d /usr/nec; then ++ lt_prog_compiler_pic_CXX=-Kconform_pic ++ fi ++ ;; ++ hpux*) ++ # PIC is the default for 64-bit PA HP-UX, but not for 32-bit ++ # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag ++ # sets the default TLS model and affects inlining. ++ case $host_cpu in ++ hppa*64*) ++ ;; ++ *) ++ lt_prog_compiler_pic_CXX='-fPIC' ++ ;; ++ esac ++ ;; ++ *qnx* | *nto*) ++ # QNX uses GNU C++, but need to define -shared option too, otherwise ++ # it will coredump. ++ lt_prog_compiler_pic_CXX='-fPIC -shared' ++ ;; ++ *) ++ lt_prog_compiler_pic_CXX='-fPIC' ++ ;; ++ esac ++ else ++ case $host_os in ++ aix[4-9]*) ++ # All AIX code is PIC. ++ if test ia64 = "$host_cpu"; then ++ # AIX 5 now supports IA64 processor ++ lt_prog_compiler_static_CXX='-Bstatic' ++ else ++ lt_prog_compiler_static_CXX='-bnso -bI:/lib/syscalls.exp' ++ fi ++ ;; ++ chorus*) ++ case $cc_basename in ++ cxch68*) ++ # Green Hills C++ Compiler ++ # _LT_TAGVAR(lt_prog_compiler_static, CXX)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" ++ ;; ++ esac ++ ;; ++ mingw* | cygwin* | os2* | pw32* | cegcc*) ++ # This hack is so that the source file can tell whether it is being ++ # built for inclusion in a dll (and should export symbols for example). ++ lt_prog_compiler_pic_CXX='-DDLL_EXPORT' ++ ;; ++ dgux*) ++ case $cc_basename in ++ ec++*) ++ lt_prog_compiler_pic_CXX='-KPIC' ++ ;; ++ ghcx*) ++ # Green Hills C++ Compiler ++ lt_prog_compiler_pic_CXX='-pic' ++ ;; ++ *) ++ ;; ++ esac ++ ;; ++ freebsd* | dragonfly*) ++ # FreeBSD uses GNU C++ ++ ;; ++ hpux9* | hpux10* | hpux11*) ++ case $cc_basename in ++ CC*) ++ lt_prog_compiler_wl_CXX='-Wl,' ++ lt_prog_compiler_static_CXX='$wl-a ${wl}archive' ++ if test ia64 != "$host_cpu"; then ++ lt_prog_compiler_pic_CXX='+Z' ++ fi ++ ;; ++ aCC*) ++ lt_prog_compiler_wl_CXX='-Wl,' ++ lt_prog_compiler_static_CXX='$wl-a ${wl}archive' ++ case $host_cpu in ++ hppa*64*|ia64*) ++ # +Z the default ++ ;; ++ *) ++ lt_prog_compiler_pic_CXX='+Z' ++ ;; ++ esac ++ ;; ++ *) ++ ;; ++ esac ++ ;; ++ interix*) ++ # This is c89, which is MS Visual C++ (no shared libs) ++ # Anyone wants to do a port? ++ ;; ++ irix5* | irix6* | nonstopux*) ++ case $cc_basename in ++ CC*) ++ lt_prog_compiler_wl_CXX='-Wl,' ++ lt_prog_compiler_static_CXX='-non_shared' ++ # CC pic flag -KPIC is the default. ++ ;; ++ *) ++ ;; ++ esac ++ ;; ++ linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) ++ case $cc_basename in ++ KCC*) ++ # KAI C++ Compiler ++ lt_prog_compiler_wl_CXX='--backend -Wl,' ++ lt_prog_compiler_pic_CXX='-fPIC' ++ ;; ++ ecpc* ) ++ # old Intel C++ for x86_64, which still supported -KPIC. ++ lt_prog_compiler_wl_CXX='-Wl,' ++ lt_prog_compiler_pic_CXX='-KPIC' ++ lt_prog_compiler_static_CXX='-static' ++ ;; ++ icpc* ) ++ # Intel C++, used to be incompatible with GCC. ++ # ICC 10 doesn't accept -KPIC any more. ++ lt_prog_compiler_wl_CXX='-Wl,' ++ lt_prog_compiler_pic_CXX='-fPIC' ++ lt_prog_compiler_static_CXX='-static' ++ ;; ++ pgCC* | pgcpp*) ++ # Portland Group C++ compiler ++ lt_prog_compiler_wl_CXX='-Wl,' ++ lt_prog_compiler_pic_CXX='-fpic' ++ lt_prog_compiler_static_CXX='-Bstatic' ++ ;; ++ cxx*) ++ # Compaq C++ ++ # Make sure the PIC flag is empty. It appears that all Alpha ++ # Linux and Compaq Tru64 Unix objects are PIC. ++ lt_prog_compiler_pic_CXX= ++ lt_prog_compiler_static_CXX='-non_shared' ++ ;; ++ xlc* | xlC* | bgxl[cC]* | mpixl[cC]*) ++ # IBM XL 8.0, 9.0 on PPC and BlueGene ++ lt_prog_compiler_wl_CXX='-Wl,' ++ lt_prog_compiler_pic_CXX='-qpic' ++ lt_prog_compiler_static_CXX='-qstaticlink' ++ ;; ++ *) ++ case `$CC -V 2>&1 | sed 5q` in ++ *Sun\ C*) ++ # Sun C++ 5.9 ++ lt_prog_compiler_pic_CXX='-KPIC' ++ lt_prog_compiler_static_CXX='-Bstatic' ++ lt_prog_compiler_wl_CXX='-Qoption ld ' ++ ;; ++ esac ++ ;; ++ esac ++ ;; ++ lynxos*) ++ ;; ++ m88k*) ++ ;; ++ mvs*) ++ case $cc_basename in ++ cxx*) ++ lt_prog_compiler_pic_CXX='-W c,exportall' ++ ;; ++ *) ++ ;; ++ esac ++ ;; ++ netbsd*) ++ ;; ++ *qnx* | *nto*) ++ # QNX uses GNU C++, but need to define -shared option too, otherwise ++ # it will coredump. ++ lt_prog_compiler_pic_CXX='-fPIC -shared' ++ ;; ++ osf3* | osf4* | osf5*) ++ case $cc_basename in ++ KCC*) ++ lt_prog_compiler_wl_CXX='--backend -Wl,' ++ ;; ++ RCC*) ++ # Rational C++ 2.4.1 ++ lt_prog_compiler_pic_CXX='-pic' ++ ;; ++ cxx*) ++ # Digital/Compaq C++ ++ lt_prog_compiler_wl_CXX='-Wl,' ++ # Make sure the PIC flag is empty. It appears that all Alpha ++ # Linux and Compaq Tru64 Unix objects are PIC. ++ lt_prog_compiler_pic_CXX= ++ lt_prog_compiler_static_CXX='-non_shared' ++ ;; ++ *) ++ ;; ++ esac ++ ;; ++ psos*) ++ ;; ++ solaris*) ++ case $cc_basename in ++ CC* | sunCC*) ++ # Sun C++ 4.2, 5.x and Centerline C++ ++ lt_prog_compiler_pic_CXX='-KPIC' ++ lt_prog_compiler_static_CXX='-Bstatic' ++ lt_prog_compiler_wl_CXX='-Qoption ld ' ++ ;; ++ gcx*) ++ # Green Hills C++ Compiler ++ lt_prog_compiler_pic_CXX='-PIC' ++ ;; ++ *) ++ ;; ++ esac ++ ;; ++ sunos4*) ++ case $cc_basename in ++ CC*) ++ # Sun C++ 4.x ++ lt_prog_compiler_pic_CXX='-pic' ++ lt_prog_compiler_static_CXX='-Bstatic' ++ ;; ++ lcc*) ++ # Lucid ++ lt_prog_compiler_pic_CXX='-pic' ++ ;; ++ *) ++ ;; ++ esac ++ ;; ++ sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) ++ case $cc_basename in ++ CC*) ++ lt_prog_compiler_wl_CXX='-Wl,' ++ lt_prog_compiler_pic_CXX='-KPIC' ++ lt_prog_compiler_static_CXX='-Bstatic' ++ ;; ++ esac ++ ;; ++ tandem*) ++ case $cc_basename in ++ NCC*) ++ # NonStop-UX NCC 3.20 ++ lt_prog_compiler_pic_CXX='-KPIC' ++ ;; ++ *) ++ ;; ++ esac ++ ;; ++ vxworks*) ++ ;; ++ *) ++ lt_prog_compiler_can_build_shared_CXX=no ++ ;; ++ esac ++ fi ++ ++case $host_os in ++ # For platforms that do not support PIC, -DPIC is meaningless: ++ *djgpp*) ++ lt_prog_compiler_pic_CXX= ++ ;; ++ *) ++ lt_prog_compiler_pic_CXX="$lt_prog_compiler_pic_CXX -DPIC" ++ ;; ++esac ++ ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 ++$as_echo_n "checking for $compiler option to produce PIC... " >&6; } ++if ${lt_cv_prog_compiler_pic_CXX+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ lt_cv_prog_compiler_pic_CXX=$lt_prog_compiler_pic_CXX ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_CXX" >&5 ++$as_echo "$lt_cv_prog_compiler_pic_CXX" >&6; } ++lt_prog_compiler_pic_CXX=$lt_cv_prog_compiler_pic_CXX ++ ++# ++# Check to make sure the PIC flag actually works. ++# ++if test -n "$lt_prog_compiler_pic_CXX"; then ++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works" >&5 ++$as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works... " >&6; } ++if ${lt_cv_prog_compiler_pic_works_CXX+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ lt_cv_prog_compiler_pic_works_CXX=no ++ ac_outfile=conftest.$ac_objext ++ echo "$lt_simple_compile_test_code" > conftest.$ac_ext ++ lt_compiler_flag="$lt_prog_compiler_pic_CXX -DPIC" ## exclude from sc_useless_quotes_in_assignment ++ # Insert the option either (1) after the last *FLAGS variable, or ++ # (2) before a word containing "conftest.", or (3) at the end. ++ # Note that $ac_compile itself does not contain backslashes and begins ++ # with a dollar sign (not a hyphen), so the echo should work correctly. ++ # The option is referenced via a variable to avoid confusing sed. ++ lt_compile=`echo "$ac_compile" | $SED \ ++ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ ++ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ ++ -e 's:$: $lt_compiler_flag:'` ++ (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) ++ (eval "$lt_compile" 2>conftest.err) ++ ac_status=$? ++ cat conftest.err >&5 ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ if (exit $ac_status) && test -s "$ac_outfile"; then ++ # The compiler can only warn and ignore the option if not recognized ++ # So say no if there are warnings other than the usual output. ++ $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp ++ $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 ++ if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then ++ lt_cv_prog_compiler_pic_works_CXX=yes ++ fi ++ fi ++ $RM conftest* ++ ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works_CXX" >&5 ++$as_echo "$lt_cv_prog_compiler_pic_works_CXX" >&6; } ++ ++if test yes = "$lt_cv_prog_compiler_pic_works_CXX"; then ++ case $lt_prog_compiler_pic_CXX in ++ "" | " "*) ;; ++ *) lt_prog_compiler_pic_CXX=" $lt_prog_compiler_pic_CXX" ;; ++ esac ++else ++ lt_prog_compiler_pic_CXX= ++ lt_prog_compiler_can_build_shared_CXX=no ++fi ++ ++fi ++ ++ ++ ++ ++ ++# ++# Check to make sure the static flag actually works. ++# ++wl=$lt_prog_compiler_wl_CXX eval lt_tmp_static_flag=\"$lt_prog_compiler_static_CXX\" ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5 ++$as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } ++if ${lt_cv_prog_compiler_static_works_CXX+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ lt_cv_prog_compiler_static_works_CXX=no ++ save_LDFLAGS=$LDFLAGS ++ LDFLAGS="$LDFLAGS $lt_tmp_static_flag" ++ echo "$lt_simple_link_test_code" > conftest.$ac_ext ++ if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then ++ # The linker can only warn and ignore the option if not recognized ++ # So say no if there are warnings ++ if test -s conftest.err; then ++ # Append any errors to the config.log. ++ cat conftest.err 1>&5 ++ $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp ++ $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 ++ if diff conftest.exp conftest.er2 >/dev/null; then ++ lt_cv_prog_compiler_static_works_CXX=yes ++ fi ++ else ++ lt_cv_prog_compiler_static_works_CXX=yes ++ fi ++ fi ++ $RM -r conftest* ++ LDFLAGS=$save_LDFLAGS ++ ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works_CXX" >&5 ++$as_echo "$lt_cv_prog_compiler_static_works_CXX" >&6; } ++ ++if test yes = "$lt_cv_prog_compiler_static_works_CXX"; then ++ : ++else ++ lt_prog_compiler_static_CXX= ++fi ++ ++ ++ ++ ++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 ++$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } ++if ${lt_cv_prog_compiler_c_o_CXX+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ lt_cv_prog_compiler_c_o_CXX=no ++ $RM -r conftest 2>/dev/null ++ mkdir conftest ++ cd conftest ++ mkdir out ++ echo "$lt_simple_compile_test_code" > conftest.$ac_ext ++ ++ lt_compiler_flag="-o out/conftest2.$ac_objext" ++ # Insert the option either (1) after the last *FLAGS variable, or ++ # (2) before a word containing "conftest.", or (3) at the end. ++ # Note that $ac_compile itself does not contain backslashes and begins ++ # with a dollar sign (not a hyphen), so the echo should work correctly. ++ lt_compile=`echo "$ac_compile" | $SED \ ++ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ ++ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ ++ -e 's:$: $lt_compiler_flag:'` ++ (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) ++ (eval "$lt_compile" 2>out/conftest.err) ++ ac_status=$? ++ cat out/conftest.err >&5 ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ if (exit $ac_status) && test -s out/conftest2.$ac_objext ++ then ++ # The compiler can only warn and ignore the option if not recognized ++ # So say no if there are warnings ++ $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp ++ $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 ++ if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then ++ lt_cv_prog_compiler_c_o_CXX=yes ++ fi ++ fi ++ chmod u+w . 2>&5 ++ $RM conftest* ++ # SGI C++ compiler will create directory out/ii_files/ for ++ # template instantiation ++ test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files ++ $RM out/* && rmdir out ++ cd .. ++ $RM -r conftest ++ $RM conftest* ++ ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o_CXX" >&5 ++$as_echo "$lt_cv_prog_compiler_c_o_CXX" >&6; } ++ ++ ++ ++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 ++$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } ++if ${lt_cv_prog_compiler_c_o_CXX+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ lt_cv_prog_compiler_c_o_CXX=no ++ $RM -r conftest 2>/dev/null ++ mkdir conftest ++ cd conftest ++ mkdir out ++ echo "$lt_simple_compile_test_code" > conftest.$ac_ext ++ ++ lt_compiler_flag="-o out/conftest2.$ac_objext" ++ # Insert the option either (1) after the last *FLAGS variable, or ++ # (2) before a word containing "conftest.", or (3) at the end. ++ # Note that $ac_compile itself does not contain backslashes and begins ++ # with a dollar sign (not a hyphen), so the echo should work correctly. ++ lt_compile=`echo "$ac_compile" | $SED \ ++ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ ++ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ ++ -e 's:$: $lt_compiler_flag:'` ++ (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) ++ (eval "$lt_compile" 2>out/conftest.err) ++ ac_status=$? ++ cat out/conftest.err >&5 ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ if (exit $ac_status) && test -s out/conftest2.$ac_objext ++ then ++ # The compiler can only warn and ignore the option if not recognized ++ # So say no if there are warnings ++ $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp ++ $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 ++ if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then ++ lt_cv_prog_compiler_c_o_CXX=yes ++ fi ++ fi ++ chmod u+w . 2>&5 ++ $RM conftest* ++ # SGI C++ compiler will create directory out/ii_files/ for ++ # template instantiation ++ test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files ++ $RM out/* && rmdir out ++ cd .. ++ $RM -r conftest ++ $RM conftest* ++ ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o_CXX" >&5 ++$as_echo "$lt_cv_prog_compiler_c_o_CXX" >&6; } ++ ++ ++ ++ ++hard_links=nottested ++if test no = "$lt_cv_prog_compiler_c_o_CXX" && test no != "$need_locks"; then ++ # do not overwrite the value of need_locks provided by the user ++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5 ++$as_echo_n "checking if we can lock with hard links... " >&6; } ++ hard_links=yes ++ $RM conftest* ++ ln conftest.a conftest.b 2>/dev/null && hard_links=no ++ touch conftest.a ++ ln conftest.a conftest.b 2>&5 || hard_links=no ++ ln conftest.a conftest.b 2>/dev/null && hard_links=no ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5 ++$as_echo "$hard_links" >&6; } ++ if test no = "$hard_links"; then ++ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&5 ++$as_echo "$as_me: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&2;} ++ need_locks=warn ++ fi ++else ++ need_locks=no ++fi ++ ++ ++ ++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 ++$as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } ++ ++ export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' ++ exclude_expsyms_CXX='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*' ++ case $host_os in ++ aix[4-9]*) ++ # If we're using GNU nm, then we don't want the "-C" option. ++ # -C means demangle to AIX nm, but means don't demangle with GNU nm ++ # Also, AIX nm treats weak defined symbols like other global defined ++ # symbols, whereas GNU nm marks them as "W". ++ if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then ++ export_symbols_cmds_CXX='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' ++ else ++ export_symbols_cmds_CXX='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' ++ fi ++ ;; ++ pw32*) ++ export_symbols_cmds_CXX=$ltdll_cmds ++ ;; ++ cygwin* | mingw* | cegcc*) ++ case $cc_basename in ++ cl*) ++ exclude_expsyms_CXX='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' ++ ;; ++ *) ++ export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols' ++ exclude_expsyms_CXX='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname' ++ ;; ++ esac ++ ;; ++ *) ++ export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' ++ ;; ++ esac ++ ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs_CXX" >&5 ++$as_echo "$ld_shlibs_CXX" >&6; } ++test no = "$ld_shlibs_CXX" && can_build_shared=no ++ ++with_gnu_ld_CXX=$with_gnu_ld ++ ++ ++ ++ ++ ++ ++# ++# Do we need to explicitly link libc? ++# ++case "x$archive_cmds_need_lc_CXX" in ++x|xyes) ++ # Assume -lc should be added ++ archive_cmds_need_lc_CXX=yes ++ ++ if test yes,yes = "$GCC,$enable_shared"; then ++ case $archive_cmds_CXX in ++ *'~'*) ++ # FIXME: we may have to deal with multi-command sequences. ++ ;; ++ '$CC '*) ++ # Test whether the compiler implicitly links with -lc since on some ++ # systems, -lgcc has to come before -lc. If gcc already passes -lc ++ # to ld, don't add -lc before -lgcc. ++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 ++$as_echo_n "checking whether -lc should be explicitly linked in... " >&6; } ++if ${lt_cv_archive_cmds_need_lc_CXX+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ $RM conftest* ++ echo "$lt_simple_compile_test_code" > conftest.$ac_ext ++ ++ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 ++ (eval $ac_compile) 2>&5 ++ ac_status=$? ++ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 ++ test $ac_status = 0; } 2>conftest.err; then ++ soname=conftest ++ lib=conftest ++ libobjs=conftest.$ac_objext ++ deplibs= ++ wl=$lt_prog_compiler_wl_CXX ++ pic_flag=$lt_prog_compiler_pic_CXX ++ compiler_flags=-v ++ linker_flags=-v ++ verstring= ++ output_objdir=. ++ libname=conftest ++ lt_save_allow_undefined_flag=$allow_undefined_flag_CXX ++ allow_undefined_flag_CXX= ++ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds_CXX 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5 ++ (eval $archive_cmds_CXX 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5 ++ ac_status=$? ++ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 ++ test $ac_status = 0; } ++ then ++ lt_cv_archive_cmds_need_lc_CXX=no ++ else ++ lt_cv_archive_cmds_need_lc_CXX=yes ++ fi ++ allow_undefined_flag_CXX=$lt_save_allow_undefined_flag ++ else ++ cat conftest.err 1>&5 ++ fi ++ $RM conftest* ++ ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc_CXX" >&5 ++$as_echo "$lt_cv_archive_cmds_need_lc_CXX" >&6; } ++ archive_cmds_need_lc_CXX=$lt_cv_archive_cmds_need_lc_CXX ++ ;; ++ esac ++ fi ++ ;; ++esac ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5 ++$as_echo_n "checking dynamic linker characteristics... " >&6; } ++ ++library_names_spec= ++libname_spec='lib$name' ++soname_spec= ++shrext_cmds=.so ++postinstall_cmds= ++postuninstall_cmds= ++finish_cmds= ++finish_eval= ++shlibpath_var= ++shlibpath_overrides_runpath=unknown ++version_type=none ++dynamic_linker="$host_os ld.so" ++sys_lib_dlsearch_path_spec="/lib /usr/lib" ++need_lib_prefix=unknown ++hardcode_into_libs=no ++ ++# when you set need_version to no, make sure it does not cause -set_version ++# flags to be left without arguments ++need_version=unknown ++ ++case $host_os in ++aix3*) ++ version_type=linux # correct to gnu/linux during the next big refactor ++ library_names_spec='$libname$release$shared_ext$versuffix $libname.a' ++ shlibpath_var=LIBPATH ++ ++ # AIX 3 has no versioning support, so we append a major version to the name. ++ soname_spec='$libname$release$shared_ext$major' ++ ;; ++ ++aix[4-9]*) ++ version_type=linux # correct to gnu/linux during the next big refactor ++ need_lib_prefix=no ++ need_version=no ++ hardcode_into_libs=yes ++ if test ia64 = "$host_cpu"; then ++ # AIX 5 supports IA64 ++ library_names_spec='$libname$release$shared_ext$major $libname$release$shared_ext$versuffix $libname$shared_ext' ++ shlibpath_var=LD_LIBRARY_PATH ++ else ++ # With GCC up to 2.95.x, collect2 would create an import file ++ # for dependence libraries. The import file would start with ++ # the line '#! .'. This would cause the generated library to ++ # depend on '.', always an invalid library. This was fixed in ++ # development snapshots of GCC prior to 3.0. ++ case $host_os in ++ aix4 | aix4.[01] | aix4.[01].*) ++ if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' ++ echo ' yes ' ++ echo '#endif'; } | $CC -E - | $GREP yes > /dev/null; then ++ : ++ else ++ can_build_shared=no ++ fi ++ ;; ++ esac ++ # AIX (on Power*) has no versioning support, so currently we cannot hardcode correct ++ # soname into executable. Probably we can add versioning support to ++ # collect2, so additional links can be useful in future. ++ if test yes = "$aix_use_runtimelinking"; then ++ # If using run time linking (on AIX 4.2 or later) use lib.so ++ # instead of lib.a to let people know that these are not ++ # typical AIX shared libraries. ++ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' ++ else ++ # We preserve .a as extension for shared libraries through AIX4.2 ++ # and later when we are not doing run time linking. ++ library_names_spec='$libname$release.a $libname.a' ++ soname_spec='$libname$release$shared_ext$major' ++ fi ++ shlibpath_var=LIBPATH ++ fi ++ ;; ++ ++amigaos*) ++ case $host_cpu in ++ powerpc) ++ # Since July 2007 AmigaOS4 officially supports .so libraries. ++ # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. ++ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' ++ ;; ++ m68k) ++ library_names_spec='$libname.ixlibrary $libname.a' ++ # Create ${libname}_ixlibrary.a entries in /sys/libs. ++ finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ++ ;; ++ esac ++ ;; ++ ++beos*) ++ library_names_spec='$libname$shared_ext' ++ dynamic_linker="$host_os ld.so" ++ shlibpath_var=LIBRARY_PATH ++ ;; ++ ++bsdi[45]*) ++ version_type=linux # correct to gnu/linux during the next big refactor ++ need_version=no ++ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' ++ soname_spec='$libname$release$shared_ext$major' ++ finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' ++ shlibpath_var=LD_LIBRARY_PATH ++ sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" ++ sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" ++ # the default ld.so.conf also contains /usr/contrib/lib and ++ # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow ++ # libtool to hard-code these into programs ++ ;; ++ ++cygwin* | mingw* | pw32* | cegcc*) ++ version_type=windows ++ shrext_cmds=.dll ++ need_version=no ++ need_lib_prefix=no ++ ++ case $GCC,$cc_basename in ++ yes,*) ++ # gcc ++ library_names_spec='$libname.dll.a' ++ # DLL is installed to $(libdir)/../bin by postinstall_cmds ++ postinstall_cmds='base_file=`basename \$file`~ ++ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ ++ dldir=$destdir/`dirname \$dlpath`~ ++ test -d \$dldir || mkdir -p \$dldir~ ++ $install_prog $dir/$dlname \$dldir/$dlname~ ++ chmod a+x \$dldir/$dlname~ ++ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then ++ eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; ++ fi' ++ postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ ++ dlpath=$dir/\$dldll~ ++ $RM \$dlpath' ++ shlibpath_overrides_runpath=yes ++ ++ case $host_os in ++ cygwin*) ++ # Cygwin DLLs use 'cyg' prefix rather than 'lib' ++ soname_spec='`echo $libname | sed -e 's/^lib/cyg/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' ++ ++ ;; ++ mingw* | cegcc*) ++ # MinGW DLLs use traditional 'lib' prefix ++ soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' ++ ;; ++ pw32*) ++ # pw32 DLLs use 'pw' prefix rather than 'lib' ++ library_names_spec='`echo $libname | sed -e 's/^lib/pw/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' ++ ;; ++ esac ++ dynamic_linker='Win32 ld.exe' ++ ;; ++ ++ *,cl*) ++ # Native MSVC ++ libname_spec='$name' ++ soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' ++ library_names_spec='$libname.dll.lib' ++ ++ case $build_os in ++ mingw*) ++ sys_lib_search_path_spec= ++ lt_save_ifs=$IFS ++ IFS=';' ++ for lt_path in $LIB ++ do ++ IFS=$lt_save_ifs ++ # Let DOS variable expansion print the short 8.3 style file name. ++ lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` ++ sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" ++ done ++ IFS=$lt_save_ifs ++ # Convert to MSYS style. ++ sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'` ++ ;; ++ cygwin*) ++ # Convert to unix form, then to dos form, then back to unix form ++ # but this time dos style (no spaces!) so that the unix form looks ++ # like /cygdrive/c/PROGRA~1:/cygdr... ++ sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` ++ sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` ++ sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` ++ ;; ++ *) ++ sys_lib_search_path_spec=$LIB ++ if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then ++ # It is most probably a Windows format PATH. ++ sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` ++ else ++ sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` ++ fi ++ # FIXME: find the short name or the path components, as spaces are ++ # common. (e.g. "Program Files" -> "PROGRA~1") ++ ;; ++ esac ++ ++ # DLL is installed to $(libdir)/../bin by postinstall_cmds ++ postinstall_cmds='base_file=`basename \$file`~ ++ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ ++ dldir=$destdir/`dirname \$dlpath`~ ++ test -d \$dldir || mkdir -p \$dldir~ ++ $install_prog $dir/$dlname \$dldir/$dlname' ++ postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ ++ dlpath=$dir/\$dldll~ ++ $RM \$dlpath' ++ shlibpath_overrides_runpath=yes ++ dynamic_linker='Win32 link.exe' ++ ;; ++ ++ *) ++ # Assume MSVC wrapper ++ library_names_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext $libname.lib' ++ dynamic_linker='Win32 ld.exe' ++ ;; ++ esac ++ # FIXME: first we should search . and the directory the executable is in ++ shlibpath_var=PATH ++ ;; ++ ++darwin* | rhapsody*) ++ dynamic_linker="$host_os dyld" ++ version_type=darwin ++ need_lib_prefix=no ++ need_version=no ++ library_names_spec='$libname$release$major$shared_ext $libname$shared_ext' ++ soname_spec='$libname$release$major$shared_ext' ++ shlibpath_overrides_runpath=yes ++ shlibpath_var=DYLD_LIBRARY_PATH ++ shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' ++ ++ sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ++ ;; ++ ++dgux*) ++ version_type=linux # correct to gnu/linux during the next big refactor ++ need_lib_prefix=no ++ need_version=no ++ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' ++ soname_spec='$libname$release$shared_ext$major' ++ shlibpath_var=LD_LIBRARY_PATH ++ ;; ++ ++freebsd* | dragonfly*) ++ # DragonFly does not have aout. When/if they implement a new ++ # versioning mechanism, adjust this. ++ if test -x /usr/bin/objformat; then ++ objformat=`/usr/bin/objformat` ++ else ++ case $host_os in ++ freebsd[23].*) objformat=aout ;; ++ *) objformat=elf ;; ++ esac ++ fi ++ version_type=freebsd-$objformat ++ case $version_type in ++ freebsd-elf*) ++ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext $libname$shared_ext' ++ need_version=no ++ need_lib_prefix=no ++ ;; ++ freebsd-*) ++ library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' ++ need_version=yes ++ ;; ++ esac ++ shlibpath_var=LD_LIBRARY_PATH ++ case $host_os in ++ freebsd2.*) ++ shlibpath_overrides_runpath=yes ++ ;; ++ freebsd3.[01]* | freebsdelf3.[01]*) ++ shlibpath_overrides_runpath=yes ++ hardcode_into_libs=yes ++ ;; ++ freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ ++ freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) ++ shlibpath_overrides_runpath=no ++ hardcode_into_libs=yes ++ ;; ++ *) # from 4.6 on, and DragonFly ++ shlibpath_overrides_runpath=yes ++ hardcode_into_libs=yes ++ ;; ++ esac ++ ;; ++ ++haiku*) ++ version_type=linux # correct to gnu/linux during the next big refactor ++ need_lib_prefix=no ++ need_version=no ++ dynamic_linker="$host_os runtime_loader" ++ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' ++ soname_spec='$libname$release$shared_ext$major' ++ shlibpath_var=LIBRARY_PATH ++ shlibpath_overrides_runpath=no ++ sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' ++ hardcode_into_libs=yes ++ ;; ++ ++hpux9* | hpux10* | hpux11*) ++ # Give a soname corresponding to the major version so that dld.sl refuses to ++ # link against other versions. ++ version_type=sunos ++ need_lib_prefix=no ++ need_version=no ++ case $host_cpu in ++ ia64*) ++ shrext_cmds='.so' ++ hardcode_into_libs=yes ++ dynamic_linker="$host_os dld.so" ++ shlibpath_var=LD_LIBRARY_PATH ++ shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. ++ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' ++ soname_spec='$libname$release$shared_ext$major' ++ if test 32 = "$HPUX_IA64_MODE"; then ++ sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" ++ else ++ sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" ++ fi ++ sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ++ ;; ++ hppa*64*) ++ shrext_cmds='.sl' ++ hardcode_into_libs=yes ++ dynamic_linker="$host_os dld.sl" ++ shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH ++ shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. ++ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' ++ soname_spec='$libname$release$shared_ext$major' ++ sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" ++ sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ++ ;; ++ *) ++ shrext_cmds='.sl' ++ dynamic_linker="$host_os dld.sl" ++ shlibpath_var=SHLIB_PATH ++ shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH ++ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' ++ soname_spec='$libname$release$shared_ext$major' ++ ;; ++ esac ++ # HP-UX runs *really* slowly unless shared libraries are mode 555, ... ++ postinstall_cmds='chmod 555 $lib' ++ # or fails outright, so override atomically: ++ install_override_mode=555 ++ ;; ++ ++interix[3-9]*) ++ version_type=linux # correct to gnu/linux during the next big refactor ++ need_lib_prefix=no ++ need_version=no ++ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' ++ soname_spec='$libname$release$shared_ext$major' ++ dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' ++ shlibpath_var=LD_LIBRARY_PATH ++ shlibpath_overrides_runpath=no ++ hardcode_into_libs=yes ++ ;; ++ ++irix5* | irix6* | nonstopux*) ++ case $host_os in ++ nonstopux*) version_type=nonstopux ;; ++ *) ++ if test yes = "$lt_cv_prog_gnu_ld"; then ++ version_type=linux # correct to gnu/linux during the next big refactor ++ else ++ version_type=irix ++ fi ;; ++ esac ++ need_lib_prefix=no ++ need_version=no ++ soname_spec='$libname$release$shared_ext$major' ++ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$release$shared_ext $libname$shared_ext' ++ case $host_os in ++ irix5* | nonstopux*) ++ libsuff= shlibsuff= ++ ;; ++ *) ++ case $LD in # libtool.m4 will add one of these switches to LD ++ *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") ++ libsuff= shlibsuff= libmagic=32-bit;; ++ *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") ++ libsuff=32 shlibsuff=N32 libmagic=N32;; ++ *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") ++ libsuff=64 shlibsuff=64 libmagic=64-bit;; ++ *) libsuff= shlibsuff= libmagic=never-match;; ++ esac ++ ;; ++ esac ++ shlibpath_var=LD_LIBRARY${shlibsuff}_PATH ++ shlibpath_overrides_runpath=no ++ sys_lib_search_path_spec="/usr/lib$libsuff /lib$libsuff /usr/local/lib$libsuff" ++ sys_lib_dlsearch_path_spec="/usr/lib$libsuff /lib$libsuff" ++ hardcode_into_libs=yes ++ ;; ++ ++# No shared lib support for Linux oldld, aout, or coff. ++linux*oldld* | linux*aout* | linux*coff*) ++ dynamic_linker=no ++ ;; ++ ++linux*android*) ++ version_type=none # Android doesn't support versioned libraries. ++ need_lib_prefix=no ++ need_version=no ++ library_names_spec='$libname$release$shared_ext' ++ soname_spec='$libname$release$shared_ext' ++ finish_cmds= ++ shlibpath_var=LD_LIBRARY_PATH ++ shlibpath_overrides_runpath=yes ++ ++ # This implies no fast_install, which is unacceptable. ++ # Some rework will be needed to allow for fast_install ++ # before this can be enabled. ++ hardcode_into_libs=yes ++ ++ dynamic_linker='Android linker' ++ # Don't embed -rpath directories since the linker doesn't support them. ++ hardcode_libdir_flag_spec_CXX='-L$libdir' ++ ;; ++ ++# This must be glibc/ELF. ++linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) ++ version_type=linux # correct to gnu/linux during the next big refactor ++ need_lib_prefix=no ++ need_version=no ++ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' ++ soname_spec='$libname$release$shared_ext$major' ++ finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' ++ shlibpath_var=LD_LIBRARY_PATH ++ shlibpath_overrides_runpath=no ++ ++ # Some binutils ld are patched to set DT_RUNPATH ++ if ${lt_cv_shlibpath_overrides_runpath+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ lt_cv_shlibpath_overrides_runpath=no ++ save_LDFLAGS=$LDFLAGS ++ save_libdir=$libdir ++ eval "libdir=/foo; wl=\"$lt_prog_compiler_wl_CXX\"; \ ++ LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec_CXX\"" ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++ ++int ++main () ++{ ++ ++ ; ++ return 0; ++} ++_ACEOF ++if ac_fn_cxx_try_link "$LINENO"; then : ++ if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then : ++ lt_cv_shlibpath_overrides_runpath=yes ++fi ++fi ++rm -f core conftest.err conftest.$ac_objext \ ++ conftest$ac_exeext conftest.$ac_ext ++ LDFLAGS=$save_LDFLAGS ++ libdir=$save_libdir ++ ++fi ++ ++ shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath ++ ++ # This implies no fast_install, which is unacceptable. ++ # Some rework will be needed to allow for fast_install ++ # before this can be enabled. ++ hardcode_into_libs=yes ++ ++ # Append ld.so.conf contents to the search path ++ if test -f /etc/ld.so.conf; then ++ lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` ++ sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" ++ fi ++ ++ # We used to test for /lib/ld.so.1 and disable shared libraries on ++ # powerpc, because MkLinux only supported shared libraries with the ++ # GNU dynamic linker. Since this was broken with cross compilers, ++ # most powerpc-linux boxes support dynamic linking these days and ++ # people can always --disable-shared, the test was removed, and we ++ # assume the GNU/Linux dynamic linker is in use. ++ dynamic_linker='GNU/Linux ld.so' ++ ;; ++ ++netbsd*) ++ version_type=sunos ++ need_lib_prefix=no ++ need_version=no ++ if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then ++ library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' ++ finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' ++ dynamic_linker='NetBSD (a.out) ld.so' ++ else ++ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' ++ soname_spec='$libname$release$shared_ext$major' ++ dynamic_linker='NetBSD ld.elf_so' ++ fi ++ shlibpath_var=LD_LIBRARY_PATH ++ shlibpath_overrides_runpath=yes ++ hardcode_into_libs=yes ++ ;; ++ ++newsos6) ++ version_type=linux # correct to gnu/linux during the next big refactor ++ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' ++ shlibpath_var=LD_LIBRARY_PATH ++ shlibpath_overrides_runpath=yes ++ ;; ++ ++*nto* | *qnx*) ++ version_type=qnx ++ need_lib_prefix=no ++ need_version=no ++ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' ++ soname_spec='$libname$release$shared_ext$major' ++ shlibpath_var=LD_LIBRARY_PATH ++ shlibpath_overrides_runpath=no ++ hardcode_into_libs=yes ++ dynamic_linker='ldqnx.so' ++ ;; ++ ++openbsd* | bitrig*) ++ version_type=sunos ++ sys_lib_dlsearch_path_spec=/usr/lib ++ need_lib_prefix=no ++ if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then ++ need_version=no ++ else ++ need_version=yes ++ fi ++ library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' ++ finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' ++ shlibpath_var=LD_LIBRARY_PATH ++ shlibpath_overrides_runpath=yes ++ ;; ++ ++os2*) ++ libname_spec='$name' ++ shrext_cmds=.dll ++ need_lib_prefix=no ++ library_names_spec='$libname$shared_ext $libname.a' ++ dynamic_linker='OS/2 ld.exe' ++ shlibpath_var=LIBPATH ++ ;; ++ ++osf3* | osf4* | osf5*) ++ version_type=osf ++ need_lib_prefix=no ++ need_version=no ++ soname_spec='$libname$release$shared_ext$major' ++ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' ++ shlibpath_var=LD_LIBRARY_PATH ++ sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" ++ sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ++ ;; ++ ++rdos*) ++ dynamic_linker=no ++ ;; ++ ++solaris*) ++ version_type=linux # correct to gnu/linux during the next big refactor ++ need_lib_prefix=no ++ need_version=no ++ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' ++ soname_spec='$libname$release$shared_ext$major' ++ shlibpath_var=LD_LIBRARY_PATH ++ shlibpath_overrides_runpath=yes ++ hardcode_into_libs=yes ++ # ldd complains unless libraries are executable ++ postinstall_cmds='chmod +x $lib' ++ ;; ++ ++sunos4*) ++ version_type=sunos ++ library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' ++ finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' ++ shlibpath_var=LD_LIBRARY_PATH ++ shlibpath_overrides_runpath=yes ++ if test yes = "$with_gnu_ld"; then ++ need_lib_prefix=no ++ fi ++ need_version=yes ++ ;; ++ ++sysv4 | sysv4.3*) ++ version_type=linux # correct to gnu/linux during the next big refactor ++ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' ++ soname_spec='$libname$release$shared_ext$major' ++ shlibpath_var=LD_LIBRARY_PATH ++ case $host_vendor in ++ sni) ++ shlibpath_overrides_runpath=no ++ need_lib_prefix=no ++ runpath_var=LD_RUN_PATH ++ ;; ++ siemens) ++ need_lib_prefix=no ++ ;; ++ motorola) ++ need_lib_prefix=no ++ need_version=no ++ shlibpath_overrides_runpath=no ++ sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ++ ;; ++ esac ++ ;; ++ ++sysv4*MP*) ++ if test -d /usr/nec; then ++ version_type=linux # correct to gnu/linux during the next big refactor ++ library_names_spec='$libname$shared_ext.$versuffix $libname$shared_ext.$major $libname$shared_ext' ++ soname_spec='$libname$shared_ext.$major' ++ shlibpath_var=LD_LIBRARY_PATH ++ fi ++ ;; ++ ++sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) ++ version_type=freebsd-elf ++ need_lib_prefix=no ++ need_version=no ++ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext $libname$shared_ext' ++ soname_spec='$libname$release$shared_ext$major' ++ shlibpath_var=LD_LIBRARY_PATH ++ shlibpath_overrides_runpath=yes ++ hardcode_into_libs=yes ++ if test yes = "$with_gnu_ld"; then ++ sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' ++ else ++ sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' ++ case $host_os in ++ sco3.2v5*) ++ sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" ++ ;; ++ esac ++ fi ++ sys_lib_dlsearch_path_spec='/usr/lib' ++ ;; ++ ++tpf*) ++ # TPF is a cross-target only. Preferred cross-host = GNU/Linux. ++ version_type=linux # correct to gnu/linux during the next big refactor ++ need_lib_prefix=no ++ need_version=no ++ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' ++ shlibpath_var=LD_LIBRARY_PATH ++ shlibpath_overrides_runpath=no ++ hardcode_into_libs=yes ++ ;; ++ ++uts4*) ++ version_type=linux # correct to gnu/linux during the next big refactor ++ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' ++ soname_spec='$libname$release$shared_ext$major' ++ shlibpath_var=LD_LIBRARY_PATH ++ ;; ++ ++*) ++ dynamic_linker=no ++ ;; ++esac ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5 ++$as_echo "$dynamic_linker" >&6; } ++test no = "$dynamic_linker" && can_build_shared=no ++ ++variables_saved_for_relink="PATH $shlibpath_var $runpath_var" ++if test yes = "$GCC"; then ++ variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" ++fi ++ ++if test set = "${lt_cv_sys_lib_search_path_spec+set}"; then ++ sys_lib_search_path_spec=$lt_cv_sys_lib_search_path_spec ++fi ++if test set = "${lt_cv_sys_lib_dlsearch_path_spec+set}"; then ++ sys_lib_dlsearch_path_spec=$lt_cv_sys_lib_dlsearch_path_spec ++fi ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5 ++$as_echo_n "checking how to hardcode library paths into programs... " >&6; } ++hardcode_action_CXX= ++if test -n "$hardcode_libdir_flag_spec_CXX" || ++ test -n "$runpath_var_CXX" || ++ test yes = "$hardcode_automatic_CXX"; then ++ ++ # We can hardcode non-existent directories. ++ if test no != "$hardcode_direct_CXX" && ++ # If the only mechanism to avoid hardcoding is shlibpath_var, we ++ # have to relink, otherwise we might link with an installed library ++ # when we should be linking with a yet-to-be-installed one ++ ## test no != "$_LT_TAGVAR(hardcode_shlibpath_var, CXX)" && ++ test no != "$hardcode_minus_L_CXX"; then ++ # Linking always hardcodes the temporary library directory. ++ hardcode_action_CXX=relink ++ else ++ # We can link without hardcoding, and we can hardcode nonexisting dirs. ++ hardcode_action_CXX=immediate ++ fi ++else ++ # We cannot hardcode anything, or else we can only hardcode existing ++ # directories. ++ hardcode_action_CXX=unsupported ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action_CXX" >&5 ++$as_echo "$hardcode_action_CXX" >&6; } ++ ++if test relink = "$hardcode_action_CXX" || ++ test yes = "$inherit_rpath_CXX"; then ++ # Fast installation is not supported ++ enable_fast_install=no ++elif test yes = "$shlibpath_overrides_runpath" || ++ test no = "$enable_shared"; then ++ # Fast installation is not necessary ++ enable_fast_install=needless ++fi ++ ++ ++ ++ ++ ++ ++ ++ fi # test -n "$compiler" ++ ++ CC=$lt_save_CC ++ CFLAGS=$lt_save_CFLAGS ++ LDCXX=$LD ++ LD=$lt_save_LD ++ GCC=$lt_save_GCC ++ with_gnu_ld=$lt_save_with_gnu_ld ++ lt_cv_path_LDCXX=$lt_cv_path_LD ++ lt_cv_path_LD=$lt_save_path_LD ++ lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld ++ lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld ++fi # test yes != "$_lt_caught_CXX_error" ++ ++ac_ext=c ++ac_cpp='$CPP $CPPFLAGS' ++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 + + + +@@ -12811,7 +16674,7 @@ + + + cputype=`(((grep cpu /proc/cpuinfo | cut -d: -f2) ; ($PRTDIAG -v |grep -i sparc) ; grep -i cpu /var/run/dmesg.boot ) | head -n 1) 2> /dev/null` +- cputype=`echo "$cputype" | tr -d ' -' |tr $as_cr_LETTERS $as_cr_letters` ++ cputype=`echo "$cputype" | tr -d ' -' | sed 's/SPARCIIi/SPARCII/' | tr $as_cr_LETTERS $as_cr_letters` + case $cputype in + *ultrasparciv*) ax_gcc_arch="ultrasparc4 ultrasparc3 ultrasparc v9" ;; + *ultrasparciii*) ax_gcc_arch="ultrasparc3 ultrasparc v9" ;; +@@ -13082,12 +16945,12 @@ + + if test "x$GCC" = "xyes"; then + CFLAGS="$CFLAGS -fexceptions" +- touch local.exp +-else +- cat > local.exp < local.exp <&5 +@@ -13288,6 +17151,7 @@ + + + TARGETDIR="unknown" ++HAVE_LONG_DOUBLE_VARIANT=0 + case "$host" in + aarch64*-*-*) + TARGET=AARCH64; TARGETDIR=aarch64 +@@ -13299,6 +17163,10 @@ + HAVE_LONG_DOUBLE='defined(__LONG_DOUBLE_128__)' + ;; + ++ arc*-*-*) ++ TARGET=ARC; TARGETDIR=arc ++ ;; ++ + arm*-*-*) + TARGET=ARM; TARGETDIR=arm + ;; +@@ -13417,6 +17285,10 @@ + TARGET=M68K; TARGETDIR=m68k + ;; + ++ m88k-*-*) ++ TARGET=M88K; TARGETDIR=m88k ++ ;; ++ + microblaze*-*-*) + TARGET=MICROBLAZE; TARGETDIR=microblaze + ;; +@@ -13432,14 +17304,19 @@ + mips-sgi-irix5.* | mips-sgi-irix6.* | mips*-*-rtems*) + TARGET=MIPS_IRIX; TARGETDIR=mips + ;; +- mips*-*-linux* | mips*-*-openbsd*) ++ mips*-*linux* | mips*-*-openbsd*) + # Support 128-bit long double for NewABI. + HAVE_LONG_DOUBLE='defined(__mips64)' +- TARGET=MIPS_IRIX; TARGETDIR=mips ++ TARGET=MIPS_LINUX; TARGETDIR=mips ++ ;; ++ ++ nios2*-linux*) ++ TARGET=NIOS2; TARGETDIR=nios2 + ;; + + powerpc*-*-linux* | powerpc-*-sysv*) + TARGET=POWERPC; TARGETDIR=powerpc ++ HAVE_LONG_DOUBLE_VARIANT=1 + ;; + powerpc-*-amigaos*) + TARGET=POWERPC; TARGETDIR=powerpc +@@ -13455,6 +17332,7 @@ + ;; + powerpc-*-freebsd* | powerpc-*-openbsd*) + TARGET=POWERPC_FREEBSD; TARGETDIR=powerpc ++ HAVE_LONG_DOUBLE_VARIANT=1 + ;; + powerpc64-*-freebsd*) + TARGET=POWERPC; TARGETDIR=powerpc +@@ -13482,6 +17360,10 @@ + TARGET=TILE; TARGETDIR=tile + ;; + ++ vax-*-*) ++ TARGET=VAX; TARGETDIR=vax ++ ;; ++ + xtensa*-*) + TARGET=XTENSA; TARGETDIR=xtensa + ;; +@@ -13559,6 +17441,22 @@ + X86_DARWIN_FALSE= + fi + ++ if test x$TARGET = xX86_DARWIN && test $ac_cv_sizeof_size_t = 4; then ++ X86_DARWIN32_TRUE= ++ X86_DARWIN32_FALSE='#' ++else ++ X86_DARWIN32_TRUE='#' ++ X86_DARWIN32_FALSE= ++fi ++ ++ if test x$TARGET = xX86_DARWIN && test $ac_cv_sizeof_size_t = 8; then ++ X86_DARWIN64_TRUE= ++ X86_DARWIN64_FALSE='#' ++else ++ X86_DARWIN64_TRUE='#' ++ X86_DARWIN64_FALSE= ++fi ++ + if test x$TARGET = xALPHA; then + ALPHA_TRUE= + ALPHA_FALSE='#' +@@ -13591,6 +17489,14 @@ + M68K_FALSE= + fi + ++ if test x$TARGET = xM88K; then ++ M88K_TRUE= ++ M88K_FALSE='#' ++else ++ M88K_TRUE='#' ++ M88K_FALSE= ++fi ++ + if test x$TARGET = xMICROBLAZE; then + MICROBLAZE_TRUE= + MICROBLAZE_FALSE='#' +@@ -13615,6 +17521,14 @@ + MOXIE_FALSE= + fi + ++ if test x$TARGET = xNIOS2; then ++ NIOS2_TRUE= ++ NIOS2_FALSE='#' ++else ++ NIOS2_TRUE='#' ++ NIOS2_FALSE= ++fi ++ + if test x$TARGET = xPOWERPC; then + POWERPC_TRUE= + POWERPC_FALSE='#' +@@ -13655,6 +17569,14 @@ + AARCH64_FALSE= + fi + ++ if test x$TARGET = xARC; then ++ ARC_TRUE= ++ ARC_FALSE='#' ++else ++ ARC_TRUE='#' ++ ARC_FALSE= ++fi ++ + if test x$TARGET = xARM; then + ARM_TRUE= + ARM_FALSE='#' +@@ -13751,6 +17673,14 @@ + TILE_FALSE= + fi + ++ if test x$TARGET = xVAX; then ++ VAX_TRUE= ++ VAX_FALSE='#' ++else ++ VAX_TRUE='#' ++ VAX_FALSE= ++fi ++ + if test x$TARGET = xXTENSA; then + XTENSA_TRUE= + XTENSA_FALSE='#' +@@ -14151,15 +18081,23 @@ + # Also AC_SUBST this variable for ffi.h. + if test -z "$HAVE_LONG_DOUBLE"; then + HAVE_LONG_DOUBLE=0 +- if test $ac_cv_sizeof_double != $ac_cv_sizeof_long_double; then +- if test $ac_cv_sizeof_long_double != 0; then ++ if test $ac_cv_sizeof_long_double != 0; then ++ if test $HAVE_LONG_DOUBLE_VARIANT != 0; then ++ ++$as_echo "#define HAVE_LONG_DOUBLE_VARIANT 1" >>confdefs.h ++ + HAVE_LONG_DOUBLE=1 ++ else ++ if test $ac_cv_sizeof_double != $ac_cv_sizeof_long_double; then ++ HAVE_LONG_DOUBLE=1 + + $as_echo "#define HAVE_LONG_DOUBLE 1" >>confdefs.h + +- fi +- fi +-fi ++ fi ++ fi ++ fi ++fi ++ + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether byte ordering is bigendian" >&5 +@@ -14602,8 +18540,7 @@ + fi + + +-if test x$TARGET = xX86_WIN64; then +- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _ prefix in compiled symbols" >&5 ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for _ prefix in compiled symbols" >&5 + $as_echo_n "checking for _ prefix in compiled symbols... " >&6; } + if ${lt_cv_sys_symbol_underscore+:} false; then : + $as_echo_n "(cached) " >&6 +@@ -14650,11 +18587,10 @@ + sys_symbol_underscore=$lt_cv_sys_symbol_underscore + + +- if test "x$sys_symbol_underscore" = xyes; then ++if test "x$sys_symbol_underscore" = xyes; then + + $as_echo "#define SYMBOL_UNDERSCORE 1" >>confdefs.h + +- fi + fi + + FFI_EXEC_TRAMPOLINE_TABLE=0 +@@ -14682,16 +18618,32 @@ + + + if test x$TARGET = xX86_64; then +- { $as_echo "$as_me:${as_lineno-$LINENO}: checking assembler supports unwind section type" >&5 +-$as_echo_n "checking assembler supports unwind section type... " >&6; } ++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking toolchain supports unwind section type" >&5 ++$as_echo_n "checking toolchain supports unwind section type... " >&6; } + if ${libffi_cv_as_x86_64_unwind_section_type+:} false; then : + $as_echo_n "(cached) " >&6 + else + +- libffi_cv_as_x86_64_unwind_section_type=yes +- echo '.section .eh_frame,"a",@unwind' > conftest.s +- if $CC $CFLAGS -c conftest.s 2>&1 | grep -i warning > /dev/null; then +- libffi_cv_as_x86_64_unwind_section_type=no ++ cat > conftest1.s << EOF ++.text ++.globl foo ++foo: ++jmp bar ++.section .eh_frame,"a",@unwind ++bar: ++EOF ++ ++ cat > conftest2.c << EOF ++extern void foo(); ++int main(){foo();} ++EOF ++ ++ libffi_cv_as_x86_64_unwind_section_type=no ++ # we ensure that we can compile _and_ link an assembly file containing an @unwind section ++ # since the compiler can support it and not the linker (ie old binutils) ++ if $CC -Wa,--fatal-warnings $CFLAGS -c conftest1.s > /dev/null 2>&1 && \ ++ $CC conftest2.c conftest1.o > /dev/null 2>&1 ; then ++ libffi_cv_as_x86_64_unwind_section_type=yes + fi + + fi +@@ -14844,7 +18796,7 @@ + toolexecdir='$(libdir)/gcc-lib/$(target_alias)' + toolexeclibdir='$(libdir)' + fi +- multi_os_directory=`$CC -print-multi-os-directory` ++ multi_os_directory=`$CC $CFLAGS -print-multi-os-directory` + case $multi_os_directory in + .) ;; # Avoid trailing /. + ../*) toolexeclibdir=$toolexeclibdir/$multi_os_directory ;; +@@ -15005,6 +18957,10 @@ + as_fn_error $? "conditional \"am__fastdepCC\" was never defined. + Usually this means the macro was only invoked conditionally." "$LINENO" 5 + fi ++if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then ++ as_fn_error $? "conditional \"am__fastdepCXX\" was never defined. ++Usually this means the macro was only invoked conditionally." "$LINENO" 5 ++fi + if test -z "${am__fastdepCCAS_TRUE}" && test -z "${am__fastdepCCAS_FALSE}"; then + as_fn_error $? "conditional \"am__fastdepCCAS\" was never defined. + Usually this means the macro was only invoked conditionally." "$LINENO" 5 +@@ -15049,6 +19005,14 @@ + as_fn_error $? "conditional \"X86_DARWIN\" was never defined. + Usually this means the macro was only invoked conditionally." "$LINENO" 5 + fi ++if test -z "${X86_DARWIN32_TRUE}" && test -z "${X86_DARWIN32_FALSE}"; then ++ as_fn_error $? "conditional \"X86_DARWIN32\" was never defined. ++Usually this means the macro was only invoked conditionally." "$LINENO" 5 ++fi ++if test -z "${X86_DARWIN64_TRUE}" && test -z "${X86_DARWIN64_FALSE}"; then ++ as_fn_error $? "conditional \"X86_DARWIN64\" was never defined. ++Usually this means the macro was only invoked conditionally." "$LINENO" 5 ++fi + if test -z "${ALPHA_TRUE}" && test -z "${ALPHA_FALSE}"; then + as_fn_error $? "conditional \"ALPHA\" was never defined. + Usually this means the macro was only invoked conditionally." "$LINENO" 5 +@@ -15065,6 +19029,10 @@ + as_fn_error $? "conditional \"M68K\" was never defined. + Usually this means the macro was only invoked conditionally." "$LINENO" 5 + fi ++if test -z "${M88K_TRUE}" && test -z "${M88K_FALSE}"; then ++ as_fn_error $? "conditional \"M88K\" was never defined. ++Usually this means the macro was only invoked conditionally." "$LINENO" 5 ++fi + if test -z "${MICROBLAZE_TRUE}" && test -z "${MICROBLAZE_FALSE}"; then + as_fn_error $? "conditional \"MICROBLAZE\" was never defined. + Usually this means the macro was only invoked conditionally." "$LINENO" 5 +@@ -15077,6 +19045,10 @@ + as_fn_error $? "conditional \"MOXIE\" was never defined. + Usually this means the macro was only invoked conditionally." "$LINENO" 5 + fi ++if test -z "${NIOS2_TRUE}" && test -z "${NIOS2_FALSE}"; then ++ as_fn_error $? "conditional \"NIOS2\" was never defined. ++Usually this means the macro was only invoked conditionally." "$LINENO" 5 ++fi + if test -z "${POWERPC_TRUE}" && test -z "${POWERPC_FALSE}"; then + as_fn_error $? "conditional \"POWERPC\" was never defined. + Usually this means the macro was only invoked conditionally." "$LINENO" 5 +@@ -15097,6 +19069,10 @@ + as_fn_error $? "conditional \"AARCH64\" was never defined. + Usually this means the macro was only invoked conditionally." "$LINENO" 5 + fi ++if test -z "${ARC_TRUE}" && test -z "${ARC_FALSE}"; then ++ as_fn_error $? "conditional \"ARC\" was never defined. ++Usually this means the macro was only invoked conditionally." "$LINENO" 5 ++fi + if test -z "${ARM_TRUE}" && test -z "${ARM_FALSE}"; then + as_fn_error $? "conditional \"ARM\" was never defined. + Usually this means the macro was only invoked conditionally." "$LINENO" 5 +@@ -15145,6 +19121,10 @@ + as_fn_error $? "conditional \"TILE\" was never defined. + Usually this means the macro was only invoked conditionally." "$LINENO" 5 + fi ++if test -z "${VAX_TRUE}" && test -z "${VAX_FALSE}"; then ++ as_fn_error $? "conditional \"VAX\" was never defined. ++Usually this means the macro was only invoked conditionally." "$LINENO" 5 ++fi + if test -z "${XTENSA_TRUE}" && test -z "${XTENSA_FALSE}"; then + as_fn_error $? "conditional \"XTENSA\" was never defined. + Usually this means the macro was only invoked conditionally." "$LINENO" 5 +@@ -15559,7 +19539,7 @@ + # report actual input values of CONFIG_FILES etc. instead of their + # values after options handling. + ac_log=" +-This file was extended by libffi $as_me 3.0.13, which was ++This file was extended by libffi $as_me 3.1, which was + generated by GNU Autoconf 2.69. Invocation command line was + + CONFIG_FILES = $CONFIG_FILES +@@ -15629,7 +19609,7 @@ + cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 + ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" + ac_cs_version="\\ +-libffi config.status 3.0.13 ++libffi config.status 3.1 + configured by $0, generated by GNU Autoconf 2.69, + with options \\"\$ac_cs_config\\" + +@@ -15821,8 +19801,10 @@ + GCC='`$ECHO "$GCC" | $SED "$delay_single_quote_subst"`' + lt_cv_sys_global_symbol_pipe='`$ECHO "$lt_cv_sys_global_symbol_pipe" | $SED "$delay_single_quote_subst"`' + lt_cv_sys_global_symbol_to_cdecl='`$ECHO "$lt_cv_sys_global_symbol_to_cdecl" | $SED "$delay_single_quote_subst"`' ++lt_cv_sys_global_symbol_to_import='`$ECHO "$lt_cv_sys_global_symbol_to_import" | $SED "$delay_single_quote_subst"`' + lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address" | $SED "$delay_single_quote_subst"`' + lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $SED "$delay_single_quote_subst"`' ++lt_cv_nm_interface='`$ECHO "$lt_cv_nm_interface" | $SED "$delay_single_quote_subst"`' + nm_file_list_spec='`$ECHO "$nm_file_list_spec" | $SED "$delay_single_quote_subst"`' + lt_sysroot='`$ECHO "$lt_sysroot" | $SED "$delay_single_quote_subst"`' + objdir='`$ECHO "$objdir" | $SED "$delay_single_quote_subst"`' +@@ -15896,6 +19878,60 @@ + enable_dlopen_self_static='`$ECHO "$enable_dlopen_self_static" | $SED "$delay_single_quote_subst"`' + old_striplib='`$ECHO "$old_striplib" | $SED "$delay_single_quote_subst"`' + striplib='`$ECHO "$striplib" | $SED "$delay_single_quote_subst"`' ++compiler_lib_search_dirs='`$ECHO "$compiler_lib_search_dirs" | $SED "$delay_single_quote_subst"`' ++predep_objects='`$ECHO "$predep_objects" | $SED "$delay_single_quote_subst"`' ++postdep_objects='`$ECHO "$postdep_objects" | $SED "$delay_single_quote_subst"`' ++predeps='`$ECHO "$predeps" | $SED "$delay_single_quote_subst"`' ++postdeps='`$ECHO "$postdeps" | $SED "$delay_single_quote_subst"`' ++compiler_lib_search_path='`$ECHO "$compiler_lib_search_path" | $SED "$delay_single_quote_subst"`' ++LD_CXX='`$ECHO "$LD_CXX" | $SED "$delay_single_quote_subst"`' ++reload_flag_CXX='`$ECHO "$reload_flag_CXX" | $SED "$delay_single_quote_subst"`' ++reload_cmds_CXX='`$ECHO "$reload_cmds_CXX" | $SED "$delay_single_quote_subst"`' ++old_archive_cmds_CXX='`$ECHO "$old_archive_cmds_CXX" | $SED "$delay_single_quote_subst"`' ++compiler_CXX='`$ECHO "$compiler_CXX" | $SED "$delay_single_quote_subst"`' ++GCC_CXX='`$ECHO "$GCC_CXX" | $SED "$delay_single_quote_subst"`' ++lt_prog_compiler_no_builtin_flag_CXX='`$ECHO "$lt_prog_compiler_no_builtin_flag_CXX" | $SED "$delay_single_quote_subst"`' ++lt_prog_compiler_pic_CXX='`$ECHO "$lt_prog_compiler_pic_CXX" | $SED "$delay_single_quote_subst"`' ++lt_prog_compiler_wl_CXX='`$ECHO "$lt_prog_compiler_wl_CXX" | $SED "$delay_single_quote_subst"`' ++lt_prog_compiler_static_CXX='`$ECHO "$lt_prog_compiler_static_CXX" | $SED "$delay_single_quote_subst"`' ++lt_cv_prog_compiler_c_o_CXX='`$ECHO "$lt_cv_prog_compiler_c_o_CXX" | $SED "$delay_single_quote_subst"`' ++archive_cmds_need_lc_CXX='`$ECHO "$archive_cmds_need_lc_CXX" | $SED "$delay_single_quote_subst"`' ++enable_shared_with_static_runtimes_CXX='`$ECHO "$enable_shared_with_static_runtimes_CXX" | $SED "$delay_single_quote_subst"`' ++export_dynamic_flag_spec_CXX='`$ECHO "$export_dynamic_flag_spec_CXX" | $SED "$delay_single_quote_subst"`' ++whole_archive_flag_spec_CXX='`$ECHO "$whole_archive_flag_spec_CXX" | $SED "$delay_single_quote_subst"`' ++compiler_needs_object_CXX='`$ECHO "$compiler_needs_object_CXX" | $SED "$delay_single_quote_subst"`' ++old_archive_from_new_cmds_CXX='`$ECHO "$old_archive_from_new_cmds_CXX" | $SED "$delay_single_quote_subst"`' ++old_archive_from_expsyms_cmds_CXX='`$ECHO "$old_archive_from_expsyms_cmds_CXX" | $SED "$delay_single_quote_subst"`' ++archive_cmds_CXX='`$ECHO "$archive_cmds_CXX" | $SED "$delay_single_quote_subst"`' ++archive_expsym_cmds_CXX='`$ECHO "$archive_expsym_cmds_CXX" | $SED "$delay_single_quote_subst"`' ++module_cmds_CXX='`$ECHO "$module_cmds_CXX" | $SED "$delay_single_quote_subst"`' ++module_expsym_cmds_CXX='`$ECHO "$module_expsym_cmds_CXX" | $SED "$delay_single_quote_subst"`' ++with_gnu_ld_CXX='`$ECHO "$with_gnu_ld_CXX" | $SED "$delay_single_quote_subst"`' ++allow_undefined_flag_CXX='`$ECHO "$allow_undefined_flag_CXX" | $SED "$delay_single_quote_subst"`' ++no_undefined_flag_CXX='`$ECHO "$no_undefined_flag_CXX" | $SED "$delay_single_quote_subst"`' ++hardcode_libdir_flag_spec_CXX='`$ECHO "$hardcode_libdir_flag_spec_CXX" | $SED "$delay_single_quote_subst"`' ++hardcode_libdir_separator_CXX='`$ECHO "$hardcode_libdir_separator_CXX" | $SED "$delay_single_quote_subst"`' ++hardcode_direct_CXX='`$ECHO "$hardcode_direct_CXX" | $SED "$delay_single_quote_subst"`' ++hardcode_direct_absolute_CXX='`$ECHO "$hardcode_direct_absolute_CXX" | $SED "$delay_single_quote_subst"`' ++hardcode_minus_L_CXX='`$ECHO "$hardcode_minus_L_CXX" | $SED "$delay_single_quote_subst"`' ++hardcode_shlibpath_var_CXX='`$ECHO "$hardcode_shlibpath_var_CXX" | $SED "$delay_single_quote_subst"`' ++hardcode_automatic_CXX='`$ECHO "$hardcode_automatic_CXX" | $SED "$delay_single_quote_subst"`' ++inherit_rpath_CXX='`$ECHO "$inherit_rpath_CXX" | $SED "$delay_single_quote_subst"`' ++link_all_deplibs_CXX='`$ECHO "$link_all_deplibs_CXX" | $SED "$delay_single_quote_subst"`' ++always_export_symbols_CXX='`$ECHO "$always_export_symbols_CXX" | $SED "$delay_single_quote_subst"`' ++export_symbols_cmds_CXX='`$ECHO "$export_symbols_cmds_CXX" | $SED "$delay_single_quote_subst"`' ++exclude_expsyms_CXX='`$ECHO "$exclude_expsyms_CXX" | $SED "$delay_single_quote_subst"`' ++include_expsyms_CXX='`$ECHO "$include_expsyms_CXX" | $SED "$delay_single_quote_subst"`' ++prelink_cmds_CXX='`$ECHO "$prelink_cmds_CXX" | $SED "$delay_single_quote_subst"`' ++postlink_cmds_CXX='`$ECHO "$postlink_cmds_CXX" | $SED "$delay_single_quote_subst"`' ++file_list_spec_CXX='`$ECHO "$file_list_spec_CXX" | $SED "$delay_single_quote_subst"`' ++hardcode_action_CXX='`$ECHO "$hardcode_action_CXX" | $SED "$delay_single_quote_subst"`' ++compiler_lib_search_dirs_CXX='`$ECHO "$compiler_lib_search_dirs_CXX" | $SED "$delay_single_quote_subst"`' ++predep_objects_CXX='`$ECHO "$predep_objects_CXX" | $SED "$delay_single_quote_subst"`' ++postdep_objects_CXX='`$ECHO "$postdep_objects_CXX" | $SED "$delay_single_quote_subst"`' ++predeps_CXX='`$ECHO "$predeps_CXX" | $SED "$delay_single_quote_subst"`' ++postdeps_CXX='`$ECHO "$postdeps_CXX" | $SED "$delay_single_quote_subst"`' ++compiler_lib_search_path_CXX='`$ECHO "$compiler_lib_search_path_CXX" | $SED "$delay_single_quote_subst"`' + + LTCC='$LTCC' + LTCFLAGS='$LTCFLAGS' +@@ -15940,8 +19976,10 @@ + compiler \ + lt_cv_sys_global_symbol_pipe \ + lt_cv_sys_global_symbol_to_cdecl \ ++lt_cv_sys_global_symbol_to_import \ + lt_cv_sys_global_symbol_to_c_name_address \ + lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \ ++lt_cv_nm_interface \ + nm_file_list_spec \ + lt_prog_compiler_no_builtin_flag \ + lt_prog_compiler_pic \ +@@ -15974,10 +20012,41 @@ + install_override_mode \ + finish_eval \ + old_striplib \ +-striplib; do ++striplib \ ++compiler_lib_search_dirs \ ++predep_objects \ ++postdep_objects \ ++predeps \ ++postdeps \ ++compiler_lib_search_path \ ++LD_CXX \ ++reload_flag_CXX \ ++compiler_CXX \ ++lt_prog_compiler_no_builtin_flag_CXX \ ++lt_prog_compiler_pic_CXX \ ++lt_prog_compiler_wl_CXX \ ++lt_prog_compiler_static_CXX \ ++lt_cv_prog_compiler_c_o_CXX \ ++export_dynamic_flag_spec_CXX \ ++whole_archive_flag_spec_CXX \ ++compiler_needs_object_CXX \ ++with_gnu_ld_CXX \ ++allow_undefined_flag_CXX \ ++no_undefined_flag_CXX \ ++hardcode_libdir_flag_spec_CXX \ ++hardcode_libdir_separator_CXX \ ++exclude_expsyms_CXX \ ++include_expsyms_CXX \ ++file_list_spec_CXX \ ++compiler_lib_search_dirs_CXX \ ++predep_objects_CXX \ ++postdep_objects_CXX \ ++predeps_CXX \ ++postdeps_CXX \ ++compiler_lib_search_path_CXX; do + case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in + *[\\\\\\\`\\"\\\$]*) +- eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ++ eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes + ;; + *) + eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" +@@ -16004,10 +20073,21 @@ + postuninstall_cmds \ + finish_cmds \ + sys_lib_search_path_spec \ +-sys_lib_dlsearch_path_spec; do ++sys_lib_dlsearch_path_spec \ ++reload_cmds_CXX \ ++old_archive_cmds_CXX \ ++old_archive_from_new_cmds_CXX \ ++old_archive_from_expsyms_cmds_CXX \ ++archive_cmds_CXX \ ++archive_expsym_cmds_CXX \ ++module_cmds_CXX \ ++module_expsym_cmds_CXX \ ++export_symbols_cmds_CXX \ ++prelink_cmds_CXX \ ++postlink_cmds_CXX; do + case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in + *[\\\\\\\`\\"\\\$]*) +- eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ++ eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes + ;; + *) + eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" +@@ -16016,24 +20096,23 @@ + done + + ac_aux_dir='$ac_aux_dir' +-xsi_shell='$xsi_shell' +-lt_shell_append='$lt_shell_append' +- +-# See if we are running on zsh, and set the options which allow our ++ ++# See if we are running on zsh, and set the options that allow our + # commands through without removal of \ escapes INIT. +-if test -n "\${ZSH_VERSION+set}" ; then ++if test -n "\${ZSH_VERSION+set}"; then + setopt NO_GLOB_SUBST + fi + + + PACKAGE='$PACKAGE' + VERSION='$VERSION' +- TIMESTAMP='$TIMESTAMP' + RM='$RM' + ofile='$ofile' + + + ++ ++ + TARGETDIR="$TARGETDIR" + + _ACEOF +@@ -16831,7 +20910,7 @@ + fi + ;; + "depfiles":C) test x"$AMDEP_TRUE" != x"" || { +- # Autoconf 2.62 quotes --file arguments for eval, but not when files ++ # Older Autoconf quotes --file arguments for eval, but not when files + # are listed without --file. Let's play safe and only enable the eval + # if we detect the quoting. + case $CONFIG_FILES in +@@ -16882,7 +20961,7 @@ + DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` + test -z "$DEPDIR" && continue + am__include=`sed -n 's/^am__include = //p' < "$mf"` +- test -z "am__include" && continue ++ test -z "$am__include" && continue + am__quote=`sed -n 's/^am__quote = //p' < "$mf"` + # Find all dependency output files, they are included files with + # $(DEPDIR) in their names. We invoke sed twice because it is the +@@ -16925,13 +21004,13 @@ + ;; + "libtool":C) + +- # See if we are running on zsh, and set the options which allow our ++ # See if we are running on zsh, and set the options that allow our + # commands through without removal of \ escapes. +- if test -n "${ZSH_VERSION+set}" ; then ++ if test -n "${ZSH_VERSION+set}"; then + setopt NO_GLOB_SUBST + fi + +- cfgfile="${ofile}T" ++ cfgfile=${ofile}T + trap "$RM \"$cfgfile\"; exit 1" 1 2 15 + $RM "$cfgfile" + +@@ -16939,7 +21018,7 @@ + #! $SHELL + + # `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. +-# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION ++# Generated automatically by $as_me ($PACKAGE) $VERSION + # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: + # NOTE: Changes made to this file will be lost: look at ltmain.sh. + # +@@ -16973,7 +21052,7 @@ + + + # The names of the tagged configurations supported by this script. +-available_tags="" ++available_tags='CXX ' + + # ### BEGIN LIBTOOL CONFIG + +@@ -17110,16 +21189,22 @@ + # Transform the output of nm in a proper C declaration. + global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl + ++# Transform the output of nm into a list of symbols to manually relocate. ++global_symbol_to_import=$lt_lt_cv_sys_global_symbol_to_import ++ + # Transform the output of nm in a C name address pair. + global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address + + # Transform the output of nm in a C name address pair when lib prefix is needed. + global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix + ++# The name lister interface. ++nm_interface=$lt_lt_cv_nm_interface ++ + # Specify filename containing input files for \$NM. + nm_file_list_spec=$lt_nm_file_list_spec + +-# The root where to search for dependent libraries,and in which our libraries should be installed. ++# The root where to search for dependent libraries,and where our libraries should be installed. + lt_sysroot=$lt_sysroot + + # The name of the directory that contains temporary libtool files. +@@ -17306,13 +21391,13 @@ + # Whether we need a single "-rpath" flag with a separated argument. + hardcode_libdir_separator=$lt_hardcode_libdir_separator + +-# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes ++# Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes + # DIR into the resulting binary. + hardcode_direct=$hardcode_direct + +-# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes ++# Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes + # DIR into the resulting binary and the resulting library dependency is +-# "absolute",i.e impossible to change by setting \${shlibpath_var} if the ++# "absolute",i.e impossible to change by setting \$shlibpath_var if the + # library is relocated. + hardcode_direct_absolute=$hardcode_direct_absolute + +@@ -17360,6 +21445,20 @@ + # How to hardcode a shared library path into an executable. + hardcode_action=$hardcode_action + ++# The directories searched by this compiler when creating a shared library. ++compiler_lib_search_dirs=$lt_compiler_lib_search_dirs ++ ++# Dependencies to place before and after the objects being linked to ++# create a shared library. ++predep_objects=$lt_predep_objects ++postdep_objects=$lt_postdep_objects ++predeps=$lt_predeps ++postdeps=$lt_postdeps ++ ++# The library search path used internally by the compiler when linking ++# a shared library. ++compiler_lib_search_path=$lt_compiler_lib_search_path ++ + # ### END LIBTOOL CONFIG + + _LT_EOF +@@ -17370,7 +21469,7 @@ + # AIX sometimes has problems with the GCC collect2 program. For some + # reason, if we set the COLLECT_NAMES environment variable, the problems + # vanish in a puff of smoke. +-if test "X${COLLECT_NAMES+set}" != Xset; then ++if test set != "${COLLECT_NAMES+set}"; then + COLLECT_NAMES= + export COLLECT_NAMES + fi +@@ -17379,7 +21478,7 @@ + esac + + +-ltmain="$ac_aux_dir/ltmain.sh" ++ltmain=$ac_aux_dir/ltmain.sh + + + # We use sed instead of cat because bash on DJGPP gets confused if +@@ -17389,169 +21488,163 @@ + sed '$q' "$ltmain" >> "$cfgfile" \ + || (rm -f "$cfgfile"; exit 1) + +- if test x"$xsi_shell" = xyes; then +- sed -e '/^func_dirname ()$/,/^} # func_dirname /c\ +-func_dirname ()\ +-{\ +-\ case ${1} in\ +-\ */*) func_dirname_result="${1%/*}${2}" ;;\ +-\ * ) func_dirname_result="${3}" ;;\ +-\ esac\ +-} # Extended-shell func_dirname implementation' "$cfgfile" > $cfgfile.tmp \ +- && mv -f "$cfgfile.tmp" "$cfgfile" \ +- || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +-test 0 -eq $? || _lt_function_replace_fail=: +- +- +- sed -e '/^func_basename ()$/,/^} # func_basename /c\ +-func_basename ()\ +-{\ +-\ func_basename_result="${1##*/}"\ +-} # Extended-shell func_basename implementation' "$cfgfile" > $cfgfile.tmp \ +- && mv -f "$cfgfile.tmp" "$cfgfile" \ +- || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +-test 0 -eq $? || _lt_function_replace_fail=: +- +- +- sed -e '/^func_dirname_and_basename ()$/,/^} # func_dirname_and_basename /c\ +-func_dirname_and_basename ()\ +-{\ +-\ case ${1} in\ +-\ */*) func_dirname_result="${1%/*}${2}" ;;\ +-\ * ) func_dirname_result="${3}" ;;\ +-\ esac\ +-\ func_basename_result="${1##*/}"\ +-} # Extended-shell func_dirname_and_basename implementation' "$cfgfile" > $cfgfile.tmp \ +- && mv -f "$cfgfile.tmp" "$cfgfile" \ +- || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +-test 0 -eq $? || _lt_function_replace_fail=: +- +- +- sed -e '/^func_stripname ()$/,/^} # func_stripname /c\ +-func_stripname ()\ +-{\ +-\ # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are\ +-\ # positional parameters, so assign one to ordinary parameter first.\ +-\ func_stripname_result=${3}\ +-\ func_stripname_result=${func_stripname_result#"${1}"}\ +-\ func_stripname_result=${func_stripname_result%"${2}"}\ +-} # Extended-shell func_stripname implementation' "$cfgfile" > $cfgfile.tmp \ +- && mv -f "$cfgfile.tmp" "$cfgfile" \ +- || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +-test 0 -eq $? || _lt_function_replace_fail=: +- +- +- sed -e '/^func_split_long_opt ()$/,/^} # func_split_long_opt /c\ +-func_split_long_opt ()\ +-{\ +-\ func_split_long_opt_name=${1%%=*}\ +-\ func_split_long_opt_arg=${1#*=}\ +-} # Extended-shell func_split_long_opt implementation' "$cfgfile" > $cfgfile.tmp \ +- && mv -f "$cfgfile.tmp" "$cfgfile" \ +- || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +-test 0 -eq $? || _lt_function_replace_fail=: +- +- +- sed -e '/^func_split_short_opt ()$/,/^} # func_split_short_opt /c\ +-func_split_short_opt ()\ +-{\ +-\ func_split_short_opt_arg=${1#??}\ +-\ func_split_short_opt_name=${1%"$func_split_short_opt_arg"}\ +-} # Extended-shell func_split_short_opt implementation' "$cfgfile" > $cfgfile.tmp \ +- && mv -f "$cfgfile.tmp" "$cfgfile" \ +- || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +-test 0 -eq $? || _lt_function_replace_fail=: +- +- +- sed -e '/^func_lo2o ()$/,/^} # func_lo2o /c\ +-func_lo2o ()\ +-{\ +-\ case ${1} in\ +-\ *.lo) func_lo2o_result=${1%.lo}.${objext} ;;\ +-\ *) func_lo2o_result=${1} ;;\ +-\ esac\ +-} # Extended-shell func_lo2o implementation' "$cfgfile" > $cfgfile.tmp \ +- && mv -f "$cfgfile.tmp" "$cfgfile" \ +- || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +-test 0 -eq $? || _lt_function_replace_fail=: +- +- +- sed -e '/^func_xform ()$/,/^} # func_xform /c\ +-func_xform ()\ +-{\ +- func_xform_result=${1%.*}.lo\ +-} # Extended-shell func_xform implementation' "$cfgfile" > $cfgfile.tmp \ +- && mv -f "$cfgfile.tmp" "$cfgfile" \ +- || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +-test 0 -eq $? || _lt_function_replace_fail=: +- +- +- sed -e '/^func_arith ()$/,/^} # func_arith /c\ +-func_arith ()\ +-{\ +- func_arith_result=$(( $* ))\ +-} # Extended-shell func_arith implementation' "$cfgfile" > $cfgfile.tmp \ +- && mv -f "$cfgfile.tmp" "$cfgfile" \ +- || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +-test 0 -eq $? || _lt_function_replace_fail=: +- +- +- sed -e '/^func_len ()$/,/^} # func_len /c\ +-func_len ()\ +-{\ +- func_len_result=${#1}\ +-} # Extended-shell func_len implementation' "$cfgfile" > $cfgfile.tmp \ +- && mv -f "$cfgfile.tmp" "$cfgfile" \ +- || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +-test 0 -eq $? || _lt_function_replace_fail=: +- +-fi +- +-if test x"$lt_shell_append" = xyes; then +- sed -e '/^func_append ()$/,/^} # func_append /c\ +-func_append ()\ +-{\ +- eval "${1}+=\\${2}"\ +-} # Extended-shell func_append implementation' "$cfgfile" > $cfgfile.tmp \ +- && mv -f "$cfgfile.tmp" "$cfgfile" \ +- || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +-test 0 -eq $? || _lt_function_replace_fail=: +- +- +- sed -e '/^func_append_quoted ()$/,/^} # func_append_quoted /c\ +-func_append_quoted ()\ +-{\ +-\ func_quote_for_eval "${2}"\ +-\ eval "${1}+=\\\\ \\$func_quote_for_eval_result"\ +-} # Extended-shell func_append_quoted implementation' "$cfgfile" > $cfgfile.tmp \ +- && mv -f "$cfgfile.tmp" "$cfgfile" \ +- || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +-test 0 -eq $? || _lt_function_replace_fail=: +- +- +- # Save a `func_append' function call where possible by direct use of '+=' +- sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \ +- && mv -f "$cfgfile.tmp" "$cfgfile" \ +- || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +- test 0 -eq $? || _lt_function_replace_fail=: +-else +- # Save a `func_append' function call even when '+=' is not available +- sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \ +- && mv -f "$cfgfile.tmp" "$cfgfile" \ +- || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +- test 0 -eq $? || _lt_function_replace_fail=: +-fi +- +-if test x"$_lt_function_replace_fail" = x":"; then +- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Unable to substitute extended shell functions in $ofile" >&5 +-$as_echo "$as_me: WARNING: Unable to substitute extended shell functions in $ofile" >&2;} +-fi +- +- + mv -f "$cfgfile" "$ofile" || + (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") + chmod +x "$ofile" + ++ ++ cat <<_LT_EOF >> "$ofile" ++ ++# ### BEGIN LIBTOOL TAG CONFIG: CXX ++ ++# The linker used to build libraries. ++LD=$lt_LD_CXX ++ ++# How to create reloadable object files. ++reload_flag=$lt_reload_flag_CXX ++reload_cmds=$lt_reload_cmds_CXX ++ ++# Commands used to build an old-style archive. ++old_archive_cmds=$lt_old_archive_cmds_CXX ++ ++# A language specific compiler. ++CC=$lt_compiler_CXX ++ ++# Is the compiler the GNU compiler? ++with_gcc=$GCC_CXX ++ ++# Compiler flag to turn off builtin functions. ++no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_CXX ++ ++# Additional compiler flags for building library objects. ++pic_flag=$lt_lt_prog_compiler_pic_CXX ++ ++# How to pass a linker flag through the compiler. ++wl=$lt_lt_prog_compiler_wl_CXX ++ ++# Compiler flag to prevent dynamic linking. ++link_static_flag=$lt_lt_prog_compiler_static_CXX ++ ++# Does compiler simultaneously support -c and -o options? ++compiler_c_o=$lt_lt_cv_prog_compiler_c_o_CXX ++ ++# Whether or not to add -lc for building shared libraries. ++build_libtool_need_lc=$archive_cmds_need_lc_CXX ++ ++# Whether or not to disallow shared libs when runtime libs are static. ++allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_CXX ++ ++# Compiler flag to allow reflexive dlopens. ++export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_CXX ++ ++# Compiler flag to generate shared objects directly from archives. ++whole_archive_flag_spec=$lt_whole_archive_flag_spec_CXX ++ ++# Whether the compiler copes with passing no objects directly. ++compiler_needs_object=$lt_compiler_needs_object_CXX ++ ++# Create an old-style archive from a shared archive. ++old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_CXX ++ ++# Create a temporary old-style archive to link instead of a shared archive. ++old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_CXX ++ ++# Commands used to build a shared archive. ++archive_cmds=$lt_archive_cmds_CXX ++archive_expsym_cmds=$lt_archive_expsym_cmds_CXX ++ ++# Commands used to build a loadable module if different from building ++# a shared archive. ++module_cmds=$lt_module_cmds_CXX ++module_expsym_cmds=$lt_module_expsym_cmds_CXX ++ ++# Whether we are building with GNU ld or not. ++with_gnu_ld=$lt_with_gnu_ld_CXX ++ ++# Flag that allows shared libraries with undefined symbols to be built. ++allow_undefined_flag=$lt_allow_undefined_flag_CXX ++ ++# Flag that enforces no undefined symbols. ++no_undefined_flag=$lt_no_undefined_flag_CXX ++ ++# Flag to hardcode \$libdir into a binary during linking. ++# This must work even if \$libdir does not exist ++hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_CXX ++ ++# Whether we need a single "-rpath" flag with a separated argument. ++hardcode_libdir_separator=$lt_hardcode_libdir_separator_CXX ++ ++# Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes ++# DIR into the resulting binary. ++hardcode_direct=$hardcode_direct_CXX ++ ++# Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes ++# DIR into the resulting binary and the resulting library dependency is ++# "absolute",i.e impossible to change by setting \$shlibpath_var if the ++# library is relocated. ++hardcode_direct_absolute=$hardcode_direct_absolute_CXX ++ ++# Set to "yes" if using the -LDIR flag during linking hardcodes DIR ++# into the resulting binary. ++hardcode_minus_L=$hardcode_minus_L_CXX ++ ++# Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR ++# into the resulting binary. ++hardcode_shlibpath_var=$hardcode_shlibpath_var_CXX ++ ++# Set to "yes" if building a shared library automatically hardcodes DIR ++# into the library and all subsequent libraries and executables linked ++# against it. ++hardcode_automatic=$hardcode_automatic_CXX ++ ++# Set to yes if linker adds runtime paths of dependent libraries ++# to runtime path list. ++inherit_rpath=$inherit_rpath_CXX ++ ++# Whether libtool must link a program against all its dependency libraries. ++link_all_deplibs=$link_all_deplibs_CXX ++ ++# Set to "yes" if exported symbols are required. ++always_export_symbols=$always_export_symbols_CXX ++ ++# The commands to list exported symbols. ++export_symbols_cmds=$lt_export_symbols_cmds_CXX ++ ++# Symbols that should not be listed in the preloaded symbols. ++exclude_expsyms=$lt_exclude_expsyms_CXX ++ ++# Symbols that must always be exported. ++include_expsyms=$lt_include_expsyms_CXX ++ ++# Commands necessary for linking programs (against libraries) with templates. ++prelink_cmds=$lt_prelink_cmds_CXX ++ ++# Commands necessary for finishing linking programs. ++postlink_cmds=$lt_postlink_cmds_CXX ++ ++# Specify filename containing input files. ++file_list_spec=$lt_file_list_spec_CXX ++ ++# How to hardcode a shared library path into an executable. ++hardcode_action=$hardcode_action_CXX ++ ++# The directories searched by this compiler when creating a shared library. ++compiler_lib_search_dirs=$lt_compiler_lib_search_dirs_CXX ++ ++# Dependencies to place before and after the objects being linked to ++# create a shared library. ++predep_objects=$lt_predep_objects_CXX ++postdep_objects=$lt_postdep_objects_CXX ++predeps=$lt_predeps_CXX ++postdeps=$lt_postdeps_CXX ++ ++# The library search path used internally by the compiler when linking ++# a shared library. ++compiler_lib_search_path=$lt_compiler_lib_search_path_CXX ++ ++# ### END LIBTOOL TAG CONFIG: CXX ++_LT_EOF ++ + ;; + "include":C) test -d include || mkdir include ;; + "src":C) +diff -r c0e311e010fc Modules/_ctypes/libffi/configure.ac +--- a/Modules/_ctypes/libffi/configure.ac ++++ b/Modules/_ctypes/libffi/configure.ac +@@ -5,13 +5,17 @@ + + AC_PREREQ(2.68) + +-AC_INIT([libffi], [3.0.13], [http://github.com/atgreen/libffi/issues]) ++AC_INIT([libffi], [3.1], [http://github.com/atgreen/libffi/issues]) + AC_CONFIG_HEADERS([fficonfig.h]) + + AC_CANONICAL_SYSTEM + target_alias=${target_alias-$host_alias} + +-. ${srcdir}/configure.host ++case "${host}" in ++ frv*-elf) ++ LDFLAGS=`echo $LDFLAGS | sed "s/\-B[^ ]*libgloss\/frv\///"`\ -B`pwd`/../libgloss/frv/ ++ ;; ++esac + + AX_ENABLE_BUILDDIR + +@@ -28,6 +32,7 @@ + m4_define([_AC_ARG_VAR_PRECIOUS],[]) + save_CFLAGS=$CFLAGS + AC_PROG_CC ++AC_PROG_CXX + CFLAGS=$save_CFLAGS + m4_undefine([_AC_ARG_VAR_PRECIOUS]) + m4_rename_force([real_PRECIOUS],[_AC_ARG_VAR_PRECIOUS]) +@@ -52,12 +57,12 @@ + + if test "x$GCC" = "xyes"; then + CFLAGS="$CFLAGS -fexceptions" +- touch local.exp +-else +- cat > local.exp < local.exp < conftest.s +- if $CC $CFLAGS -c conftest.s 2>&1 | grep -i warning > /dev/null; then +- libffi_cv_as_x86_64_unwind_section_type=no ++ cat > conftest1.s << EOF ++.text ++.globl foo ++foo: ++jmp bar ++.section .eh_frame,"a",@unwind ++bar: ++EOF ++ ++ cat > conftest2.c << EOF ++extern void foo(); ++int main(){foo();} ++EOF ++ ++ libffi_cv_as_x86_64_unwind_section_type=no ++ # we ensure that we can compile _and_ link an assembly file containing an @unwind section ++ # since the compiler can support it and not the linker (ie old binutils) ++ if $CC -Wa,--fatal-warnings $CFLAGS -c conftest1.s > /dev/null 2>&1 && \ ++ $CC conftest2.c conftest1.o > /dev/null 2>&1 ; then ++ libffi_cv_as_x86_64_unwind_section_type=yes + fi + ]) + if test "x$libffi_cv_as_x86_64_unwind_section_type" = xyes; then +@@ -526,14 +575,14 @@ + AC_ARG_ENABLE(structs, + [ --disable-structs omit code for struct support], + if test "$enable_structs" = "no"; then +- AC_DEFINE(FFI_NO_STRUCTS, 1, [Define this is you do not want support for aggregate types.]) ++ AC_DEFINE(FFI_NO_STRUCTS, 1, [Define this if you do not want support for aggregate types.]) + fi) + AM_CONDITIONAL(FFI_DEBUG, test "$enable_debug" = "yes") + + AC_ARG_ENABLE(raw-api, + [ --disable-raw-api make the raw api unavailable], + if test "$enable_raw_api" = "no"; then +- AC_DEFINE(FFI_NO_RAW_API, 1, [Define this is you do not want support for the raw API.]) ++ AC_DEFINE(FFI_NO_RAW_API, 1, [Define this if you do not want support for the raw API.]) + fi) + + AC_ARG_ENABLE(purify-safety, +@@ -553,7 +602,7 @@ + toolexecdir='$(libdir)/gcc-lib/$(target_alias)' + toolexeclibdir='$(libdir)' + fi +- multi_os_directory=`$CC -print-multi-os-directory` ++ multi_os_directory=`$CC $CFLAGS -print-multi-os-directory` + case $multi_os_directory in + .) ;; # Avoid trailing /. + ../*) toolexeclibdir=$toolexeclibdir/$multi_os_directory ;; +diff -r c0e311e010fc Modules/_ctypes/libffi/configure.host +--- a/Modules/_ctypes/libffi/configure.host ++++ /dev/null +@@ -1,11 +0,0 @@ +-# configure.host +-# +-# This shell script handles all host based configuration for libffi. +-# +- +-# THIS TABLE IS SORTED. KEEP IT THAT WAY. +-case "${host}" in +- frv*-elf) +- LDFLAGS=`echo $LDFLAGS | sed "s/\-B[^ ]*libgloss\/frv\///"`\ -B`pwd`/../libgloss/frv/ +- ;; +-esac +diff -r c0e311e010fc Modules/_ctypes/libffi/depcomp +--- a/Modules/_ctypes/libffi/depcomp ++++ b/Modules/_ctypes/libffi/depcomp +@@ -1,10 +1,9 @@ + #! /bin/sh + # depcomp - compile a program generating dependencies as side-effects + +-scriptversion=2009-04-28.21; # UTC ++scriptversion=2013-05-30.07; # UTC + +-# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007, 2009 Free +-# Software Foundation, Inc. ++# Copyright (C) 1999-2013 Free Software Foundation, Inc. + + # This program is free software; you can redistribute it and/or modify + # it under the terms of the GNU General Public License as published by +@@ -28,9 +27,9 @@ + + case $1 in + '') +- echo "$0: No command. Try \`$0 --help' for more information." 1>&2 +- exit 1; +- ;; ++ echo "$0: No command. Try '$0 --help' for more information." 1>&2 ++ exit 1; ++ ;; + -h | --h*) + cat <<\EOF + Usage: depcomp [--help] [--version] PROGRAM [ARGS] +@@ -40,11 +39,11 @@ + + Environment variables: + depmode Dependency tracking mode. +- source Source file read by `PROGRAMS ARGS'. +- object Object file output by `PROGRAMS ARGS'. ++ source Source file read by 'PROGRAMS ARGS'. ++ object Object file output by 'PROGRAMS ARGS'. + DEPDIR directory where to store dependencies. + depfile Dependency file to output. +- tmpdepfile Temporary file to use when outputing dependencies. ++ tmpdepfile Temporary file to use when outputting dependencies. + libtool Whether libtool is used (yes/no). + + Report bugs to . +@@ -57,6 +56,66 @@ + ;; + esac + ++# Get the directory component of the given path, and save it in the ++# global variables '$dir'. Note that this directory component will ++# be either empty or ending with a '/' character. This is deliberate. ++set_dir_from () ++{ ++ case $1 in ++ */*) dir=`echo "$1" | sed -e 's|/[^/]*$|/|'`;; ++ *) dir=;; ++ esac ++} ++ ++# Get the suffix-stripped basename of the given path, and save it the ++# global variable '$base'. ++set_base_from () ++{ ++ base=`echo "$1" | sed -e 's|^.*/||' -e 's/\.[^.]*$//'` ++} ++ ++# If no dependency file was actually created by the compiler invocation, ++# we still have to create a dummy depfile, to avoid errors with the ++# Makefile "include basename.Plo" scheme. ++make_dummy_depfile () ++{ ++ echo "#dummy" > "$depfile" ++} ++ ++# Factor out some common post-processing of the generated depfile. ++# Requires the auxiliary global variable '$tmpdepfile' to be set. ++aix_post_process_depfile () ++{ ++ # If the compiler actually managed to produce a dependency file, ++ # post-process it. ++ if test -f "$tmpdepfile"; then ++ # Each line is of the form 'foo.o: dependency.h'. ++ # Do two passes, one to just change these to ++ # $object: dependency.h ++ # and one to simply output ++ # dependency.h: ++ # which is needed to avoid the deleted-header problem. ++ { sed -e "s,^.*\.[$lower]*:,$object:," < "$tmpdepfile" ++ sed -e "s,^.*\.[$lower]*:[$tab ]*,," -e 's,$,:,' < "$tmpdepfile" ++ } > "$depfile" ++ rm -f "$tmpdepfile" ++ else ++ make_dummy_depfile ++ fi ++} ++ ++# A tabulation character. ++tab=' ' ++# A newline character. ++nl=' ++' ++# Character ranges might be problematic outside the C locale. ++# These definitions help. ++upper=ABCDEFGHIJKLMNOPQRSTUVWXYZ ++lower=abcdefghijklmnopqrstuvwxyz ++digits=0123456789 ++alpha=${upper}${lower} ++ + if test -z "$depmode" || test -z "$source" || test -z "$object"; then + echo "depcomp: Variables source, object and depmode must be set" 1>&2 + exit 1 +@@ -69,6 +128,9 @@ + + rm -f "$tmpdepfile" + ++# Avoid interferences from the environment. ++gccflag= dashmflag= ++ + # Some modes work just like other modes, but use different flags. We + # parameterize here, but still list the modes in the big case below, + # to make depend.m4 easier to write. Note that we *cannot* use a case +@@ -80,18 +142,32 @@ + fi + + if test "$depmode" = dashXmstdout; then +- # This is just like dashmstdout with a different argument. +- dashmflag=-xM +- depmode=dashmstdout ++ # This is just like dashmstdout with a different argument. ++ dashmflag=-xM ++ depmode=dashmstdout + fi + + cygpath_u="cygpath -u -f -" + if test "$depmode" = msvcmsys; then +- # This is just like msvisualcpp but w/o cygpath translation. +- # Just convert the backslash-escaped backslashes to single forward +- # slashes to satisfy depend.m4 +- cygpath_u="sed s,\\\\\\\\,/,g" +- depmode=msvisualcpp ++ # This is just like msvisualcpp but w/o cygpath translation. ++ # Just convert the backslash-escaped backslashes to single forward ++ # slashes to satisfy depend.m4 ++ cygpath_u='sed s,\\\\,/,g' ++ depmode=msvisualcpp ++fi ++ ++if test "$depmode" = msvc7msys; then ++ # This is just like msvc7 but w/o cygpath translation. ++ # Just convert the backslash-escaped backslashes to single forward ++ # slashes to satisfy depend.m4 ++ cygpath_u='sed s,\\\\,/,g' ++ depmode=msvc7 ++fi ++ ++if test "$depmode" = xlc; then ++ # IBM C/C++ Compilers xlc/xlC can output gcc-like dependency information. ++ gccflag=-qmakedep=gcc,-MF ++ depmode=gcc + fi + + case "$depmode" in +@@ -114,8 +190,7 @@ + done + "$@" + stat=$? +- if test $stat -eq 0; then : +- else ++ if test $stat -ne 0; then + rm -f "$tmpdepfile" + exit $stat + fi +@@ -123,13 +198,17 @@ + ;; + + gcc) ++## Note that this doesn't just cater to obsosete pre-3.x GCC compilers. ++## but also to in-use compilers like IMB xlc/xlC and the HP C compiler. ++## (see the conditional assignment to $gccflag above). + ## There are various ways to get dependency output from gcc. Here's + ## why we pick this rather obscure method: + ## - Don't want to use -MD because we'd like the dependencies to end + ## up in a subdir. Having to rename by hand is ugly. + ## (We might end up doing this anyway to support other compilers.) + ## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like +-## -MM, not -M (despite what the docs say). ++## -MM, not -M (despite what the docs say). Also, it might not be ++## supported by the other compilers which use the 'gcc' depmode. + ## - Using -M directly means running the compiler twice (even worse + ## than renaming). + if test -z "$gccflag"; then +@@ -137,31 +216,31 @@ + fi + "$@" -Wp,"$gccflag$tmpdepfile" + stat=$? +- if test $stat -eq 0; then : +- else ++ if test $stat -ne 0; then + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + echo "$object : \\" > "$depfile" +- alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz +-## The second -e expression handles DOS-style file names with drive letters. ++ # The second -e expression handles DOS-style file names with drive ++ # letters. + sed -e 's/^[^:]*: / /' \ + -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" +-## This next piece of magic avoids the `deleted header file' problem. ++## This next piece of magic avoids the "deleted header file" problem. + ## The problem is that when a header file which appears in a .P file + ## is deleted, the dependency causes make to die (because there is + ## typically no way to rebuild the header). We avoid this by adding + ## dummy dependencies for each header file. Too bad gcc doesn't do + ## this for us directly. +- tr ' ' ' +-' < "$tmpdepfile" | +-## Some versions of gcc put a space before the `:'. On the theory ++## Some versions of gcc put a space before the ':'. On the theory + ## that the space means something, we add a space to the output as +-## well. ++## well. hp depmode also adds that space, but also prefixes the VPATH ++## to the object. Take care to not repeat it in the output. + ## Some versions of the HPUX 10.20 sed can't process this invocation + ## correctly. Breaking it into two sed invocations is a workaround. +- sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" ++ tr ' ' "$nl" < "$tmpdepfile" \ ++ | sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \ ++ | sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +@@ -179,8 +258,7 @@ + "$@" -MDupdate "$tmpdepfile" + fi + stat=$? +- if test $stat -eq 0; then : +- else ++ if test $stat -ne 0; then + rm -f "$tmpdepfile" + exit $stat + fi +@@ -188,43 +266,41 @@ + + if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files + echo "$object : \\" > "$depfile" +- + # Clip off the initial element (the dependent). Don't try to be + # clever and replace this with sed code, as IRIX sed won't handle + # lines with more than a fixed number of characters (4096 in + # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; +- # the IRIX cc adds comments like `#:fec' to the end of the ++ # the IRIX cc adds comments like '#:fec' to the end of the + # dependency line. +- tr ' ' ' +-' < "$tmpdepfile" \ +- | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \ +- tr ' +-' ' ' >> "$depfile" ++ tr ' ' "$nl" < "$tmpdepfile" \ ++ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' \ ++ | tr "$nl" ' ' >> "$depfile" + echo >> "$depfile" +- + # The second pass generates a dummy entry for each header file. +- tr ' ' ' +-' < "$tmpdepfile" \ +- | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ +- >> "$depfile" ++ tr ' ' "$nl" < "$tmpdepfile" \ ++ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ ++ >> "$depfile" + else +- # The sourcefile does not contain any dependencies, so just +- # store a dummy comment line, to avoid errors with the Makefile +- # "include basename.Plo" scheme. +- echo "#dummy" > "$depfile" ++ make_dummy_depfile + fi + rm -f "$tmpdepfile" + ;; + ++xlc) ++ # This case exists only to let depend.m4 do its work. It works by ++ # looking at the text of this script. This case will never be run, ++ # since it is checked for above. ++ exit 1 ++ ;; ++ + aix) + # The C for AIX Compiler uses -M and outputs the dependencies + # in a .u file. In older versions, this file always lives in the +- # current directory. Also, the AIX compiler puts `$object:' at the ++ # current directory. Also, the AIX compiler puts '$object:' at the + # start of each line; $object doesn't have directory information. + # Version 6 uses the directory in both cases. +- dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` +- test "x$dir" = "x$object" && dir= +- base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` ++ set_dir_from "$object" ++ set_base_from "$object" + if test "$libtool" = yes; then + tmpdepfile1=$dir$base.u + tmpdepfile2=$base.u +@@ -237,9 +313,7 @@ + "$@" -M + fi + stat=$? +- +- if test $stat -eq 0; then : +- else ++ if test $stat -ne 0; then + rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" + exit $stat + fi +@@ -248,44 +322,100 @@ + do + test -f "$tmpdepfile" && break + done +- if test -f "$tmpdepfile"; then +- # Each line is of the form `foo.o: dependent.h'. +- # Do two passes, one to just change these to +- # `$object: dependent.h' and one to simply `dependent.h:'. +- sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" +- # That's a tab and a space in the []. +- sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" +- else +- # The sourcefile does not contain any dependencies, so just +- # store a dummy comment line, to avoid errors with the Makefile +- # "include basename.Plo" scheme. +- echo "#dummy" > "$depfile" ++ aix_post_process_depfile ++ ;; ++ ++tcc) ++ # tcc (Tiny C Compiler) understand '-MD -MF file' since version 0.9.26 ++ # FIXME: That version still under development at the moment of writing. ++ # Make that this statement remains true also for stable, released ++ # versions. ++ # It will wrap lines (doesn't matter whether long or short) with a ++ # trailing '\', as in: ++ # ++ # foo.o : \ ++ # foo.c \ ++ # foo.h \ ++ # ++ # It will put a trailing '\' even on the last line, and will use leading ++ # spaces rather than leading tabs (at least since its commit 0394caf7 ++ # "Emit spaces for -MD"). ++ "$@" -MD -MF "$tmpdepfile" ++ stat=$? ++ if test $stat -ne 0; then ++ rm -f "$tmpdepfile" ++ exit $stat + fi ++ rm -f "$depfile" ++ # Each non-empty line is of the form 'foo.o : \' or ' dep.h \'. ++ # We have to change lines of the first kind to '$object: \'. ++ sed -e "s|.*:|$object :|" < "$tmpdepfile" > "$depfile" ++ # And for each line of the second kind, we have to emit a 'dep.h:' ++ # dummy dependency, to avoid the deleted-header problem. ++ sed -n -e 's|^ *\(.*\) *\\$|\1:|p' < "$tmpdepfile" >> "$depfile" + rm -f "$tmpdepfile" + ;; + +-icc) +- # Intel's C compiler understands `-MD -MF file'. However on +- # icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c +- # ICC 7.0 will fill foo.d with something like +- # foo.o: sub/foo.c +- # foo.o: sub/foo.h +- # which is wrong. We want: +- # sub/foo.o: sub/foo.c +- # sub/foo.o: sub/foo.h +- # sub/foo.c: +- # sub/foo.h: +- # ICC 7.1 will output ++## The order of this option in the case statement is important, since the ++## shell code in configure will try each of these formats in the order ++## listed in this file. A plain '-MD' option would be understood by many ++## compilers, so we must ensure this comes after the gcc and icc options. ++pgcc) ++ # Portland's C compiler understands '-MD'. ++ # Will always output deps to 'file.d' where file is the root name of the ++ # source file under compilation, even if file resides in a subdirectory. ++ # The object file name does not affect the name of the '.d' file. ++ # pgcc 10.2 will output + # foo.o: sub/foo.c sub/foo.h +- # and will wrap long lines using \ : ++ # and will wrap long lines using '\' : + # foo.o: sub/foo.c ... \ + # sub/foo.h ... \ + # ... ++ set_dir_from "$object" ++ # Use the source, not the object, to determine the base name, since ++ # that's sadly what pgcc will do too. ++ set_base_from "$source" ++ tmpdepfile=$base.d + +- "$@" -MD -MF "$tmpdepfile" +- stat=$? +- if test $stat -eq 0; then : +- else ++ # For projects that build the same source file twice into different object ++ # files, the pgcc approach of using the *source* file root name can cause ++ # problems in parallel builds. Use a locking strategy to avoid stomping on ++ # the same $tmpdepfile. ++ lockdir=$base.d-lock ++ trap " ++ echo '$0: caught signal, cleaning up...' >&2 ++ rmdir '$lockdir' ++ exit 1 ++ " 1 2 13 15 ++ numtries=100 ++ i=$numtries ++ while test $i -gt 0; do ++ # mkdir is a portable test-and-set. ++ if mkdir "$lockdir" 2>/dev/null; then ++ # This process acquired the lock. ++ "$@" -MD ++ stat=$? ++ # Release the lock. ++ rmdir "$lockdir" ++ break ++ else ++ # If the lock is being held by a different process, wait ++ # until the winning process is done or we timeout. ++ while test -d "$lockdir" && test $i -gt 0; do ++ sleep 1 ++ i=`expr $i - 1` ++ done ++ fi ++ i=`expr $i - 1` ++ done ++ trap - 1 2 13 15 ++ if test $i -le 0; then ++ echo "$0: failed to acquire lock after $numtries attempts" >&2 ++ echo "$0: check lockdir '$lockdir'" >&2 ++ exit 1 ++ fi ++ ++ if test $stat -ne 0; then + rm -f "$tmpdepfile" + exit $stat + fi +@@ -297,8 +427,8 @@ + sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile" + # Some versions of the HPUX 10.20 sed can't process this invocation + # correctly. Breaking it into two sed invocations is a workaround. +- sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" | +- sed -e 's/$/ :/' >> "$depfile" ++ sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" \ ++ | sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +@@ -309,9 +439,8 @@ + # 'foo.d', which lands next to the object file, wherever that + # happens to be. + # Much of this is similar to the tru64 case; see comments there. +- dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` +- test "x$dir" = "x$object" && dir= +- base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` ++ set_dir_from "$object" ++ set_base_from "$object" + if test "$libtool" = yes; then + tmpdepfile1=$dir$base.d + tmpdepfile2=$dir.libs/$base.d +@@ -322,8 +451,7 @@ + "$@" +Maked + fi + stat=$? +- if test $stat -eq 0; then : +- else ++ if test $stat -ne 0; then + rm -f "$tmpdepfile1" "$tmpdepfile2" + exit $stat + fi +@@ -333,77 +461,107 @@ + test -f "$tmpdepfile" && break + done + if test -f "$tmpdepfile"; then +- sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile" +- # Add `dependent.h:' lines. ++ sed -e "s,^.*\.[$lower]*:,$object:," "$tmpdepfile" > "$depfile" ++ # Add 'dependent.h:' lines. + sed -ne '2,${ +- s/^ *// +- s/ \\*$// +- s/$/:/ +- p +- }' "$tmpdepfile" >> "$depfile" ++ s/^ *// ++ s/ \\*$// ++ s/$/:/ ++ p ++ }' "$tmpdepfile" >> "$depfile" + else +- echo "#dummy" > "$depfile" ++ make_dummy_depfile + fi + rm -f "$tmpdepfile" "$tmpdepfile2" + ;; + + tru64) +- # The Tru64 compiler uses -MD to generate dependencies as a side +- # effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'. +- # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put +- # dependencies in `foo.d' instead, so we check for that too. +- # Subdirectories are respected. +- dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` +- test "x$dir" = "x$object" && dir= +- base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` ++ # The Tru64 compiler uses -MD to generate dependencies as a side ++ # effect. 'cc -MD -o foo.o ...' puts the dependencies into 'foo.o.d'. ++ # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put ++ # dependencies in 'foo.d' instead, so we check for that too. ++ # Subdirectories are respected. ++ set_dir_from "$object" ++ set_base_from "$object" + +- if test "$libtool" = yes; then +- # With Tru64 cc, shared objects can also be used to make a +- # static library. This mechanism is used in libtool 1.4 series to +- # handle both shared and static libraries in a single compilation. +- # With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d. +- # +- # With libtool 1.5 this exception was removed, and libtool now +- # generates 2 separate objects for the 2 libraries. These two +- # compilations output dependencies in $dir.libs/$base.o.d and +- # in $dir$base.o.d. We have to check for both files, because +- # one of the two compilations can be disabled. We should prefer +- # $dir$base.o.d over $dir.libs/$base.o.d because the latter is +- # automatically cleaned when .libs/ is deleted, while ignoring +- # the former would cause a distcleancheck panic. +- tmpdepfile1=$dir.libs/$base.lo.d # libtool 1.4 +- tmpdepfile2=$dir$base.o.d # libtool 1.5 +- tmpdepfile3=$dir.libs/$base.o.d # libtool 1.5 +- tmpdepfile4=$dir.libs/$base.d # Compaq CCC V6.2-504 +- "$@" -Wc,-MD +- else +- tmpdepfile1=$dir$base.o.d +- tmpdepfile2=$dir$base.d +- tmpdepfile3=$dir$base.d +- tmpdepfile4=$dir$base.d +- "$@" -MD +- fi ++ if test "$libtool" = yes; then ++ # Libtool generates 2 separate objects for the 2 libraries. These ++ # two compilations output dependencies in $dir.libs/$base.o.d and ++ # in $dir$base.o.d. We have to check for both files, because ++ # one of the two compilations can be disabled. We should prefer ++ # $dir$base.o.d over $dir.libs/$base.o.d because the latter is ++ # automatically cleaned when .libs/ is deleted, while ignoring ++ # the former would cause a distcleancheck panic. ++ tmpdepfile1=$dir$base.o.d # libtool 1.5 ++ tmpdepfile2=$dir.libs/$base.o.d # Likewise. ++ tmpdepfile3=$dir.libs/$base.d # Compaq CCC V6.2-504 ++ "$@" -Wc,-MD ++ else ++ tmpdepfile1=$dir$base.d ++ tmpdepfile2=$dir$base.d ++ tmpdepfile3=$dir$base.d ++ "$@" -MD ++ fi + +- stat=$? +- if test $stat -eq 0; then : +- else +- rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" +- exit $stat +- fi ++ stat=$? ++ if test $stat -ne 0; then ++ rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" ++ exit $stat ++ fi + +- for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" +- do +- test -f "$tmpdepfile" && break +- done +- if test -f "$tmpdepfile"; then +- sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" +- # That's a tab and a space in the []. +- sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" +- else +- echo "#dummy" > "$depfile" +- fi +- rm -f "$tmpdepfile" +- ;; ++ for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" ++ do ++ test -f "$tmpdepfile" && break ++ done ++ # Same post-processing that is required for AIX mode. ++ aix_post_process_depfile ++ ;; ++ ++msvc7) ++ if test "$libtool" = yes; then ++ showIncludes=-Wc,-showIncludes ++ else ++ showIncludes=-showIncludes ++ fi ++ "$@" $showIncludes > "$tmpdepfile" ++ stat=$? ++ grep -v '^Note: including file: ' "$tmpdepfile" ++ if test $stat -ne 0; then ++ rm -f "$tmpdepfile" ++ exit $stat ++ fi ++ rm -f "$depfile" ++ echo "$object : \\" > "$depfile" ++ # The first sed program below extracts the file names and escapes ++ # backslashes for cygpath. The second sed program outputs the file ++ # name when reading, but also accumulates all include files in the ++ # hold buffer in order to output them again at the end. This only ++ # works with sed implementations that can handle large buffers. ++ sed < "$tmpdepfile" -n ' ++/^Note: including file: *\(.*\)/ { ++ s//\1/ ++ s/\\/\\\\/g ++ p ++}' | $cygpath_u | sort -u | sed -n ' ++s/ /\\ /g ++s/\(.*\)/'"$tab"'\1 \\/p ++s/.\(.*\) \\/\1:/ ++H ++$ { ++ s/.*/'"$tab"'/ ++ G ++ p ++}' >> "$depfile" ++ echo >> "$depfile" # make sure the fragment doesn't end with a backslash ++ rm -f "$tmpdepfile" ++ ;; ++ ++msvc7msys) ++ # This case exists only to let depend.m4 do its work. It works by ++ # looking at the text of this script. This case will never be run, ++ # since it is checked for above. ++ exit 1 ++ ;; + + #nosideeffect) + # This comment above is used by automake to tell side-effect +@@ -422,7 +580,7 @@ + shift + fi + +- # Remove `-o $object'. ++ # Remove '-o $object'. + IFS=" " + for arg + do +@@ -442,18 +600,18 @@ + done + + test -z "$dashmflag" && dashmflag=-M +- # Require at least two characters before searching for `:' ++ # Require at least two characters before searching for ':' + # in the target name. This is to cope with DOS-style filenames: +- # a dependency such as `c:/foo/bar' could be seen as target `c' otherwise. ++ # a dependency such as 'c:/foo/bar' could be seen as target 'c' otherwise. + "$@" $dashmflag | +- sed 's:^[ ]*[^: ][^:][^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile" ++ sed "s|^[$tab ]*[^:$tab ][^:][^:]*:[$tab ]*|$object: |" > "$tmpdepfile" + rm -f "$depfile" + cat < "$tmpdepfile" > "$depfile" +- tr ' ' ' +-' < "$tmpdepfile" | \ +-## Some versions of the HPUX 10.20 sed can't process this invocation +-## correctly. Breaking it into two sed invocations is a workaround. +- sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" ++ # Some versions of the HPUX 10.20 sed can't process this sed invocation ++ # correctly. Breaking it into two sed invocations is a workaround. ++ tr ' ' "$nl" < "$tmpdepfile" \ ++ | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \ ++ | sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +@@ -503,12 +661,15 @@ + touch "$tmpdepfile" + ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" + rm -f "$depfile" +- cat < "$tmpdepfile" > "$depfile" +- sed '1,2d' "$tmpdepfile" | tr ' ' ' +-' | \ +-## Some versions of the HPUX 10.20 sed can't process this invocation +-## correctly. Breaking it into two sed invocations is a workaround. +- sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" ++ # makedepend may prepend the VPATH from the source file name to the object. ++ # No need to regex-escape $object, excess matching of '.' is harmless. ++ sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile" ++ # Some versions of the HPUX 10.20 sed can't process the last invocation ++ # correctly. Breaking it into two sed invocations is a workaround. ++ sed '1,2d' "$tmpdepfile" \ ++ | tr ' ' "$nl" \ ++ | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \ ++ | sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" "$tmpdepfile".bak + ;; + +@@ -525,7 +686,7 @@ + shift + fi + +- # Remove `-o $object'. ++ # Remove '-o $object'. + IFS=" " + for arg + do +@@ -544,10 +705,10 @@ + esac + done + +- "$@" -E | +- sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ +- -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' | +- sed '$ s: \\$::' > "$tmpdepfile" ++ "$@" -E \ ++ | sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ ++ -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ ++ | sed '$ s: \\$::' > "$tmpdepfile" + rm -f "$depfile" + echo "$object : \\" > "$depfile" + cat < "$tmpdepfile" >> "$depfile" +@@ -579,23 +740,23 @@ + shift + ;; + "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") +- set fnord "$@" +- shift +- shift +- ;; ++ set fnord "$@" ++ shift ++ shift ++ ;; + *) +- set fnord "$@" "$arg" +- shift +- shift +- ;; ++ set fnord "$@" "$arg" ++ shift ++ shift ++ ;; + esac + done + "$@" -E 2>/dev/null | + sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile" + rm -f "$depfile" + echo "$object : \\" > "$depfile" +- sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile" +- echo " " >> "$depfile" ++ sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::'"$tab"'\1 \\:p' >> "$depfile" ++ echo "$tab" >> "$depfile" + sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile" + rm -f "$tmpdepfile" + ;; +diff -r c0e311e010fc Modules/_ctypes/libffi/doc/libffi.info +Binary file Modules/_ctypes/libffi/doc/libffi.info has changed +diff -r c0e311e010fc Modules/_ctypes/libffi/doc/libffi.texi +--- a/Modules/_ctypes/libffi/doc/libffi.texi ++++ b/Modules/_ctypes/libffi/doc/libffi.texi +@@ -184,11 +184,11 @@ + + @var{rvalue} is a pointer to a chunk of memory that will hold the + result of the function call. This must be large enough to hold the +-result and must be suitably aligned; it is the caller's responsibility ++result, no smaller than the system register size (generally 32 or 64 ++bits), and must be suitably aligned; it is the caller's responsibility + to ensure this. If @var{cif} declares that the function returns + @code{void} (using @code{ffi_type_void}), then @var{rvalue} is +-ignored. If @var{rvalue} is @samp{NULL}, then the return value is +-discarded. ++ignored. + + @var{avalues} is a vector of @code{void *} pointers that point to the + memory locations holding the argument values for a call. If @var{cif} +@@ -214,7 +214,7 @@ + ffi_type *args[1]; + void *values[1]; + char *s; +- int rc; ++ ffi_arg rc; + + /* Initialize the argument info vectors */ + args[0] = &ffi_type_pointer; +@@ -222,7 +222,7 @@ + + /* Initialize the cif */ + if (ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1, +- &ffi_type_uint, args) == FFI_OK) ++ &ffi_type_sint, args) == FFI_OK) + @{ + s = "Hello World!"; + ffi_call(&cif, puts, &rc, values); +@@ -414,6 +414,7 @@ + int i; + + tm_type.size = tm_type.alignment = 0; ++ tm_type.type = FFI_TYPE_STRUCT; + tm_type.elements = &tm_type_elements; + + for (i = 0; i < 9; i++) +@@ -533,28 +534,30 @@ + @section Closure Example + + A trivial example that creates a new @code{puts} by binding +-@code{fputs} with @code{stdin}. ++@code{fputs} with @code{stdout}. + + @example + #include + #include + + /* Acts like puts with the file given at time of enclosure. */ +-void puts_binding(ffi_cif *cif, unsigned int *ret, void* args[], +- FILE *stream) ++void puts_binding(ffi_cif *cif, void *ret, void* args[], ++ void *stream) + @{ +- *ret = fputs(*(char **)args[0], stream); ++ *(ffi_arg *)ret = fputs(*(char **)args[0], (FILE *)stream); + @} + ++typedef int (*puts_t)(char *); ++ + int main() + @{ + ffi_cif cif; + ffi_type *args[1]; + ffi_closure *closure; + +- int (*bound_puts)(char *); ++ void *bound_puts; + int rc; +- ++ + /* Allocate closure and bound_puts */ + closure = ffi_closure_alloc(sizeof(ffi_closure), &bound_puts); + +@@ -565,13 +568,13 @@ + + /* Initialize the cif */ + if (ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1, +- &ffi_type_uint, args) == FFI_OK) ++ &ffi_type_sint, args) == FFI_OK) + @{ + /* Initialize the closure, setting stream to stdout */ +- if (ffi_prep_closure_loc(closure, &cif, puts_binding, ++ if (ffi_prep_closure_loc(closure, &cif, puts_binding, + stdout, bound_puts) == FFI_OK) + @{ +- rc = bound_puts("Hello World!"); ++ rc = ((puts_t)bound_puts)("Hello World!"); + /* rc now holds the result of the call to fputs */ + @} + @} +diff -r c0e311e010fc Modules/_ctypes/libffi/doc/stamp-vti +--- a/Modules/_ctypes/libffi/doc/stamp-vti ++++ b/Modules/_ctypes/libffi/doc/stamp-vti +@@ -1,4 +1,4 @@ +-@set UPDATED 16 March 2013 +-@set UPDATED-MONTH March 2013 +-@set EDITION 3.0.13 +-@set VERSION 3.0.13 ++@set UPDATED 25 April 2014 ++@set UPDATED-MONTH April 2014 ++@set EDITION 3.1 ++@set VERSION 3.1 +diff -r c0e311e010fc Modules/_ctypes/libffi/doc/version.texi +--- a/Modules/_ctypes/libffi/doc/version.texi ++++ b/Modules/_ctypes/libffi/doc/version.texi +@@ -1,4 +1,4 @@ +-@set UPDATED 16 March 2013 +-@set UPDATED-MONTH March 2013 +-@set EDITION 3.0.13 +-@set VERSION 3.0.13 ++@set UPDATED 25 April 2014 ++@set UPDATED-MONTH April 2014 ++@set EDITION 3.1 ++@set VERSION 3.1 +diff -r c0e311e010fc Modules/_ctypes/libffi/fficonfig.h.in +--- a/Modules/_ctypes/libffi/fficonfig.h.in ++++ b/Modules/_ctypes/libffi/fficonfig.h.in +@@ -26,10 +26,10 @@ + /* Cannot use malloc on this target, so, we revert to alternative means */ + #undef FFI_MMAP_EXEC_WRIT + +-/* Define this is you do not want support for the raw API. */ ++/* Define this if you do not want support for the raw API. */ + #undef FFI_NO_RAW_API + +-/* Define this is you do not want support for aggregate types. */ ++/* Define this if you do not want support for aggregate types. */ + #undef FFI_NO_STRUCTS + + /* Define to 1 if you have `alloca', as a function or macro. */ +@@ -73,6 +73,9 @@ + /* Define if you have the long double type and it is bigger than a double */ + #undef HAVE_LONG_DOUBLE + ++/* Define if you support more than one size of the long double type */ ++#undef HAVE_LONG_DOUBLE_VARIANT ++ + /* Define to 1 if you have the `memcpy' function. */ + #undef HAVE_MEMCPY + +@@ -118,8 +121,7 @@ + /* Define to 1 if you have the header file. */ + #undef HAVE_UNISTD_H + +-/* Define to the sub-directory in which libtool stores uninstalled libraries. +- */ ++/* Define to the sub-directory where libtool stores uninstalled libraries. */ + #undef LT_OBJDIR + + /* Define to 1 if your C compiler doesn't accept -c and -o together. */ +@@ -152,6 +154,9 @@ + /* The size of `long double', as computed by sizeof. */ + #undef SIZEOF_LONG_DOUBLE + ++/* The size of `size_t', as computed by sizeof. */ ++#undef SIZEOF_SIZE_T ++ + /* If using the C implementation of alloca, define if you know the + direction of stack growth for your system; otherwise it will be + automatically deduced at runtime. +diff -r c0e311e010fc Modules/_ctypes/libffi/fficonfig.py.in +--- a/Modules/_ctypes/libffi/fficonfig.py.in ++++ b/Modules/_ctypes/libffi/fficonfig.py.in +@@ -6,7 +6,7 @@ + ffi_platforms = { + 'MIPS_IRIX': ['src/mips/ffi.c', 'src/mips/o32.S', 'src/mips/n32.S'], + 'MIPS_LINUX': ['src/mips/ffi.c', 'src/mips/o32.S'], +- 'X86': ['src/x86/ffi.c', 'src/x86/sysv.S'], ++ 'X86': ['src/x86/ffi.c', 'src/x86/sysv.S', 'src/x86/win32.S'], + 'X86_FREEBSD': ['src/x86/ffi.c', 'src/x86/freebsd.S'], + 'X86_WIN32': ['src/x86/ffi.c', 'src/x86/win32.S'], + 'SPARC': ['src/sparc/ffi.c', 'src/sparc/v8.S', 'src/sparc/v9.S'], +@@ -14,9 +14,10 @@ + 'IA64': ['src/ia64/ffi.c', 'src/ia64/unix.S'], + 'M32R': ['src/m32r/sysv.S', 'src/m32r/ffi.c'], + 'M68K': ['src/m68k/ffi.c', 'src/m68k/sysv.S'], +- 'POWERPC': ['src/powerpc/ffi.c', 'src/powerpc/sysv.S', 'src/powerpc/ppc_closure.S', 'src/powerpc/linux64.S', 'src/powerpc/linux64_closure.S'], ++ 'POWERPC': ['src/powerpc/ffi.c', 'src/powerpc/ffi_sysv.c', 'src/powerpc/ffi_linux64.c', 'src/powerpc/sysv.S', 'src/powerpc/ppc_closure.S', 'src/powerpc/linux64.S', 'src/powerpc/linux64_closure.S'], + 'POWERPC_AIX': ['src/powerpc/ffi_darwin.c', 'src/powerpc/aix.S', 'src/powerpc/aix_closure.S'], + 'POWERPC_FREEBSD': ['src/powerpc/ffi.c', 'src/powerpc/sysv.S', 'src/powerpc/ppc_closure.S'], ++ 'AARCH64': ['src/aarch64/sysv.S', 'src/aarch64/ffi.c'], + 'ARM': ['src/arm/sysv.S', 'src/arm/ffi.c'], + 'LIBFFI_CRIS': ['src/cris/sysv.S', 'src/cris/ffi.c'], + 'FRV': ['src/frv/eabi.S', 'src/frv/ffi.c'], +diff -r c0e311e010fc Modules/_ctypes/libffi/generate-darwin-source-and-headers.py +--- /dev/null ++++ b/Modules/_ctypes/libffi/generate-darwin-source-and-headers.py +@@ -0,0 +1,209 @@ ++#!/usr/bin/env python ++import subprocess ++import os ++import errno ++import collections ++import glob ++import argparse ++ ++class Platform(object): ++ pass ++ ++class simulator_platform(Platform): ++ directory = 'darwin_ios' ++ sdk = 'iphonesimulator' ++ arch = 'i386' ++ triple = 'i386-apple-darwin11' ++ version_min = '-miphoneos-version-min=5.1.1' ++ ++ prefix = "#ifdef __i386__\n\n" ++ suffix = "\n\n#endif" ++ src_dir = 'x86' ++ src_files = ['darwin.S', 'win32.S', 'ffi.c'] ++ ++ ++class simulator64_platform(Platform): ++ directory = 'darwin_ios' ++ sdk = 'iphonesimulator' ++ arch = 'x86_64' ++ triple = 'x86_64-apple-darwin13' ++ version_min = '-miphoneos-version-min=7.0' ++ ++ prefix = "#ifdef __x86_64__\n\n" ++ suffix = "\n\n#endif" ++ src_dir = 'x86' ++ src_files = ['darwin64.S', 'ffi64.c'] ++ ++ ++class device_platform(Platform): ++ directory = 'darwin_ios' ++ sdk = 'iphoneos' ++ arch = 'armv7' ++ triple = 'arm-apple-darwin11' ++ version_min = '-miphoneos-version-min=5.1.1' ++ ++ prefix = "#ifdef __arm__\n\n" ++ suffix = "\n\n#endif" ++ src_dir = 'arm' ++ src_files = ['sysv.S', 'trampoline.S', 'ffi.c'] ++ ++ ++class device64_platform(Platform): ++ directory = 'darwin_ios' ++ sdk = 'iphoneos' ++ arch = 'arm64' ++ triple = 'aarch64-apple-darwin13' ++ version_min = '-miphoneos-version-min=7.0' ++ ++ prefix = "#ifdef __arm64__\n\n" ++ suffix = "\n\n#endif" ++ src_dir = 'aarch64' ++ src_files = ['sysv.S', 'ffi.c'] ++ ++ ++class desktop32_platform(Platform): ++ directory = 'darwin_osx' ++ sdk = 'macosx' ++ arch = 'i386' ++ triple = 'i386-apple-darwin10' ++ version_min = '-mmacosx-version-min=10.6' ++ src_dir = 'x86' ++ src_files = ['darwin.S', 'win32.S', 'ffi.c'] ++ ++ prefix = "#ifdef __i386__\n\n" ++ suffix = "\n\n#endif" ++ ++ ++class desktop64_platform(Platform): ++ directory = 'darwin_osx' ++ sdk = 'macosx' ++ arch = 'x86_64' ++ triple = 'x86_64-apple-darwin10' ++ version_min = '-mmacosx-version-min=10.6' ++ ++ prefix = "#ifdef __x86_64__\n\n" ++ suffix = "\n\n#endif" ++ src_dir = 'x86' ++ src_files = ['darwin64.S', 'ffi64.c'] ++ ++ ++def mkdir_p(path): ++ try: ++ os.makedirs(path) ++ except OSError as exc: # Python >2.5 ++ if exc.errno == errno.EEXIST: ++ pass ++ else: ++ raise ++ ++ ++def move_file(src_dir, dst_dir, filename, file_suffix=None, prefix='', suffix=''): ++ mkdir_p(dst_dir) ++ out_filename = filename ++ ++ if file_suffix: ++ split_name = os.path.splitext(filename) ++ out_filename = "%s_%s%s" % (split_name[0], file_suffix, split_name[1]) ++ ++ with open(os.path.join(src_dir, filename)) as in_file: ++ with open(os.path.join(dst_dir, out_filename), 'w') as out_file: ++ if prefix: ++ out_file.write(prefix) ++ ++ out_file.write(in_file.read()) ++ ++ if suffix: ++ out_file.write(suffix) ++ ++ ++def list_files(src_dir, pattern=None, filelist=None): ++ if pattern: filelist = glob.iglob(os.path.join(src_dir, pattern)) ++ for file in filelist: ++ yield os.path.basename(file) ++ ++ ++def copy_files(src_dir, dst_dir, pattern=None, filelist=None, file_suffix=None, prefix=None, suffix=None): ++ for filename in list_files(src_dir, pattern=pattern, filelist=filelist): ++ move_file(src_dir, dst_dir, filename, file_suffix=file_suffix, prefix=prefix, suffix=suffix) ++ ++ ++def copy_src_platform_files(platform): ++ src_dir = os.path.join('src', platform.src_dir) ++ dst_dir = os.path.join(platform.directory, 'src', platform.src_dir) ++ copy_files(src_dir, dst_dir, filelist=platform.src_files, file_suffix=platform.arch, prefix=platform.prefix, suffix=platform.suffix) ++ ++ ++def build_target(platform, platform_headers): ++ def xcrun_cmd(cmd): ++ return 'xcrun -sdk %s %s -arch %s' % (platform.sdk, cmd, platform.arch) ++ ++ tag='%s-%s' % (platform.sdk, platform.arch) ++ build_dir = 'build_%s' % tag ++ mkdir_p(build_dir) ++ env = dict(CC=xcrun_cmd('clang'), ++ LD=xcrun_cmd('ld'), ++ CFLAGS='%s' % (platform.version_min)) ++ working_dir = os.getcwd() ++ try: ++ os.chdir(build_dir) ++ subprocess.check_call(['../configure', '-host', platform.triple], env=env) ++ finally: ++ os.chdir(working_dir) ++ ++ for src_dir in [build_dir, os.path.join(build_dir, 'include')]: ++ copy_files(src_dir, ++ os.path.join(platform.directory, 'include'), ++ pattern='*.h', ++ file_suffix=platform.arch, ++ prefix=platform.prefix, ++ suffix=platform.suffix) ++ ++ for filename in list_files(src_dir, pattern='*.h'): ++ platform_headers[filename].add((platform.prefix, platform.arch, platform.suffix)) ++ ++ ++def make_tramp(): ++ with open('src/arm/trampoline.S', 'w') as tramp_out: ++ p = subprocess.Popen(['bash', 'src/arm/gentramp.sh'], stdout=tramp_out) ++ p.wait() ++ ++ ++def generate_source_and_headers(generate_osx=True, generate_ios=True): ++ copy_files('src', 'darwin_common/src', pattern='*.c') ++ copy_files('include', 'darwin_common/include', pattern='*.h') ++ ++ if generate_ios: ++ make_tramp() ++ copy_src_platform_files(simulator_platform) ++ copy_src_platform_files(simulator64_platform) ++ copy_src_platform_files(device_platform) ++ copy_src_platform_files(device64_platform) ++ if generate_osx: ++ copy_src_platform_files(desktop32_platform) ++ copy_src_platform_files(desktop64_platform) ++ ++ platform_headers = collections.defaultdict(set) ++ ++ if generate_ios: ++ build_target(simulator_platform, platform_headers) ++ build_target(simulator64_platform, platform_headers) ++ build_target(device_platform, platform_headers) ++ build_target(device64_platform, platform_headers) ++ if generate_osx: ++ build_target(desktop32_platform, platform_headers) ++ build_target(desktop64_platform, platform_headers) ++ ++ mkdir_p('darwin_common/include') ++ for header_name, tag_tuples in platform_headers.iteritems(): ++ basename, suffix = os.path.splitext(header_name) ++ with open(os.path.join('darwin_common/include', header_name), 'w') as header: ++ for tag_tuple in tag_tuples: ++ header.write('%s#include <%s_%s%s>\n%s\n' % (tag_tuple[0], basename, tag_tuple[1], suffix, tag_tuple[2])) ++ ++if __name__ == '__main__': ++ parser = argparse.ArgumentParser() ++ parser.add_argument('--only-ios', action='store_true', default=False) ++ parser.add_argument('--only-osx', action='store_true', default=False) ++ args = parser.parse_args() ++ ++ generate_source_and_headers(generate_osx=not args.only_ios, generate_ios=not args.only_osx) +diff -r c0e311e010fc Modules/_ctypes/libffi/generate-ios-source-and-headers.py +--- a/Modules/_ctypes/libffi/generate-ios-source-and-headers.py ++++ /dev/null +@@ -1,160 +0,0 @@ +-#!/usr/bin/env python +- +-import subprocess +-import re +-import os +-import errno +-import collections +-import sys +- +-class Platform(object): +- pass +- +-sdk_re = re.compile(r'.*-sdk ([a-zA-Z0-9.]*)') +- +-def sdkinfo(sdkname): +- ret = {} +- for line in subprocess.Popen(['xcodebuild', '-sdk', sdkname, '-version'], stdout=subprocess.PIPE).stdout: +- kv = line.strip().split(': ', 1) +- if len(kv) == 2: +- k,v = kv +- ret[k] = v +- return ret +- +-sim_sdk_info = sdkinfo('iphonesimulator') +-device_sdk_info = sdkinfo('iphoneos') +- +-def latest_sdks(): +- latest_sim = None +- latest_device = None +- for line in subprocess.Popen(['xcodebuild', '-showsdks'], stdout=subprocess.PIPE).stdout: +- match = sdk_re.match(line) +- if match: +- if 'Simulator' in line: +- latest_sim = match.group(1) +- elif 'iOS' in line: +- latest_device = match.group(1) +- +- return latest_sim, latest_device +- +-sim_sdk, device_sdk = latest_sdks() +- +-class simulator_platform(Platform): +- sdk='iphonesimulator' +- arch = 'i386' +- name = 'simulator' +- triple = 'i386-apple-darwin10' +- sdkroot = sim_sdk_info['Path'] +- +- prefix = "#if !defined(__arm__) && defined(__i386__)\n\n" +- suffix = "\n\n#endif" +- +-class device_platform(Platform): +- sdk='iphoneos' +- name = 'ios' +- arch = 'armv7' +- triple = 'arm-apple-darwin10' +- sdkroot = device_sdk_info['Path'] +- +- prefix = "#ifdef __arm__\n\n" +- suffix = "\n\n#endif" +- +- +-def move_file(src_dir, dst_dir, filename, file_suffix=None, prefix='', suffix=''): +- if not os.path.exists(dst_dir): +- os.makedirs(dst_dir) +- +- out_filename = filename +- +- if file_suffix: +- split_name = os.path.splitext(filename) +- out_filename = "%s_%s%s" % (split_name[0], file_suffix, split_name[1]) +- +- with open(os.path.join(src_dir, filename)) as in_file: +- with open(os.path.join(dst_dir, out_filename), 'w') as out_file: +- if prefix: +- out_file.write(prefix) +- +- out_file.write(in_file.read()) +- +- if suffix: +- out_file.write(suffix) +- +-headers_seen = collections.defaultdict(set) +- +-def move_source_tree(src_dir, dest_dir, dest_include_dir, arch=None, prefix=None, suffix=None): +- for root, dirs, files in os.walk(src_dir, followlinks=True): +- relroot = os.path.relpath(root,src_dir) +- +- def move_dir(arch, prefix='', suffix='', files=[]): +- for file in files: +- file_suffix = None +- if file.endswith('.h'): +- if dest_include_dir: +- file_suffix = arch +- if arch: +- headers_seen[file].add(arch) +- move_file(root, dest_include_dir, file, arch, prefix=prefix, suffix=suffix) +- +- elif dest_dir: +- outroot = os.path.join(dest_dir, relroot) +- move_file(root, outroot, file, prefix=prefix, suffix=suffix) +- +- if relroot == '.': +- move_dir(arch=arch, +- files=files, +- prefix=prefix, +- suffix=suffix) +- elif relroot == 'arm': +- move_dir(arch='arm', +- prefix="#ifdef __arm__\n\n", +- suffix="\n\n#endif", +- files=files) +- elif relroot == 'x86': +- move_dir(arch='i386', +- prefix="#if !defined(__arm__) && defined(__i386__)\n\n", +- suffix="\n\n#endif", +- files=files) +- +-def build_target(platform): +- def xcrun_cmd(cmd): +- return subprocess.check_output(['xcrun', '-sdk', platform.sdkroot, '-find', cmd]).strip() +- +- build_dir = 'build_' + platform.name +- if not os.path.exists(build_dir): +- os.makedirs(build_dir) +- env = dict(CC=xcrun_cmd('clang'), +- LD=xcrun_cmd('ld'), +- CFLAGS='-arch %s -isysroot %s -miphoneos-version-min=4.0' % (platform.arch, platform.sdkroot)) +- working_dir=os.getcwd() +- try: +- os.chdir(build_dir) +- subprocess.check_call(['../configure', '-host', platform.triple], env=env) +- move_source_tree('.', None, '../ios/include', +- arch=platform.arch, +- prefix=platform.prefix, +- suffix=platform.suffix) +- move_source_tree('./include', None, '../ios/include', +- arch=platform.arch, +- prefix=platform.prefix, +- suffix=platform.suffix) +- finally: +- os.chdir(working_dir) +- +- for header_name, archs in headers_seen.iteritems(): +- basename, suffix = os.path.splitext(header_name) +- +-def main(): +- move_source_tree('src', 'ios/src', 'ios/include') +- move_source_tree('include', None, 'ios/include') +- build_target(simulator_platform) +- build_target(device_platform) +- +- for header_name, archs in headers_seen.iteritems(): +- basename, suffix = os.path.splitext(header_name) +- with open(os.path.join('ios/include', header_name), 'w') as header: +- for arch in archs: +- header.write('#include <%s_%s%s>\n' % (basename, arch, suffix)) +- +-if __name__ == '__main__': +- main() +diff -r c0e311e010fc Modules/_ctypes/libffi/generate-osx-source-and-headers.py +--- a/Modules/_ctypes/libffi/generate-osx-source-and-headers.py ++++ /dev/null +@@ -1,153 +0,0 @@ +-#!/usr/bin/env python +-import subprocess +-import re +-import os +-import errno +-import collections +-import sys +- +-class Platform(object): +- pass +- +-sdk_re = re.compile(r'.*-sdk ([a-zA-Z0-9.]*)') +- +-def sdkinfo(sdkname): +- ret = {} +- for line in subprocess.Popen(['xcodebuild', '-sdk', sdkname, '-version'], stdout=subprocess.PIPE).stdout: +- kv = line.strip().split(': ', 1) +- if len(kv) == 2: +- k,v = kv +- ret[k] = v +- return ret +- +-desktop_sdk_info = sdkinfo('macosx') +- +-def latest_sdks(): +- latest_desktop = None +- for line in subprocess.Popen(['xcodebuild', '-showsdks'], stdout=subprocess.PIPE).stdout: +- match = sdk_re.match(line) +- if match: +- if 'OS X' in line: +- latest_desktop = match.group(1) +- +- return latest_desktop +- +-desktop_sdk = latest_sdks() +- +-class desktop_platform_32(Platform): +- sdk='macosx' +- arch = 'i386' +- name = 'mac32' +- triple = 'i386-apple-darwin10' +- sdkroot = desktop_sdk_info['Path'] +- +- prefix = "#if defined(__i386__) && !defined(__x86_64__)\n\n" +- suffix = "\n\n#endif" +- +-class desktop_platform_64(Platform): +- sdk='macosx' +- arch = 'x86_64' +- name = 'mac' +- triple = 'x86_64-apple-darwin10' +- sdkroot = desktop_sdk_info['Path'] +- +- prefix = "#if !defined(__i386__) && defined(__x86_64__)\n\n" +- suffix = "\n\n#endif" +- +-def move_file(src_dir, dst_dir, filename, file_suffix=None, prefix='', suffix=''): +- if not os.path.exists(dst_dir): +- os.makedirs(dst_dir) +- +- out_filename = filename +- +- if file_suffix: +- split_name = os.path.splitext(filename) +- out_filename = "%s_%s%s" % (split_name[0], file_suffix, split_name[1]) +- +- with open(os.path.join(src_dir, filename)) as in_file: +- with open(os.path.join(dst_dir, out_filename), 'w') as out_file: +- if prefix: +- out_file.write(prefix) +- +- out_file.write(in_file.read()) +- +- if suffix: +- out_file.write(suffix) +- +-headers_seen = collections.defaultdict(set) +- +-def move_source_tree(src_dir, dest_dir, dest_include_dir, arch=None, prefix=None, suffix=None): +- for root, dirs, files in os.walk(src_dir, followlinks=True): +- relroot = os.path.relpath(root,src_dir) +- +- def move_dir(arch, prefix='', suffix='', files=[]): +- for file in files: +- file_suffix = None +- if file.endswith('.h'): +- if dest_include_dir: +- file_suffix = arch +- if arch: +- headers_seen[file].add(arch) +- move_file(root, dest_include_dir, file, arch, prefix=prefix, suffix=suffix) +- +- elif dest_dir: +- outroot = os.path.join(dest_dir, relroot) +- move_file(root, outroot, file, prefix=prefix, suffix=suffix) +- +- if relroot == '.': +- move_dir(arch=arch, +- files=files, +- prefix=prefix, +- suffix=suffix) +- elif relroot == 'x86': +- move_dir(arch='i386', +- prefix="#if defined(__i386__) && !defined(__x86_64__)\n\n", +- suffix="\n\n#endif", +- files=files) +- move_dir(arch='x86_64', +- prefix="#if !defined(__i386__) && defined(__x86_64__)\n\n", +- suffix="\n\n#endif", +- files=files) +- +-def build_target(platform): +- def xcrun_cmd(cmd): +- return subprocess.check_output(['xcrun', '-sdk', platform.sdkroot, '-find', cmd]).strip() +- +- build_dir = 'build_' + platform.name +- if not os.path.exists(build_dir): +- os.makedirs(build_dir) +- env = dict(CC=xcrun_cmd('clang'), +- LD=xcrun_cmd('ld'), +- CFLAGS='-arch %s -isysroot %s -mmacosx-version-min=10.6' % (platform.arch, platform.sdkroot)) +- working_dir=os.getcwd() +- try: +- os.chdir(build_dir) +- subprocess.check_call(['../configure', '-host', platform.triple], env=env) +- move_source_tree('.', None, '../osx/include', +- arch=platform.arch, +- prefix=platform.prefix, +- suffix=platform.suffix) +- move_source_tree('./include', None, '../osx/include', +- arch=platform.arch, +- prefix=platform.prefix, +- suffix=platform.suffix) +- finally: +- os.chdir(working_dir) +- +- for header_name, archs in headers_seen.iteritems(): +- basename, suffix = os.path.splitext(header_name) +- +-def main(): +- move_source_tree('src', 'osx/src', 'osx/include') +- move_source_tree('include', None, 'osx/include') +- build_target(desktop_platform_32) +- build_target(desktop_platform_64) +- +- for header_name, archs in headers_seen.iteritems(): +- basename, suffix = os.path.splitext(header_name) +- with open(os.path.join('osx/include', header_name), 'w') as header: +- for arch in archs: +- header.write('#include <%s_%s%s>\n' % (basename, arch, suffix)) +- +-if __name__ == '__main__': +- main() +diff -r c0e311e010fc Modules/_ctypes/libffi/include/Makefile.in +--- a/Modules/_ctypes/libffi/include/Makefile.in ++++ b/Modules/_ctypes/libffi/include/Makefile.in +@@ -1,7 +1,7 @@ +-# Makefile.in generated by automake 1.12.2 from Makefile.am. ++# Makefile.in generated by automake 1.13.4 from Makefile.am. + # @configure_input@ + +-# Copyright (C) 1994-2012 Free Software Foundation, Inc. ++# Copyright (C) 1994-2013 Free Software Foundation, Inc. + + # This Makefile.in is free software; the Free Software Foundation + # gives unlimited permission to copy and/or distribute it, +@@ -15,23 +15,51 @@ + @SET_MAKE@ + + VPATH = @srcdir@ +-am__make_dryrun = \ +- { \ +- am__dry=no; \ ++am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' ++am__make_running_with_option = \ ++ case $${target_option-} in \ ++ ?) ;; \ ++ *) echo "am__make_running_with_option: internal error: invalid" \ ++ "target option '$${target_option-}' specified" >&2; \ ++ exit 1;; \ ++ esac; \ ++ has_opt=no; \ ++ sane_makeflags=$$MAKEFLAGS; \ ++ if $(am__is_gnu_make); then \ ++ sane_makeflags=$$MFLAGS; \ ++ else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ +- echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ +- | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ +- *) \ +- for am__flg in $$MAKEFLAGS; do \ +- case $$am__flg in \ +- *=*|--*) ;; \ +- *n*) am__dry=yes; break;; \ +- esac; \ +- done;; \ ++ bs=\\; \ ++ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ ++ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ +- test $$am__dry = yes; \ +- } ++ fi; \ ++ skip_next=no; \ ++ strip_trailopt () \ ++ { \ ++ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ ++ }; \ ++ for flg in $$sane_makeflags; do \ ++ test $$skip_next = yes && { skip_next=no; continue; }; \ ++ case $$flg in \ ++ *=*|--*) continue;; \ ++ -*I) strip_trailopt 'I'; skip_next=yes;; \ ++ -*I?*) strip_trailopt 'I';; \ ++ -*O) strip_trailopt 'O'; skip_next=yes;; \ ++ -*O?*) strip_trailopt 'O';; \ ++ -*l) strip_trailopt 'l'; skip_next=yes;; \ ++ -*l?*) strip_trailopt 'l';; \ ++ -[dEDm]) skip_next=yes;; \ ++ -[JT]) skip_next=yes;; \ ++ esac; \ ++ case $$flg in \ ++ *$$target_option*) has_opt=yes; break;; \ ++ esac; \ ++ done; \ ++ test $$has_opt = yes ++am__make_dryrun = (target_option=n; $(am__make_running_with_option)) ++am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) + pkgdatadir = $(datadir)/@PACKAGE@ + pkgincludedir = $(includedir)/@PACKAGE@ + pkglibdir = $(libdir)/@PACKAGE@ +@@ -52,7 +80,7 @@ + host_triplet = @host@ + target_triplet = @target@ + subdir = include +-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ ++DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ + $(srcdir)/ffi.h.in + ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 + am__aclocal_m4_deps = $(top_srcdir)/m4/asmcfi.m4 \ +@@ -75,6 +103,18 @@ + CONFIG_HEADER = $(top_builddir)/fficonfig.h + CONFIG_CLEAN_FILES = ffi.h ffitarget.h + CONFIG_CLEAN_VPATH_FILES = ++AM_V_P = $(am__v_P_@AM_V@) ++am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) ++am__v_P_0 = false ++am__v_P_1 = : ++AM_V_GEN = $(am__v_GEN_@AM_V@) ++am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) ++am__v_GEN_0 = @echo " GEN " $@; ++am__v_GEN_1 = ++AM_V_at = $(am__v_at_@AM_V@) ++am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) ++am__v_at_0 = @ ++am__v_at_1 = + SOURCES = + DIST_SOURCES = + am__can_run_installinfo = \ +@@ -111,12 +151,30 @@ + } + am__installdirs = "$(DESTDIR)$(includesdir)" + HEADERS = $(nodist_includes_HEADERS) ++am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) ++# Read a list of newline-separated strings from the standard input, ++# and print each of them once, without duplicates. Input order is ++# *not* preserved. ++am__uniquify_input = $(AWK) '\ ++ BEGIN { nonempty = 0; } \ ++ { items[$$0] = 1; nonempty = 1; } \ ++ END { if (nonempty) { for (i in items) print i; }; } \ ++' ++# Make sure the list of sources is unique. This is necessary because, ++# e.g., the same source file might be shared among _SOURCES variables ++# for different programs/libraries. ++am__define_uniq_tagged_files = \ ++ list='$(am__tagged_files)'; \ ++ unique=`for i in $$list; do \ ++ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ ++ done | $(am__uniquify_input)` + ETAGS = etags + CTAGS = ctags + DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) + ACLOCAL = @ACLOCAL@ + ALLOCA = @ALLOCA@ + AMTAR = @AMTAR@ ++AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ + AM_LTLDFLAGS = @AM_LTLDFLAGS@ + AM_RUNTESTFLAGS = @AM_RUNTESTFLAGS@ + AR = @AR@ +@@ -132,6 +190,10 @@ + CFLAGS = @CFLAGS@ + CPP = @CPP@ + CPPFLAGS = @CPPFLAGS@ ++CXX = @CXX@ ++CXXCPP = @CXXCPP@ ++CXXDEPMODE = @CXXDEPMODE@ ++CXXFLAGS = @CXXFLAGS@ + CYGPATH_W = @CYGPATH_W@ + DEFS = @DEFS@ + DEPDIR = @DEPDIR@ +@@ -147,6 +209,7 @@ + FGREP = @FGREP@ + GREP = @GREP@ + HAVE_LONG_DOUBLE = @HAVE_LONG_DOUBLE@ ++HAVE_LONG_DOUBLE_VARIANT = @HAVE_LONG_DOUBLE_VARIANT@ + INSTALL = @INSTALL@ + INSTALL_DATA = @INSTALL_DATA@ + INSTALL_PROGRAM = @INSTALL_PROGRAM@ +@@ -193,6 +256,7 @@ + abs_top_srcdir = @abs_top_srcdir@ + ac_ct_AR = @ac_ct_AR@ + ac_ct_CC = @ac_ct_CC@ ++ac_ct_CXX = @ac_ct_CXX@ + ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ + am__include = @am__include@ + am__leading_dot = @am__leading_dot@ +@@ -315,26 +379,15 @@ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + dir='$(DESTDIR)$(includesdir)'; $(am__uninstall_files_from_dir) + +-ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) +- list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ +- unique=`for i in $$list; do \ +- if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ +- done | \ +- $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ +- END { if (nonempty) { for (i in files) print i; }; }'`; \ +- mkid -fID $$unique +-tags: TAGS ++ID: $(am__tagged_files) ++ $(am__define_uniq_tagged_files); mkid -fID $$unique ++tags: tags-am ++TAGS: tags + +-TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ +- $(TAGS_FILES) $(LISP) ++tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + set x; \ + here=`pwd`; \ +- list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ +- unique=`for i in $$list; do \ +- if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ +- done | \ +- $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ +- END { if (nonempty) { for (i in files) print i; }; }'`; \ ++ $(am__define_uniq_tagged_files); \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ +@@ -346,15 +399,11 @@ + $$unique; \ + fi; \ + fi +-ctags: CTAGS +-CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ +- $(TAGS_FILES) $(LISP) +- list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ +- unique=`for i in $$list; do \ +- if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ +- done | \ +- $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ +- END { if (nonempty) { for (i in files) print i; }; }'`; \ ++ctags: ctags-am ++ ++CTAGS: ctags ++ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) ++ $(am__define_uniq_tagged_files); \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique +@@ -363,9 +412,10 @@ + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" ++cscopelist: cscopelist-am + +-cscopelist: $(HEADERS) $(SOURCES) $(LISP) +- list='$(SOURCES) $(HEADERS) $(LISP)'; \ ++cscopelist-am: $(am__tagged_files) ++ list='$(am__tagged_files)'; \ + case "$(srcdir)" in \ + [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ + *) sdir=$(subdir)/$(srcdir) ;; \ +@@ -517,18 +567,19 @@ + + .MAKE: install-am install-strip + +-.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ +- clean-libtool cscopelist ctags distclean distclean-generic \ +- distclean-libtool distclean-tags distdir dvi dvi-am html \ +- html-am info info-am install install-am install-data \ +- install-data-am install-dvi install-dvi-am install-exec \ +- install-exec-am install-html install-html-am install-info \ +- install-info-am install-man install-nodist_includesHEADERS \ +- install-pdf install-pdf-am install-ps install-ps-am \ +- install-strip installcheck installcheck-am installdirs \ +- maintainer-clean maintainer-clean-generic mostlyclean \ +- mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ +- tags uninstall uninstall-am uninstall-nodist_includesHEADERS ++.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ ++ clean-libtool cscopelist-am ctags ctags-am distclean \ ++ distclean-generic distclean-libtool distclean-tags distdir dvi \ ++ dvi-am html html-am info info-am install install-am \ ++ install-data install-data-am install-dvi install-dvi-am \ ++ install-exec install-exec-am install-html install-html-am \ ++ install-info install-info-am install-man \ ++ install-nodist_includesHEADERS install-pdf install-pdf-am \ ++ install-ps install-ps-am install-strip installcheck \ ++ installcheck-am installdirs maintainer-clean \ ++ maintainer-clean-generic mostlyclean mostlyclean-generic \ ++ mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \ ++ uninstall-am uninstall-nodist_includesHEADERS + + + # Tell versions [3.59,3.63) of GNU make to not export all variables. +diff -r c0e311e010fc Modules/_ctypes/libffi/include/ffi.h.in +--- a/Modules/_ctypes/libffi/include/ffi.h.in ++++ b/Modules/_ctypes/libffi/include/ffi.h.in +@@ -221,6 +221,11 @@ + #endif + } ffi_cif; + ++#if HAVE_LONG_DOUBLE_VARIANT ++/* Used to adjust size/alignment of ffi types. */ ++void ffi_prep_types (ffi_abi abi); ++# endif ++ + /* Used internally, but overridden by some architectures */ + ffi_status ffi_prep_cif_core(ffi_cif *cif, + ffi_abi abi, +diff -r c0e311e010fc Modules/_ctypes/libffi/include/ffi_common.h +--- a/Modules/_ctypes/libffi/include/ffi_common.h ++++ b/Modules/_ctypes/libffi/include/ffi_common.h +@@ -1,5 +1,5 @@ + /* ----------------------------------------------------------------------- +- ffi_common.h - Copyright (C) 2011, 2012 Anthony Green ++ ffi_common.h - Copyright (C) 2011, 2012, 2013 Anthony Green + Copyright (C) 2007 Free Software Foundation, Inc + Copyright (c) 1996 Red Hat, Inc. + +@@ -19,10 +19,14 @@ + /* Do not move this. Some versions of AIX are very picky about where + this is positioned. */ + #ifdef __GNUC__ +-/* mingw64 defines this already in malloc.h. */ +-#ifndef alloca +-# define alloca __builtin_alloca +-#endif ++# if HAVE_ALLOCA_H ++# include ++# else ++ /* mingw64 defines this already in malloc.h. */ ++# ifndef alloca ++# define alloca __builtin_alloca ++# endif ++# endif + # define MAYBE_UNUSED __attribute__((__unused__)) + #else + # define MAYBE_UNUSED +@@ -30,17 +34,17 @@ + # include + # else + # ifdef _AIX +- #pragma alloca ++# pragma alloca + # else + # ifndef alloca /* predefined by HP cc +Olibcalls */ + # ifdef _MSC_VER + # define alloca _alloca + # else + char *alloca (); +-# endif + # endif + # endif + # endif ++# endif + #endif + + /* Check for the existence of memcpy. */ +diff -r c0e311e010fc Modules/_ctypes/libffi/install-sh +--- a/Modules/_ctypes/libffi/install-sh ++++ b/Modules/_ctypes/libffi/install-sh +@@ -1,7 +1,7 @@ + #!/bin/sh + # install - install a program, script, or datafile + +-scriptversion=2009-04-28.21; # UTC ++scriptversion=2011-11-20.07; # UTC + + # This originates from X11R5 (mit/util/scripts/install.sh), which was + # later released in X11R6 (xc/config/util/install.sh) with the +@@ -35,7 +35,7 @@ + # FSF changes to this file are in the public domain. + # + # Calling this script install-sh is preferred over install.sh, to prevent +-# `make' implicit rules from creating a file called install from it ++# 'make' implicit rules from creating a file called install from it + # when there is no Makefile. + # + # This script is compatible with the BSD install script, but was written +@@ -156,6 +156,10 @@ + -s) stripcmd=$stripprog;; + + -t) dst_arg=$2 ++ # Protect names problematic for 'test' and other utilities. ++ case $dst_arg in ++ -* | [=\(\)!]) dst_arg=./$dst_arg;; ++ esac + shift;; + + -T) no_target_directory=true;; +@@ -186,6 +190,10 @@ + fi + shift # arg + dst_arg=$arg ++ # Protect names problematic for 'test' and other utilities. ++ case $dst_arg in ++ -* | [=\(\)!]) dst_arg=./$dst_arg;; ++ esac + done + fi + +@@ -194,13 +202,17 @@ + echo "$0: no input file specified." >&2 + exit 1 + fi +- # It's OK to call `install-sh -d' without argument. ++ # It's OK to call 'install-sh -d' without argument. + # This can happen when creating conditional directories. + exit 0 + fi + + if test -z "$dir_arg"; then +- trap '(exit $?); exit' 1 2 13 15 ++ do_exit='(exit $ret); exit $ret' ++ trap "ret=129; $do_exit" 1 ++ trap "ret=130; $do_exit" 2 ++ trap "ret=141; $do_exit" 13 ++ trap "ret=143; $do_exit" 15 + + # Set umask so as not to create temps with too-generous modes. + # However, 'strip' requires both read and write access to temps. +@@ -228,9 +240,9 @@ + + for src + do +- # Protect names starting with `-'. ++ # Protect names problematic for 'test' and other utilities. + case $src in +- -*) src=./$src;; ++ -* | [=\(\)!]) src=./$src;; + esac + + if test -n "$dir_arg"; then +@@ -252,12 +264,7 @@ + echo "$0: no destination specified." >&2 + exit 1 + fi +- + dst=$dst_arg +- # Protect names starting with `-'. +- case $dst in +- -*) dst=./$dst;; +- esac + + # If destination is a directory, append the input filename; won't work + # if double slashes aren't ignored. +@@ -347,7 +354,7 @@ + if test -z "$dir_arg" || { + # Check for POSIX incompatibilities with -m. + # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or +- # other-writeable bit of parent directory when it shouldn't. ++ # other-writable bit of parent directory when it shouldn't. + # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. + ls_ld_tmpdir=`ls -ld "$tmpdir"` + case $ls_ld_tmpdir in +@@ -385,7 +392,7 @@ + + case $dstdir in + /*) prefix='/';; +- -*) prefix='./';; ++ [-=\(\)!]*) prefix='./';; + *) prefix='';; + esac + +@@ -403,7 +410,7 @@ + + for d + do +- test -z "$d" && continue ++ test X"$d" = X && continue + + prefix=$prefix$d + if test -d "$prefix"; then +diff -r c0e311e010fc Modules/_ctypes/libffi/libffi.pc.in +--- a/Modules/_ctypes/libffi/libffi.pc.in ++++ b/Modules/_ctypes/libffi/libffi.pc.in +@@ -1,10 +1,11 @@ + prefix=@prefix@ + exec_prefix=@exec_prefix@ + libdir=@libdir@ ++toolexeclibdir=@toolexeclibdir@ + includedir=${libdir}/@PACKAGE_NAME@-@PACKAGE_VERSION@/include + + Name: @PACKAGE_NAME@ + Description: Library supporting Foreign Function Interfaces + Version: @PACKAGE_VERSION@ +-Libs: -L${libdir} -lffi ++Libs: -L${toolexeclibdir} -lffi + Cflags: -I${includedir} +diff -r c0e311e010fc Modules/_ctypes/libffi/libffi.xcodeproj/project.pbxproj +--- a/Modules/_ctypes/libffi/libffi.xcodeproj/project.pbxproj ++++ b/Modules/_ctypes/libffi/libffi.xcodeproj/project.pbxproj +@@ -7,473 +7,448 @@ + objects = { + + /* Begin PBXBuildFile section */ +- 6C43CBDC1534F76F00162364 /* ffi.c in Sources */ = {isa = PBXBuildFile; fileRef = 6C43CBBD1534F76F00162364 /* ffi.c */; }; +- 6C43CBDD1534F76F00162364 /* sysv.S in Sources */ = {isa = PBXBuildFile; fileRef = 6C43CBBF1534F76F00162364 /* sysv.S */; }; +- 6C43CBDE1534F76F00162364 /* trampoline.S in Sources */ = {isa = PBXBuildFile; fileRef = 6C43CBC01534F76F00162364 /* trampoline.S */; }; +- 6C43CBE61534F76F00162364 /* darwin.S in Sources */ = {isa = PBXBuildFile; fileRef = 6C43CBC91534F76F00162364 /* darwin.S */; }; +- 6C43CBE81534F76F00162364 /* ffi.c in Sources */ = {isa = PBXBuildFile; fileRef = 6C43CBCB1534F76F00162364 /* ffi.c */; }; +- 6C43CC1F1534F77800162364 /* darwin.S in Sources */ = {isa = PBXBuildFile; fileRef = 6C43CC051534F77800162364 /* darwin.S */; }; +- 6C43CC201534F77800162364 /* darwin64.S in Sources */ = {isa = PBXBuildFile; fileRef = 6C43CC061534F77800162364 /* darwin64.S */; }; +- 6C43CC211534F77800162364 /* ffi.c in Sources */ = {isa = PBXBuildFile; fileRef = 6C43CC071534F77800162364 /* ffi.c */; }; +- 6C43CC221534F77800162364 /* ffi64.c in Sources */ = {isa = PBXBuildFile; fileRef = 6C43CC081534F77800162364 /* ffi64.c */; }; +- 6C43CC2F1534F7BE00162364 /* closures.c in Sources */ = {isa = PBXBuildFile; fileRef = 6C43CC281534F7BE00162364 /* closures.c */; }; +- 6C43CC301534F7BE00162364 /* closures.c in Sources */ = {isa = PBXBuildFile; fileRef = 6C43CC281534F7BE00162364 /* closures.c */; }; +- 6C43CC351534F7BE00162364 /* java_raw_api.c in Sources */ = {isa = PBXBuildFile; fileRef = 6C43CC2B1534F7BE00162364 /* java_raw_api.c */; }; +- 6C43CC361534F7BE00162364 /* java_raw_api.c in Sources */ = {isa = PBXBuildFile; fileRef = 6C43CC2B1534F7BE00162364 /* java_raw_api.c */; }; +- 6C43CC371534F7BE00162364 /* prep_cif.c in Sources */ = {isa = PBXBuildFile; fileRef = 6C43CC2C1534F7BE00162364 /* prep_cif.c */; }; +- 6C43CC381534F7BE00162364 /* prep_cif.c in Sources */ = {isa = PBXBuildFile; fileRef = 6C43CC2C1534F7BE00162364 /* prep_cif.c */; }; +- 6C43CC391534F7BE00162364 /* raw_api.c in Sources */ = {isa = PBXBuildFile; fileRef = 6C43CC2D1534F7BE00162364 /* raw_api.c */; }; +- 6C43CC3A1534F7BE00162364 /* raw_api.c in Sources */ = {isa = PBXBuildFile; fileRef = 6C43CC2D1534F7BE00162364 /* raw_api.c */; }; +- 6C43CC3B1534F7BE00162364 /* types.c in Sources */ = {isa = PBXBuildFile; fileRef = 6C43CC2E1534F7BE00162364 /* types.c */; }; +- 6C43CC3C1534F7BE00162364 /* types.c in Sources */ = {isa = PBXBuildFile; fileRef = 6C43CC2E1534F7BE00162364 /* types.c */; }; +- 6C43CC971535032600162364 /* ffi.h in Headers */ = {isa = PBXBuildFile; fileRef = 6C43CC8D1535032600162364 /* ffi.h */; settings = {ATTRIBUTES = (Public, ); }; }; +- 6C43CC981535032600162364 /* ffi_common.h in Headers */ = {isa = PBXBuildFile; fileRef = 6C43CC8E1535032600162364 /* ffi_common.h */; settings = {ATTRIBUTES = (Public, ); }; }; +- 6C43CC991535032600162364 /* ffi_i386.h in Headers */ = {isa = PBXBuildFile; fileRef = 6C43CC8F1535032600162364 /* ffi_i386.h */; settings = {ATTRIBUTES = (Public, ); }; }; +- 6C43CC9A1535032600162364 /* ffi_x86_64.h in Headers */ = {isa = PBXBuildFile; fileRef = 6C43CC901535032600162364 /* ffi_x86_64.h */; settings = {ATTRIBUTES = (Public, ); }; }; +- 6C43CC9B1535032600162364 /* fficonfig.h in Headers */ = {isa = PBXBuildFile; fileRef = 6C43CC911535032600162364 /* fficonfig.h */; }; +- 6C43CC9C1535032600162364 /* fficonfig_i386.h in Headers */ = {isa = PBXBuildFile; fileRef = 6C43CC921535032600162364 /* fficonfig_i386.h */; }; +- 6C43CC9D1535032600162364 /* fficonfig_x86_64.h in Headers */ = {isa = PBXBuildFile; fileRef = 6C43CC931535032600162364 /* fficonfig_x86_64.h */; }; +- 6C43CC9E1535032600162364 /* ffitarget.h in Headers */ = {isa = PBXBuildFile; fileRef = 6C43CC941535032600162364 /* ffitarget.h */; settings = {ATTRIBUTES = (Public, ); }; }; +- 6C43CC9F1535032600162364 /* ffitarget_i386.h in Headers */ = {isa = PBXBuildFile; fileRef = 6C43CC951535032600162364 /* ffitarget_i386.h */; settings = {ATTRIBUTES = (Public, ); }; }; +- 6C43CCA01535032600162364 /* ffitarget_x86_64.h in Headers */ = {isa = PBXBuildFile; fileRef = 6C43CC961535032600162364 /* ffitarget_x86_64.h */; settings = {ATTRIBUTES = (Public, ); }; }; +- 6C43CCAD1535039600162364 /* ffi.h in Headers */ = {isa = PBXBuildFile; fileRef = 6C43CCA21535039600162364 /* ffi.h */; settings = {ATTRIBUTES = (Public, ); }; }; +- 6C43CCAE1535039600162364 /* ffi_armv7.h in Headers */ = {isa = PBXBuildFile; fileRef = 6C43CCA31535039600162364 /* ffi_armv7.h */; settings = {ATTRIBUTES = (Public, ); }; }; +- 6C43CCAF1535039600162364 /* ffi_common.h in Headers */ = {isa = PBXBuildFile; fileRef = 6C43CCA41535039600162364 /* ffi_common.h */; settings = {ATTRIBUTES = (Public, ); }; }; +- 6C43CCB01535039600162364 /* ffi_i386.h in Headers */ = {isa = PBXBuildFile; fileRef = 6C43CCA51535039600162364 /* ffi_i386.h */; settings = {ATTRIBUTES = (Public, ); }; }; +- 6C43CCB11535039600162364 /* fficonfig.h in Headers */ = {isa = PBXBuildFile; fileRef = 6C43CCA61535039600162364 /* fficonfig.h */; }; +- 6C43CCB21535039600162364 /* fficonfig_armv7.h in Headers */ = {isa = PBXBuildFile; fileRef = 6C43CCA71535039600162364 /* fficonfig_armv7.h */; }; +- 6C43CCB31535039600162364 /* fficonfig_i386.h in Headers */ = {isa = PBXBuildFile; fileRef = 6C43CCA81535039600162364 /* fficonfig_i386.h */; }; +- 6C43CCB41535039600162364 /* ffitarget.h in Headers */ = {isa = PBXBuildFile; fileRef = 6C43CCA91535039600162364 /* ffitarget.h */; settings = {ATTRIBUTES = (Public, ); }; }; +- 6C43CCB51535039600162364 /* ffitarget_arm.h in Headers */ = {isa = PBXBuildFile; fileRef = 6C43CCAA1535039600162364 /* ffitarget_arm.h */; settings = {ATTRIBUTES = (Public, ); }; }; +- 6C43CCB61535039600162364 /* ffitarget_armv7.h in Headers */ = {isa = PBXBuildFile; fileRef = 6C43CCAB1535039600162364 /* ffitarget_armv7.h */; settings = {ATTRIBUTES = (Public, ); }; }; +- 6C43CCB71535039600162364 /* ffitarget_i386.h in Headers */ = {isa = PBXBuildFile; fileRef = 6C43CCAC1535039600162364 /* ffitarget_i386.h */; settings = {ATTRIBUTES = (Public, ); }; }; ++ DBFA714A187F1D8600A76262 /* ffi.h in Headers */ = {isa = PBXBuildFile; fileRef = DBFA713E187F1D8600A76262 /* ffi.h */; }; ++ DBFA714B187F1D8600A76262 /* ffi_common.h in Headers */ = {isa = PBXBuildFile; fileRef = DBFA713F187F1D8600A76262 /* ffi_common.h */; }; ++ DBFA714C187F1D8600A76262 /* fficonfig.h in Headers */ = {isa = PBXBuildFile; fileRef = DBFA7140187F1D8600A76262 /* fficonfig.h */; }; ++ DBFA714D187F1D8600A76262 /* ffitarget.h in Headers */ = {isa = PBXBuildFile; fileRef = DBFA7141187F1D8600A76262 /* ffitarget.h */; }; ++ DBFA714E187F1D8600A76262 /* closures.c in Sources */ = {isa = PBXBuildFile; fileRef = DBFA7143187F1D8600A76262 /* closures.c */; }; ++ DBFA714F187F1D8600A76262 /* closures.c in Sources */ = {isa = PBXBuildFile; fileRef = DBFA7143187F1D8600A76262 /* closures.c */; }; ++ DBFA7156187F1D8600A76262 /* prep_cif.c in Sources */ = {isa = PBXBuildFile; fileRef = DBFA7147187F1D8600A76262 /* prep_cif.c */; }; ++ DBFA7157187F1D8600A76262 /* prep_cif.c in Sources */ = {isa = PBXBuildFile; fileRef = DBFA7147187F1D8600A76262 /* prep_cif.c */; }; ++ DBFA7158187F1D8600A76262 /* raw_api.c in Sources */ = {isa = PBXBuildFile; fileRef = DBFA7148187F1D8600A76262 /* raw_api.c */; }; ++ DBFA7159187F1D8600A76262 /* raw_api.c in Sources */ = {isa = PBXBuildFile; fileRef = DBFA7148187F1D8600A76262 /* raw_api.c */; }; ++ DBFA715A187F1D8600A76262 /* types.c in Sources */ = {isa = PBXBuildFile; fileRef = DBFA7149187F1D8600A76262 /* types.c */; }; ++ DBFA715B187F1D8600A76262 /* types.c in Sources */ = {isa = PBXBuildFile; fileRef = DBFA7149187F1D8600A76262 /* types.c */; }; ++ DBFA7177187F1D9B00A76262 /* ffi_arm64.c in Sources */ = {isa = PBXBuildFile; fileRef = DBFA716C187F1D9B00A76262 /* ffi_arm64.c */; }; ++ DBFA7178187F1D9B00A76262 /* sysv_arm64.S in Sources */ = {isa = PBXBuildFile; fileRef = DBFA716D187F1D9B00A76262 /* sysv_arm64.S */; }; ++ DBFA7179187F1D9B00A76262 /* ffi_armv7.c in Sources */ = {isa = PBXBuildFile; fileRef = DBFA716F187F1D9B00A76262 /* ffi_armv7.c */; }; ++ DBFA717A187F1D9B00A76262 /* sysv_armv7.S in Sources */ = {isa = PBXBuildFile; fileRef = DBFA7170187F1D9B00A76262 /* sysv_armv7.S */; }; ++ DBFA717B187F1D9B00A76262 /* trampoline_armv7.S in Sources */ = {isa = PBXBuildFile; fileRef = DBFA7171187F1D9B00A76262 /* trampoline_armv7.S */; }; ++ DBFA717C187F1D9B00A76262 /* darwin64_x86_64.S in Sources */ = {isa = PBXBuildFile; fileRef = DBFA7173187F1D9B00A76262 /* darwin64_x86_64.S */; }; ++ DBFA717D187F1D9B00A76262 /* darwin_i386.S in Sources */ = {isa = PBXBuildFile; fileRef = DBFA7174187F1D9B00A76262 /* darwin_i386.S */; }; ++ DBFA717E187F1D9B00A76262 /* ffi64_x86_64.c in Sources */ = {isa = PBXBuildFile; fileRef = DBFA7175187F1D9B00A76262 /* ffi64_x86_64.c */; }; ++ DBFA717F187F1D9B00A76262 /* ffi_i386.c in Sources */ = {isa = PBXBuildFile; fileRef = DBFA7176187F1D9B00A76262 /* ffi_i386.c */; }; ++ DBFA718E187F1DA100A76262 /* ffi_i386.h in Headers */ = {isa = PBXBuildFile; fileRef = DBFA7182187F1DA100A76262 /* ffi_i386.h */; }; ++ DBFA718F187F1DA100A76262 /* ffi_x86_64.h in Headers */ = {isa = PBXBuildFile; fileRef = DBFA7183187F1DA100A76262 /* ffi_x86_64.h */; }; ++ DBFA7190187F1DA100A76262 /* fficonfig_i386.h in Headers */ = {isa = PBXBuildFile; fileRef = DBFA7184187F1DA100A76262 /* fficonfig_i386.h */; }; ++ DBFA7191187F1DA100A76262 /* fficonfig_x86_64.h in Headers */ = {isa = PBXBuildFile; fileRef = DBFA7185187F1DA100A76262 /* fficonfig_x86_64.h */; }; ++ DBFA7192187F1DA100A76262 /* ffitarget_i386.h in Headers */ = {isa = PBXBuildFile; fileRef = DBFA7186187F1DA100A76262 /* ffitarget_i386.h */; }; ++ DBFA7193187F1DA100A76262 /* ffitarget_x86_64.h in Headers */ = {isa = PBXBuildFile; fileRef = DBFA7187187F1DA100A76262 /* ffitarget_x86_64.h */; }; ++ DBFA7194187F1DA100A76262 /* darwin64_x86_64.S in Sources */ = {isa = PBXBuildFile; fileRef = DBFA718A187F1DA100A76262 /* darwin64_x86_64.S */; }; ++ DBFA7195187F1DA100A76262 /* darwin_i386.S in Sources */ = {isa = PBXBuildFile; fileRef = DBFA718B187F1DA100A76262 /* darwin_i386.S */; }; ++ DBFA7196187F1DA100A76262 /* ffi64_x86_64.c in Sources */ = {isa = PBXBuildFile; fileRef = DBFA718C187F1DA100A76262 /* ffi64_x86_64.c */; }; ++ DBFA7197187F1DA100A76262 /* ffi_i386.c in Sources */ = {isa = PBXBuildFile; fileRef = DBFA718D187F1DA100A76262 /* ffi_i386.c */; }; + /* End PBXBuildFile section */ + ++/* Begin PBXCopyFilesBuildPhase section */ ++ DB13B1641849DF1E0010F42D /* CopyFiles */ = { ++ isa = PBXCopyFilesBuildPhase; ++ buildActionMask = 8; ++ dstPath = "include/$(PRODUCT_NAME)"; ++ dstSubfolderSpec = 16; ++ files = ( ++ ); ++ runOnlyForDeploymentPostprocessing = 1; ++ }; ++/* End PBXCopyFilesBuildPhase section */ ++ + /* Begin PBXFileReference section */ +- 6C43CB3D1534E9D100162364 /* libffi.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libffi.a; sourceTree = BUILT_PRODUCTS_DIR; }; +- 6C43CBBD1534F76F00162364 /* ffi.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ffi.c; sourceTree = ""; }; +- 6C43CBBF1534F76F00162364 /* sysv.S */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.asm; path = sysv.S; sourceTree = ""; }; +- 6C43CBC01534F76F00162364 /* trampoline.S */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.asm; path = trampoline.S; sourceTree = ""; }; +- 6C43CBC91534F76F00162364 /* darwin.S */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.asm; path = darwin.S; sourceTree = ""; }; +- 6C43CBCB1534F76F00162364 /* ffi.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ffi.c; sourceTree = ""; }; +- 6C43CC051534F77800162364 /* darwin.S */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.asm; path = darwin.S; sourceTree = ""; }; +- 6C43CC061534F77800162364 /* darwin64.S */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.asm; path = darwin64.S; sourceTree = ""; }; +- 6C43CC071534F77800162364 /* ffi.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ffi.c; sourceTree = ""; }; +- 6C43CC081534F77800162364 /* ffi64.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ffi64.c; sourceTree = ""; }; +- 6C43CC281534F7BE00162364 /* closures.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = closures.c; path = src/closures.c; sourceTree = SOURCE_ROOT; }; +- 6C43CC2B1534F7BE00162364 /* java_raw_api.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = java_raw_api.c; path = src/java_raw_api.c; sourceTree = SOURCE_ROOT; }; +- 6C43CC2C1534F7BE00162364 /* prep_cif.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = prep_cif.c; path = src/prep_cif.c; sourceTree = SOURCE_ROOT; }; +- 6C43CC2D1534F7BE00162364 /* raw_api.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = raw_api.c; path = src/raw_api.c; sourceTree = SOURCE_ROOT; }; +- 6C43CC2E1534F7BE00162364 /* types.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = types.c; path = src/types.c; sourceTree = SOURCE_ROOT; }; +- 6C43CC8D1535032600162364 /* ffi.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ffi.h; sourceTree = ""; }; +- 6C43CC8E1535032600162364 /* ffi_common.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ffi_common.h; sourceTree = ""; }; +- 6C43CC8F1535032600162364 /* ffi_i386.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ffi_i386.h; sourceTree = ""; }; +- 6C43CC901535032600162364 /* ffi_x86_64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ffi_x86_64.h; sourceTree = ""; }; +- 6C43CC911535032600162364 /* fficonfig.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = fficonfig.h; sourceTree = ""; }; +- 6C43CC921535032600162364 /* fficonfig_i386.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = fficonfig_i386.h; sourceTree = ""; }; +- 6C43CC931535032600162364 /* fficonfig_x86_64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = fficonfig_x86_64.h; sourceTree = ""; }; +- 6C43CC941535032600162364 /* ffitarget.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ffitarget.h; sourceTree = ""; }; +- 6C43CC951535032600162364 /* ffitarget_i386.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ffitarget_i386.h; sourceTree = ""; }; +- 6C43CC961535032600162364 /* ffitarget_x86_64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ffitarget_x86_64.h; sourceTree = ""; }; +- 6C43CCA21535039600162364 /* ffi.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ffi.h; sourceTree = ""; }; +- 6C43CCA31535039600162364 /* ffi_armv7.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ffi_armv7.h; sourceTree = ""; }; +- 6C43CCA41535039600162364 /* ffi_common.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ffi_common.h; sourceTree = ""; }; +- 6C43CCA51535039600162364 /* ffi_i386.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ffi_i386.h; sourceTree = ""; }; +- 6C43CCA61535039600162364 /* fficonfig.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = fficonfig.h; sourceTree = ""; }; +- 6C43CCA71535039600162364 /* fficonfig_armv7.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = fficonfig_armv7.h; sourceTree = ""; }; +- 6C43CCA81535039600162364 /* fficonfig_i386.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = fficonfig_i386.h; sourceTree = ""; }; +- 6C43CCA91535039600162364 /* ffitarget.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ffitarget.h; sourceTree = ""; }; +- 6C43CCAA1535039600162364 /* ffitarget_arm.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ffitarget_arm.h; sourceTree = ""; }; +- 6C43CCAB1535039600162364 /* ffitarget_armv7.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ffitarget_armv7.h; sourceTree = ""; }; +- 6C43CCAC1535039600162364 /* ffitarget_i386.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ffitarget_i386.h; sourceTree = ""; }; +- F6F980BA147386130008F121 /* libffi.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libffi.a; sourceTree = BUILT_PRODUCTS_DIR; }; ++ DB13B1661849DF1E0010F42D /* libffi.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libffi.a; sourceTree = BUILT_PRODUCTS_DIR; }; ++ DB13B1911849DF510010F42D /* ffi.dylib */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.dylib"; includeInIndex = 0; path = ffi.dylib; sourceTree = BUILT_PRODUCTS_DIR; }; ++ DBFA713E187F1D8600A76262 /* ffi.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ffi.h; sourceTree = ""; }; ++ DBFA713F187F1D8600A76262 /* ffi_common.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ffi_common.h; sourceTree = ""; }; ++ DBFA7140187F1D8600A76262 /* fficonfig.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = fficonfig.h; sourceTree = ""; }; ++ DBFA7141187F1D8600A76262 /* ffitarget.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ffitarget.h; sourceTree = ""; }; ++ DBFA7143187F1D8600A76262 /* closures.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = closures.c; sourceTree = ""; }; ++ DBFA7145187F1D8600A76262 /* dlmalloc.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = dlmalloc.c; sourceTree = ""; }; ++ DBFA7147187F1D8600A76262 /* prep_cif.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = prep_cif.c; sourceTree = ""; }; ++ DBFA7148187F1D8600A76262 /* raw_api.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = raw_api.c; sourceTree = ""; }; ++ DBFA7149187F1D8600A76262 /* types.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = types.c; sourceTree = ""; }; ++ DBFA715E187F1D9B00A76262 /* ffi_arm64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ffi_arm64.h; sourceTree = ""; }; ++ DBFA715F187F1D9B00A76262 /* ffi_armv7.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ffi_armv7.h; sourceTree = ""; }; ++ DBFA7160187F1D9B00A76262 /* ffi_i386.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ffi_i386.h; sourceTree = ""; }; ++ DBFA7161187F1D9B00A76262 /* ffi_x86_64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ffi_x86_64.h; sourceTree = ""; }; ++ DBFA7162187F1D9B00A76262 /* fficonfig_arm64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = fficonfig_arm64.h; sourceTree = ""; }; ++ DBFA7163187F1D9B00A76262 /* fficonfig_armv7.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = fficonfig_armv7.h; sourceTree = ""; }; ++ DBFA7164187F1D9B00A76262 /* fficonfig_i386.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = fficonfig_i386.h; sourceTree = ""; }; ++ DBFA7165187F1D9B00A76262 /* fficonfig_x86_64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = fficonfig_x86_64.h; sourceTree = ""; }; ++ DBFA7166187F1D9B00A76262 /* ffitarget_arm64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ffitarget_arm64.h; sourceTree = ""; }; ++ DBFA7167187F1D9B00A76262 /* ffitarget_armv7.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ffitarget_armv7.h; sourceTree = ""; }; ++ DBFA7168187F1D9B00A76262 /* ffitarget_i386.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ffitarget_i386.h; sourceTree = ""; }; ++ DBFA7169187F1D9B00A76262 /* ffitarget_x86_64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ffitarget_x86_64.h; sourceTree = ""; }; ++ DBFA716C187F1D9B00A76262 /* ffi_arm64.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ffi_arm64.c; sourceTree = ""; }; ++ DBFA716D187F1D9B00A76262 /* sysv_arm64.S */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.asm; path = sysv_arm64.S; sourceTree = ""; }; ++ DBFA716F187F1D9B00A76262 /* ffi_armv7.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ffi_armv7.c; sourceTree = ""; }; ++ DBFA7170187F1D9B00A76262 /* sysv_armv7.S */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.asm; path = sysv_armv7.S; sourceTree = ""; }; ++ DBFA7171187F1D9B00A76262 /* trampoline_armv7.S */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.asm; path = trampoline_armv7.S; sourceTree = ""; }; ++ DBFA7173187F1D9B00A76262 /* darwin64_x86_64.S */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.asm; path = darwin64_x86_64.S; sourceTree = ""; }; ++ DBFA7174187F1D9B00A76262 /* darwin_i386.S */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.asm; path = darwin_i386.S; sourceTree = ""; }; ++ DBFA7175187F1D9B00A76262 /* ffi64_x86_64.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ffi64_x86_64.c; sourceTree = ""; }; ++ DBFA7176187F1D9B00A76262 /* ffi_i386.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ffi_i386.c; sourceTree = ""; }; ++ DBFA7182187F1DA100A76262 /* ffi_i386.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ffi_i386.h; sourceTree = ""; }; ++ DBFA7183187F1DA100A76262 /* ffi_x86_64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ffi_x86_64.h; sourceTree = ""; }; ++ DBFA7184187F1DA100A76262 /* fficonfig_i386.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = fficonfig_i386.h; sourceTree = ""; }; ++ DBFA7185187F1DA100A76262 /* fficonfig_x86_64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = fficonfig_x86_64.h; sourceTree = ""; }; ++ DBFA7186187F1DA100A76262 /* ffitarget_i386.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ffitarget_i386.h; sourceTree = ""; }; ++ DBFA7187187F1DA100A76262 /* ffitarget_x86_64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ffitarget_x86_64.h; sourceTree = ""; }; ++ DBFA718A187F1DA100A76262 /* darwin64_x86_64.S */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.asm; path = darwin64_x86_64.S; sourceTree = ""; }; ++ DBFA718B187F1DA100A76262 /* darwin_i386.S */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.asm; path = darwin_i386.S; sourceTree = ""; }; ++ DBFA718C187F1DA100A76262 /* ffi64_x86_64.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ffi64_x86_64.c; sourceTree = ""; }; ++ DBFA718D187F1DA100A76262 /* ffi_i386.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ffi_i386.c; sourceTree = ""; }; + /* End PBXFileReference section */ + +-/* Begin PBXFrameworksBuildPhase section */ +- 6C43CB3A1534E9D100162364 /* Frameworks */ = { +- isa = PBXFrameworksBuildPhase; +- buildActionMask = 2147483647; +- files = ( +- ); +- runOnlyForDeploymentPostprocessing = 0; +- }; +- F6F980B7147386130008F121 /* Frameworks */ = { +- isa = PBXFrameworksBuildPhase; +- buildActionMask = 2147483647; +- files = ( +- ); +- runOnlyForDeploymentPostprocessing = 0; +- }; +-/* End PBXFrameworksBuildPhase section */ +- + /* Begin PBXGroup section */ +- 6C43CBAF1534F76F00162364 /* iOS */ = { ++ DB13B15B1849DEB70010F42D = { + isa = PBXGroup; + children = ( +- 6C43CCA11535039600162364 /* include */, +- 6C43CBBB1534F76F00162364 /* src */, ++ DBFA713C187F1D8600A76262 /* darwin_common */, ++ DBFA715C187F1D9B00A76262 /* darwin_ios */, ++ DBFA7180187F1DA100A76262 /* darwin_osx */, ++ DB13B1671849DF1E0010F42D /* Products */, + ); +- name = iOS; +- path = ios; + sourceTree = ""; + }; +- 6C43CBBB1534F76F00162364 /* src */ = { ++ DB13B1671849DF1E0010F42D /* Products */ = { + isa = PBXGroup; + children = ( +- 6C43CBC81534F76F00162364 /* x86 */, +- 6C43CBBC1534F76F00162364 /* arm */, ++ DB13B1661849DF1E0010F42D /* libffi.a */, ++ DB13B1911849DF510010F42D /* ffi.dylib */, ++ ); ++ name = Products; ++ sourceTree = ""; ++ }; ++ DBFA713C187F1D8600A76262 /* darwin_common */ = { ++ isa = PBXGroup; ++ children = ( ++ DBFA713D187F1D8600A76262 /* include */, ++ DBFA7142187F1D8600A76262 /* src */, ++ ); ++ path = "darwin_common"; ++ sourceTree = ""; ++ }; ++ DBFA713D187F1D8600A76262 /* include */ = { ++ isa = PBXGroup; ++ children = ( ++ DBFA713E187F1D8600A76262 /* ffi.h */, ++ DBFA713F187F1D8600A76262 /* ffi_common.h */, ++ DBFA7140187F1D8600A76262 /* fficonfig.h */, ++ DBFA7141187F1D8600A76262 /* ffitarget.h */, ++ ); ++ path = include; ++ sourceTree = ""; ++ }; ++ DBFA7142187F1D8600A76262 /* src */ = { ++ isa = PBXGroup; ++ children = ( ++ DBFA7143187F1D8600A76262 /* closures.c */, ++ DBFA7145187F1D8600A76262 /* dlmalloc.c */, ++ DBFA7147187F1D8600A76262 /* prep_cif.c */, ++ DBFA7148187F1D8600A76262 /* raw_api.c */, ++ DBFA7149187F1D8600A76262 /* types.c */, + ); + path = src; + sourceTree = ""; + }; +- 6C43CBBC1534F76F00162364 /* arm */ = { ++ DBFA715C187F1D9B00A76262 /* darwin_ios */ = { + isa = PBXGroup; + children = ( +- 6C43CBBD1534F76F00162364 /* ffi.c */, +- 6C43CBBF1534F76F00162364 /* sysv.S */, +- 6C43CBC01534F76F00162364 /* trampoline.S */, ++ DBFA715D187F1D9B00A76262 /* include */, ++ DBFA716A187F1D9B00A76262 /* src */, ++ ); ++ path = "darwin_ios"; ++ sourceTree = ""; ++ }; ++ DBFA715D187F1D9B00A76262 /* include */ = { ++ isa = PBXGroup; ++ children = ( ++ DBFA715E187F1D9B00A76262 /* ffi_arm64.h */, ++ DBFA715F187F1D9B00A76262 /* ffi_armv7.h */, ++ DBFA7160187F1D9B00A76262 /* ffi_i386.h */, ++ DBFA7161187F1D9B00A76262 /* ffi_x86_64.h */, ++ DBFA7162187F1D9B00A76262 /* fficonfig_arm64.h */, ++ DBFA7163187F1D9B00A76262 /* fficonfig_armv7.h */, ++ DBFA7164187F1D9B00A76262 /* fficonfig_i386.h */, ++ DBFA7165187F1D9B00A76262 /* fficonfig_x86_64.h */, ++ DBFA7166187F1D9B00A76262 /* ffitarget_arm64.h */, ++ DBFA7167187F1D9B00A76262 /* ffitarget_armv7.h */, ++ DBFA7168187F1D9B00A76262 /* ffitarget_i386.h */, ++ DBFA7169187F1D9B00A76262 /* ffitarget_x86_64.h */, ++ ); ++ path = include; ++ sourceTree = ""; ++ }; ++ DBFA716A187F1D9B00A76262 /* src */ = { ++ isa = PBXGroup; ++ children = ( ++ DBFA716B187F1D9B00A76262 /* aarch64 */, ++ DBFA716E187F1D9B00A76262 /* arm */, ++ DBFA7172187F1D9B00A76262 /* x86 */, ++ ); ++ path = src; ++ sourceTree = ""; ++ }; ++ DBFA716B187F1D9B00A76262 /* aarch64 */ = { ++ isa = PBXGroup; ++ children = ( ++ DBFA716C187F1D9B00A76262 /* ffi_arm64.c */, ++ DBFA716D187F1D9B00A76262 /* sysv_arm64.S */, ++ ); ++ path = aarch64; ++ sourceTree = ""; ++ }; ++ DBFA716E187F1D9B00A76262 /* arm */ = { ++ isa = PBXGroup; ++ children = ( ++ DBFA716F187F1D9B00A76262 /* ffi_armv7.c */, ++ DBFA7170187F1D9B00A76262 /* sysv_armv7.S */, ++ DBFA7171187F1D9B00A76262 /* trampoline_armv7.S */, + ); + path = arm; + sourceTree = ""; + }; +- 6C43CBC81534F76F00162364 /* x86 */ = { ++ DBFA7172187F1D9B00A76262 /* x86 */ = { + isa = PBXGroup; + children = ( +- 6C43CBC91534F76F00162364 /* darwin.S */, +- 6C43CBCB1534F76F00162364 /* ffi.c */, ++ DBFA7173187F1D9B00A76262 /* darwin64_x86_64.S */, ++ DBFA7174187F1D9B00A76262 /* darwin_i386.S */, ++ DBFA7175187F1D9B00A76262 /* ffi64_x86_64.c */, ++ DBFA7176187F1D9B00A76262 /* ffi_i386.c */, + ); + path = x86; + sourceTree = ""; + }; +- 6C43CBF01534F77800162364 /* OS X */ = { ++ DBFA7180187F1DA100A76262 /* darwin_osx */ = { + isa = PBXGroup; + children = ( +- 6C43CC8C1535032600162364 /* include */, +- 6C43CBFC1534F77800162364 /* src */, ++ DBFA7181187F1DA100A76262 /* include */, ++ DBFA7188187F1DA100A76262 /* src */, + ); +- name = "OS X"; +- path = osx; ++ path = "darwin_osx"; + sourceTree = ""; + }; +- 6C43CBFC1534F77800162364 /* src */ = { ++ DBFA7181187F1DA100A76262 /* include */ = { + isa = PBXGroup; + children = ( +- 6C43CC041534F77800162364 /* x86 */, ++ DBFA7182187F1DA100A76262 /* ffi_i386.h */, ++ DBFA7183187F1DA100A76262 /* ffi_x86_64.h */, ++ DBFA7184187F1DA100A76262 /* fficonfig_i386.h */, ++ DBFA7185187F1DA100A76262 /* fficonfig_x86_64.h */, ++ DBFA7186187F1DA100A76262 /* ffitarget_i386.h */, ++ DBFA7187187F1DA100A76262 /* ffitarget_x86_64.h */, ++ ); ++ path = include; ++ sourceTree = ""; ++ }; ++ DBFA7188187F1DA100A76262 /* src */ = { ++ isa = PBXGroup; ++ children = ( ++ DBFA7189187F1DA100A76262 /* x86 */, + ); + path = src; + sourceTree = ""; + }; +- 6C43CC041534F77800162364 /* x86 */ = { ++ DBFA7189187F1DA100A76262 /* x86 */ = { + isa = PBXGroup; + children = ( +- 6C43CC051534F77800162364 /* darwin.S */, +- 6C43CC061534F77800162364 /* darwin64.S */, +- 6C43CC071534F77800162364 /* ffi.c */, +- 6C43CC081534F77800162364 /* ffi64.c */, ++ DBFA718A187F1DA100A76262 /* darwin64_x86_64.S */, ++ DBFA718B187F1DA100A76262 /* darwin_i386.S */, ++ DBFA718C187F1DA100A76262 /* ffi64_x86_64.c */, ++ DBFA718D187F1DA100A76262 /* ffi_i386.c */, + ); + path = x86; + sourceTree = ""; + }; +- 6C43CC3D1534F7C400162364 /* src */ = { +- isa = PBXGroup; +- children = ( +- 6C43CC281534F7BE00162364 /* closures.c */, +- 6C43CC2B1534F7BE00162364 /* java_raw_api.c */, +- 6C43CC2C1534F7BE00162364 /* prep_cif.c */, +- 6C43CC2D1534F7BE00162364 /* raw_api.c */, +- 6C43CC2E1534F7BE00162364 /* types.c */, +- ); +- name = src; +- path = ios; +- sourceTree = ""; +- }; +- 6C43CC8C1535032600162364 /* include */ = { +- isa = PBXGroup; +- children = ( +- 6C43CC8D1535032600162364 /* ffi.h */, +- 6C43CC8E1535032600162364 /* ffi_common.h */, +- 6C43CC8F1535032600162364 /* ffi_i386.h */, +- 6C43CC901535032600162364 /* ffi_x86_64.h */, +- 6C43CC911535032600162364 /* fficonfig.h */, +- 6C43CC921535032600162364 /* fficonfig_i386.h */, +- 6C43CC931535032600162364 /* fficonfig_x86_64.h */, +- 6C43CC941535032600162364 /* ffitarget.h */, +- 6C43CC951535032600162364 /* ffitarget_i386.h */, +- 6C43CC961535032600162364 /* ffitarget_x86_64.h */, +- ); +- path = include; +- sourceTree = ""; +- }; +- 6C43CCA11535039600162364 /* include */ = { +- isa = PBXGroup; +- children = ( +- 6C43CCA21535039600162364 /* ffi.h */, +- 6C43CCA31535039600162364 /* ffi_armv7.h */, +- 6C43CCA41535039600162364 /* ffi_common.h */, +- 6C43CCA51535039600162364 /* ffi_i386.h */, +- 6C43CCA61535039600162364 /* fficonfig.h */, +- 6C43CCA71535039600162364 /* fficonfig_armv7.h */, +- 6C43CCA81535039600162364 /* fficonfig_i386.h */, +- 6C43CCA91535039600162364 /* ffitarget.h */, +- 6C43CCAA1535039600162364 /* ffitarget_arm.h */, +- 6C43CCAB1535039600162364 /* ffitarget_armv7.h */, +- 6C43CCAC1535039600162364 /* ffitarget_i386.h */, +- ); +- path = include; +- sourceTree = ""; +- }; +- F6B0839514721EE50031D8A1 = { +- isa = PBXGroup; +- children = ( +- 6C43CC3D1534F7C400162364 /* src */, +- 6C43CBAF1534F76F00162364 /* iOS */, +- 6C43CBF01534F77800162364 /* OS X */, +- F6F980C6147386260008F121 /* Products */, +- ); +- sourceTree = ""; +- }; +- F6F980C6147386260008F121 /* Products */ = { +- isa = PBXGroup; +- children = ( +- F6F980BA147386130008F121 /* libffi.a */, +- 6C43CB3D1534E9D100162364 /* libffi.a */, +- ); +- name = Products; +- path = ../..; +- sourceTree = BUILT_PRODUCTS_DIR; +- }; + /* End PBXGroup section */ + + /* Begin PBXHeadersBuildPhase section */ +- 6C43CB3B1534E9D100162364 /* Headers */ = { ++ DB13B18F1849DF510010F42D /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( +- 6C43CC971535032600162364 /* ffi.h in Headers */, +- 6C43CC981535032600162364 /* ffi_common.h in Headers */, +- 6C43CC991535032600162364 /* ffi_i386.h in Headers */, +- 6C43CC9A1535032600162364 /* ffi_x86_64.h in Headers */, +- 6C43CC9E1535032600162364 /* ffitarget.h in Headers */, +- 6C43CC9F1535032600162364 /* ffitarget_i386.h in Headers */, +- 6C43CCA01535032600162364 /* ffitarget_x86_64.h in Headers */, +- 6C43CC9B1535032600162364 /* fficonfig.h in Headers */, +- 6C43CC9C1535032600162364 /* fficonfig_i386.h in Headers */, +- 6C43CC9D1535032600162364 /* fficonfig_x86_64.h in Headers */, +- ); +- runOnlyForDeploymentPostprocessing = 0; +- }; +- F6F980B8147386130008F121 /* Headers */ = { +- isa = PBXHeadersBuildPhase; +- buildActionMask = 2147483647; +- files = ( +- 6C43CCAD1535039600162364 /* ffi.h in Headers */, +- 6C43CCAE1535039600162364 /* ffi_armv7.h in Headers */, +- 6C43CCAF1535039600162364 /* ffi_common.h in Headers */, +- 6C43CCB01535039600162364 /* ffi_i386.h in Headers */, +- 6C43CCB41535039600162364 /* ffitarget.h in Headers */, +- 6C43CCB51535039600162364 /* ffitarget_arm.h in Headers */, +- 6C43CCB61535039600162364 /* ffitarget_armv7.h in Headers */, +- 6C43CCB71535039600162364 /* ffitarget_i386.h in Headers */, +- 6C43CCB11535039600162364 /* fficonfig.h in Headers */, +- 6C43CCB21535039600162364 /* fficonfig_armv7.h in Headers */, +- 6C43CCB31535039600162364 /* fficonfig_i386.h in Headers */, ++ DBFA714C187F1D8600A76262 /* fficonfig.h in Headers */, ++ DBFA714D187F1D8600A76262 /* ffitarget.h in Headers */, ++ DBFA714A187F1D8600A76262 /* ffi.h in Headers */, ++ DBFA718F187F1DA100A76262 /* ffi_x86_64.h in Headers */, ++ DBFA7191187F1DA100A76262 /* fficonfig_x86_64.h in Headers */, ++ DBFA718E187F1DA100A76262 /* ffi_i386.h in Headers */, ++ DBFA7190187F1DA100A76262 /* fficonfig_i386.h in Headers */, ++ DBFA714B187F1D8600A76262 /* ffi_common.h in Headers */, ++ DBFA7193187F1DA100A76262 /* ffitarget_x86_64.h in Headers */, ++ DBFA7192187F1DA100A76262 /* ffitarget_i386.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + /* End PBXHeadersBuildPhase section */ + + /* Begin PBXNativeTarget section */ +- 6C43CB3C1534E9D100162364 /* libffi OS X */ = { ++ DB13B1651849DF1E0010F42D /* libffi-iOS */ = { + isa = PBXNativeTarget; +- buildConfigurationList = 6C43CB4A1534E9D100162364 /* Build configuration list for PBXNativeTarget "libffi OS X" */; ++ buildConfigurationList = DB13B18B1849DF1E0010F42D /* Build configuration list for PBXNativeTarget "libffi-iOS" */; + buildPhases = ( +- 6C43CC401534FF3B00162364 /* Generate Source and Headers */, +- 6C43CB391534E9D100162364 /* Sources */, +- 6C43CB3A1534E9D100162364 /* Frameworks */, +- 6C43CB3B1534E9D100162364 /* Headers */, ++ DB13B3051849E01C0010F42D /* ShellScript */, ++ DB13B1621849DF1E0010F42D /* Sources */, ++ DB13B1641849DF1E0010F42D /* CopyFiles */, + ); + buildRules = ( + ); + dependencies = ( + ); +- name = "libffi OS X"; +- productName = "ffi OS X"; +- productReference = 6C43CB3D1534E9D100162364 /* libffi.a */; ++ name = "libffi-iOS"; ++ productName = ffi; ++ productReference = DB13B1661849DF1E0010F42D /* libffi.a */; + productType = "com.apple.product-type.library.static"; + }; +- F6F980B9147386130008F121 /* libffi iOS */ = { ++ DB13B1901849DF510010F42D /* libffi-Mac */ = { + isa = PBXNativeTarget; +- buildConfigurationList = F6F980C4147386130008F121 /* Build configuration list for PBXNativeTarget "libffi iOS" */; ++ buildConfigurationList = DB13B1B01849DF520010F42D /* Build configuration list for PBXNativeTarget "libffi-Mac" */; + buildPhases = ( +- 6C43CC3E1534F8E200162364 /* Generate Trampoline */, +- 6C43CC3F1534FF1B00162364 /* Generate Source and Headers */, +- F6F980B6147386130008F121 /* Sources */, +- F6F980B7147386130008F121 /* Frameworks */, +- F6F980B8147386130008F121 /* Headers */, ++ DB13B3061849E0490010F42D /* ShellScript */, ++ DB13B18D1849DF510010F42D /* Sources */, ++ DB13B18F1849DF510010F42D /* Headers */, + ); + buildRules = ( + ); + dependencies = ( + ); +- name = "libffi iOS"; ++ name = "libffi-Mac"; + productName = ffi; +- productReference = F6F980BA147386130008F121 /* libffi.a */; +- productType = "com.apple.product-type.library.static"; ++ productReference = DB13B1911849DF510010F42D /* ffi.dylib */; ++ productType = "com.apple.product-type.library.dynamic"; + }; + /* End PBXNativeTarget section */ + + /* Begin PBXProject section */ +- F6B0839714721EE50031D8A1 /* Project object */ = { ++ DB13B15C1849DEB70010F42D /* Project object */ = { + isa = PBXProject; + attributes = { +- LastUpgradeCheck = 0430; ++ LastUpgradeCheck = 0510; + }; +- buildConfigurationList = F6B0839A14721EE50031D8A1 /* Build configuration list for PBXProject "libffi" */; ++ buildConfigurationList = DB13B15F1849DEB70010F42D /* Build configuration list for PBXProject "libffi" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + ); +- mainGroup = F6B0839514721EE50031D8A1; +- productRefGroup = F6B0839514721EE50031D8A1; ++ mainGroup = DB13B15B1849DEB70010F42D; ++ productRefGroup = DB13B1671849DF1E0010F42D /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( +- F6F980B9147386130008F121 /* libffi iOS */, +- 6C43CB3C1534E9D100162364 /* libffi OS X */, ++ DB13B1651849DF1E0010F42D /* libffi-iOS */, ++ DB13B1901849DF510010F42D /* libffi-Mac */, + ); + }; + /* End PBXProject section */ + + /* Begin PBXShellScriptBuildPhase section */ +- 6C43CC3E1534F8E200162364 /* Generate Trampoline */ = { ++ DB13B3051849E01C0010F42D /* ShellScript */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); +- name = "Generate Trampoline"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; +- shellPath = /usr/bin/python; +- shellScript = "import subprocess\nimport re\nimport os\nimport errno\nimport sys\n\ndef main():\n with open('src/arm/trampoline.S', 'w') as tramp_out:\n p = subprocess.Popen(['bash', 'src/arm/gentramp.sh'], stdout=tramp_out)\n p.wait()\n\nif __name__ == '__main__':\n main()"; ++ shellPath = /bin/sh; ++ shellScript = "/usr/bin/python generate-darwin-source-and-headers.py --only-ios"; + }; +- 6C43CC3F1534FF1B00162364 /* Generate Source and Headers */ = { ++ DB13B3061849E0490010F42D /* ShellScript */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); +- name = "Generate Source and Headers"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; +- shellScript = "/usr/bin/python generate-ios-source-and-headers.py"; +- }; +- 6C43CC401534FF3B00162364 /* Generate Source and Headers */ = { +- isa = PBXShellScriptBuildPhase; +- buildActionMask = 2147483647; +- files = ( +- ); +- inputPaths = ( +- ); +- name = "Generate Source and Headers"; +- outputPaths = ( +- ); +- runOnlyForDeploymentPostprocessing = 0; +- shellPath = /bin/sh; +- shellScript = "/usr/bin/python generate-osx-source-and-headers.py"; ++ shellScript = "/usr/bin/python generate-darwin-source-and-headers.py --only-osx"; + }; + /* End PBXShellScriptBuildPhase section */ + + /* Begin PBXSourcesBuildPhase section */ +- 6C43CB391534E9D100162364 /* Sources */ = { ++ DB13B1621849DF1E0010F42D /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( +- 6C43CC1F1534F77800162364 /* darwin.S in Sources */, +- 6C43CC201534F77800162364 /* darwin64.S in Sources */, +- 6C43CC211534F77800162364 /* ffi.c in Sources */, +- 6C43CC221534F77800162364 /* ffi64.c in Sources */, +- 6C43CC301534F7BE00162364 /* closures.c in Sources */, +- 6C43CC361534F7BE00162364 /* java_raw_api.c in Sources */, +- 6C43CC381534F7BE00162364 /* prep_cif.c in Sources */, +- 6C43CC3A1534F7BE00162364 /* raw_api.c in Sources */, +- 6C43CC3C1534F7BE00162364 /* types.c in Sources */, ++ DBFA717E187F1D9B00A76262 /* ffi64_x86_64.c in Sources */, ++ DBFA7179187F1D9B00A76262 /* ffi_armv7.c in Sources */, ++ DBFA717B187F1D9B00A76262 /* trampoline_armv7.S in Sources */, ++ DBFA714E187F1D8600A76262 /* closures.c in Sources */, ++ DBFA717A187F1D9B00A76262 /* sysv_armv7.S in Sources */, ++ DBFA717D187F1D9B00A76262 /* darwin_i386.S in Sources */, ++ DBFA7156187F1D8600A76262 /* prep_cif.c in Sources */, ++ DBFA717F187F1D9B00A76262 /* ffi_i386.c in Sources */, ++ DBFA7158187F1D8600A76262 /* raw_api.c in Sources */, ++ DBFA7178187F1D9B00A76262 /* sysv_arm64.S in Sources */, ++ DBFA717C187F1D9B00A76262 /* darwin64_x86_64.S in Sources */, ++ DBFA715A187F1D8600A76262 /* types.c in Sources */, ++ DBFA7177187F1D9B00A76262 /* ffi_arm64.c in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +- F6F980B6147386130008F121 /* Sources */ = { ++ DB13B18D1849DF510010F42D /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( +- 6C43CBDC1534F76F00162364 /* ffi.c in Sources */, +- 6C43CBDD1534F76F00162364 /* sysv.S in Sources */, +- 6C43CBDE1534F76F00162364 /* trampoline.S in Sources */, +- 6C43CBE61534F76F00162364 /* darwin.S in Sources */, +- 6C43CBE81534F76F00162364 /* ffi.c in Sources */, +- 6C43CC2F1534F7BE00162364 /* closures.c in Sources */, +- 6C43CC351534F7BE00162364 /* java_raw_api.c in Sources */, +- 6C43CC371534F7BE00162364 /* prep_cif.c in Sources */, +- 6C43CC391534F7BE00162364 /* raw_api.c in Sources */, +- 6C43CC3B1534F7BE00162364 /* types.c in Sources */, ++ DBFA7196187F1DA100A76262 /* ffi64_x86_64.c in Sources */, ++ DBFA7195187F1DA100A76262 /* darwin_i386.S in Sources */, ++ DBFA7157187F1D8600A76262 /* prep_cif.c in Sources */, ++ DBFA7197187F1DA100A76262 /* ffi_i386.c in Sources */, ++ DBFA715B187F1D8600A76262 /* types.c in Sources */, ++ DBFA7159187F1D8600A76262 /* raw_api.c in Sources */, ++ DBFA714F187F1D8600A76262 /* closures.c in Sources */, ++ DBFA7194187F1DA100A76262 /* darwin64_x86_64.S in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + /* End PBXSourcesBuildPhase section */ + + /* Begin XCBuildConfiguration section */ +- 6C43CB4B1534E9D100162364 /* Debug */ = { ++ DB13B1601849DEB70010F42D /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { +- ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; +- DSTROOT = /tmp/ffi.dst; +- FRAMEWORK_SEARCH_PATHS = ( ++ HEADER_SEARCH_PATHS = ( + "$(inherited)", +- "\"$(SYSTEM_APPS_DIR)/Xcode.app/Contents/Developer/Library/Frameworks\"", ++ "darwin_common/include", + ); +- GCC_ENABLE_OBJC_EXCEPTIONS = YES; +- GCC_VERSION = com.apple.compilers.llvm.clang.1_0; +- GCC_WARN_64_TO_32_BIT_CONVERSION = YES; +- GCC_WARN_UNINITIALIZED_AUTOS = YES; +- MACOSX_DEPLOYMENT_TARGET = 10.6; + ONLY_ACTIVE_ARCH = YES; +- PRODUCT_NAME = ffi; +- SDKROOT = macosx; + }; + name = Debug; + }; +- 6C43CB4C1534E9D100162364 /* Release */ = { ++ DB13B1611849DEB70010F42D /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { +- ARCHS = "$(ARCHS_STANDARD_32_64_BIT)"; +- DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; +- DSTROOT = /tmp/ffi.dst; +- FRAMEWORK_SEARCH_PATHS = ( ++ HEADER_SEARCH_PATHS = ( + "$(inherited)", +- "\"$(SYSTEM_APPS_DIR)/Xcode.app/Contents/Developer/Library/Frameworks\"", ++ "darwin_common/include", + ); +- GCC_ENABLE_OBJC_EXCEPTIONS = YES; +- GCC_VERSION = com.apple.compilers.llvm.clang.1_0; +- GCC_WARN_64_TO_32_BIT_CONVERSION = YES; +- GCC_WARN_UNINITIALIZED_AUTOS = YES; +- MACOSX_DEPLOYMENT_TARGET = 10.6; +- PRODUCT_NAME = ffi; +- SDKROOT = macosx; + }; + name = Release; + }; +- F6B083AB14721EE50031D8A1 /* Debug */ = { ++ DB13B1871849DF1E0010F42D /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; +- ARCHS = "$(ARCHS_STANDARD_32_BIT)"; ++ ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)"; ++ CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; ++ CLANG_CXX_LIBRARY = "libc++"; ++ CLANG_ENABLE_MODULES = YES; ++ CLANG_ENABLE_OBJC_ARC = YES; ++ CLANG_WARN_BOOL_CONVERSION = YES; ++ CLANG_WARN_CONSTANT_CONVERSION = YES; ++ CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; ++ CLANG_WARN_EMPTY_BODY = YES; ++ CLANG_WARN_ENUM_CONVERSION = YES; ++ CLANG_WARN_INT_CONVERSION = YES; ++ CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; ++ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; ++ DSTROOT = /tmp/ffi.dst; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_DYNAMIC_NO_PIC = NO; + GCC_OPTIMIZATION_LEVEL = 0; +@@ -482,98 +457,181 @@ + "$(inherited)", + ); + GCC_SYMBOLS_PRIVATE_EXTERN = NO; +- GCC_WARN_ABOUT_MISSING_PROTOTYPES = NO; +- GCC_WARN_ABOUT_RETURN_TYPE = YES; +- GCC_WARN_UNUSED_VALUE = NO; ++ GCC_WARN_64_TO_32_BIT_CONVERSION = YES; ++ GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; ++ GCC_WARN_UNDECLARED_SELECTOR = YES; ++ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; ++ GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; +- HEADER_SEARCH_PATHS = ios/include; ++ HEADER_SEARCH_PATHS = ( ++ "$(inherited)", ++ "darwin_ios/include", ++ ); ++ IPHONEOS_DEPLOYMENT_TARGET = 5.0; ++ "IPHONEOS_DEPLOYMENT_TARGET[arch=arm64]" = 7.0; ++ OTHER_LDFLAGS = "-ObjC"; ++ PRODUCT_NAME = ffi; + SDKROOT = iphoneos; ++ SKIP_INSTALL = YES; + }; + name = Debug; + }; +- F6B083AC14721EE50031D8A1 /* Release */ = { ++ DB13B1881849DF1E0010F42D /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; +- ARCHS = "$(ARCHS_STANDARD_32_BIT)"; ++ ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)"; ++ CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; ++ CLANG_CXX_LIBRARY = "libc++"; ++ CLANG_ENABLE_MODULES = YES; ++ CLANG_ENABLE_OBJC_ARC = YES; ++ CLANG_WARN_BOOL_CONVERSION = YES; ++ CLANG_WARN_CONSTANT_CONVERSION = YES; ++ CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; ++ CLANG_WARN_EMPTY_BODY = YES; ++ CLANG_WARN_ENUM_CONVERSION = YES; ++ CLANG_WARN_INT_CONVERSION = YES; ++ CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; ++ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = YES; ++ DSTROOT = /tmp/ffi.dst; ++ ENABLE_NS_ASSERTIONS = NO; + GCC_C_LANGUAGE_STANDARD = gnu99; +- GCC_PREPROCESSOR_DEFINITIONS = ""; +- GCC_WARN_ABOUT_MISSING_PROTOTYPES = NO; +- GCC_WARN_ABOUT_RETURN_TYPE = YES; +- GCC_WARN_UNUSED_VALUE = NO; ++ GCC_WARN_64_TO_32_BIT_CONVERSION = YES; ++ GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; ++ GCC_WARN_UNDECLARED_SELECTOR = YES; ++ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; ++ GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; +- HEADER_SEARCH_PATHS = ios/include; ++ HEADER_SEARCH_PATHS = ( ++ "$(inherited)", ++ "darwin_ios/include", ++ ); ++ IPHONEOS_DEPLOYMENT_TARGET = 5.0; ++ "IPHONEOS_DEPLOYMENT_TARGET[arch=arm64]" = 7.0; ++ OTHER_LDFLAGS = "-ObjC"; ++ PRODUCT_NAME = ffi; + SDKROOT = iphoneos; ++ SKIP_INSTALL = YES; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; +- F6F980C2147386130008F121 /* Debug */ = { ++ DB13B1B11849DF520010F42D /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { +- ARCHS = ( +- armv6, +- armv7, ++ ALWAYS_SEARCH_USER_PATHS = NO; ++ CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; ++ CLANG_CXX_LIBRARY = "libc++"; ++ CLANG_ENABLE_OBJC_ARC = YES; ++ CLANG_WARN_BOOL_CONVERSION = YES; ++ CLANG_WARN_CONSTANT_CONVERSION = YES; ++ CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; ++ CLANG_WARN_EMPTY_BODY = YES; ++ CLANG_WARN_ENUM_CONVERSION = YES; ++ CLANG_WARN_INT_CONVERSION = YES; ++ CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; ++ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; ++ COPY_PHASE_STRIP = NO; ++ DYLIB_COMPATIBILITY_VERSION = 1; ++ DYLIB_CURRENT_VERSION = 1; ++ GCC_C_LANGUAGE_STANDARD = gnu99; ++ GCC_DYNAMIC_NO_PIC = NO; ++ GCC_ENABLE_OBJC_EXCEPTIONS = YES; ++ GCC_OPTIMIZATION_LEVEL = 0; ++ GCC_PREPROCESSOR_DEFINITIONS = ( ++ "DEBUG=1", ++ "$(inherited)", + ); +- DSTROOT = /tmp/ffi.dst; +- GCC_PRECOMPILE_PREFIX_HEADER = YES; +- GCC_THUMB_SUPPORT = NO; +- IPHONEOS_DEPLOYMENT_TARGET = 4.0; +- OTHER_LDFLAGS = "-ObjC"; ++ GCC_SYMBOLS_PRIVATE_EXTERN = NO; ++ GCC_WARN_64_TO_32_BIT_CONVERSION = YES; ++ GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; ++ GCC_WARN_UNDECLARED_SELECTOR = YES; ++ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; ++ GCC_WARN_UNUSED_FUNCTION = YES; ++ GCC_WARN_UNUSED_VARIABLE = YES; ++ HEADER_SEARCH_PATHS = ( ++ "$(inherited)", ++ "darwin_osx/include", ++ ); ++ MACOSX_DEPLOYMENT_TARGET = 10.6; ++ ONLY_ACTIVE_ARCH = YES; ++ OTHER_LDFLAGS = "-Wl,-no_compact_unwind"; + PRODUCT_NAME = ffi; +- SKIP_INSTALL = YES; ++ SDKROOT = macosx; + }; + name = Debug; + }; +- F6F980C3147386130008F121 /* Release */ = { ++ DB13B1B21849DF520010F42D /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { +- ARCHS = ( +- armv6, +- armv7, ++ ALWAYS_SEARCH_USER_PATHS = NO; ++ CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; ++ CLANG_CXX_LIBRARY = "libc++"; ++ CLANG_ENABLE_OBJC_ARC = YES; ++ CLANG_WARN_BOOL_CONVERSION = YES; ++ CLANG_WARN_CONSTANT_CONVERSION = YES; ++ CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; ++ CLANG_WARN_EMPTY_BODY = YES; ++ CLANG_WARN_ENUM_CONVERSION = YES; ++ CLANG_WARN_INT_CONVERSION = YES; ++ CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; ++ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; ++ COPY_PHASE_STRIP = YES; ++ DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; ++ DYLIB_COMPATIBILITY_VERSION = 1; ++ DYLIB_CURRENT_VERSION = 1; ++ ENABLE_NS_ASSERTIONS = NO; ++ GCC_C_LANGUAGE_STANDARD = gnu99; ++ GCC_ENABLE_OBJC_EXCEPTIONS = YES; ++ GCC_WARN_64_TO_32_BIT_CONVERSION = YES; ++ GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; ++ GCC_WARN_UNDECLARED_SELECTOR = YES; ++ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; ++ GCC_WARN_UNUSED_FUNCTION = YES; ++ GCC_WARN_UNUSED_VARIABLE = YES; ++ HEADER_SEARCH_PATHS = ( ++ "$(inherited)", ++ "darwin_osx/include", + ); +- DSTROOT = /tmp/ffi.dst; +- GCC_PRECOMPILE_PREFIX_HEADER = YES; +- GCC_THUMB_SUPPORT = NO; +- IPHONEOS_DEPLOYMENT_TARGET = 4.0; +- OTHER_LDFLAGS = "-ObjC"; ++ MACOSX_DEPLOYMENT_TARGET = 10.6; ++ OTHER_LDFLAGS = "-Wl,-no_compact_unwind"; + PRODUCT_NAME = ffi; +- SKIP_INSTALL = YES; ++ SDKROOT = macosx; + }; + name = Release; + }; + /* End XCBuildConfiguration section */ + + /* Begin XCConfigurationList section */ +- 6C43CB4A1534E9D100162364 /* Build configuration list for PBXNativeTarget "libffi OS X" */ = { ++ DB13B15F1849DEB70010F42D /* Build configuration list for PBXProject "libffi" */ = { + isa = XCConfigurationList; + buildConfigurations = ( +- 6C43CB4B1534E9D100162364 /* Debug */, +- 6C43CB4C1534E9D100162364 /* Release */, ++ DB13B1601849DEB70010F42D /* Debug */, ++ DB13B1611849DEB70010F42D /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +- F6B0839A14721EE50031D8A1 /* Build configuration list for PBXProject "libffi" */ = { ++ DB13B18B1849DF1E0010F42D /* Build configuration list for PBXNativeTarget "libffi-iOS" */ = { + isa = XCConfigurationList; + buildConfigurations = ( +- F6B083AB14721EE50031D8A1 /* Debug */, +- F6B083AC14721EE50031D8A1 /* Release */, ++ DB13B1871849DF1E0010F42D /* Debug */, ++ DB13B1881849DF1E0010F42D /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +- F6F980C4147386130008F121 /* Build configuration list for PBXNativeTarget "libffi iOS" */ = { ++ DB13B1B01849DF520010F42D /* Build configuration list for PBXNativeTarget "libffi-Mac" */ = { + isa = XCConfigurationList; + buildConfigurations = ( +- F6F980C2147386130008F121 /* Debug */, +- F6F980C3147386130008F121 /* Release */, ++ DB13B1B11849DF520010F42D /* Debug */, ++ DB13B1B21849DF520010F42D /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + /* End XCConfigurationList section */ + }; +- rootObject = F6B0839714721EE50031D8A1 /* Project object */; ++ rootObject = DB13B15C1849DEB70010F42D /* Project object */; + } +diff -r c0e311e010fc Modules/_ctypes/libffi/libtool-version +--- a/Modules/_ctypes/libffi/libtool-version ++++ b/Modules/_ctypes/libffi/libtool-version +@@ -26,4 +26,4 @@ + # release, then set age to 0. + # + # CURRENT:REVISION:AGE +-6:1:0 ++6:2:0 +diff -r c0e311e010fc Modules/_ctypes/libffi/ltmain.sh +--- a/Modules/_ctypes/libffi/ltmain.sh ++++ b/Modules/_ctypes/libffi/ltmain.sh +@@ -1,9 +1,10 @@ +- +-# libtool (GNU libtool) 2.4.2 ++#! /bin/sh ++ ++# libtool (GNU libtool) 2.4.2.418 ++# Provide generalized library-building support services. + # Written by Gordon Matzigkeit , 1996 + +-# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006, +-# 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc. ++# Copyright (C) 1996-2013 Free Software Foundation, Inc. + # This is free software; see the source for copying conditions. There is NO + # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +@@ -23,166 +24,562 @@ + # General Public License for more details. + # + # You should have received a copy of the GNU General Public License +-# along with GNU Libtool; see the file COPYING. If not, a copy +-# can be downloaded from http://www.gnu.org/licenses/gpl.html, +-# or obtained by writing to the Free Software Foundation, Inc., +-# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +- +-# Usage: $progname [OPTION]... [MODE-ARG]... +-# +-# Provide generalized library-building support services. +-# +-# --config show all configuration variables +-# --debug enable verbose shell tracing +-# -n, --dry-run display commands without modifying any files +-# --features display basic configuration information and exit +-# --mode=MODE use operation mode MODE +-# --preserve-dup-deps don't remove duplicate dependency libraries +-# --quiet, --silent don't print informational messages +-# --no-quiet, --no-silent +-# print informational messages (default) +-# --no-warn don't display warning messages +-# --tag=TAG use configuration variables from tag TAG +-# -v, --verbose print more informational messages than default +-# --no-verbose don't print the extra informational messages +-# --version print version information +-# -h, --help, --help-all print short, long, or detailed help message +-# +-# MODE must be one of the following: +-# +-# clean remove files from the build directory +-# compile compile a source file into a libtool object +-# execute automatically set library path, then run a program +-# finish complete the installation of libtool libraries +-# install install libraries or executables +-# link create a library or an executable +-# uninstall remove libraries from an installed directory +-# +-# MODE-ARGS vary depending on the MODE. When passed as first option, +-# `--mode=MODE' may be abbreviated as `MODE' or a unique abbreviation of that. +-# Try `$progname --help --mode=MODE' for a more detailed description of MODE. +-# +-# When reporting a bug, please describe a test case to reproduce it and +-# include the following information: +-# +-# host-triplet: $host +-# shell: $SHELL +-# compiler: $LTCC +-# compiler flags: $LTCFLAGS +-# linker: $LD (gnu? $with_gnu_ld) +-# $progname: (GNU libtool) 2.4.2 +-# automake: $automake_version +-# autoconf: $autoconf_version +-# +-# Report bugs to . +-# GNU libtool home page: . +-# General help using GNU software: . ++# along with this program. If not, see . ++ + + PROGRAM=libtool + PACKAGE=libtool +-VERSION=2.4.2 +-TIMESTAMP="" +-package_revision=1.3337 +- +-# Be Bourne compatible +-if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then ++VERSION=2.4.2.418 ++package_revision=2.4.2.418 ++ ++ ++## ------ ## ++## Usage. ## ++## ------ ## ++ ++# Run './libtool --help' for help with using this script from the ++# command line. ++ ++ ++## ------------------------------- ## ++## User overridable command paths. ## ++## ------------------------------- ## ++ ++# After configure completes, it has a better idea of some of the ++# shell tools we need than the defaults used by the functions shared ++# with bootstrap, so set those here where they can still be over- ++# ridden by the user, but otherwise take precedence. ++ ++: ${AUTOCONF="autoconf"} ++: ${AUTOMAKE="automake"} ++ ++ ++## -------------------------- ## ++## Source external libraries. ## ++## -------------------------- ## ++ ++# Much of our low-level functionality needs to be sourced from external ++# libraries, which are installed to $pkgauxdir. ++ ++# Set a version string for this script. ++scriptversion=2013-08-23.20; # UTC ++ ++# General shell script boiler plate, and helper functions. ++# Written by Gary V. Vaughan, 2004 ++ ++# Copyright (C) 2004-2013 Free Software Foundation, Inc. ++# This is free software; see the source for copying conditions. There is NO ++# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. ++ ++# This program is free software; you can redistribute it and/or modify ++# it under the terms of the GNU General Public License as published by ++# the Free Software Foundation; either version 3 of the License, or ++# (at your option) any later version. ++ ++# As a special exception to the GNU General Public License, if you distribute ++# this file as part of a program or library that is built using GNU Libtool, ++# you may include this file under the same distribution terms that you use ++# for the rest of that program. ++ ++# This program is distributed in the hope that it will be useful, ++# but WITHOUT ANY WARRANTY; without even the implied warranty of ++# MERCHANTABILITY or FITNES FOR A PARTICULAR PURPOSE. See the GNU ++# General Public License for more details. ++ ++# You should have received a copy of the GNU General Public License ++# along with this program. If not, see . ++ ++# Please report bugs or propose patches to gary@gnu.org. ++ ++ ++## ------ ## ++## Usage. ## ++## ------ ## ++ ++# Evaluate this file near the top of your script to gain access to ++# the functions and variables defined here: ++# ++# . `echo "$0" | ${SED-sed} 's|[^/]*$||'`/build-aux/funclib.sh ++# ++# If you need to override any of the default environment variable ++# settings, do that before evaluating this file. ++ ++ ++## -------------------- ## ++## Shell normalisation. ## ++## -------------------- ## ++ ++# Some shells need a little help to be as Bourne compatible as possible. ++# Before doing anything else, make sure all that help has been provided! ++ ++DUALCASE=1; export DUALCASE # for MKS sh ++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 + else +- case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac ++ case `(set -o) 2>/dev/null` in *posix*) set -o posix ;; esac + fi +-BIN_SH=xpg4; export BIN_SH # for Tru64 +-DUALCASE=1; export DUALCASE # for MKS sh +- +-# A function that is used when there is no print builtin or printf. +-func_fallback_echo () +-{ +- eval 'cat <<_LTECHO_EOF +-$1 +-_LTECHO_EOF' +-} +- +-# NLS nuisances: We save the old values to restore during execute mode. +-lt_user_locale= +-lt_safe_locale= +-for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES ++ ++# NLS nuisances: We save the old values in case they are required later. ++_G_user_locale= ++_G_safe_locale= ++for _G_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES + do +- eval "if test \"\${$lt_var+set}\" = set; then +- save_$lt_var=\$$lt_var +- $lt_var=C +- export $lt_var +- lt_user_locale=\"$lt_var=\\\$save_\$lt_var; \$lt_user_locale\" +- lt_safe_locale=\"$lt_var=C; \$lt_safe_locale\" ++ eval "if test set = \"\${$_G_var+set}\"; then ++ save_$_G_var=\$$_G_var ++ $_G_var=C ++ export $_G_var ++ _G_user_locale=\"$_G_var=\\\$save_\$_G_var; \$_G_user_locale\" ++ _G_safe_locale=\"$_G_var=C; \$_G_safe_locale\" + fi" + done +-LC_ALL=C +-LANGUAGE=C +-export LANGUAGE LC_ALL +- +-$lt_unset CDPATH +- ++ ++# CDPATH. ++(unset CDPATH) >/dev/null 2>&1 && unset CDPATH ++ ++# Make sure IFS has a sensible default ++sp=' ' ++nl=' ++' ++IFS="$sp $nl" ++ ++# There are still modern systems that have problems with 'echo' mis- ++# handling backslashes, among others, so make sure $bs_echo is set to a ++# command that correctly interprets backslashes. ++# (this code from Autoconf 2.68) ++ ++# Printing a long string crashes Solaris 7 /usr/bin/printf. ++bs_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ++bs_echo=$bs_echo$bs_echo$bs_echo$bs_echo$bs_echo ++bs_echo=$bs_echo$bs_echo$bs_echo$bs_echo$bs_echo$bs_echo ++# Prefer a ksh shell builtin over an external printf program on Solaris, ++# but without wasting forks for bash or zsh. ++if test -z "$BASH_VERSION$ZSH_VERSION" \ ++ && (test "X`print -r -- $bs_echo`" = "X$bs_echo") 2>/dev/null; then ++ bs_echo='print -r --' ++ bs_echo_n='print -rn --' ++elif (test "X`printf %s $bs_echo`" = "X$bs_echo") 2>/dev/null; then ++ bs_echo='printf %s\n' ++ bs_echo_n='printf %s' ++else ++ if test "X`(/usr/ucb/echo -n -n $bs_echo) 2>/dev/null`" = "X-n $bs_echo"; then ++ bs_echo_body='eval /usr/ucb/echo -n "$1$nl"' ++ bs_echo_n='/usr/ucb/echo -n' ++ else ++ bs_echo_body='eval expr "X$1" : "X\\(.*\\)"' ++ bs_echo_n_body='eval ++ arg=$1; ++ case $arg in #( ++ *"$nl"*) ++ expr "X$arg" : "X\\(.*\\)$nl"; ++ arg=`expr "X$arg" : ".*$nl\\(.*\\)"`;; ++ esac; ++ expr "X$arg" : "X\\(.*\\)" | tr -d "$nl" ++ ' ++ export bs_echo_n_body ++ bs_echo_n='sh -c $bs_echo_n_body bs_echo' ++ fi ++ export bs_echo_body ++ bs_echo='sh -c $bs_echo_body bs_echo' ++fi ++ ++ ++## ------------------------------- ## ++## User overridable command paths. ## ++## ------------------------------- ## ++ ++# All uppercase variable names are used for environment variables. These ++# variables can be overridden by the user before calling a script that ++# uses them if a suitable command of that name is not already available ++# in the command search PATH. ++ ++: ${CP="cp -f"} ++: ${ECHO="$bs_echo"} ++: ${EGREP="grep -E"} ++: ${FGREP="grep -F"} ++: ${GREP="grep"} ++: ${LN_S="ln -s"} ++: ${MAKE="make"} ++: ${MKDIR="mkdir"} ++: ${MV="mv -f"} ++: ${RM="rm -f"} ++: ${SED="sed"} ++: ${SHELL="${CONFIG_SHELL-/bin/sh}"} ++ ++ ++## -------------------- ## ++## Useful sed snippets. ## ++## -------------------- ## ++ ++sed_dirname='s|/[^/]*$||' ++sed_basename='s|^.*/||' ++ ++# Sed substitution that helps us do robust quoting. It backslashifies ++# metacharacters that are still active within double-quoted strings. ++sed_quote_subst='s|\([`"$\\]\)|\\\1|g' ++ ++# Same as above, but do not quote variable references. ++sed_double_quote_subst='s/\(["`\\]\)/\\\1/g' ++ ++# Sed substitution that turns a string into a regex matching for the ++# string literally. ++sed_make_literal_regex='s|[].[^$\\*\/]|\\&|g' ++ ++# Sed substitution that converts a w32 file name or path ++# that contains forward slashes, into one that contains ++# (escaped) backslashes. A very naive implementation. ++sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g' ++ ++# Re-'\' parameter expansions in output of sed_double_quote_subst that ++# were '\'-ed in input to the same. If an odd number of '\' preceded a ++# '$' in input to sed_double_quote_subst, that '$' was protected from ++# expansion. Since each input '\' is now two '\'s, look for any number ++# of runs of four '\'s followed by two '\'s and then a '$'. '\' that '$'. ++_G_bs='\\' ++_G_bs2='\\\\' ++_G_bs4='\\\\\\\\' ++_G_dollar='\$' ++sed_double_backslash="\ ++ s/$_G_bs4/&\\ ++/g ++ s/^$_G_bs2$_G_dollar/$_G_bs&/ ++ s/\\([^$_G_bs]\\)$_G_bs2$_G_dollar/\\1$_G_bs2$_G_bs$_G_dollar/g ++ s/\n//g" ++ ++ ++## ----------------- ## ++## Global variables. ## ++## ----------------- ## ++ ++# Except for the global variables explicitly listed below, the following ++# functions in the '^func_' namespace, and the '^require_' namespace ++# variables initialised in the 'Resource management' section, sourcing ++# this file will not pollute your global namespace with anything ++# else. There's no portable way to scope variables in Bourne shell ++# though, so actually running these functions will sometimes place ++# results into a variable named after the function, and often use ++# temporary variables in the '^_G_' namespace. If you are careful to ++# avoid using those namespaces casually in your sourcing script, things ++# should continue to work as you expect. And, of course, you can freely ++# overwrite any of the functions or variables defined here before ++# calling anything to customize them. ++ ++EXIT_SUCCESS=0 ++EXIT_FAILURE=1 ++EXIT_MISMATCH=63 # $? = 63 is used to indicate version mismatch to missing. ++EXIT_SKIP=77 # $? = 77 is used to indicate a skipped test to automake. ++ ++# Allow overriding, eg assuming that you follow the convention of ++# putting '$debug_cmd' at the start of all your functions, you can get ++# bash to show function call trace with: ++# ++# debug_cmd='eval echo "${FUNCNAME[0]} $*" >&2' bash your-script-name ++debug_cmd=${debug_cmd-":"} ++exit_cmd=: ++ ++# By convention, finish your script with: ++# ++# exit $exit_status ++# ++# so that you can set exit_status to non-zero if you want to indicate ++# something went wrong during execution without actually bailing out at ++# the point of failure. ++exit_status=$EXIT_SUCCESS + + # Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh + # is ksh but when the shell is invoked as "sh" and the current value of + # the _XPG environment variable is not equal to 1 (one), the special + # positional parameter $0, within a function call, is the name of the + # function. +-progpath="$0" +- +- +- +-: ${CP="cp -f"} +-test "${ECHO+set}" = set || ECHO=${as_echo-'printf %s\n'} +-: ${MAKE="make"} +-: ${MKDIR="mkdir"} +-: ${MV="mv -f"} +-: ${RM="rm -f"} +-: ${SHELL="${CONFIG_SHELL-/bin/sh}"} +-: ${Xsed="$SED -e 1s/^X//"} +- +-# Global variables: +-EXIT_SUCCESS=0 +-EXIT_FAILURE=1 +-EXIT_MISMATCH=63 # $? = 63 is used to indicate version mismatch to missing. +-EXIT_SKIP=77 # $? = 77 is used to indicate a skipped test to automake. +- +-exit_status=$EXIT_SUCCESS +- +-# Make sure IFS has a sensible default +-lt_nl=' +-' +-IFS=" $lt_nl" +- +-dirname="s,/[^/]*$,," +-basename="s,^.*/,," +- +-# func_dirname file append nondir_replacement ++progpath=$0 ++ ++# The name of this program. ++progname=`$bs_echo "$progpath" |$SED "$sed_basename"` ++ ++# Make sure we have an absolute progpath for reexecution: ++case $progpath in ++ [\\/]*|[A-Za-z]:\\*) ;; ++ *[\\/]*) ++ progdir=`$bs_echo "$progpath" |$SED "$sed_dirname"` ++ progdir=`cd "$progdir" && pwd` ++ progpath=$progdir/$progname ++ ;; ++ *) ++ _G_IFS=$IFS ++ IFS=${PATH_SEPARATOR-:} ++ for progdir in $PATH; do ++ IFS=$_G_IFS ++ test -x "$progdir/$progname" && break ++ done ++ IFS=$_G_IFS ++ test -n "$progdir" || progdir=`pwd` ++ progpath=$progdir/$progname ++ ;; ++esac ++ ++ ++## ----------------- ## ++## Standard options. ## ++## ----------------- ## ++ ++# The following options affect the operation of the functions defined ++# below, and should be set appropriately depending on run-time para- ++# meters passed on the command line. ++ ++opt_dry_run=false ++opt_quiet=false ++opt_verbose=false ++ ++# Categories 'all' and 'none' are always available. Append any others ++# you will pass as the first argument to func_warning from your own ++# code. ++warning_categories= ++ ++# By default, display warnings according to 'opt_warning_types'. Set ++# 'warning_func' to ':' to elide all warnings, or func_fatal_error to ++# treat the next displayed warning as a fatal error. ++warning_func=func_warn_and_continue ++ ++# Set to 'all' to display all warnings, 'none' to suppress all ++# warnings, or a space delimited list of some subset of ++# 'warning_categories' to display only the listed warnings. ++opt_warning_types=all ++ ++ ++## -------------------- ## ++## Resource management. ## ++## -------------------- ## ++ ++# This section contains definitions for functions that each ensure a ++# particular resource (a file, or a non-empty configuration variable for ++# example) is available, and if appropriate to extract default values ++# from pertinent package files. Call them using their associated ++# 'require_*' variable to ensure that they are executed, at most, once. ++# ++# It's entirely deliberate that calling these functions can set ++# variables that don't obey the namespace limitations obeyed by the rest ++# of this file, in order that that they be as useful as possible to ++# callers. ++ ++ ++# require_term_colors ++# ------------------- ++# Allow display of bold text on terminals that support it. ++require_term_colors=func_require_term_colors ++func_require_term_colors () ++{ ++ $debug_cmd ++ ++ test -t 1 && { ++ # COLORTERM and USE_ANSI_COLORS environment variables take ++ # precedence, because most terminfo databases neglect to describe ++ # whether color sequences are supported. ++ test -n "${COLORTERM+set}" && : ${USE_ANSI_COLORS="1"} ++ ++ if test 1 = "$USE_ANSI_COLORS"; then ++ # Standard ANSI escape sequences ++ tc_reset='' ++ tc_bold=''; tc_standout='' ++ tc_red=''; tc_green='' ++ tc_blue=''; tc_cyan='' ++ else ++ # Otherwise trust the terminfo database after all. ++ test -n "`tput sgr0 2>/dev/null`" && { ++ tc_reset=`tput sgr0` ++ test -n "`tput bold 2>/dev/null`" && tc_bold=`tput bold` ++ tc_standout=$tc_bold ++ test -n "`tput smso 2>/dev/null`" && tc_standout=`tput smso` ++ test -n "`tput setaf 1 2>/dev/null`" && tc_red=`tput setaf 1` ++ test -n "`tput setaf 2 2>/dev/null`" && tc_green=`tput setaf 2` ++ test -n "`tput setaf 4 2>/dev/null`" && tc_blue=`tput setaf 4` ++ test -n "`tput setaf 5 2>/dev/null`" && tc_cyan=`tput setaf 5` ++ } ++ fi ++ } ++ ++ require_term_colors=: ++} ++ ++ ++## ----------------- ## ++## Function library. ## ++## ----------------- ## ++ ++# This section contains a variety of useful functions to call in your ++# scripts. Take note of the portable wrappers for features provided by ++# some modern shells, which will fall back to slower equivalents on ++# less featureful shells. ++ ++ ++# func_append VAR VALUE ++# --------------------- ++# Append VALUE onto the existing contents of VAR. ++ ++ # We should try to minimise forks, especially on Windows where they are ++ # unreasonably slow, so skip the feature probes when bash or zsh are ++ # being used: ++ if test set = "${BASH_VERSION+set}${ZSH_VERSION+set}"; then ++ : ${_G_HAVE_ARITH_OP="yes"} ++ : ${_G_HAVE_XSI_OPS="yes"} ++ # The += operator was introduced in bash 3.1 ++ case $BASH_VERSION in ++ [12].* | 3.0 | 3.0*) ;; ++ *) ++ : ${_G_HAVE_PLUSEQ_OP="yes"} ++ ;; ++ esac ++ fi ++ ++ # _G_HAVE_PLUSEQ_OP ++ # Can be empty, in which case the shell is probed, "yes" if += is ++ # useable or anything else if it does not work. ++ test -z "$_G_HAVE_PLUSEQ_OP" \ ++ && (eval 'x=a; x+=" b"; test "a b" = "$x"') 2>/dev/null \ ++ && _G_HAVE_PLUSEQ_OP=yes ++ ++if test yes = "$_G_HAVE_PLUSEQ_OP" ++then ++ # This is an XSI compatible shell, allowing a faster implementation... ++ eval 'func_append () ++ { ++ $debug_cmd ++ ++ eval "$1+=\$2" ++ }' ++else ++ # ...otherwise fall back to using expr, which is often a shell builtin. ++ func_append () ++ { ++ $debug_cmd ++ ++ eval "$1=\$$1\$2" ++ } ++fi ++ ++ ++# func_append_quoted VAR VALUE ++# ---------------------------- ++# Quote VALUE and append to the end of shell variable VAR, separated ++# by a space. ++if test yes = "$_G_HAVE_PLUSEQ_OP"; then ++ eval 'func_append_quoted () ++ { ++ $debug_cmd ++ ++ func_quote_for_eval "$2" ++ eval "$1+=\\ \$func_quote_for_eval_result" ++ }' ++else ++ func_append_quoted () ++ { ++ $debug_cmd ++ ++ func_quote_for_eval "$2" ++ eval "$1=\$$1\\ \$func_quote_for_eval_result" ++ } ++fi ++ ++ ++# func_append_uniq VAR VALUE ++# -------------------------- ++# Append unique VALUE onto the existing contents of VAR, assuming ++# entries are delimited by the first character of VALUE. For example: ++# ++# func_append_uniq options " --another-option option-argument" ++# ++# will only append to $options if " --another-option option-argument " ++# is not already present somewhere in $options already (note spaces at ++# each end implied by leading space in second argument). ++func_append_uniq () ++{ ++ $debug_cmd ++ ++ eval _G_current_value='`$bs_echo $'$1'`' ++ _G_delim=`expr "$2" : '\(.\)'` ++ ++ case $_G_delim$_G_current_value$_G_delim in ++ *"$2$_G_delim"*) ;; ++ *) func_append "$@" ;; ++ esac ++} ++ ++ ++# func_arith TERM... ++# ------------------ ++# Set func_arith_result to the result of evaluating TERMs. ++ test -z "$_G_HAVE_ARITH_OP" \ ++ && (eval 'test 2 = $(( 1 + 1 ))') 2>/dev/null \ ++ && _G_HAVE_ARITH_OP=yes ++ ++if test yes = "$_G_HAVE_ARITH_OP"; then ++ eval 'func_arith () ++ { ++ $debug_cmd ++ ++ func_arith_result=$(( $* )) ++ }' ++else ++ func_arith () ++ { ++ $debug_cmd ++ ++ func_arith_result=`expr "$@"` ++ } ++fi ++ ++ ++# func_basename FILE ++# ------------------ ++# Set func_basename_result to FILE with everything up to and including ++# the last / stripped. ++if test yes = "$_G_HAVE_XSI_OPS"; then ++ # If this shell supports suffix pattern removal, then use it to avoid ++ # forking. Hide the definitions single quotes in case the shell chokes ++ # on unsupported syntax... ++ _b='func_basename_result=${1##*/}' ++ _d='case $1 in ++ */*) func_dirname_result=${1%/*}$2 ;; ++ * ) func_dirname_result=$3 ;; ++ esac' ++ ++else ++ # ...otherwise fall back to using sed. ++ _b='func_basename_result=`$ECHO "$1" |$SED "$sed_basename"`' ++ _d='func_dirname_result=`$ECHO "$1" |$SED "$sed_dirname"` ++ if test "X$func_dirname_result" = "X$1"; then ++ func_dirname_result=$3 ++ else ++ func_append func_dirname_result "$2" ++ fi' ++fi ++ ++eval 'func_basename () ++{ ++ $debug_cmd ++ ++ '"$_b"' ++}' ++ ++ ++# func_dirname FILE APPEND NONDIR_REPLACEMENT ++# ------------------------------------------- + # Compute the dirname of FILE. If nonempty, add APPEND to the result, + # otherwise set result to NONDIR_REPLACEMENT. +-func_dirname () +-{ +- func_dirname_result=`$ECHO "${1}" | $SED "$dirname"` +- if test "X$func_dirname_result" = "X${1}"; then +- func_dirname_result="${3}" +- else +- func_dirname_result="$func_dirname_result${2}" +- fi +-} # func_dirname may be replaced by extended shell implementation +- +- +-# func_basename file +-func_basename () +-{ +- func_basename_result=`$ECHO "${1}" | $SED "$basename"` +-} # func_basename may be replaced by extended shell implementation +- +- +-# func_dirname_and_basename file append nondir_replacement +-# perform func_basename and func_dirname in a single function ++eval 'func_dirname () ++{ ++ $debug_cmd ++ ++ '"$_d"' ++}' ++ ++ ++# func_dirname_and_basename FILE APPEND NONDIR_REPLACEMENT ++# -------------------------------------------------------- ++# Perform func_basename and func_dirname in a single function + # call: + # dirname: Compute the dirname of FILE. If nonempty, + # add APPEND to the result, otherwise set result +@@ -190,263 +587,327 @@ + # value returned in "$func_dirname_result" + # basename: Compute filename of FILE. + # value retuned in "$func_basename_result" +-# Implementation must be kept synchronized with func_dirname +-# and func_basename. For efficiency, we do not delegate to +-# those functions but instead duplicate the functionality here. +-func_dirname_and_basename () +-{ +- # Extract subdirectory from the argument. +- func_dirname_result=`$ECHO "${1}" | $SED -e "$dirname"` +- if test "X$func_dirname_result" = "X${1}"; then +- func_dirname_result="${3}" ++# For efficiency, we do not delegate to the functions above but instead ++# duplicate the functionality here. ++eval 'func_dirname_and_basename () ++{ ++ $debug_cmd ++ ++ '"$_b"' ++ '"$_d"' ++}' ++ ++ ++# func_echo ARG... ++# ---------------- ++# Echo program name prefixed message. ++func_echo () ++{ ++ $debug_cmd ++ ++ _G_message=$* ++ ++ func_echo_IFS=$IFS ++ IFS=$nl ++ for _G_line in $_G_message; do ++ IFS=$func_echo_IFS ++ $bs_echo "$progname: $_G_line" ++ done ++ IFS=$func_echo_IFS ++} ++ ++ ++# func_echo_all ARG... ++# -------------------- ++# Invoke $ECHO with all args, space-separated. ++func_echo_all () ++{ ++ $ECHO "$*" ++} ++ ++ ++# func_echo_infix_1 INFIX ARG... ++# ------------------------------ ++# Echo program name, followed by INFIX on the first line, with any ++# additional lines not showing INFIX. ++func_echo_infix_1 () ++{ ++ $debug_cmd ++ ++ $require_term_colors ++ ++ _G_infix=$1; shift ++ _G_indent=$_G_infix ++ _G_prefix="$progname: $_G_infix: " ++ _G_message=$* ++ ++ # Strip color escape sequences before counting printable length ++ for _G_tc in "$tc_reset" "$tc_bold" "$tc_standout" "$tc_red" "$tc_green" "$tc_blue" "$tc_cyan" ++ do ++ test -n "$_G_tc" && { ++ _G_esc_tc=`$bs_echo "$_G_tc" | sed "$sed_make_literal_regex"` ++ _G_indent=`$bs_echo "$_G_indent" | sed "s|$_G_esc_tc||g"` ++ } ++ done ++ _G_indent="$progname: "`echo "$_G_indent" | sed 's|.| |g'`" " ## exclude from sc_prohibit_nested_quotes ++ ++ func_echo_infix_1_IFS=$IFS ++ IFS=$nl ++ for _G_line in $_G_message; do ++ IFS=$func_echo_infix_1_IFS ++ $bs_echo "$_G_prefix$tc_bold$_G_line$tc_reset" >&2 ++ _G_prefix=$_G_indent ++ done ++ IFS=$func_echo_infix_1_IFS ++} ++ ++ ++# func_error ARG... ++# ----------------- ++# Echo program name prefixed message to standard error. ++func_error () ++{ ++ $debug_cmd ++ ++ $require_term_colors ++ ++ func_echo_infix_1 " $tc_standout${tc_red}error$tc_reset" "$*" >&2 ++} ++ ++ ++# func_fatal_error ARG... ++# ----------------------- ++# Echo program name prefixed message to standard error, and exit. ++func_fatal_error () ++{ ++ $debug_cmd ++ ++ func_error "$*" ++ exit $EXIT_FAILURE ++} ++ ++ ++# func_grep EXPRESSION FILENAME ++# ----------------------------- ++# Check whether EXPRESSION matches any line of FILENAME, without output. ++func_grep () ++{ ++ $debug_cmd ++ ++ $GREP "$1" "$2" >/dev/null 2>&1 ++} ++ ++ ++# func_len STRING ++# --------------- ++# Set func_len_result to the length of STRING. STRING may not ++# start with a hyphen. ++ test -z "$_G_HAVE_XSI_OPS" \ ++ && (eval 'x=a/b/c; ++ test 5aa/bb/cc = "${#x}${x%%/*}${x%/*}${x#*/}${x##*/}"') 2>/dev/null \ ++ && _G_HAVE_XSI_OPS=yes ++ ++if test yes = "$_G_HAVE_XSI_OPS"; then ++ eval 'func_len () ++ { ++ $debug_cmd ++ ++ func_len_result=${#1} ++ }' ++else ++ func_len () ++ { ++ $debug_cmd ++ ++ func_len_result=`expr "$1" : ".*" 2>/dev/null || echo $max_cmd_len` ++ } ++fi ++ ++ ++# func_mkdir_p DIRECTORY-PATH ++# --------------------------- ++# Make sure the entire path to DIRECTORY-PATH is available. ++func_mkdir_p () ++{ ++ $debug_cmd ++ ++ _G_directory_path=$1 ++ _G_dir_list= ++ ++ if test -n "$_G_directory_path" && test : != "$opt_dry_run"; then ++ ++ # Protect directory names starting with '-' ++ case $_G_directory_path in ++ -*) _G_directory_path=./$_G_directory_path ;; ++ esac ++ ++ # While some portion of DIR does not yet exist... ++ while test ! -d "$_G_directory_path"; do ++ # ...make a list in topmost first order. Use a colon delimited ++ # list incase some portion of path contains whitespace. ++ _G_dir_list=$_G_directory_path:$_G_dir_list ++ ++ # If the last portion added has no slash in it, the list is done ++ case $_G_directory_path in */*) ;; *) break ;; esac ++ ++ # ...otherwise throw away the child directory and loop ++ _G_directory_path=`$ECHO "$_G_directory_path" | $SED -e "$sed_dirname"` ++ done ++ _G_dir_list=`$ECHO "$_G_dir_list" | $SED 's|:*$||'` ++ ++ func_mkdir_p_IFS=$IFS; IFS=: ++ for _G_dir in $_G_dir_list; do ++ IFS=$func_mkdir_p_IFS ++ # mkdir can fail with a 'File exist' error if two processes ++ # try to create one of the directories concurrently. Don't ++ # stop in that case! ++ $MKDIR "$_G_dir" 2>/dev/null || : ++ done ++ IFS=$func_mkdir_p_IFS ++ ++ # Bail out if we (or some other process) failed to create a directory. ++ test -d "$_G_directory_path" || \ ++ func_fatal_error "Failed to create '$1'" ++ fi ++} ++ ++ ++# func_mktempdir [BASENAME] ++# ------------------------- ++# Make a temporary directory that won't clash with other running ++# libtool processes, and avoids race conditions if possible. If ++# given, BASENAME is the basename for that directory. ++func_mktempdir () ++{ ++ $debug_cmd ++ ++ _G_template=${TMPDIR-/tmp}/${1-$progname} ++ ++ if test : = "$opt_dry_run"; then ++ # Return a directory name, but don't create it in dry-run mode ++ _G_tmpdir=$_G_template-$$ + else +- func_dirname_result="$func_dirname_result${2}" ++ ++ # If mktemp works, use that first and foremost ++ _G_tmpdir=`mktemp -d "$_G_template-XXXXXXXX" 2>/dev/null` ++ ++ if test ! -d "$_G_tmpdir"; then ++ # Failing that, at least try and use $RANDOM to avoid a race ++ _G_tmpdir=$_G_template-${RANDOM-0}$$ ++ ++ func_mktempdir_umask=`umask` ++ umask 0077 ++ $MKDIR "$_G_tmpdir" ++ umask $func_mktempdir_umask ++ fi ++ ++ # If we're not in dry-run mode, bomb out on failure ++ test -d "$_G_tmpdir" || \ ++ func_fatal_error "cannot create temporary directory '$_G_tmpdir'" + fi +- func_basename_result=`$ECHO "${1}" | $SED -e "$basename"` +-} # func_dirname_and_basename may be replaced by extended shell implementation +- +- +-# func_stripname prefix suffix name +-# strip PREFIX and SUFFIX off of NAME. +-# PREFIX and SUFFIX must not contain globbing or regex special +-# characters, hashes, percent signs, but SUFFIX may contain a leading +-# dot (in which case that matches only a dot). +-# func_strip_suffix prefix name +-func_stripname () +-{ +- case ${2} in +- .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;; +- *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;; +- esac +-} # func_stripname may be replaced by extended shell implementation +- +- +-# These SED scripts presuppose an absolute path with a trailing slash. +-pathcar='s,^/\([^/]*\).*$,\1,' +-pathcdr='s,^/[^/]*,,' +-removedotparts=':dotsl +- s@/\./@/@g +- t dotsl +- s,/\.$,/,' +-collapseslashes='s@/\{1,\}@/@g' +-finalslash='s,/*$,/,' ++ ++ $ECHO "$_G_tmpdir" ++} ++ + + # func_normal_abspath PATH ++# ------------------------ + # Remove doubled-up and trailing slashes, "." path components, + # and cancel out any ".." path components in PATH after making + # it an absolute path. +-# value returned in "$func_normal_abspath_result" + func_normal_abspath () + { +- # Start from root dir and reassemble the path. +- func_normal_abspath_result= +- func_normal_abspath_tpath=$1 +- func_normal_abspath_altnamespace= +- case $func_normal_abspath_tpath in +- "") +- # Empty path, that just means $cwd. +- func_stripname '' '/' "`pwd`" +- func_normal_abspath_result=$func_stripname_result +- return +- ;; +- # The next three entries are used to spot a run of precisely +- # two leading slashes without using negated character classes; +- # we take advantage of case's first-match behaviour. +- ///*) +- # Unusual form of absolute path, do nothing. +- ;; +- //*) +- # Not necessarily an ordinary path; POSIX reserves leading '//' +- # and for example Cygwin uses it to access remote file shares +- # over CIFS/SMB, so we conserve a leading double slash if found. +- func_normal_abspath_altnamespace=/ +- ;; +- /*) +- # Absolute path, do nothing. +- ;; +- *) +- # Relative path, prepend $cwd. +- func_normal_abspath_tpath=`pwd`/$func_normal_abspath_tpath +- ;; +- esac +- # Cancel out all the simple stuff to save iterations. We also want +- # the path to end with a slash for ease of parsing, so make sure +- # there is one (and only one) here. +- func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ +- -e "$removedotparts" -e "$collapseslashes" -e "$finalslash"` +- while :; do +- # Processed it all yet? +- if test "$func_normal_abspath_tpath" = / ; then +- # If we ascended to the root using ".." the result may be empty now. +- if test -z "$func_normal_abspath_result" ; then +- func_normal_abspath_result=/ +- fi +- break +- fi +- func_normal_abspath_tcomponent=`$ECHO "$func_normal_abspath_tpath" | $SED \ +- -e "$pathcar"` ++ $debug_cmd ++ ++ # These SED scripts presuppose an absolute path with a trailing slash. ++ _G_pathcar='s|^/\([^/]*\).*$|\1|' ++ _G_pathcdr='s|^/[^/]*||' ++ _G_removedotparts=':dotsl ++ s|/\./|/|g ++ t dotsl ++ s|/\.$|/|' ++ _G_collapseslashes='s|/\{1,\}|/|g' ++ _G_finalslash='s|/*$|/|' ++ ++ # Start from root dir and reassemble the path. ++ func_normal_abspath_result= ++ func_normal_abspath_tpath=$1 ++ func_normal_abspath_altnamespace= ++ case $func_normal_abspath_tpath in ++ "") ++ # Empty path, that just means $cwd. ++ func_stripname '' '/' "`pwd`" ++ func_normal_abspath_result=$func_stripname_result ++ return ++ ;; ++ # The next three entries are used to spot a run of precisely ++ # two leading slashes without using negated character classes; ++ # we take advantage of case's first-match behaviour. ++ ///*) ++ # Unusual form of absolute path, do nothing. ++ ;; ++ //*) ++ # Not necessarily an ordinary path; POSIX reserves leading '//' ++ # and for example Cygwin uses it to access remote file shares ++ # over CIFS/SMB, so we conserve a leading double slash if found. ++ func_normal_abspath_altnamespace=/ ++ ;; ++ /*) ++ # Absolute path, do nothing. ++ ;; ++ *) ++ # Relative path, prepend $cwd. ++ func_normal_abspath_tpath=`pwd`/$func_normal_abspath_tpath ++ ;; ++ esac ++ ++ # Cancel out all the simple stuff to save iterations. We also want ++ # the path to end with a slash for ease of parsing, so make sure ++ # there is one (and only one) here. + func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ +- -e "$pathcdr"` +- # Figure out what to do with it +- case $func_normal_abspath_tcomponent in +- "") +- # Trailing empty path component, ignore it. +- ;; +- ..) +- # Parent dir; strip last assembled component from result. +- func_dirname "$func_normal_abspath_result" +- func_normal_abspath_result=$func_dirname_result +- ;; +- *) +- # Actual path component, append it. +- func_normal_abspath_result=$func_normal_abspath_result/$func_normal_abspath_tcomponent +- ;; +- esac +- done +- # Restore leading double-slash if one was found on entry. +- func_normal_abspath_result=$func_normal_abspath_altnamespace$func_normal_abspath_result +-} +- +-# func_relative_path SRCDIR DSTDIR +-# generates a relative path from SRCDIR to DSTDIR, with a trailing +-# slash if non-empty, suitable for immediately appending a filename +-# without needing to append a separator. +-# value returned in "$func_relative_path_result" +-func_relative_path () +-{ +- func_relative_path_result= +- func_normal_abspath "$1" +- func_relative_path_tlibdir=$func_normal_abspath_result +- func_normal_abspath "$2" +- func_relative_path_tbindir=$func_normal_abspath_result +- +- # Ascend the tree starting from libdir +- while :; do +- # check if we have found a prefix of bindir +- case $func_relative_path_tbindir in +- $func_relative_path_tlibdir) +- # found an exact match +- func_relative_path_tcancelled= +- break +- ;; +- $func_relative_path_tlibdir*) +- # found a matching prefix +- func_stripname "$func_relative_path_tlibdir" '' "$func_relative_path_tbindir" +- func_relative_path_tcancelled=$func_stripname_result +- if test -z "$func_relative_path_result"; then +- func_relative_path_result=. ++ -e "$_G_removedotparts" -e "$_G_collapseslashes" -e "$_G_finalslash"` ++ while :; do ++ # Processed it all yet? ++ if test / = "$func_normal_abspath_tpath"; then ++ # If we ascended to the root using ".." the result may be empty now. ++ if test -z "$func_normal_abspath_result"; then ++ func_normal_abspath_result=/ + fi + break +- ;; +- *) +- func_dirname $func_relative_path_tlibdir +- func_relative_path_tlibdir=${func_dirname_result} +- if test "x$func_relative_path_tlibdir" = x ; then +- # Have to descend all the way to the root! +- func_relative_path_result=../$func_relative_path_result +- func_relative_path_tcancelled=$func_relative_path_tbindir +- break +- fi +- func_relative_path_result=../$func_relative_path_result +- ;; +- esac +- done +- +- # Now calculate path; take care to avoid doubling-up slashes. +- func_stripname '' '/' "$func_relative_path_result" +- func_relative_path_result=$func_stripname_result +- func_stripname '/' '/' "$func_relative_path_tcancelled" +- if test "x$func_stripname_result" != x ; then +- func_relative_path_result=${func_relative_path_result}/${func_stripname_result} +- fi +- +- # Normalisation. If bindir is libdir, return empty string, +- # else relative path ending with a slash; either way, target +- # file name can be directly appended. +- if test ! -z "$func_relative_path_result"; then +- func_stripname './' '' "$func_relative_path_result/" +- func_relative_path_result=$func_stripname_result +- fi +-} +- +-# The name of this program: +-func_dirname_and_basename "$progpath" +-progname=$func_basename_result +- +-# Make sure we have an absolute path for reexecution: +-case $progpath in +- [\\/]*|[A-Za-z]:\\*) ;; +- *[\\/]*) +- progdir=$func_dirname_result +- progdir=`cd "$progdir" && pwd` +- progpath="$progdir/$progname" +- ;; +- *) +- save_IFS="$IFS" +- IFS=${PATH_SEPARATOR-:} +- for progdir in $PATH; do +- IFS="$save_IFS" +- test -x "$progdir/$progname" && break +- done +- IFS="$save_IFS" +- test -n "$progdir" || progdir=`pwd` +- progpath="$progdir/$progname" +- ;; +-esac +- +-# Sed substitution that helps us do robust quoting. It backslashifies +-# metacharacters that are still active within double-quoted strings. +-Xsed="${SED}"' -e 1s/^X//' +-sed_quote_subst='s/\([`"$\\]\)/\\\1/g' +- +-# Same as above, but do not quote variable references. +-double_quote_subst='s/\(["`\\]\)/\\\1/g' +- +-# Sed substitution that turns a string into a regex matching for the +-# string literally. +-sed_make_literal_regex='s,[].[^$\\*\/],\\&,g' +- +-# Sed substitution that converts a w32 file name or path +-# which contains forward slashes, into one that contains +-# (escaped) backslashes. A very naive implementation. +-lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g' +- +-# Re-`\' parameter expansions in output of double_quote_subst that were +-# `\'-ed in input to the same. If an odd number of `\' preceded a '$' +-# in input to double_quote_subst, that '$' was protected from expansion. +-# Since each input `\' is now two `\'s, look for any number of runs of +-# four `\'s followed by two `\'s and then a '$'. `\' that '$'. +-bs='\\' +-bs2='\\\\' +-bs4='\\\\\\\\' +-dollar='\$' +-sed_double_backslash="\ +- s/$bs4/&\\ +-/g +- s/^$bs2$dollar/$bs&/ +- s/\\([^$bs]\\)$bs2$dollar/\\1$bs2$bs$dollar/g +- s/\n//g" +- +-# Standard options: +-opt_dry_run=false +-opt_help=false +-opt_quiet=false +-opt_verbose=false +-opt_warning=: +- +-# func_echo arg... +-# Echo program name prefixed message, along with the current mode +-# name if it has been set yet. +-func_echo () +-{ +- $ECHO "$progname: ${opt_mode+$opt_mode: }$*" +-} +- +-# func_verbose arg... +-# Echo program name prefixed message in verbose mode only. +-func_verbose () +-{ +- $opt_verbose && func_echo ${1+"$@"} ++ fi ++ func_normal_abspath_tcomponent=`$ECHO "$func_normal_abspath_tpath" | $SED \ ++ -e "$_G_pathcar"` ++ func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ ++ -e "$_G_pathcdr"` ++ # Figure out what to do with it ++ case $func_normal_abspath_tcomponent in ++ "") ++ # Trailing empty path component, ignore it. ++ ;; ++ ..) ++ # Parent dir; strip last assembled component from result. ++ func_dirname "$func_normal_abspath_result" ++ func_normal_abspath_result=$func_dirname_result ++ ;; ++ *) ++ # Actual path component, append it. ++ func_append func_normal_abspath_result "/$func_normal_abspath_tcomponent" ++ ;; ++ esac ++ done ++ # Restore leading double-slash if one was found on entry. ++ func_normal_abspath_result=$func_normal_abspath_altnamespace$func_normal_abspath_result ++} ++ ++ ++# func_notquiet ARG... ++# -------------------- ++# Echo program name prefixed message only when not in quiet mode. ++func_notquiet () ++{ ++ $debug_cmd ++ ++ $opt_quiet || func_echo ${1+"$@"} + + # A bug in bash halts the script if the last line of a function + # fails when set -e is in force, so we need another command to +@@ -454,450 +915,1122 @@ + : + } + +-# func_echo_all arg... +-# Invoke $ECHO with all args, space-separated. +-func_echo_all () +-{ +- $ECHO "$*" +-} +- +-# func_error arg... +-# Echo program name prefixed message to standard error. +-func_error () +-{ +- $ECHO "$progname: ${opt_mode+$opt_mode: }"${1+"$@"} 1>&2 +-} +- +-# func_warning arg... +-# Echo program name prefixed warning message to standard error. +-func_warning () +-{ +- $opt_warning && $ECHO "$progname: ${opt_mode+$opt_mode: }warning: "${1+"$@"} 1>&2 +- +- # bash bug again: ++ ++# func_relative_path SRCDIR DSTDIR ++# -------------------------------- ++# Set func_relative_path_result to the relative path from SRCDIR to DSTDIR. ++func_relative_path () ++{ ++ $debug_cmd ++ ++ func_relative_path_result= ++ func_normal_abspath "$1" ++ func_relative_path_tlibdir=$func_normal_abspath_result ++ func_normal_abspath "$2" ++ func_relative_path_tbindir=$func_normal_abspath_result ++ ++ # Ascend the tree starting from libdir ++ while :; do ++ # check if we have found a prefix of bindir ++ case $func_relative_path_tbindir in ++ $func_relative_path_tlibdir) ++ # found an exact match ++ func_relative_path_tcancelled= ++ break ++ ;; ++ $func_relative_path_tlibdir*) ++ # found a matching prefix ++ func_stripname "$func_relative_path_tlibdir" '' "$func_relative_path_tbindir" ++ func_relative_path_tcancelled=$func_stripname_result ++ if test -z "$func_relative_path_result"; then ++ func_relative_path_result=. ++ fi ++ break ++ ;; ++ *) ++ func_dirname $func_relative_path_tlibdir ++ func_relative_path_tlibdir=$func_dirname_result ++ if test -z "$func_relative_path_tlibdir"; then ++ # Have to descend all the way to the root! ++ func_relative_path_result=../$func_relative_path_result ++ func_relative_path_tcancelled=$func_relative_path_tbindir ++ break ++ fi ++ func_relative_path_result=../$func_relative_path_result ++ ;; ++ esac ++ done ++ ++ # Now calculate path; take care to avoid doubling-up slashes. ++ func_stripname '' '/' "$func_relative_path_result" ++ func_relative_path_result=$func_stripname_result ++ func_stripname '/' '/' "$func_relative_path_tcancelled" ++ if test -n "$func_stripname_result"; then ++ func_append func_relative_path_result "/$func_stripname_result" ++ fi ++ ++ # Normalisation. If bindir is libdir, return '.' else relative path. ++ if test -n "$func_relative_path_result"; then ++ func_stripname './' '' "$func_relative_path_result" ++ func_relative_path_result=$func_stripname_result ++ fi ++ ++ test -n "$func_relative_path_result" || func_relative_path_result=. ++ + : + } + +-# func_fatal_error arg... +-# Echo program name prefixed message to standard error, and exit. +-func_fatal_error () +-{ +- func_error ${1+"$@"} +- exit $EXIT_FAILURE +-} +- +-# func_fatal_help arg... +-# Echo program name prefixed message to standard error, followed by +-# a help hint, and exit. +-func_fatal_help () +-{ +- func_error ${1+"$@"} +- func_fatal_error "$help" +-} +-help="Try \`$progname --help' for more information." ## default +- +- +-# func_grep expression filename +-# Check whether EXPRESSION matches any line of FILENAME, without output. +-func_grep () +-{ +- $GREP "$1" "$2" >/dev/null 2>&1 +-} +- +- +-# func_mkdir_p directory-path +-# Make sure the entire path to DIRECTORY-PATH is available. +-func_mkdir_p () +-{ +- my_directory_path="$1" +- my_dir_list= +- +- if test -n "$my_directory_path" && test "$opt_dry_run" != ":"; then +- +- # Protect directory names starting with `-' +- case $my_directory_path in +- -*) my_directory_path="./$my_directory_path" ;; ++ ++# func_quote_for_eval ARG... ++# -------------------------- ++# Aesthetically quote ARGs to be evaled later. ++# This function returns two values: ++# i) func_quote_for_eval_result ++# double-quoted, suitable for a subsequent eval ++# ii) func_quote_for_eval_unquoted_result ++# has all characters that are still active within double ++# quotes backslashified. ++func_quote_for_eval () ++{ ++ $debug_cmd ++ ++ func_quote_for_eval_unquoted_result= ++ func_quote_for_eval_result= ++ while test 0 -lt $#; do ++ case $1 in ++ *[\\\`\"\$]*) ++ _G_unquoted_arg=`printf '%s\n' "$1" |$SED "$sed_quote_subst"` ;; ++ *) ++ _G_unquoted_arg=$1 ;; + esac +- +- # While some portion of DIR does not yet exist... +- while test ! -d "$my_directory_path"; do +- # ...make a list in topmost first order. Use a colon delimited +- # list incase some portion of path contains whitespace. +- my_dir_list="$my_directory_path:$my_dir_list" +- +- # If the last portion added has no slash in it, the list is done +- case $my_directory_path in */*) ;; *) break ;; esac +- +- # ...otherwise throw away the child directory and loop +- my_directory_path=`$ECHO "$my_directory_path" | $SED -e "$dirname"` +- done +- my_dir_list=`$ECHO "$my_dir_list" | $SED 's,:*$,,'` +- +- save_mkdir_p_IFS="$IFS"; IFS=':' +- for my_dir in $my_dir_list; do +- IFS="$save_mkdir_p_IFS" +- # mkdir can fail with a `File exist' error if two processes +- # try to create one of the directories concurrently. Don't +- # stop in that case! +- $MKDIR "$my_dir" 2>/dev/null || : +- done +- IFS="$save_mkdir_p_IFS" +- +- # Bail out if we (or some other process) failed to create a directory. +- test -d "$my_directory_path" || \ +- func_fatal_error "Failed to create \`$1'" +- fi +-} +- +- +-# func_mktempdir [string] +-# Make a temporary directory that won't clash with other running +-# libtool processes, and avoids race conditions if possible. If +-# given, STRING is the basename for that directory. +-func_mktempdir () +-{ +- my_template="${TMPDIR-/tmp}/${1-$progname}" +- +- if test "$opt_dry_run" = ":"; then +- # Return a directory name, but don't create it in dry-run mode +- my_tmpdir="${my_template}-$$" +- else +- +- # If mktemp works, use that first and foremost +- my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null` +- +- if test ! -d "$my_tmpdir"; then +- # Failing that, at least try and use $RANDOM to avoid a race +- my_tmpdir="${my_template}-${RANDOM-0}$$" +- +- save_mktempdir_umask=`umask` +- umask 0077 +- $MKDIR "$my_tmpdir" +- umask $save_mktempdir_umask ++ if test -n "$func_quote_for_eval_unquoted_result"; then ++ func_append func_quote_for_eval_unquoted_result " $_G_unquoted_arg" ++ else ++ func_append func_quote_for_eval_unquoted_result "$_G_unquoted_arg" + fi + +- # If we're not in dry-run mode, bomb out on failure +- test -d "$my_tmpdir" || \ +- func_fatal_error "cannot create temporary directory \`$my_tmpdir'" +- fi +- +- $ECHO "$my_tmpdir" +-} +- +- +-# func_quote_for_eval arg +-# Aesthetically quote ARG to be evaled later. +-# This function returns two values: FUNC_QUOTE_FOR_EVAL_RESULT +-# is double-quoted, suitable for a subsequent eval, whereas +-# FUNC_QUOTE_FOR_EVAL_UNQUOTED_RESULT has merely all characters +-# which are still active within double quotes backslashified. +-func_quote_for_eval () +-{ +- case $1 in +- *[\\\`\"\$]*) +- func_quote_for_eval_unquoted_result=`$ECHO "$1" | $SED "$sed_quote_subst"` ;; +- *) +- func_quote_for_eval_unquoted_result="$1" ;; +- esac +- +- case $func_quote_for_eval_unquoted_result in +- # Double-quote args containing shell metacharacters to delay +- # word splitting, command substitution and and variable +- # expansion for a subsequent eval. +- # Many Bourne shells cannot handle close brackets correctly +- # in scan sets, so we specify it separately. +- *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") +- func_quote_for_eval_result="\"$func_quote_for_eval_unquoted_result\"" +- ;; +- *) +- func_quote_for_eval_result="$func_quote_for_eval_unquoted_result" +- esac +-} +- +- +-# func_quote_for_expand arg ++ case $_G_unquoted_arg in ++ # Double-quote args containing shell metacharacters to delay ++ # word splitting, command substitution and variable expansion ++ # for a subsequent eval. ++ # Many Bourne shells cannot handle close brackets correctly ++ # in scan sets, so we specify it separately. ++ *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") ++ _G_quoted_arg=\"$_G_unquoted_arg\" ++ ;; ++ *) ++ _G_quoted_arg=$_G_unquoted_arg ++ ;; ++ esac ++ ++ if test -n "$func_quote_for_eval_result"; then ++ func_append func_quote_for_eval_result " $_G_quoted_arg" ++ else ++ func_append func_quote_for_eval_result "$_G_quoted_arg" ++ fi ++ shift ++ done ++} ++ ++ ++# func_quote_for_expand ARG ++# ------------------------- + # Aesthetically quote ARG to be evaled later; same as above, + # but do not quote variable references. + func_quote_for_expand () + { ++ $debug_cmd ++ + case $1 in + *[\\\`\"]*) +- my_arg=`$ECHO "$1" | $SED \ +- -e "$double_quote_subst" -e "$sed_double_backslash"` ;; ++ _G_arg=`$ECHO "$1" | $SED \ ++ -e "$sed_double_quote_subst" -e "$sed_double_backslash"` ;; + *) +- my_arg="$1" ;; ++ _G_arg=$1 ;; + esac + +- case $my_arg in ++ case $_G_arg in + # Double-quote args containing shell metacharacters to delay + # word splitting and command substitution for a subsequent eval. + # Many Bourne shells cannot handle close brackets correctly + # in scan sets, so we specify it separately. + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") +- my_arg="\"$my_arg\"" ++ _G_arg=\"$_G_arg\" + ;; + esac + +- func_quote_for_expand_result="$my_arg" +-} +- +- +-# func_show_eval cmd [fail_exp] +-# Unless opt_silent is true, then output CMD. Then, if opt_dryrun is ++ func_quote_for_expand_result=$_G_arg ++} ++ ++ ++# func_stripname PREFIX SUFFIX NAME ++# --------------------------------- ++# strip PREFIX and SUFFIX from NAME, and store in func_stripname_result. ++# PREFIX and SUFFIX must not contain globbing or regex special ++# characters, hashes, percent signs, but SUFFIX may contain a leading ++# dot (in which case that matches only a dot). ++if test yes = "$_G_HAVE_XSI_OPS"; then ++ eval 'func_stripname () ++ { ++ $debug_cmd ++ ++ # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are ++ # positional parameters, so assign one to ordinary variable first. ++ func_stripname_result=$3 ++ func_stripname_result=${func_stripname_result#"$1"} ++ func_stripname_result=${func_stripname_result%"$2"} ++ }' ++else ++ func_stripname () ++ { ++ $debug_cmd ++ ++ case $2 in ++ .*) func_stripname_result=`$ECHO "$3" | $SED -e "s%^$1%%" -e "s%\\\\$2\$%%"`;; ++ *) func_stripname_result=`$ECHO "$3" | $SED -e "s%^$1%%" -e "s%$2\$%%"`;; ++ esac ++ } ++fi ++ ++ ++# func_show_eval CMD [FAIL_EXP] ++# ----------------------------- ++# Unless opt_quiet is true, then output CMD. Then, if opt_dryrun is + # not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP + # is given, then evaluate it. + func_show_eval () + { +- my_cmd="$1" +- my_fail_exp="${2-:}" +- +- ${opt_silent-false} || { +- func_quote_for_expand "$my_cmd" +- eval "func_echo $func_quote_for_expand_result" ++ $debug_cmd ++ ++ _G_cmd=$1 ++ _G_fail_exp=${2-':'} ++ ++ func_quote_for_expand "$_G_cmd" ++ eval "func_notquiet $func_quote_for_expand_result" ++ ++ $opt_dry_run || { ++ eval "$_G_cmd" ++ _G_status=$? ++ if test 0 -ne "$_G_status"; then ++ eval "(exit $_G_status); $_G_fail_exp" ++ fi + } +- +- if ${opt_dry_run-false}; then :; else +- eval "$my_cmd" +- my_status=$? +- if test "$my_status" -eq 0; then :; else +- eval "(exit $my_status); $my_fail_exp" +- fi +- fi +-} +- +- +-# func_show_eval_locale cmd [fail_exp] +-# Unless opt_silent is true, then output CMD. Then, if opt_dryrun is ++} ++ ++ ++# func_show_eval_locale CMD [FAIL_EXP] ++# ------------------------------------ ++# Unless opt_quiet is true, then output CMD. Then, if opt_dryrun is + # not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP + # is given, then evaluate it. Use the saved locale for evaluation. + func_show_eval_locale () + { +- my_cmd="$1" +- my_fail_exp="${2-:}" +- +- ${opt_silent-false} || { +- func_quote_for_expand "$my_cmd" ++ $debug_cmd ++ ++ _G_cmd=$1 ++ _G_fail_exp=${2-':'} ++ ++ $opt_quiet || { ++ func_quote_for_expand "$_G_cmd" + eval "func_echo $func_quote_for_expand_result" + } + +- if ${opt_dry_run-false}; then :; else +- eval "$lt_user_locale +- $my_cmd" +- my_status=$? +- eval "$lt_safe_locale" +- if test "$my_status" -eq 0; then :; else +- eval "(exit $my_status); $my_fail_exp" ++ $opt_dry_run || { ++ eval "$_G_user_locale ++ $_G_cmd" ++ _G_status=$? ++ eval "$_G_safe_locale" ++ if test 0 -ne "$_G_status"; then ++ eval "(exit $_G_status); $_G_fail_exp" + fi +- fi +-} ++ } ++} ++ + + # func_tr_sh ++# ---------- + # Turn $1 into a string suitable for a shell variable name. + # Result is stored in $func_tr_sh_result. All characters + # not in the set a-zA-Z0-9_ are replaced with '_'. Further, + # if $1 begins with a digit, a '_' is prepended as well. + func_tr_sh () + { +- case $1 in +- [0-9]* | *[!a-zA-Z0-9_]*) +- func_tr_sh_result=`$ECHO "$1" | $SED 's/^\([0-9]\)/_\1/; s/[^a-zA-Z0-9_]/_/g'` +- ;; +- * ) +- func_tr_sh_result=$1 +- ;; +- esac +-} +- +- +-# func_version +-# Echo version message to standard output and exit. +-func_version () +-{ +- $opt_debug +- +- $SED -n '/(C)/!b go +- :more +- /\./!{ +- N +- s/\n# / / +- b more +- } +- :go +- /^# '$PROGRAM' (GNU /,/# warranty; / { +- s/^# // +- s/^# *$// +- s/\((C)\)[ 0-9,-]*\( [1-9][0-9]*\)/\1\2/ +- p +- }' < "$progpath" +- exit $? +-} +- +-# func_usage +-# Echo short help message to standard output and exit. +-func_usage () +-{ +- $opt_debug +- +- $SED -n '/^# Usage:/,/^# *.*--help/ { +- s/^# // +- s/^# *$// +- s/\$progname/'$progname'/ +- p +- }' < "$progpath" +- echo +- $ECHO "run \`$progname --help | more' for full usage" +- exit $? +-} +- +-# func_help [NOEXIT] +-# Echo long help message to standard output and exit, +-# unless 'noexit' is passed as argument. ++ $debug_cmd ++ ++ case $1 in ++ [0-9]* | *[!a-zA-Z0-9_]*) ++ func_tr_sh_result=`$ECHO "$1" | $SED -e 's/^\([0-9]\)/_\1/' -e 's/[^a-zA-Z0-9_]/_/g'` ++ ;; ++ * ) ++ func_tr_sh_result=$1 ++ ;; ++ esac ++} ++ ++ ++# func_verbose ARG... ++# ------------------- ++# Echo program name prefixed message in verbose mode only. ++func_verbose () ++{ ++ $debug_cmd ++ ++ $opt_verbose && func_echo "$*" ++ ++ : ++} ++ ++ ++# func_warn_and_continue ARG... ++# ----------------------------- ++# Echo program name prefixed warning message to standard error. ++func_warn_and_continue () ++{ ++ $debug_cmd ++ ++ $require_term_colors ++ ++ func_echo_infix_1 "${tc_red}warning$tc_reset" "$*" >&2 ++} ++ ++ ++# func_warning CATEGORY ARG... ++# ---------------------------- ++# Echo program name prefixed warning message to standard error. Warning ++# messages can be filtered according to CATEGORY, where this function ++# elides messages where CATEGORY is not listed in the global variable ++# 'opt_warning_types'. ++func_warning () ++{ ++ $debug_cmd ++ ++ # CATEGORY must be in the warning_categories list! ++ case " $warning_categories " in ++ *" $1 "*) ;; ++ *) func_internal_error "invalid warning category '$1'" ;; ++ esac ++ ++ _G_category=$1 ++ shift ++ ++ case " $opt_warning_types " in ++ *" $_G_category "*) $warning_func ${1+"$@"} ;; ++ esac ++} ++ ++ ++# func_sort_ver VER1 VER2 ++# ----------------------- ++# 'sort -V' is not generally available. ++# Note this deviates from the version comparison in automake ++# in that it treats 1.5 < 1.5.0, and treats 1.4.4a < 1.4-p3a ++# but this should suffice as we won't be specifying old ++# version formats or redundant trailing .0 in bootstrap.conf. ++# If we did want full compatibility then we should probably ++# use m4_version_compare from autoconf. ++func_sort_ver () ++{ ++ $debug_cmd ++ ++ ver1=$1 ++ ver2=$2 ++ ++ # Split on '.' and compare each component. ++ i=1 ++ while :; do ++ p1=`echo "$ver1" |cut -d. -f$i` ++ p2=`echo "$ver2" |cut -d. -f$i` ++ if test ! "$p1"; then ++ echo "$1 $2" ++ break ++ elif test ! "$p2"; then ++ echo "$2 $1" ++ break ++ elif test ! "$p1" = "$p2"; then ++ if test "$p1" -gt "$p2" 2>/dev/null; then # numeric comparison ++ echo "$2 $1" ++ elif test "$p2" -gt "$p1" 2>/dev/null; then # numeric comparison ++ echo "$1 $2" ++ else # numeric, then lexicographic comparison ++ lp=`printf "$p1\n$p2\n" |sort -n |tail -n1` ++ if test "$lp" = "$p2"; then ++ echo "$1 $2" ++ else ++ echo "$2 $1" ++ fi ++ fi ++ break ++ fi ++ i=`expr $i + 1` ++ done ++} ++ ++ ++# Local variables: ++# mode: shell-script ++# sh-indentation: 2 ++# eval: (add-hook 'write-file-hooks 'time-stamp) ++# time-stamp-pattern: "10/scriptversion=%:y-%02m-%02d.%02H; # UTC" ++# time-stamp-time-zone: "UTC" ++# End: ++#! /bin/sh ++ ++# Set a version string for this script. ++scriptversion=2012-10-21.11; # UTC ++ ++# A portable, pluggable option parser for Bourne shell. ++# Written by Gary V. Vaughan, 2010 ++ ++# Copyright (C) 2010-2013 Free Software Foundation, Inc. ++# This is free software; see the source for copying conditions. There is NO ++# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. ++ ++# This program is free software: you can redistribute it and/or modify ++# it under the terms of the GNU General Public License as published by ++# the Free Software Foundation, either version 3 of the License, or ++# (at your option) any later version. ++ ++# This program is distributed in the hope that it will be useful, ++# but WITHOUT ANY WARRANTY; without even the implied warranty of ++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++# GNU General Public License for more details. ++ ++# You should have received a copy of the GNU General Public License ++# along with this program. If not, see . ++ ++# Please report bugs or propose patches to gary@gnu.org. ++ ++ ++## ------ ## ++## Usage. ## ++## ------ ## ++ ++# This file is a library for parsing options in your shell scripts along ++# with assorted other useful supporting features that you can make use ++# of too. ++# ++# For the simplest scripts you might need only: ++# ++# #!/bin/sh ++# . relative/path/to/funclib.sh ++# . relative/path/to/options-parser ++# scriptversion=1.0 ++# func_options ${1+"$@"} ++# eval set dummy "$func_options_result"; shift ++# ...rest of your script... ++# ++# In order for the '--version' option to work, you will need to have a ++# suitably formatted comment like the one at the top of this file ++# starting with '# Written by ' and ending with '# warranty; '. ++# ++# For '-h' and '--help' to work, you will also need a one line ++# description of your script's purpose in a comment directly above the ++# '# Written by ' line, like the one at the top of this file. ++# ++# The default options also support '--debug', which will turn on shell ++# execution tracing (see the comment above debug_cmd below for another ++# use), and '--verbose' and the func_verbose function to allow your script ++# to display verbose messages only when your user has specified ++# '--verbose'. ++# ++# After sourcing this file, you can plug processing for additional ++# options by amending the variables from the 'Configuration' section ++# below, and following the instructions in the 'Option parsing' ++# section further down. ++ ++## -------------- ## ++## Configuration. ## ++## -------------- ## ++ ++# You should override these variables in your script after sourcing this ++# file so that they reflect the customisations you have added to the ++# option parser. ++ ++# The usage line for option parsing errors and the start of '-h' and ++# '--help' output messages. You can embed shell variables for delayed ++# expansion at the time the message is displayed, but you will need to ++# quote other shell meta-characters carefully to prevent them being ++# expanded when the contents are evaled. ++usage='$progpath [OPTION]...' ++ ++# Short help message in response to '-h' and '--help'. Add to this or ++# override it after sourcing this library to reflect the full set of ++# options your script accepts. ++usage_message="\ ++ --debug enable verbose shell tracing ++ -W, --warnings=CATEGORY ++ report the warnings falling in CATEGORY [all] ++ -v, --verbose verbosely report processing ++ --version print version information and exit ++ -h, --help print short or long help message and exit ++" ++ ++# Additional text appended to 'usage_message' in response to '--help'. ++long_help_message=" ++Warning categories include: ++ 'all' show all warnings ++ 'none' turn off all the warnings ++ 'error' warnings are treated as fatal errors" ++ ++# Help message printed before fatal option parsing errors. ++fatal_help="Try '\$progname --help' for more information." ++ ++ ++ ++## ------------------------- ## ++## Hook function management. ## ++## ------------------------- ## ++ ++# This section contains functions for adding, removing, and running hooks ++# to the main code. A hook is just a named list of of function, that can ++# be run in order later on. ++ ++# func_hookable FUNC_NAME ++# ----------------------- ++# Declare that FUNC_NAME will run hooks added with ++# 'func_add_hook FUNC_NAME ...'. ++func_hookable () ++{ ++ $debug_cmd ++ ++ func_append hookable_fns " $1" ++} ++ ++ ++# func_add_hook FUNC_NAME HOOK_FUNC ++# --------------------------------- ++# Request that FUNC_NAME call HOOK_FUNC before it returns. FUNC_NAME must ++# first have been declared "hookable" by a call to 'func_hookable'. ++func_add_hook () ++{ ++ $debug_cmd ++ ++ case " $hookable_fns " in ++ *" $1 "*) ;; ++ *) func_fatal_error "'$1' does not accept hook functions." ;; ++ esac ++ ++ eval func_append ${1}_hooks '" $2"' ++} ++ ++ ++# func_remove_hook FUNC_NAME HOOK_FUNC ++# ------------------------------------ ++# Remove HOOK_FUNC from the list of functions called by FUNC_NAME. ++func_remove_hook () ++{ ++ $debug_cmd ++ ++ eval ${1}_hooks='`$bs_echo "\$'$1'_hooks" |$SED "s| '$2'||"`' ++} ++ ++ ++# func_run_hooks FUNC_NAME [ARG]... ++# --------------------------------- ++# Run all hook functions registered to FUNC_NAME. ++# It is assumed that the list of hook functions contains nothing more ++# than a whitespace-delimited list of legal shell function names, and ++# no effort is wasted trying to catch shell meta-characters or preserve ++# whitespace. ++func_run_hooks () ++{ ++ $debug_cmd ++ ++ case " $hookable_fns " in ++ *" $1 "*) ;; ++ *) func_fatal_error "'$1' does not support hook funcions.n" ;; ++ esac ++ ++ eval _G_hook_fns=\$$1_hooks; shift ++ ++ for _G_hook in $_G_hook_fns; do ++ eval $_G_hook '"$@"' ++ ++ # store returned options list back into positional ++ # parameters for next 'cmd' execution. ++ eval _G_hook_result=\$${_G_hook}_result ++ eval set dummy "$_G_hook_result"; shift ++ done ++ ++ func_quote_for_eval ${1+"$@"} ++ func_run_hooks_result=$func_quote_for_eval_result ++} ++ ++ ++ ++## --------------- ## ++## Option parsing. ## ++## --------------- ## ++ ++# In order to add your own option parsing hooks, you must accept the ++# full positional parameter list in your hook function, remove any ++# options that you action, and then pass back the remaining unprocessed ++# options in '_result', escaped suitably for ++# 'eval'. Like this: ++# ++# my_options_prep () ++# { ++# $debug_cmd ++# ++# # Extend the existing usage message. ++# usage_message=$usage_message' ++# -s, --silent don'\''t print informational messages ++# ' ++# ++# func_quote_for_eval ${1+"$@"} ++# my_options_prep_result=$func_quote_for_eval_result ++# } ++# func_add_hook func_options_prep my_options_prep ++# ++# ++# my_silent_option () ++# { ++# $debug_cmd ++# ++# # Note that for efficiency, we parse as many options as we can ++# # recognise in a loop before passing the remainder back to the ++# # caller on the first unrecognised argument we encounter. ++# while test $# -gt 0; do ++# opt=$1; shift ++# case $opt in ++# --silent|-s) opt_silent=: ;; ++# # Separate non-argument short options: ++# -s*) func_split_short_opt "$_G_opt" ++# set dummy "$func_split_short_opt_name" \ ++# "-$func_split_short_opt_arg" ${1+"$@"} ++# shift ++# ;; ++# *) set dummy "$_G_opt" "$*"; shift; break ;; ++# esac ++# done ++# ++# func_quote_for_eval ${1+"$@"} ++# my_silent_option_result=$func_quote_for_eval_result ++# } ++# func_add_hook func_parse_options my_silent_option ++# ++# ++# my_option_validation () ++# { ++# $debug_cmd ++# ++# $opt_silent && $opt_verbose && func_fatal_help "\ ++# '--silent' and '--verbose' options are mutually exclusive." ++# ++# func_quote_for_eval ${1+"$@"} ++# my_option_validation_result=$func_quote_for_eval_result ++# } ++# func_add_hook func_validate_options my_option_validation ++# ++# You'll alse need to manually amend $usage_message to reflect the extra ++# options you parse. It's preferable to append if you can, so that ++# multiple option parsing hooks can be added safely. ++ ++ ++# func_options [ARG]... ++# --------------------- ++# All the functions called inside func_options are hookable. See the ++# individual implementations for details. ++func_hookable func_options ++func_options () ++{ ++ $debug_cmd ++ ++ func_options_prep ${1+"$@"} ++ eval func_parse_options \ ++ ${func_options_prep_result+"$func_options_prep_result"} ++ eval func_validate_options \ ++ ${func_parse_options_result+"$func_parse_options_result"} ++ ++ eval func_run_hooks func_options \ ++ ${func_validate_options_result+"$func_validate_options_result"} ++ ++ # save modified positional parameters for caller ++ func_options_result=$func_run_hooks_result ++} ++ ++ ++# func_options_prep [ARG]... ++# -------------------------- ++# All initialisations required before starting the option parse loop. ++# Note that when calling hook functions, we pass through the list of ++# positional parameters. If a hook function modifies that list, and ++# needs to propogate that back to rest of this script, then the complete ++# modified list must be put in 'func_run_hooks_result' before ++# returning. ++func_hookable func_options_prep ++func_options_prep () ++{ ++ $debug_cmd ++ ++ # Option defaults: ++ opt_verbose=false ++ opt_warning_types= ++ ++ func_run_hooks func_options_prep ${1+"$@"} ++ ++ # save modified positional parameters for caller ++ func_options_prep_result=$func_run_hooks_result ++} ++ ++ ++# func_parse_options [ARG]... ++# --------------------------- ++# The main option parsing loop. ++func_hookable func_parse_options ++func_parse_options () ++{ ++ $debug_cmd ++ ++ func_parse_options_result= ++ ++ # this just eases exit handling ++ while test $# -gt 0; do ++ # Defer to hook functions for initial option parsing, so they ++ # get priority in the event of reusing an option name. ++ func_run_hooks func_parse_options ${1+"$@"} ++ ++ # Adjust func_parse_options positional parameters to match ++ eval set dummy "$func_run_hooks_result"; shift ++ ++ # Break out of the loop if we already parsed every option. ++ test $# -gt 0 || break ++ ++ _G_opt=$1 ++ shift ++ case $_G_opt in ++ --debug|-x) debug_cmd='set -x' ++ func_echo "enabling shell trace mode" ++ $debug_cmd ++ ;; ++ ++ --no-warnings|--no-warning|--no-warn) ++ set dummy --warnings none ${1+"$@"} ++ shift ++ ;; ++ ++ --warnings|--warning|-W) ++ test $# = 0 && func_missing_arg $_G_opt && break ++ case " $warning_categories $1" in ++ *" $1 "*) ++ # trailing space prevents matching last $1 above ++ func_append_uniq opt_warning_types " $1" ++ ;; ++ *all) ++ opt_warning_types=$warning_categories ++ ;; ++ *none) ++ opt_warning_types=none ++ warning_func=: ++ ;; ++ *error) ++ opt_warning_types=$warning_categories ++ warning_func=func_fatal_error ++ ;; ++ *) ++ func_fatal_error \ ++ "unsupported warning category: '$1'" ++ ;; ++ esac ++ shift ++ ;; ++ ++ --verbose|-v) opt_verbose=: ;; ++ --version) func_version ;; ++ -\?|-h) func_usage ;; ++ --help) func_help ;; ++ ++ # Separate optargs to long options (plugins may need this): ++ --*=*) func_split_equals "$_G_opt" ++ set dummy "$func_split_equals_lhs" \ ++ "$func_split_equals_rhs" ${1+"$@"} ++ shift ++ ;; ++ ++ # Separate optargs to short options: ++ -W*) ++ func_split_short_opt "$_G_opt" ++ set dummy "$func_split_short_opt_name" \ ++ "$func_split_short_opt_arg" ${1+"$@"} ++ shift ++ ;; ++ ++ # Separate non-argument short options: ++ -\?*|-h*|-v*|-x*) ++ func_split_short_opt "$_G_opt" ++ set dummy "$func_split_short_opt_name" \ ++ "-$func_split_short_opt_arg" ${1+"$@"} ++ shift ++ ;; ++ ++ --) break ;; ++ -*) func_fatal_help "unrecognised option: '$_G_opt'" ;; ++ *) set dummy "$_G_opt" ${1+"$@"}; shift; break ;; ++ esac ++ done ++ ++ # save modified positional parameters for caller ++ func_quote_for_eval ${1+"$@"} ++ func_parse_options_result=$func_quote_for_eval_result ++} ++ ++ ++# func_validate_options [ARG]... ++# ------------------------------ ++# Perform any sanity checks on option settings and/or unconsumed ++# arguments. ++func_hookable func_validate_options ++func_validate_options () ++{ ++ $debug_cmd ++ ++ # Display all warnings if -W was not given. ++ test -n "$opt_warning_types" || opt_warning_types=" $warning_categories" ++ ++ func_run_hooks func_validate_options ${1+"$@"} ++ ++ # Bail if the options were screwed! ++ $exit_cmd $EXIT_FAILURE ++ ++ # save modified positional parameters for caller ++ func_validate_options_result=$func_run_hooks_result ++} ++ ++ ++ ++## ------------------## ++## Helper functions. ## ++## ------------------## ++ ++# This section contains the helper functions used by the rest of the ++# hookable option parser framework in ascii-betical order. ++ ++ ++# func_fatal_help ARG... ++# ---------------------- ++# Echo program name prefixed message to standard error, followed by ++# a help hint, and exit. ++func_fatal_help () ++{ ++ $debug_cmd ++ ++ eval \$bs_echo \""Usage: $usage"\" ++ eval \$bs_echo \""$fatal_help"\" ++ func_error ${1+"$@"} ++ exit $EXIT_FAILURE ++} ++ ++ ++# func_help ++# --------- ++# Echo long help message to standard output and exit. + func_help () + { +- $opt_debug +- +- $SED -n '/^# Usage:/,/# Report bugs to/ { +- :print +- s/^# // +- s/^# *$// +- s*\$progname*'$progname'* +- s*\$host*'"$host"'* +- s*\$SHELL*'"$SHELL"'* +- s*\$LTCC*'"$LTCC"'* +- s*\$LTCFLAGS*'"$LTCFLAGS"'* +- s*\$LD*'"$LD"'* +- s/\$with_gnu_ld/'"$with_gnu_ld"'/ +- s/\$automake_version/'"`(${AUTOMAKE-automake} --version) 2>/dev/null |$SED 1q`"'/ +- s/\$autoconf_version/'"`(${AUTOCONF-autoconf} --version) 2>/dev/null |$SED 1q`"'/ +- p +- d +- } +- /^# .* home page:/b print +- /^# General help using/b print +- ' < "$progpath" +- ret=$? +- if test -z "$1"; then +- exit $ret +- fi +-} +- +-# func_missing_arg argname ++ $debug_cmd ++ ++ func_usage_message ++ $bs_echo "$long_help_message" ++ exit 0 ++} ++ ++ ++# func_missing_arg ARGNAME ++# ------------------------ + # Echo program name prefixed message to standard error and set global + # exit_cmd. + func_missing_arg () + { +- $opt_debug +- +- func_error "missing argument for $1." ++ $debug_cmd ++ ++ func_error "Missing argument for '$1'." + exit_cmd=exit + } + + +-# func_split_short_opt shortopt ++# func_split_equals STRING ++# ------------------------ ++# Set func_split_equals_lhs and func_split_equals_rhs shell variables after ++# splitting STRING at the '=' sign. ++test -z "$_G_HAVE_XSI_OPS" \ ++ && (eval 'x=a/b/c; ++ test 5aa/bb/cc = "${#x}${x%%/*}${x%/*}${x#*/}${x##*/}"') 2>/dev/null \ ++ && _G_HAVE_XSI_OPS=yes ++ ++if test yes = "$_G_HAVE_XSI_OPS" ++then ++ # This is an XSI compatible shell, allowing a faster implementation... ++ eval 'func_split_equals () ++ { ++ $debug_cmd ++ ++ func_split_equals_lhs=${1%%=*} ++ func_split_equals_rhs=${1#*=} ++ test "x$func_split_equals_lhs" = "x$1" \ ++ && func_split_equals_rhs= ++ }' ++else ++ # ...otherwise fall back to using expr, which is often a shell builtin. ++ func_split_equals () ++ { ++ $debug_cmd ++ ++ func_split_equals_lhs=`expr "x$1" : 'x\([^=]*\)'` ++ func_split_equals_rhs= ++ test "x$func_split_equals_lhs" = "x$1" \ ++ || func_split_equals_rhs=`expr "x$1" : 'x[^=]*=\(.*\)$'` ++ } ++fi #func_split_equals ++ ++ ++# func_split_short_opt SHORTOPT ++# ----------------------------- + # Set func_split_short_opt_name and func_split_short_opt_arg shell + # variables after splitting SHORTOPT after the 2nd character. +-func_split_short_opt () +-{ +- my_sed_short_opt='1s/^\(..\).*$/\1/;q' +- my_sed_short_rest='1s/^..\(.*\)$/\1/;q' +- +- func_split_short_opt_name=`$ECHO "$1" | $SED "$my_sed_short_opt"` +- func_split_short_opt_arg=`$ECHO "$1" | $SED "$my_sed_short_rest"` +-} # func_split_short_opt may be replaced by extended shell implementation +- +- +-# func_split_long_opt longopt +-# Set func_split_long_opt_name and func_split_long_opt_arg shell +-# variables after splitting LONGOPT at the `=' sign. +-func_split_long_opt () +-{ +- my_sed_long_opt='1s/^\(--[^=]*\)=.*/\1/;q' +- my_sed_long_arg='1s/^--[^=]*=//' +- +- func_split_long_opt_name=`$ECHO "$1" | $SED "$my_sed_long_opt"` +- func_split_long_opt_arg=`$ECHO "$1" | $SED "$my_sed_long_arg"` +-} # func_split_long_opt may be replaced by extended shell implementation +- +-exit_cmd=: +- +- +- +- +- +-magic="%%%MAGIC variable%%%" +-magic_exe="%%%MAGIC EXE variable%%%" +- +-# Global variables. +-nonopt= +-preserve_args= +-lo2o="s/\\.lo\$/.${objext}/" +-o2lo="s/\\.${objext}\$/.lo/" +-extracted_archives= +-extracted_serial=0 +- +-# If this variable is set in any of the actions, the command in it +-# will be execed at the end. This prevents here-documents from being +-# left over by shells. +-exec_cmd= +- +-# func_append var value +-# Append VALUE to the end of shell variable VAR. +-func_append () +-{ +- eval "${1}=\$${1}\${2}" +-} # func_append may be replaced by extended shell implementation +- +-# func_append_quoted var value +-# Quote VALUE and append to the end of shell variable VAR, separated +-# by a space. +-func_append_quoted () +-{ +- func_quote_for_eval "${2}" +- eval "${1}=\$${1}\\ \$func_quote_for_eval_result" +-} # func_append_quoted may be replaced by extended shell implementation +- +- +-# func_arith arithmetic-term... +-func_arith () +-{ +- func_arith_result=`expr "${@}"` +-} # func_arith may be replaced by extended shell implementation +- +- +-# func_len string +-# STRING may not start with a hyphen. +-func_len () +-{ +- func_len_result=`expr "${1}" : ".*" 2>/dev/null || echo $max_cmd_len` +-} # func_len may be replaced by extended shell implementation +- +- +-# func_lo2o object +-func_lo2o () +-{ +- func_lo2o_result=`$ECHO "${1}" | $SED "$lo2o"` +-} # func_lo2o may be replaced by extended shell implementation +- +- +-# func_xform libobj-or-source +-func_xform () +-{ +- func_xform_result=`$ECHO "${1}" | $SED 's/\.[^.]*$/.lo/'` +-} # func_xform may be replaced by extended shell implementation +- +- +-# func_fatal_configuration arg... ++if test yes = "$_G_HAVE_XSI_OPS" ++then ++ # This is an XSI compatible shell, allowing a faster implementation... ++ eval 'func_split_short_opt () ++ { ++ $debug_cmd ++ ++ func_split_short_opt_arg=${1#??} ++ func_split_short_opt_name=${1%"$func_split_short_opt_arg"} ++ }' ++else ++ # ...otherwise fall back to using expr, which is often a shell builtin. ++ func_split_short_opt () ++ { ++ $debug_cmd ++ ++ func_split_short_opt_name=`expr "x$1" : 'x-\(.\)'` ++ func_split_short_opt_arg=`expr "x$1" : 'x-.\(.*\)$'` ++ } ++fi #func_split_short_opt ++ ++ ++# func_usage ++# ---------- ++# Echo short help message to standard output and exit. ++func_usage () ++{ ++ $debug_cmd ++ ++ func_usage_message ++ $bs_echo "Run '$progname --help |${PAGER-more}' for full usage" ++ exit 0 ++} ++ ++ ++# func_usage_message ++# ------------------ ++# Echo short help message to standard output. ++func_usage_message () ++{ ++ $debug_cmd ++ ++ eval \$bs_echo \""Usage: $usage"\" ++ echo ++ $SED -n 's|^# || ++ /^Written by/{ ++ x;p;x ++ } ++ h ++ /^Written by/q' < "$progpath" ++ echo ++ eval \$bs_echo \""$usage_message"\" ++} ++ ++ ++# func_version ++# ------------ ++# Echo version message to standard output and exit. ++func_version () ++{ ++ $debug_cmd ++ ++ printf '%s\n' "$progname $scriptversion" ++ $SED -n '/^##/q ++ /(C)/!b go ++ :more ++ /\./!{ ++ N ++ s|\n# | | ++ b more ++ } ++ :go ++ /^# Written by /,/# warranty; / { ++ s|^# || ++ s|^# *$|| ++ s|\((C)\)[ 0-9,-]*[ ,-]\([1-9][0-9]* \)|\1 \2| ++ p ++ } ++ /^# Written by / { ++ s|^# || ++ p ++ } ++ /^warranty; /q' < "$progpath" ++ ++ exit $? ++} ++ ++ ++# Local variables: ++# mode: shell-script ++# sh-indentation: 2 ++# eval: (add-hook 'write-file-hooks 'time-stamp) ++# time-stamp-pattern: "10/scriptversion=%:y-%02m-%02d.%02H; # UTC" ++# time-stamp-time-zone: "UTC" ++# End: ++ ++# Set a version string. ++scriptversion='(GNU libtool) 2.4.2.418' ++ ++ ++# func_echo ARG... ++# ---------------- ++# Libtool also displays the current mode in messages, so override ++# funclib.sh func_echo with this custom definition. ++func_echo () ++{ ++ $debug_cmd ++ ++ _G_message=$* ++ ++ func_echo_IFS=$IFS ++ IFS=$nl ++ for _G_line in $_G_message; do ++ IFS=$func_echo_IFS ++ $bs_echo "$progname${opt_mode+: $opt_mode}: $_G_line" ++ done ++ IFS=$func_echo_IFS ++} ++ ++ ++# func_warning ARG... ++# ------------------- ++# Libtool warnings are not categorized, so override funclib.sh ++# func_warning with this simpler definition. ++func_warning () ++{ ++ $debug_cmd ++ ++ $warning_func ${1+"$@"} ++} ++ ++ ++## ---------------- ## ++## Options parsing. ## ++## ---------------- ## ++ ++# Hook in the functions to make sure our own options are parsed during ++# the option parsing loop. ++ ++usage='$progpath [OPTION]... [MODE-ARG]...' ++ ++# Short help message in response to '-h'. ++usage_message="Options: ++ --config show all configuration variables ++ --debug enable verbose shell tracing ++ -n, --dry-run display commands without modifying any files ++ --features display basic configuration information and exit ++ --mode=MODE use operation mode MODE ++ --no-warnings equivalent to '-Wnone' ++ --preserve-dup-deps don't remove duplicate dependency libraries ++ --quiet, --silent don't print informational messages ++ --tag=TAG use configuration variables from tag TAG ++ -v, --verbose print more informational messages than default ++ --version print version information ++ -W, --warnings=CATEGORY report the warnings falling in CATEGORY [all] ++ -h, --help, --help-all print short, long, or detailed help message ++" ++ ++# Additional text appended to 'usage_message' in response to '--help'. ++long_help_message=$long_help_message" ++ ++MODE must be one of the following: ++ ++ clean remove files from the build directory ++ compile compile a source file into a libtool object ++ execute automatically set library path, then run a program ++ finish complete the installation of libtool libraries ++ install install libraries or executables ++ link create a library or an executable ++ uninstall remove libraries from an installed directory ++ ++MODE-ARGS vary depending on the MODE. When passed as first option, ++'--mode=MODE' may be abbreviated as 'MODE' or a unique abbreviation of that. ++Try '$progname --help --mode=MODE' for a more detailed description of MODE. ++ ++When reporting a bug, please describe a test case to reproduce it and ++include the following information: ++ ++ host-triplet: $host ++ shell: $SHELL ++ compiler: $LTCC ++ compiler flags: $LTCFLAGS ++ linker: $LD (gnu? $with_gnu_ld) ++ version: $progname (GNU libtool) 2.4.2.418 ++ automake: `($AUTOMAKE --version) 2>/dev/null |$SED 1q` ++ autoconf: `($AUTOCONF --version) 2>/dev/null |$SED 1q` ++ ++Report bugs to . ++GNU libtool home page: . ++General help using GNU software: ." ++ ++ ++# func_lo2o OBJECT-NAME ++# --------------------- ++# Transform OBJECT-NAME from a '.lo' suffix to the platform specific ++# object suffix. ++ ++lo2o=s/\\.lo\$/.$objext/ ++o2lo=s/\\.$objext\$/.lo/ ++ ++if test yes = "$_G_HAVE_XSI_OPS"; then ++ eval 'func_lo2o () ++ { ++ case $1 in ++ *.lo) func_lo2o_result=${1%.lo}.$objext ;; ++ * ) func_lo2o_result=$1 ;; ++ esac ++ }' ++ ++ # func_xform LIBOBJ-OR-SOURCE ++ # --------------------------- ++ # Transform LIBOBJ-OR-SOURCE from a '.o' or '.c' (or otherwise) ++ # suffix to a '.lo' libtool-object suffix. ++ eval 'func_xform () ++ { ++ func_xform_result=${1%.*}.lo ++ }' ++else ++ # ...otherwise fall back to using sed. ++ func_lo2o () ++ { ++ func_lo2o_result=`$ECHO "$1" | $SED "$lo2o"` ++ } ++ ++ func_xform () ++ { ++ func_xform_result=`$ECHO "$1" | $SED 's|\.[^.]*$|.lo|'` ++ } ++fi ++ ++ ++# func_fatal_configuration ARG... ++# ------------------------------- + # Echo program name prefixed message to standard error, followed by + # a configuration failure hint, and exit. + func_fatal_configuration () + { +- func_error ${1+"$@"} +- func_error "See the $PACKAGE documentation for more information." +- func_fatal_error "Fatal configuration error." ++ func__fatal_error ${1+"$@"} \ ++ "See the $PACKAGE documentation for more information." \ ++ "Fatal configuration error." + } + + + # func_config ++# ----------- + # Display the configuration for all the tags in this script. + func_config () + { +@@ -915,17 +2048,19 @@ + exit $? + } + ++ + # func_features ++# ------------- + # Display the features supported by this script. + func_features () + { + echo "host: $host" +- if test "$build_libtool_libs" = yes; then ++ if test yes = "$build_libtool_libs"; then + echo "enable shared libraries" + else + echo "disable shared libraries" + fi +- if test "$build_old_libs" = yes; then ++ if test yes = "$build_old_libs"; then + echo "enable static libraries" + else + echo "disable static libraries" +@@ -934,289 +2069,295 @@ + exit $? + } + +-# func_enable_tag tagname ++ ++# func_enable_tag TAGNAME ++# ----------------------- + # Verify that TAGNAME is valid, and either flag an error and exit, or + # enable the TAGNAME tag. We also add TAGNAME to the global $taglist + # variable here. + func_enable_tag () + { +- # Global variable: +- tagname="$1" +- +- re_begincf="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$" +- re_endcf="^# ### END LIBTOOL TAG CONFIG: $tagname\$" +- sed_extractcf="/$re_begincf/,/$re_endcf/p" +- +- # Validate tagname. +- case $tagname in +- *[!-_A-Za-z0-9,/]*) +- func_fatal_error "invalid tag name: $tagname" +- ;; +- esac +- +- # Don't test for the "default" C tag, as we know it's +- # there but not specially marked. +- case $tagname in +- CC) ;; ++ # Global variable: ++ tagname=$1 ++ ++ re_begincf="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$" ++ re_endcf="^# ### END LIBTOOL TAG CONFIG: $tagname\$" ++ sed_extractcf=/$re_begincf/,/$re_endcf/p ++ ++ # Validate tagname. ++ case $tagname in ++ *[!-_A-Za-z0-9,/]*) ++ func_fatal_error "invalid tag name: $tagname" ++ ;; ++ esac ++ ++ # Don't test for the "default" C tag, as we know it's ++ # there but not specially marked. ++ case $tagname in ++ CC) ;; + *) +- if $GREP "$re_begincf" "$progpath" >/dev/null 2>&1; then +- taglist="$taglist $tagname" +- +- # Evaluate the configuration. Be careful to quote the path +- # and the sed script, to avoid splitting on whitespace, but +- # also don't use non-portable quotes within backquotes within +- # quotes we have to do it in 2 steps: +- extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"` +- eval "$extractedcf" +- else +- func_error "ignoring unknown tag $tagname" +- fi +- ;; +- esac +-} ++ if $GREP "$re_begincf" "$progpath" >/dev/null 2>&1; then ++ taglist="$taglist $tagname" ++ ++ # Evaluate the configuration. Be careful to quote the path ++ # and the sed script, to avoid splitting on whitespace, but ++ # also don't use non-portable quotes within backquotes within ++ # quotes we have to do it in 2 steps: ++ extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"` ++ eval "$extractedcf" ++ else ++ func_error "ignoring unknown tag $tagname" ++ fi ++ ;; ++ esac ++} ++ + + # func_check_version_match ++# ------------------------ + # Ensure that we are using m4 macros, and libtool script from the same + # release of libtool. + func_check_version_match () + { +- if test "$package_revision" != "$macro_revision"; then +- if test "$VERSION" != "$macro_version"; then +- if test -z "$macro_version"; then +- cat >&2 <<_LT_EOF ++ if test "$package_revision" != "$macro_revision"; then ++ if test "$VERSION" != "$macro_version"; then ++ if test -z "$macro_version"; then ++ cat >&2 <<_LT_EOF + $progname: Version mismatch error. This is $PACKAGE $VERSION, but the + $progname: definition of this LT_INIT comes from an older release. + $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION + $progname: and run autoconf again. + _LT_EOF +- else +- cat >&2 <<_LT_EOF ++ else ++ cat >&2 <<_LT_EOF + $progname: Version mismatch error. This is $PACKAGE $VERSION, but the + $progname: definition of this LT_INIT comes from $PACKAGE $macro_version. + $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION + $progname: and run autoconf again. + _LT_EOF +- fi +- else +- cat >&2 <<_LT_EOF ++ fi ++ else ++ cat >&2 <<_LT_EOF + $progname: Version mismatch error. This is $PACKAGE $VERSION, revision $package_revision, + $progname: but the definition of this LT_INIT comes from revision $macro_revision. + $progname: You should recreate aclocal.m4 with macros from revision $package_revision + $progname: of $PACKAGE $VERSION and run autoconf again. + _LT_EOF ++ fi ++ ++ exit $EXIT_MISMATCH + fi +- +- exit $EXIT_MISMATCH +- fi +-} +- +- +-# Shorthand for --mode=foo, only valid as the first argument +-case $1 in +-clean|clea|cle|cl) +- shift; set dummy --mode clean ${1+"$@"}; shift +- ;; +-compile|compil|compi|comp|com|co|c) +- shift; set dummy --mode compile ${1+"$@"}; shift +- ;; +-execute|execut|execu|exec|exe|ex|e) +- shift; set dummy --mode execute ${1+"$@"}; shift +- ;; +-finish|finis|fini|fin|fi|f) +- shift; set dummy --mode finish ${1+"$@"}; shift +- ;; +-install|instal|insta|inst|ins|in|i) +- shift; set dummy --mode install ${1+"$@"}; shift +- ;; +-link|lin|li|l) +- shift; set dummy --mode link ${1+"$@"}; shift +- ;; +-uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u) +- shift; set dummy --mode uninstall ${1+"$@"}; shift +- ;; +-esac +- +- +- +-# Option defaults: +-opt_debug=: +-opt_dry_run=false +-opt_config=false +-opt_preserve_dup_deps=false +-opt_features=false +-opt_finish=false +-opt_help=false +-opt_help_all=false +-opt_silent=: +-opt_warning=: +-opt_verbose=: +-opt_silent=false +-opt_verbose=false +- +- +-# Parse options once, thoroughly. This comes as soon as possible in the +-# script to make things like `--version' happen as quickly as we can. +-{ +- # this just eases exit handling +- while test $# -gt 0; do +- opt="$1" +- shift +- case $opt in +- --debug|-x) opt_debug='set -x' +- func_echo "enabling shell trace mode" +- $opt_debug +- ;; +- --dry-run|--dryrun|-n) +- opt_dry_run=: +- ;; +- --config) +- opt_config=: +-func_config +- ;; +- --dlopen|-dlopen) +- optarg="$1" +- opt_dlopen="${opt_dlopen+$opt_dlopen +-}$optarg" +- shift +- ;; +- --preserve-dup-deps) +- opt_preserve_dup_deps=: +- ;; +- --features) +- opt_features=: +-func_features +- ;; +- --finish) +- opt_finish=: +-set dummy --mode finish ${1+"$@"}; shift +- ;; +- --help) +- opt_help=: +- ;; +- --help-all) +- opt_help_all=: +-opt_help=': help-all' +- ;; +- --mode) +- test $# = 0 && func_missing_arg $opt && break +- optarg="$1" +- opt_mode="$optarg" +-case $optarg in +- # Valid mode arguments: +- clean|compile|execute|finish|install|link|relink|uninstall) ;; +- +- # Catch anything else as an error +- *) func_error "invalid argument for $opt" +- exit_cmd=exit +- break +- ;; +-esac +- shift +- ;; +- --no-silent|--no-quiet) +- opt_silent=false +-func_append preserve_args " $opt" +- ;; +- --no-warning|--no-warn) +- opt_warning=false +-func_append preserve_args " $opt" +- ;; +- --no-verbose) +- opt_verbose=false +-func_append preserve_args " $opt" +- ;; +- --silent|--quiet) +- opt_silent=: +-func_append preserve_args " $opt" +- opt_verbose=false +- ;; +- --verbose|-v) +- opt_verbose=: +-func_append preserve_args " $opt" +-opt_silent=false +- ;; +- --tag) +- test $# = 0 && func_missing_arg $opt && break +- optarg="$1" +- opt_tag="$optarg" +-func_append preserve_args " $opt $optarg" +-func_enable_tag "$optarg" +- shift +- ;; +- +- -\?|-h) func_usage ;; +- --help) func_help ;; +- --version) func_version ;; +- +- # Separate optargs to long options: +- --*=*) +- func_split_long_opt "$opt" +- set dummy "$func_split_long_opt_name" "$func_split_long_opt_arg" ${1+"$@"} +- shift +- ;; +- +- # Separate non-argument short options: +- -\?*|-h*|-n*|-v*) +- func_split_short_opt "$opt" +- set dummy "$func_split_short_opt_name" "-$func_split_short_opt_arg" ${1+"$@"} +- shift +- ;; +- +- --) break ;; +- -*) func_fatal_help "unrecognized option \`$opt'" ;; +- *) set dummy "$opt" ${1+"$@"}; shift; break ;; ++} ++ ++ ++# libtool_options_prep [ARG]... ++# ----------------------------- ++# Preparation for options parsed by libtool. ++libtool_options_prep () ++{ ++ $debug_mode ++ ++ # Option defaults: ++ opt_config=false ++ opt_dlopen= ++ opt_dry_run=false ++ opt_help=false ++ opt_mode= ++ opt_preserve_dup_deps=false ++ opt_quiet=false ++ ++ nonopt= ++ preserve_args= ++ ++ # Shorthand for --mode=foo, only valid as the first argument ++ case $1 in ++ clean|clea|cle|cl) ++ shift; set dummy --mode clean ${1+"$@"}; shift ++ ;; ++ compile|compil|compi|comp|com|co|c) ++ shift; set dummy --mode compile ${1+"$@"}; shift ++ ;; ++ execute|execut|execu|exec|exe|ex|e) ++ shift; set dummy --mode execute ${1+"$@"}; shift ++ ;; ++ finish|finis|fini|fin|fi|f) ++ shift; set dummy --mode finish ${1+"$@"}; shift ++ ;; ++ install|instal|insta|inst|ins|in|i) ++ shift; set dummy --mode install ${1+"$@"}; shift ++ ;; ++ link|lin|li|l) ++ shift; set dummy --mode link ${1+"$@"}; shift ++ ;; ++ uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u) ++ shift; set dummy --mode uninstall ${1+"$@"}; shift ++ ;; + esac +- done +- +- # Validate options: +- +- # save first non-option argument +- if test "$#" -gt 0; then +- nonopt="$opt" +- shift +- fi +- +- # preserve --debug +- test "$opt_debug" = : || func_append preserve_args " --debug" +- +- case $host in +- *cygwin* | *mingw* | *pw32* | *cegcc*) +- # don't eliminate duplications in $postdeps and $predeps +- opt_duplicate_compiler_generated_deps=: +- ;; +- *) +- opt_duplicate_compiler_generated_deps=$opt_preserve_dup_deps +- ;; +- esac +- +- $opt_help || { +- # Sanity checks first: +- func_check_version_match +- +- if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then +- func_fatal_configuration "not configured to build any kind of library" ++ ++ # Pass back the list of options. ++ func_quote_for_eval ${1+"$@"} ++ libtool_options_prep_result=$func_quote_for_eval_result ++} ++func_add_hook func_options_prep libtool_options_prep ++ ++ ++# libtool_parse_options [ARG]... ++# --------------------------------- ++# Provide handling for libtool specific options. ++libtool_parse_options () ++{ ++ $debug_cmd ++ ++ # Perform our own loop to consume as many options as possible in ++ # each iteration. ++ while test $# -gt 0; do ++ _G_opt=$1 ++ shift ++ case $_G_opt in ++ --dry-run|--dryrun|-n) ++ opt_dry_run=: ++ ;; ++ ++ --config) func_config ;; ++ ++ --dlopen|-dlopen) ++ opt_dlopen="${opt_dlopen+$opt_dlopen ++}$1" ++ shift ++ ;; ++ ++ --preserve-dup-deps) ++ opt_preserve_dup_deps=: ;; ++ ++ --features) func_features ;; ++ ++ --finish) set dummy --mode finish ${1+"$@"}; shift ;; ++ ++ --help) opt_help=: ;; ++ ++ --help-all) opt_help=': help-all' ;; ++ ++ --mode) test $# = 0 && func_missing_arg $_G_opt && break ++ opt_mode=$1 ++ case $1 in ++ # Valid mode arguments: ++ clean|compile|execute|finish|install|link|relink|uninstall) ;; ++ ++ # Catch anything else as an error ++ *) func_error "invalid argument for $_G_opt" ++ exit_cmd=exit ++ break ++ ;; ++ esac ++ shift ++ ;; ++ ++ --no-silent|--no-quiet) ++ opt_quiet=false ++ func_append preserve_args " $_G_opt" ++ ;; ++ ++ --no-warnings|--no-warning|--no-warn) ++ opt_warning=false ++ func_append preserve_args " $_G_opt" ++ ;; ++ ++ --no-verbose) ++ opt_verbose=false ++ func_append preserve_args " $_G_opt" ++ ;; ++ ++ --silent|--quiet) ++ opt_quiet=: ++ opt_verbose=false ++ func_append preserve_args " $_G_opt" ++ ;; ++ ++ --tag) test $# = 0 && func_missing_arg $_G_opt && break ++ opt_tag=$1 ++ func_append preserve_args " $_G_opt $1" ++ func_enable_tag "$1" ++ shift ++ ;; ++ ++ --verbose|-v) opt_quiet=false ++ opt_verbose=: ++ func_append preserve_args " $_G_opt" ++ ;; ++ ++ # An option not handled by this hook function: ++ *) set dummy "$_G_opt" ${1+"$@"}; shift; break ;; ++ esac ++ done ++ ++ ++ # save modified positional parameters for caller ++ func_quote_for_eval ${1+"$@"} ++ libtool_parse_options_result=$func_quote_for_eval_result ++} ++func_add_hook func_parse_options libtool_parse_options ++ ++ ++ ++# libtool_validate_options [ARG]... ++# --------------------------------- ++# Perform any sanity checks on option settings and/or unconsumed ++# arguments. ++libtool_validate_options () ++{ ++ # save first non-option argument ++ if test 0 -lt $#; then ++ nonopt=$1 ++ shift + fi + +- # Darwin sucks +- eval std_shrext=\"$shrext_cmds\" +- +- # Only execute mode is allowed to have -dlopen flags. +- if test -n "$opt_dlopen" && test "$opt_mode" != execute; then +- func_error "unrecognized option \`-dlopen'" +- $ECHO "$help" 1>&2 +- exit $EXIT_FAILURE +- fi +- +- # Change the help message to a mode-specific one. +- generic_help="$help" +- help="Try \`$progname --help --mode=$opt_mode' for more information." +- } +- +- +- # Bail if the options were screwed +- $exit_cmd $EXIT_FAILURE +-} +- ++ # preserve --debug ++ test : = "$debug_cmd" || func_append preserve_args " --debug" ++ ++ case $host in ++ *cygwin* | *mingw* | *pw32* | *cegcc*) ++ # don't eliminate duplications in $postdeps and $predeps ++ opt_duplicate_compiler_generated_deps=: ++ ;; ++ *) ++ opt_duplicate_compiler_generated_deps=$opt_preserve_dup_deps ++ ;; ++ esac ++ ++ $opt_help || { ++ # Sanity checks first: ++ func_check_version_match ++ ++ test yes != "$build_libtool_libs" \ ++ && test yes != "$build_old_libs" \ ++ && func_fatal_configuration "not configured to build any kind of library" ++ ++ # Darwin sucks ++ eval std_shrext=\"$shrext_cmds\" ++ ++ # Only execute mode is allowed to have -dlopen flags. ++ if test -n "$opt_dlopen" && test execute != "$opt_mode"; then ++ func_error "unrecognized option '-dlopen'" ++ $ECHO "$help" 1>&2 ++ exit $EXIT_FAILURE ++ fi ++ ++ # Change the help message to a mode-specific one. ++ generic_help=$help ++ help="Try '$progname --help --mode=$opt_mode' for more information." ++ } ++ ++ # Pass back the unparsed argument list ++ func_quote_for_eval ${1+"$@"} ++ libtool_validate_options_result=$func_quote_for_eval_result ++} ++func_add_hook func_validate_options libtool_validate_options ++ ++ ++# Process options as early as possible so that --help and --version ++# can return quickly. ++func_options ${1+"$@"} ++eval set dummy "$func_options_result"; shift + + + +@@ -1224,8 +2365,29 @@ + ## Main. ## + ## ----------- ## + ++magic='%%%MAGIC variable%%%' ++magic_exe='%%%MAGIC EXE variable%%%' ++ ++# Global variables. ++extracted_archives= ++extracted_serial=0 ++ ++# If this variable is set in any of the actions, the command in it ++# will be execed at the end. This prevents here-documents from being ++# left over by shells. ++exec_cmd= ++ ++ ++# A function that is used when there is no print builtin or printf. ++func_fallback_echo () ++{ ++ eval 'cat <<_LTECHO_EOF ++$1 ++_LTECHO_EOF' ++} ++ + # func_lalib_p file +-# True iff FILE is a libtool `.la' library or `.lo' object file. ++# True iff FILE is a libtool '.la' library or '.lo' object file. + # This function is only a basic sanity check; it will hardly flush out + # determined imposters. + func_lalib_p () +@@ -1236,12 +2398,12 @@ + } + + # func_lalib_unsafe_p file +-# True iff FILE is a libtool `.la' library or `.lo' object file. ++# True iff FILE is a libtool '.la' library or '.lo' object file. + # This function implements the same check as func_lalib_p without + # resorting to external programs. To this end, it redirects stdin and + # closes it afterwards, without saving the original file descriptor. + # As a safety measure, use it only where a negative result would be +-# fatal anyway. Works if `file' does not exist. ++# fatal anyway. Works if 'file' does not exist. + func_lalib_unsafe_p () + { + lalib_p=no +@@ -1249,13 +2411,13 @@ + for lalib_p_l in 1 2 3 4 + do + read lalib_p_line +- case "$lalib_p_line" in ++ case $lalib_p_line in + \#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;; + esac + done + exec 0<&5 5<&- + fi +- test "$lalib_p" = yes ++ test yes = "$lalib_p" + } + + # func_ltwrapper_script_p file +@@ -1289,7 +2451,7 @@ + { + func_dirname_and_basename "$1" "" "." + func_stripname '' '.exe' "$func_basename_result" +- func_ltwrapper_scriptname_result="$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper" ++ func_ltwrapper_scriptname_result=$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper + } + + # func_ltwrapper_p file +@@ -1308,11 +2470,13 @@ + # FAIL_CMD may read-access the current command in variable CMD! + func_execute_cmds () + { +- $opt_debug ++ $debug_cmd ++ + save_ifs=$IFS; IFS='~' + for cmd in $1; do ++ IFS=$sp$nl ++ eval cmd=\"$cmd\" + IFS=$save_ifs +- eval cmd=\"$cmd\" + func_show_eval "$cmd" "${2-:}" + done + IFS=$save_ifs +@@ -1324,10 +2488,11 @@ + # Note that it is not necessary on cygwin/mingw to append a dot to + # FILE even if both FILE and FILE.exe exist: automatic-append-.exe + # behavior happens only for exec(3), not for open(2)! Also, sourcing +-# `FILE.' does not work on cygwin managed mounts. ++# 'FILE.' does not work on cygwin managed mounts. + func_source () + { +- $opt_debug ++ $debug_cmd ++ + case $1 in + */* | *\\*) . "$1" ;; + *) . "./$1" ;; +@@ -1354,10 +2519,10 @@ + # store the result into func_replace_sysroot_result. + func_replace_sysroot () + { +- case "$lt_sysroot:$1" in ++ case $lt_sysroot:$1 in + ?*:"$lt_sysroot"*) + func_stripname "$lt_sysroot" '' "$1" +- func_replace_sysroot_result="=$func_stripname_result" ++ func_replace_sysroot_result='='$func_stripname_result + ;; + *) + # Including no sysroot. +@@ -1374,7 +2539,8 @@ + # arg is usually of the form 'gcc ...' + func_infer_tag () + { +- $opt_debug ++ $debug_cmd ++ + if test -n "$available_tags" && test -z "$tagname"; then + CC_quoted= + for arg in $CC; do +@@ -1393,7 +2559,7 @@ + for z in $available_tags; do + if $GREP "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then + # Evaluate the configuration. +- eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`" ++ eval "`$SED -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`" + CC_quoted= + for arg in $CC; do + # Double-quote args containing other shell metacharacters. +@@ -1418,7 +2584,7 @@ + # line option must be used. + if test -z "$tagname"; then + func_echo "unable to infer tagged configuration" +- func_fatal_error "specify a tag with \`--tag'" ++ func_fatal_error "specify a tag with '--tag'" + # else + # func_verbose "using $tagname tagged configuration" + fi +@@ -1434,15 +2600,15 @@ + # but don't create it if we're doing a dry run. + func_write_libtool_object () + { +- write_libobj=${1} +- if test "$build_libtool_libs" = yes; then +- write_lobj=\'${2}\' ++ write_libobj=$1 ++ if test yes = "$build_libtool_libs"; then ++ write_lobj=\'$2\' + else + write_lobj=none + fi + +- if test "$build_old_libs" = yes; then +- write_oldobj=\'${3}\' ++ if test yes = "$build_old_libs"; then ++ write_oldobj=\'$3\' + else + write_oldobj=none + fi +@@ -1450,7 +2616,7 @@ + $opt_dry_run || { + cat >${write_libobj}T </dev/null` +- if test "$?" -eq 0 && test -n "${func_convert_core_file_wine_to_w32_tmp}"; then ++ if test "$?" -eq 0 && test -n "$func_convert_core_file_wine_to_w32_tmp"; then + func_convert_core_file_wine_to_w32_result=`$ECHO "$func_convert_core_file_wine_to_w32_tmp" | +- $SED -e "$lt_sed_naive_backslashify"` ++ $SED -e "$sed_naive_backslashify"` + else + func_convert_core_file_wine_to_w32_result= + fi +@@ -1514,18 +2681,19 @@ + # are convertible, then the result may be empty. + func_convert_core_path_wine_to_w32 () + { +- $opt_debug ++ $debug_cmd ++ + # unfortunately, winepath doesn't convert paths, only file names +- func_convert_core_path_wine_to_w32_result="" ++ func_convert_core_path_wine_to_w32_result= + if test -n "$1"; then + oldIFS=$IFS + IFS=: + for func_convert_core_path_wine_to_w32_f in $1; do + IFS=$oldIFS + func_convert_core_file_wine_to_w32 "$func_convert_core_path_wine_to_w32_f" +- if test -n "$func_convert_core_file_wine_to_w32_result" ; then ++ if test -n "$func_convert_core_file_wine_to_w32_result"; then + if test -z "$func_convert_core_path_wine_to_w32_result"; then +- func_convert_core_path_wine_to_w32_result="$func_convert_core_file_wine_to_w32_result" ++ func_convert_core_path_wine_to_w32_result=$func_convert_core_file_wine_to_w32_result + else + func_append func_convert_core_path_wine_to_w32_result ";$func_convert_core_file_wine_to_w32_result" + fi +@@ -1554,7 +2722,8 @@ + # environment variable; do not put it in $PATH. + func_cygpath () + { +- $opt_debug ++ $debug_cmd ++ + if test -n "$LT_CYGPATH" && test -f "$LT_CYGPATH"; then + func_cygpath_result=`$LT_CYGPATH "$@" 2>/dev/null` + if test "$?" -ne 0; then +@@ -1563,7 +2732,7 @@ + fi + else + func_cygpath_result= +- func_error "LT_CYGPATH is empty or specifies non-existent file: \`$LT_CYGPATH'" ++ func_error "LT_CYGPATH is empty or specifies non-existent file: '$LT_CYGPATH'" + fi + } + #end: func_cygpath +@@ -1574,10 +2743,11 @@ + # result in func_convert_core_msys_to_w32_result. + func_convert_core_msys_to_w32 () + { +- $opt_debug ++ $debug_cmd ++ + # awkward: cmd appends spaces to result + func_convert_core_msys_to_w32_result=`( cmd //c echo "$1" ) 2>/dev/null | +- $SED -e 's/[ ]*$//' -e "$lt_sed_naive_backslashify"` ++ $SED -e 's/[ ]*$//' -e "$sed_naive_backslashify"` + } + #end: func_convert_core_msys_to_w32 + +@@ -1588,13 +2758,14 @@ + # func_to_host_file_result to ARG1). + func_convert_file_check () + { +- $opt_debug +- if test -z "$2" && test -n "$1" ; then ++ $debug_cmd ++ ++ if test -z "$2" && test -n "$1"; then + func_error "Could not determine host file name corresponding to" +- func_error " \`$1'" ++ func_error " '$1'" + func_error "Continuing, but uninstalled executables may not work." + # Fallback: +- func_to_host_file_result="$1" ++ func_to_host_file_result=$1 + fi + } + # end func_convert_file_check +@@ -1606,10 +2777,11 @@ + # func_to_host_file_result to a simplistic fallback value (see below). + func_convert_path_check () + { +- $opt_debug ++ $debug_cmd ++ + if test -z "$4" && test -n "$3"; then + func_error "Could not determine the host path corresponding to" +- func_error " \`$3'" ++ func_error " '$3'" + func_error "Continuing, but uninstalled executables may not work." + # Fallback. This is a deliberately simplistic "conversion" and + # should not be "improved". See libtool.info. +@@ -1618,7 +2790,7 @@ + func_to_host_path_result=`echo "$3" | + $SED -e "$lt_replace_pathsep_chars"` + else +- func_to_host_path_result="$3" ++ func_to_host_path_result=$3 + fi + fi + } +@@ -1630,9 +2802,10 @@ + # and appending REPL if ORIG matches BACKPAT. + func_convert_path_front_back_pathsep () + { +- $opt_debug ++ $debug_cmd ++ + case $4 in +- $1 ) func_to_host_path_result="$3$func_to_host_path_result" ++ $1 ) func_to_host_path_result=$3$func_to_host_path_result + ;; + esac + case $4 in +@@ -1646,7 +2819,7 @@ + ################################################## + # $build to $host FILE NAME CONVERSION FUNCTIONS # + ################################################## +-# invoked via `$to_host_file_cmd ARG' ++# invoked via '$to_host_file_cmd ARG' + # + # In each case, ARG is the path to be converted from $build to $host format. + # Result will be available in $func_to_host_file_result. +@@ -1657,7 +2830,8 @@ + # in func_to_host_file_result. + func_to_host_file () + { +- $opt_debug ++ $debug_cmd ++ + $to_host_file_cmd "$1" + } + # end func_to_host_file +@@ -1669,7 +2843,8 @@ + # in (the comma separated) LAZY, no conversion takes place. + func_to_tool_file () + { +- $opt_debug ++ $debug_cmd ++ + case ,$2, in + *,"$to_tool_file_cmd",*) + func_to_tool_file_result=$1 +@@ -1687,7 +2862,7 @@ + # Copy ARG to func_to_host_file_result. + func_convert_file_noop () + { +- func_to_host_file_result="$1" ++ func_to_host_file_result=$1 + } + # end func_convert_file_noop + +@@ -1698,11 +2873,12 @@ + # func_to_host_file_result. + func_convert_file_msys_to_w32 () + { +- $opt_debug +- func_to_host_file_result="$1" ++ $debug_cmd ++ ++ func_to_host_file_result=$1 + if test -n "$1"; then + func_convert_core_msys_to_w32 "$1" +- func_to_host_file_result="$func_convert_core_msys_to_w32_result" ++ func_to_host_file_result=$func_convert_core_msys_to_w32_result + fi + func_convert_file_check "$1" "$func_to_host_file_result" + } +@@ -1714,8 +2890,9 @@ + # func_to_host_file_result. + func_convert_file_cygwin_to_w32 () + { +- $opt_debug +- func_to_host_file_result="$1" ++ $debug_cmd ++ ++ func_to_host_file_result=$1 + if test -n "$1"; then + # because $build is cygwin, we call "the" cygpath in $PATH; no need to use + # LT_CYGPATH in this case. +@@ -1731,11 +2908,12 @@ + # and a working winepath. Returns result in func_to_host_file_result. + func_convert_file_nix_to_w32 () + { +- $opt_debug +- func_to_host_file_result="$1" ++ $debug_cmd ++ ++ func_to_host_file_result=$1 + if test -n "$1"; then + func_convert_core_file_wine_to_w32 "$1" +- func_to_host_file_result="$func_convert_core_file_wine_to_w32_result" ++ func_to_host_file_result=$func_convert_core_file_wine_to_w32_result + fi + func_convert_file_check "$1" "$func_to_host_file_result" + } +@@ -1747,12 +2925,13 @@ + # Returns result in func_to_host_file_result. + func_convert_file_msys_to_cygwin () + { +- $opt_debug +- func_to_host_file_result="$1" ++ $debug_cmd ++ ++ func_to_host_file_result=$1 + if test -n "$1"; then + func_convert_core_msys_to_w32 "$1" + func_cygpath -u "$func_convert_core_msys_to_w32_result" +- func_to_host_file_result="$func_cygpath_result" ++ func_to_host_file_result=$func_cygpath_result + fi + func_convert_file_check "$1" "$func_to_host_file_result" + } +@@ -1765,13 +2944,14 @@ + # in func_to_host_file_result. + func_convert_file_nix_to_cygwin () + { +- $opt_debug +- func_to_host_file_result="$1" ++ $debug_cmd ++ ++ func_to_host_file_result=$1 + if test -n "$1"; then + # convert from *nix to w32, then use cygpath to convert from w32 to cygwin. + func_convert_core_file_wine_to_w32 "$1" + func_cygpath -u "$func_convert_core_file_wine_to_w32_result" +- func_to_host_file_result="$func_cygpath_result" ++ func_to_host_file_result=$func_cygpath_result + fi + func_convert_file_check "$1" "$func_to_host_file_result" + } +@@ -1781,7 +2961,7 @@ + ############################################# + # $build to $host PATH CONVERSION FUNCTIONS # + ############################################# +-# invoked via `$to_host_path_cmd ARG' ++# invoked via '$to_host_path_cmd ARG' + # + # In each case, ARG is the path to be converted from $build to $host format. + # The result will be available in $func_to_host_path_result. +@@ -1805,10 +2985,11 @@ + to_host_path_cmd= + func_init_to_host_path_cmd () + { +- $opt_debug ++ $debug_cmd ++ + if test -z "$to_host_path_cmd"; then + func_stripname 'func_convert_file_' '' "$to_host_file_cmd" +- to_host_path_cmd="func_convert_path_${func_stripname_result}" ++ to_host_path_cmd=func_convert_path_$func_stripname_result + fi + } + +@@ -1818,7 +2999,8 @@ + # in func_to_host_path_result. + func_to_host_path () + { +- $opt_debug ++ $debug_cmd ++ + func_init_to_host_path_cmd + $to_host_path_cmd "$1" + } +@@ -1829,7 +3011,7 @@ + # Copy ARG to func_to_host_path_result. + func_convert_path_noop () + { +- func_to_host_path_result="$1" ++ func_to_host_path_result=$1 + } + # end func_convert_path_noop + +@@ -1840,8 +3022,9 @@ + # func_to_host_path_result. + func_convert_path_msys_to_w32 () + { +- $opt_debug +- func_to_host_path_result="$1" ++ $debug_cmd ++ ++ func_to_host_path_result=$1 + if test -n "$1"; then + # Remove leading and trailing path separator characters from ARG. MSYS + # behavior is inconsistent here; cygpath turns them into '.;' and ';.'; +@@ -1849,7 +3032,7 @@ + func_stripname : : "$1" + func_to_host_path_tmp1=$func_stripname_result + func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" +- func_to_host_path_result="$func_convert_core_msys_to_w32_result" ++ func_to_host_path_result=$func_convert_core_msys_to_w32_result + func_convert_path_check : ";" \ + "$func_to_host_path_tmp1" "$func_to_host_path_result" + func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" +@@ -1863,8 +3046,9 @@ + # func_to_host_file_result. + func_convert_path_cygwin_to_w32 () + { +- $opt_debug +- func_to_host_path_result="$1" ++ $debug_cmd ++ ++ func_to_host_path_result=$1 + if test -n "$1"; then + # See func_convert_path_msys_to_w32: + func_stripname : : "$1" +@@ -1883,14 +3067,15 @@ + # a working winepath. Returns result in func_to_host_file_result. + func_convert_path_nix_to_w32 () + { +- $opt_debug +- func_to_host_path_result="$1" ++ $debug_cmd ++ ++ func_to_host_path_result=$1 + if test -n "$1"; then + # See func_convert_path_msys_to_w32: + func_stripname : : "$1" + func_to_host_path_tmp1=$func_stripname_result + func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" +- func_to_host_path_result="$func_convert_core_path_wine_to_w32_result" ++ func_to_host_path_result=$func_convert_core_path_wine_to_w32_result + func_convert_path_check : ";" \ + "$func_to_host_path_tmp1" "$func_to_host_path_result" + func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" +@@ -1904,15 +3089,16 @@ + # Returns result in func_to_host_file_result. + func_convert_path_msys_to_cygwin () + { +- $opt_debug +- func_to_host_path_result="$1" ++ $debug_cmd ++ ++ func_to_host_path_result=$1 + if test -n "$1"; then + # See func_convert_path_msys_to_w32: + func_stripname : : "$1" + func_to_host_path_tmp1=$func_stripname_result + func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" + func_cygpath -u -p "$func_convert_core_msys_to_w32_result" +- func_to_host_path_result="$func_cygpath_result" ++ func_to_host_path_result=$func_cygpath_result + func_convert_path_check : : \ + "$func_to_host_path_tmp1" "$func_to_host_path_result" + func_convert_path_front_back_pathsep ":*" "*:" : "$1" +@@ -1927,8 +3113,9 @@ + # func_to_host_file_result. + func_convert_path_nix_to_cygwin () + { +- $opt_debug +- func_to_host_path_result="$1" ++ $debug_cmd ++ ++ func_to_host_path_result=$1 + if test -n "$1"; then + # Remove leading and trailing path separator characters from + # ARG. msys behavior is inconsistent here, cygpath turns them +@@ -1937,7 +3124,7 @@ + func_to_host_path_tmp1=$func_stripname_result + func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" + func_cygpath -u -p "$func_convert_core_path_wine_to_w32_result" +- func_to_host_path_result="$func_cygpath_result" ++ func_to_host_path_result=$func_cygpath_result + func_convert_path_check : : \ + "$func_to_host_path_tmp1" "$func_to_host_path_result" + func_convert_path_front_back_pathsep ":*" "*:" : "$1" +@@ -1946,13 +3133,31 @@ + # end func_convert_path_nix_to_cygwin + + ++# func_dll_def_p FILE ++# True iff FILE is a Windows DLL '.def' file. ++# Keep in sync with _LT_DLL_DEF_P in libtool.m4 ++func_dll_def_p () ++{ ++ $debug_cmd ++ ++ func_dll_def_p_tmp=`$SED -n \ ++ -e 's/^[ ]*//' \ ++ -e '/^\(;.*\)*$/d' \ ++ -e 's/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p' \ ++ -e q \ ++ "$1"` ++ test DEF = "$func_dll_def_p_tmp" ++} ++ ++ + # func_mode_compile arg... + func_mode_compile () + { +- $opt_debug ++ $debug_cmd ++ + # Get the compilation command and the source file. + base_compile= +- srcfile="$nonopt" # always keep a non-empty value in "srcfile" ++ srcfile=$nonopt # always keep a non-empty value in "srcfile" + suppress_opt=yes + suppress_output= + arg_mode=normal +@@ -1965,12 +3170,12 @@ + case $arg_mode in + arg ) + # do not "continue". Instead, add this to base_compile +- lastarg="$arg" ++ lastarg=$arg + arg_mode=normal + ;; + + target ) +- libobj="$arg" ++ libobj=$arg + arg_mode=normal + continue + ;; +@@ -1980,7 +3185,7 @@ + case $arg in + -o) + test -n "$libobj" && \ +- func_fatal_error "you cannot specify \`-o' more than once" ++ func_fatal_error "you cannot specify '-o' more than once" + arg_mode=target + continue + ;; +@@ -2009,12 +3214,12 @@ + func_stripname '-Wc,' '' "$arg" + args=$func_stripname_result + lastarg= +- save_ifs="$IFS"; IFS=',' ++ save_ifs=$IFS; IFS=, + for arg in $args; do +- IFS="$save_ifs" ++ IFS=$save_ifs + func_append_quoted lastarg "$arg" + done +- IFS="$save_ifs" ++ IFS=$save_ifs + func_stripname ' ' '' "$lastarg" + lastarg=$func_stripname_result + +@@ -2027,8 +3232,8 @@ + # Accept the current argument as the source file. + # The previous "srcfile" becomes the current argument. + # +- lastarg="$srcfile" +- srcfile="$arg" ++ lastarg=$srcfile ++ srcfile=$arg + ;; + esac # case $arg + ;; +@@ -2043,13 +3248,13 @@ + func_fatal_error "you must specify an argument for -Xcompile" + ;; + target) +- func_fatal_error "you must specify a target with \`-o'" ++ func_fatal_error "you must specify a target with '-o'" + ;; + *) + # Get the name of the library object. + test -z "$libobj" && { + func_basename "$srcfile" +- libobj="$func_basename_result" ++ libobj=$func_basename_result + } + ;; + esac +@@ -2069,7 +3274,7 @@ + case $libobj in + *.lo) func_lo2o "$libobj"; obj=$func_lo2o_result ;; + *) +- func_fatal_error "cannot determine name of library object from \`$libobj'" ++ func_fatal_error "cannot determine name of library object from '$libobj'" + ;; + esac + +@@ -2078,8 +3283,8 @@ + for arg in $later; do + case $arg in + -shared) +- test "$build_libtool_libs" != yes && \ +- func_fatal_configuration "can not build a shared library" ++ test yes = "$build_libtool_libs" \ ++ || func_fatal_configuration "cannot build a shared library" + build_old_libs=no + continue + ;; +@@ -2105,17 +3310,17 @@ + func_quote_for_eval "$libobj" + test "X$libobj" != "X$func_quote_for_eval_result" \ + && $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"' &()|`$[]' \ +- && func_warning "libobj name \`$libobj' may not contain shell special characters." ++ && func_warning "libobj name '$libobj' may not contain shell special characters." + func_dirname_and_basename "$obj" "/" "" +- objname="$func_basename_result" +- xdir="$func_dirname_result" +- lobj=${xdir}$objdir/$objname ++ objname=$func_basename_result ++ xdir=$func_dirname_result ++ lobj=$xdir$objdir/$objname + + test -z "$base_compile" && \ + func_fatal_help "you must specify a compilation command" + + # Delete any leftover library objects. +- if test "$build_old_libs" = yes; then ++ if test yes = "$build_old_libs"; then + removelist="$obj $lobj $libobj ${libobj}T" + else + removelist="$lobj $libobj ${libobj}T" +@@ -2127,16 +3332,16 @@ + pic_mode=default + ;; + esac +- if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then ++ if test no = "$pic_mode" && test pass_all != "$deplibs_check_method"; then + # non-PIC code in shared libraries is not supported + pic_mode=default + fi + + # Calculate the filename of the output object if compiler does + # not support -o with -c +- if test "$compiler_c_o" = no; then +- output_obj=`$ECHO "$srcfile" | $SED 's%^.*/%%; s%\.[^.]*$%%'`.${objext} +- lockfile="$output_obj.lock" ++ if test no = "$compiler_c_o"; then ++ output_obj=`$ECHO "$srcfile" | $SED 's%^.*/%%; s%\.[^.]*$%%'`.$objext ++ lockfile=$output_obj.lock + else + output_obj= + need_locks=no +@@ -2145,12 +3350,12 @@ + + # Lock this critical section if it is needed + # We use this script file to make the link, it avoids creating a new file +- if test "$need_locks" = yes; then ++ if test yes = "$need_locks"; then + until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do + func_echo "Waiting for $lockfile to be removed" + sleep 2 + done +- elif test "$need_locks" = warn; then ++ elif test warn = "$need_locks"; then + if test -f "$lockfile"; then + $ECHO "\ + *** ERROR, $lockfile exists and contains: +@@ -2158,7 +3363,7 @@ + + This indicates that another process is trying to use the same + temporary object file, and libtool could not work around it because +-your compiler does not support \`-c' and \`-o' together. If you ++your compiler does not support '-c' and '-o' together. If you + repeat this compilation, it may succeed, by chance, but you had better + avoid parallel builds (make -j) in this platform, or get a better + compiler." +@@ -2180,11 +3385,11 @@ + qsrcfile=$func_quote_for_eval_result + + # Only build a PIC object if we are building libtool libraries. +- if test "$build_libtool_libs" = yes; then ++ if test yes = "$build_libtool_libs"; then + # Without this assignment, base_compile gets emptied. + fbsd_hideous_sh_bug=$base_compile + +- if test "$pic_mode" != no; then ++ if test no != "$pic_mode"; then + command="$base_compile $qsrcfile $pic_flag" + else + # Don't build PIC code +@@ -2201,7 +3406,7 @@ + func_show_eval_locale "$command" \ + 'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE' + +- if test "$need_locks" = warn && ++ if test warn = "$need_locks" && + test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then + $ECHO "\ + *** ERROR, $lockfile contains: +@@ -2212,7 +3417,7 @@ + + This indicates that another process is trying to use the same + temporary object file, and libtool could not work around it because +-your compiler does not support \`-c' and \`-o' together. If you ++your compiler does not support '-c' and '-o' together. If you + repeat this compilation, it may succeed, by chance, but you had better + avoid parallel builds (make -j) in this platform, or get a better + compiler." +@@ -2228,20 +3433,20 @@ + fi + + # Allow error messages only from the first compilation. +- if test "$suppress_opt" = yes; then ++ if test yes = "$suppress_opt"; then + suppress_output=' >/dev/null 2>&1' + fi + fi + + # Only build a position-dependent object if we build old libraries. +- if test "$build_old_libs" = yes; then +- if test "$pic_mode" != yes; then ++ if test yes = "$build_old_libs"; then ++ if test yes != "$pic_mode"; then + # Don't build PIC code + command="$base_compile $qsrcfile$pie_flag" + else + command="$base_compile $qsrcfile $pic_flag" + fi +- if test "$compiler_c_o" = yes; then ++ if test yes = "$compiler_c_o"; then + func_append command " -o $obj" + fi + +@@ -2250,7 +3455,7 @@ + func_show_eval_locale "$command" \ + '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' + +- if test "$need_locks" = warn && ++ if test warn = "$need_locks" && + test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then + $ECHO "\ + *** ERROR, $lockfile contains: +@@ -2261,7 +3466,7 @@ + + This indicates that another process is trying to use the same + temporary object file, and libtool could not work around it because +-your compiler does not support \`-c' and \`-o' together. If you ++your compiler does not support '-c' and '-o' together. If you + repeat this compilation, it may succeed, by chance, but you had better + avoid parallel builds (make -j) in this platform, or get a better + compiler." +@@ -2281,7 +3486,7 @@ + func_write_libtool_object "$libobj" "$objdir/$objname" "$objname" + + # Unlock the critical section if it was locked +- if test "$need_locks" != no; then ++ if test no != "$need_locks"; then + removelist=$lockfile + $RM "$lockfile" + fi +@@ -2291,7 +3496,7 @@ + } + + $opt_help || { +- test "$opt_mode" = compile && func_mode_compile ${1+"$@"} ++ test compile = "$opt_mode" && func_mode_compile ${1+"$@"} + } + + func_mode_help () +@@ -2311,7 +3516,7 @@ + Remove files from the build directory. + + RM is the name of the program to use to delete files associated with each FILE +-(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed ++(typically '/bin/rm'). RM-OPTIONS are options (such as '-f') to be passed + to RM. + + If FILE is a libtool library, object or program, all the files associated +@@ -2330,16 +3535,16 @@ + -no-suppress do not suppress compiler output for multiple passes + -prefer-pic try to build PIC objects only + -prefer-non-pic try to build non-PIC objects only +- -shared do not build a \`.o' file suitable for static linking +- -static only build a \`.o' file suitable for static linking ++ -shared do not build a '.o' file suitable for static linking ++ -static only build a '.o' file suitable for static linking + -Wc,FLAG pass FLAG directly to the compiler + +-COMPILE-COMMAND is a command to be used in creating a \`standard' object file ++COMPILE-COMMAND is a command to be used in creating a 'standard' object file + from the given SOURCEFILE. + + The output file name is determined by removing the directory component from +-SOURCEFILE, then substituting the C source code suffix \`.c' with the +-library object suffix, \`.lo'." ++SOURCEFILE, then substituting the C source code suffix '.c' with the ++library object suffix, '.lo'." + ;; + + execute) +@@ -2352,7 +3557,7 @@ + + -dlopen FILE add the directory containing FILE to the library path + +-This mode sets the library path environment variable according to \`-dlopen' ++This mode sets the library path environment variable according to '-dlopen' + flags. + + If any of the ARGS are libtool executable wrappers, then they are translated +@@ -2371,7 +3576,7 @@ + Each LIBDIR is a directory that contains libtool libraries. + + The commands that this mode executes may require superuser privileges. Use +-the \`--dry-run' option if you just want to see what would be executed." ++the '--dry-run' option if you just want to see what would be executed." + ;; + + install) +@@ -2381,7 +3586,7 @@ + Install executables or libraries. + + INSTALL-COMMAND is the installation command. The first component should be +-either the \`install' or \`cp' program. ++either the 'install' or 'cp' program. + + The following components of INSTALL-COMMAND are treated specially: + +@@ -2407,7 +3612,7 @@ + -avoid-version do not add a version suffix if possible + -bindir BINDIR specify path to binaries directory (for systems where + libraries must be found in the PATH setting at runtime) +- -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime ++ -dlopen FILE '-dlpreopen' FILE if it cannot be dlopened at runtime + -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols + -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3) + -export-symbols SYMFILE +@@ -2441,20 +3646,20 @@ + -Xlinker FLAG pass linker-specific FLAG directly to the linker + -XCClinker FLAG pass link-specific FLAG to the compiler driver (CC) + +-All other options (arguments beginning with \`-') are ignored. +- +-Every other argument is treated as a filename. Files ending in \`.la' are ++All other options (arguments beginning with '-') are ignored. ++ ++Every other argument is treated as a filename. Files ending in '.la' are + treated as uninstalled libtool libraries, other files are standard or library + object files. + +-If the OUTPUT-FILE ends in \`.la', then a libtool library is created, +-only library objects (\`.lo' files) may be specified, and \`-rpath' is ++If the OUTPUT-FILE ends in '.la', then a libtool library is created, ++only library objects ('.lo' files) may be specified, and '-rpath' is + required, except when creating a convenience library. + +-If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created +-using \`ar' and \`ranlib', or on Windows using \`lib'. +- +-If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file ++If OUTPUT-FILE ends in '.a' or '.lib', then a standard library is created ++using 'ar' and 'ranlib', or on Windows using 'lib'. ++ ++If OUTPUT-FILE ends in '.lo' or '.$objext', then a reloadable object file + is created, otherwise an executable program is created." + ;; + +@@ -2465,7 +3670,7 @@ + Remove libraries from an installation directory. + + RM is the name of the program to use to delete files associated with each FILE +-(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed ++(typically '/bin/rm'). RM-OPTIONS are options (such as '-f') to be passed + to RM. + + If FILE is a libtool library, all the files associated with it are deleted. +@@ -2473,17 +3678,17 @@ + ;; + + *) +- func_fatal_help "invalid operation mode \`$opt_mode'" ++ func_fatal_help "invalid operation mode '$opt_mode'" + ;; + esac + + echo +- $ECHO "Try \`$progname --help' for more information about other modes." ++ $ECHO "Try '$progname --help' for more information about other modes." + } + + # Now that we've collected a possible --mode arg, show help if necessary + if $opt_help; then +- if test "$opt_help" = :; then ++ if test : = "$opt_help"; then + func_mode_help + else + { +@@ -2516,16 +3721,17 @@ + # func_mode_execute arg... + func_mode_execute () + { +- $opt_debug ++ $debug_cmd ++ + # The first argument is the command name. +- cmd="$nonopt" ++ cmd=$nonopt + test -z "$cmd" && \ + func_fatal_help "you must specify a COMMAND" + + # Handle -dlopen flags immediately. + for file in $opt_dlopen; do + test -f "$file" \ +- || func_fatal_help "\`$file' is not a file" ++ || func_fatal_help "'$file' is not a file" + + dir= + case $file in +@@ -2535,7 +3741,7 @@ + + # Check to see that this really is a libtool archive. + func_lalib_unsafe_p "$file" \ +- || func_fatal_help "\`$lib' is not a valid libtool archive" ++ || func_fatal_help "'$lib' is not a valid libtool archive" + + # Read the libtool library. + dlname= +@@ -2546,18 +3752,18 @@ + if test -z "$dlname"; then + # Warn if it was a shared library. + test -n "$library_names" && \ +- func_warning "\`$file' was not linked with \`-export-dynamic'" ++ func_warning "'$file' was not linked with '-export-dynamic'" + continue + fi + + func_dirname "$file" "" "." +- dir="$func_dirname_result" ++ dir=$func_dirname_result + + if test -f "$dir/$objdir/$dlname"; then + func_append dir "/$objdir" + else + if test ! -f "$dir/$dlname"; then +- func_fatal_error "cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" ++ func_fatal_error "cannot find '$dlname' in '$dir' or '$dir/$objdir'" + fi + fi + ;; +@@ -2565,18 +3771,18 @@ + *.lo) + # Just add the directory containing the .lo file. + func_dirname "$file" "" "." +- dir="$func_dirname_result" ++ dir=$func_dirname_result + ;; + + *) +- func_warning "\`-dlopen' is ignored for non-libtool libraries and objects" ++ func_warning "'-dlopen' is ignored for non-libtool libraries and objects" + continue + ;; + esac + + # Get the absolute pathname. + absdir=`cd "$dir" && pwd` +- test -n "$absdir" && dir="$absdir" ++ test -n "$absdir" && dir=$absdir + + # Now add the directory to shlibpath_var. + if eval "test -z \"\$$shlibpath_var\""; then +@@ -2588,7 +3794,7 @@ + + # This variable tells wrapper scripts just to set shlibpath_var + # rather than running their programs. +- libtool_execute_magic="$magic" ++ libtool_execute_magic=$magic + + # Check if any of the arguments is a wrapper script. + args= +@@ -2601,12 +3807,12 @@ + if func_ltwrapper_script_p "$file"; then + func_source "$file" + # Transform arg to wrapped name. +- file="$progdir/$program" ++ file=$progdir/$program + elif func_ltwrapper_executable_p "$file"; then + func_ltwrapper_scriptname "$file" + func_source "$func_ltwrapper_scriptname_result" + # Transform arg to wrapped name. +- file="$progdir/$program" ++ file=$progdir/$program + fi + ;; + esac +@@ -2614,7 +3820,15 @@ + func_append_quoted args "$file" + done + +- if test "X$opt_dry_run" = Xfalse; then ++ if $opt_dry_run; then ++ # Display what would be done. ++ if test -n "$shlibpath_var"; then ++ eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\"" ++ echo "export $shlibpath_var" ++ fi ++ $ECHO "$cmd$args" ++ exit $EXIT_SUCCESS ++ else + if test -n "$shlibpath_var"; then + # Export the shlibpath_var. + eval "export $shlibpath_var" +@@ -2631,25 +3845,18 @@ + done + + # Now prepare to actually exec the command. +- exec_cmd="\$cmd$args" +- else +- # Display what would be done. +- if test -n "$shlibpath_var"; then +- eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\"" +- echo "export $shlibpath_var" +- fi +- $ECHO "$cmd$args" +- exit $EXIT_SUCCESS ++ exec_cmd=\$cmd$args + fi + } + +-test "$opt_mode" = execute && func_mode_execute ${1+"$@"} ++test execute = "$opt_mode" && func_mode_execute ${1+"$@"} + + + # func_mode_finish arg... + func_mode_finish () + { +- $opt_debug ++ $debug_cmd ++ + libs= + libdirs= + admincmds= +@@ -2663,11 +3870,11 @@ + if func_lalib_unsafe_p "$opt"; then + func_append libs " $opt" + else +- func_warning "\`$opt' is not a valid libtool archive" ++ func_warning "'$opt' is not a valid libtool archive" + fi + + else +- func_fatal_error "invalid argument \`$opt'" ++ func_fatal_error "invalid argument '$opt'" + fi + done + +@@ -2682,12 +3889,12 @@ + # Remove sysroot references + if $opt_dry_run; then + for lib in $libs; do +- echo "removing references to $lt_sysroot and \`=' prefixes from $lib" ++ echo "removing references to $lt_sysroot and '=' prefixes from $lib" + done + else + tmpdir=`func_mktempdir` + for lib in $libs; do +- sed -e "${sysroot_cmd} s/\([ ']-[LR]\)=/\1/g; s/\([ ']\)=/\1/g" $lib \ ++ sed -e "$sysroot_cmd s/\([ ']-[LR]\)=/\1/g; s/\([ ']\)=/\1/g" $lib \ + > $tmpdir/tmp-la + mv -f $tmpdir/tmp-la $lib + done +@@ -2712,7 +3919,7 @@ + fi + + # Exit here if they wanted silent mode. +- $opt_silent && exit $EXIT_SUCCESS ++ $opt_quiet && exit $EXIT_SUCCESS + + if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then + echo "----------------------------------------------------------------------" +@@ -2723,27 +3930,27 @@ + echo + echo "If you ever happen to want to link against installed libraries" + echo "in a given directory, LIBDIR, you must either use libtool, and" +- echo "specify the full pathname of the library, or use the \`-LLIBDIR'" ++ echo "specify the full pathname of the library, or use the '-LLIBDIR'" + echo "flag during linking and do at least one of the following:" + if test -n "$shlibpath_var"; then +- echo " - add LIBDIR to the \`$shlibpath_var' environment variable" ++ echo " - add LIBDIR to the '$shlibpath_var' environment variable" + echo " during execution" + fi + if test -n "$runpath_var"; then +- echo " - add LIBDIR to the \`$runpath_var' environment variable" ++ echo " - add LIBDIR to the '$runpath_var' environment variable" + echo " during linking" + fi + if test -n "$hardcode_libdir_flag_spec"; then + libdir=LIBDIR + eval flag=\"$hardcode_libdir_flag_spec\" + +- $ECHO " - use the \`$flag' linker flag" ++ $ECHO " - use the '$flag' linker flag" + fi + if test -n "$admincmds"; then + $ECHO " - have your system administrator run these commands:$admincmds" + fi + if test -f /etc/ld.so.conf; then +- echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'" ++ echo " - have your system administrator add LIBDIR to '/etc/ld.so.conf'" + fi + echo + +@@ -2762,18 +3969,20 @@ + exit $EXIT_SUCCESS + } + +-test "$opt_mode" = finish && func_mode_finish ${1+"$@"} ++test finish = "$opt_mode" && func_mode_finish ${1+"$@"} + + + # func_mode_install arg... + func_mode_install () + { +- $opt_debug ++ $debug_cmd ++ + # There may be an optional sh(1) argument at the beginning of + # install_prog (especially on Windows NT). +- if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh || ++ if test "$SHELL" = "$nonopt" || test /bin/sh = "$nonopt" || + # Allow the use of GNU shtool's install command. +- case $nonopt in *shtool*) :;; *) false;; esac; then ++ case $nonopt in *shtool*) :;; *) false;; esac ++ then + # Aesthetically quote it. + func_quote_for_eval "$nonopt" + install_prog="$func_quote_for_eval_result " +@@ -2800,7 +4009,7 @@ + opts= + prev= + install_type= +- isdir=no ++ isdir=false + stripme= + no_mode=: + for arg +@@ -2813,7 +4022,7 @@ + fi + + case $arg in +- -d) isdir=yes ;; ++ -d) isdir=: ;; + -f) + if $install_cp; then :; else + prev=$arg +@@ -2831,7 +4040,7 @@ + *) + # If the previous option needed an argument, then skip it. + if test -n "$prev"; then +- if test "x$prev" = x-m && test -n "$install_override_mode"; then ++ if test X-m = "X$prev" && test -n "$install_override_mode"; then + arg2=$install_override_mode + no_mode=false + fi +@@ -2856,7 +4065,7 @@ + func_fatal_help "you must specify an install program" + + test -n "$prev" && \ +- func_fatal_help "the \`$prev' option requires an argument" ++ func_fatal_help "the '$prev' option requires an argument" + + if test -n "$install_override_mode" && $no_mode; then + if $install_cp; then :; else +@@ -2878,19 +4087,19 @@ + dest=$func_stripname_result + + # Check to see that the destination is a directory. +- test -d "$dest" && isdir=yes +- if test "$isdir" = yes; then +- destdir="$dest" ++ test -d "$dest" && isdir=: ++ if $isdir; then ++ destdir=$dest + destname= + else + func_dirname_and_basename "$dest" "" "." +- destdir="$func_dirname_result" +- destname="$func_basename_result" ++ destdir=$func_dirname_result ++ destname=$func_basename_result + + # Not a directory, so check to see that there is only one file specified. + set dummy $files; shift + test "$#" -gt 1 && \ +- func_fatal_help "\`$dest' is not a directory" ++ func_fatal_help "'$dest' is not a directory" + fi + case $destdir in + [\\/]* | [A-Za-z]:[\\/]*) ;; +@@ -2899,7 +4108,7 @@ + case $file in + *.lo) ;; + *) +- func_fatal_help "\`$destdir' must be an absolute directory name" ++ func_fatal_help "'$destdir' must be an absolute directory name" + ;; + esac + done +@@ -2908,7 +4117,7 @@ + + # This variable tells wrapper scripts just to set variables rather + # than running their programs. +- libtool_install_magic="$magic" ++ libtool_install_magic=$magic + + staticlibs= + future_libdirs= +@@ -2928,7 +4137,7 @@ + + # Check to see that this really is a libtool archive. + func_lalib_unsafe_p "$file" \ +- || func_fatal_help "\`$file' is not a valid libtool archive" ++ || func_fatal_help "'$file' is not a valid libtool archive" + + library_names= + old_library= +@@ -2950,7 +4159,7 @@ + fi + + func_dirname "$file" "/" "" +- dir="$func_dirname_result" ++ dir=$func_dirname_result + func_append dir "$objdir" + + if test -n "$relink_command"; then +@@ -2964,7 +4173,7 @@ + # are installed into $libdir/../bin (currently, that works fine) + # but it's something to keep an eye on. + test "$inst_prefix_dir" = "$destdir" && \ +- func_fatal_error "error: cannot install \`$file' to a directory not ending in $libdir" ++ func_fatal_error "error: cannot install '$file' to a directory not ending in $libdir" + + if test -n "$inst_prefix_dir"; then + # Stick the inst_prefix_dir data into the link command. +@@ -2973,29 +4182,29 @@ + relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%%"` + fi + +- func_warning "relinking \`$file'" ++ func_warning "relinking '$file'" + func_show_eval "$relink_command" \ +- 'func_fatal_error "error: relink \`$file'\'' with the above command before installing it"' ++ 'func_fatal_error "error: relink '\''$file'\'' with the above command before installing it"' + fi + + # See the names of the shared library. + set dummy $library_names; shift + if test -n "$1"; then +- realname="$1" ++ realname=$1 + shift + +- srcname="$realname" +- test -n "$relink_command" && srcname="$realname"T ++ srcname=$realname ++ test -n "$relink_command" && srcname=${realname}T + + # Install the shared library and build the symlinks. + func_show_eval "$install_shared_prog $dir/$srcname $destdir/$realname" \ + 'exit $?' +- tstripme="$stripme" ++ tstripme=$stripme + case $host_os in + cygwin* | mingw* | pw32* | cegcc*) + case $realname in + *.dll.a) +- tstripme="" ++ tstripme= + ;; + esac + ;; +@@ -3006,7 +4215,7 @@ + + if test "$#" -gt 0; then + # Delete the old symlinks, and create new ones. +- # Try `ln -sf' first, because the `ln' binary might depend on ++ # Try 'ln -sf' first, because the 'ln' binary might depend on + # the symlink we replace! Solaris /bin/ln does not understand -f, + # so we also need to try rm && ln -s. + for linkname +@@ -3017,14 +4226,14 @@ + fi + + # Do each command in the postinstall commands. +- lib="$destdir/$realname" ++ lib=$destdir/$realname + func_execute_cmds "$postinstall_cmds" 'exit $?' + fi + + # Install the pseudo-library for information purposes. + func_basename "$file" +- name="$func_basename_result" +- instname="$dir/$name"i ++ name=$func_basename_result ++ instname=$dir/${name}i + func_show_eval "$install_prog $instname $destdir/$name" 'exit $?' + + # Maybe install the static library, too. +@@ -3036,11 +4245,11 @@ + + # Figure out destination file name, if it wasn't already specified. + if test -n "$destname"; then +- destfile="$destdir/$destname" ++ destfile=$destdir/$destname + else + func_basename "$file" +- destfile="$func_basename_result" +- destfile="$destdir/$destfile" ++ destfile=$func_basename_result ++ destfile=$destdir/$destfile + fi + + # Deduce the name of the destination old-style object file. +@@ -3050,11 +4259,11 @@ + staticdest=$func_lo2o_result + ;; + *.$objext) +- staticdest="$destfile" ++ staticdest=$destfile + destfile= + ;; + *) +- func_fatal_help "cannot copy a libtool object to \`$destfile'" ++ func_fatal_help "cannot copy a libtool object to '$destfile'" + ;; + esac + +@@ -3063,7 +4272,7 @@ + func_show_eval "$install_prog $file $destfile" 'exit $?' + + # Install the old object if enabled. +- if test "$build_old_libs" = yes; then ++ if test yes = "$build_old_libs"; then + # Deduce the name of the old-style object file. + func_lo2o "$file" + staticobj=$func_lo2o_result +@@ -3075,23 +4284,23 @@ + *) + # Figure out destination file name, if it wasn't already specified. + if test -n "$destname"; then +- destfile="$destdir/$destname" ++ destfile=$destdir/$destname + else + func_basename "$file" +- destfile="$func_basename_result" +- destfile="$destdir/$destfile" ++ destfile=$func_basename_result ++ destfile=$destdir/$destfile + fi + + # If the file is missing, and there is a .exe on the end, strip it + # because it is most likely a libtool script we actually want to + # install +- stripped_ext="" ++ stripped_ext= + case $file in + *.exe) + if test ! -f "$file"; then + func_stripname '' '.exe' "$file" + file=$func_stripname_result +- stripped_ext=".exe" ++ stripped_ext=.exe + fi + ;; + esac +@@ -3119,19 +4328,19 @@ + + # Check the variables that should have been set. + test -z "$generated_by_libtool_version" && \ +- func_fatal_error "invalid libtool wrapper script \`$wrapper'" +- +- finalize=yes ++ func_fatal_error "invalid libtool wrapper script '$wrapper'" ++ ++ finalize=: + for lib in $notinst_deplibs; do + # Check to see that each library is installed. + libdir= + if test -f "$lib"; then + func_source "$lib" + fi +- libfile="$libdir/"`$ECHO "$lib" | $SED 's%^.*/%%g'` ### testsuite: skip nested quoting test ++ libfile=$libdir/`$ECHO "$lib" | $SED 's%^.*/%%g'` + if test -n "$libdir" && test ! -f "$libfile"; then +- func_warning "\`$lib' has not been installed in \`$libdir'" +- finalize=no ++ func_warning "'$lib' has not been installed in '$libdir'" ++ finalize=false + fi + done + +@@ -3139,29 +4348,29 @@ + func_source "$wrapper" + + outputname= +- if test "$fast_install" = no && test -n "$relink_command"; then ++ if test no = "$fast_install" && test -n "$relink_command"; then + $opt_dry_run || { +- if test "$finalize" = yes; then ++ if $finalize; then + tmpdir=`func_mktempdir` + func_basename "$file$stripped_ext" +- file="$func_basename_result" +- outputname="$tmpdir/$file" ++ file=$func_basename_result ++ outputname=$tmpdir/$file + # Replace the output file specification. + relink_command=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$outputname"'%g'` + +- $opt_silent || { ++ $opt_quiet || { + func_quote_for_expand "$relink_command" + eval "func_echo $func_quote_for_expand_result" + } + if eval "$relink_command"; then : + else +- func_error "error: relink \`$file' with the above command before installing it" ++ func_error "error: relink '$file' with the above command before installing it" + $opt_dry_run || ${RM}r "$tmpdir" + continue + fi +- file="$outputname" ++ file=$outputname + else +- func_warning "cannot relink \`$file'" ++ func_warning "cannot relink '$file'" + fi + } + else +@@ -3198,10 +4407,10 @@ + + for file in $staticlibs; do + func_basename "$file" +- name="$func_basename_result" ++ name=$func_basename_result + + # Set up the ranlib parameters. +- oldlib="$destdir/$name" ++ oldlib=$destdir/$name + func_to_tool_file "$oldlib" func_convert_file_msys_to_w32 + tool_oldlib=$func_to_tool_file_result + +@@ -3216,18 +4425,18 @@ + done + + test -n "$future_libdirs" && \ +- func_warning "remember to run \`$progname --finish$future_libdirs'" ++ func_warning "remember to run '$progname --finish$future_libdirs'" + + if test -n "$current_libdirs"; then + # Maybe just do a dry run. + $opt_dry_run && current_libdirs=" -n$current_libdirs" +- exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs' ++ exec_cmd='$SHELL "$progpath" $preserve_args --finish$current_libdirs' + else + exit $EXIT_SUCCESS + fi + } + +-test "$opt_mode" = install && func_mode_install ${1+"$@"} ++test install = "$opt_mode" && func_mode_install ${1+"$@"} + + + # func_generate_dlsyms outputname originator pic_p +@@ -3235,16 +4444,17 @@ + # a dlpreopen symbol table. + func_generate_dlsyms () + { +- $opt_debug +- my_outputname="$1" +- my_originator="$2" +- my_pic_p="${3-no}" ++ $debug_cmd ++ ++ my_outputname=$1 ++ my_originator=$2 ++ my_pic_p=${3-false} + my_prefix=`$ECHO "$my_originator" | sed 's%[^a-zA-Z0-9]%_%g'` + my_dlsyms= + +- if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then ++ if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; then + if test -n "$NM" && test -n "$global_symbol_pipe"; then +- my_dlsyms="${my_outputname}S.c" ++ my_dlsyms=${my_outputname}S.c + else + func_error "not configured to extract global symbols from dlpreopened files" + fi +@@ -3255,7 +4465,7 @@ + "") ;; + *.c) + # Discover the nlist of each of the dlfiles. +- nlist="$output_objdir/${my_outputname}.nm" ++ nlist=$output_objdir/$my_outputname.nm + + func_show_eval "$RM $nlist ${nlist}S ${nlist}T" + +@@ -3263,34 +4473,36 @@ + func_verbose "creating $output_objdir/$my_dlsyms" + + $opt_dry_run || $ECHO > "$output_objdir/$my_dlsyms" "\ +-/* $my_dlsyms - symbol resolution table for \`$my_outputname' dlsym emulation. */ +-/* Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION */ ++/* $my_dlsyms - symbol resolution table for '$my_outputname' dlsym emulation. */ ++/* Generated by $PROGRAM (GNU $PACKAGE) $VERSION */ + + #ifdef __cplusplus + extern \"C\" { + #endif + +-#if defined(__GNUC__) && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 4)) ++#if defined __GNUC__ && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 4)) + #pragma GCC diagnostic ignored \"-Wstrict-prototypes\" + #endif + + /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ +-#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) +-/* DATA imports from DLLs on WIN32 con't be const, because runtime ++#if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE ++/* DATA imports from DLLs on WIN32 can't be const, because runtime + relocations are performed -- see ld's documentation on pseudo-relocs. */ + # define LT_DLSYM_CONST +-#elif defined(__osf__) ++#elif defined __osf__ + /* This system does not cope well with relocations in const data. */ + # define LT_DLSYM_CONST + #else + # define LT_DLSYM_CONST const + #endif + ++#define STREQ(s1, s2) (strcmp ((s1), (s2)) == 0) ++ + /* External symbol declarations for the compiler. */\ + " + +- if test "$dlself" = yes; then +- func_verbose "generating symbol list for \`$output'" ++ if test yes = "$dlself"; then ++ func_verbose "generating symbol list for '$output'" + + $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist" + +@@ -3298,7 +4510,7 @@ + progfiles=`$ECHO "$objs$old_deplibs" | $SP2NL | $SED "$lo2o" | $NL2SP` + for progfile in $progfiles; do + func_to_tool_file "$progfile" func_convert_file_msys_to_w32 +- func_verbose "extracting global C symbols from \`$func_to_tool_file_result'" ++ func_verbose "extracting global C symbols from '$func_to_tool_file_result'" + $opt_dry_run || eval "$NM $func_to_tool_file_result | $global_symbol_pipe >> '$nlist'" + done + +@@ -3318,10 +4530,10 @@ + + # Prepare the list of exported symbols + if test -z "$export_symbols"; then +- export_symbols="$output_objdir/$outputname.exp" ++ export_symbols=$output_objdir/$outputname.exp + $opt_dry_run || { + $RM $export_symbols +- eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' ++ eval "$SED -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' + case $host in + *cygwin* | *mingw* | *cegcc* ) + eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' +@@ -3331,7 +4543,7 @@ + } + else + $opt_dry_run || { +- eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"' ++ eval "$SED -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"' + eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T' + eval '$MV "$nlist"T "$nlist"' + case $host in +@@ -3345,22 +4557,22 @@ + fi + + for dlprefile in $dlprefiles; do +- func_verbose "extracting global C symbols from \`$dlprefile'" ++ func_verbose "extracting global C symbols from '$dlprefile'" + func_basename "$dlprefile" +- name="$func_basename_result" ++ name=$func_basename_result + case $host in + *cygwin* | *mingw* | *cegcc* ) + # if an import library, we need to obtain dlname + if func_win32_import_lib_p "$dlprefile"; then + func_tr_sh "$dlprefile" + eval "curr_lafile=\$libfile_$func_tr_sh_result" +- dlprefile_dlbasename="" ++ dlprefile_dlbasename= + if test -n "$curr_lafile" && func_lalib_p "$curr_lafile"; then + # Use subshell, to avoid clobbering current variable values + dlprefile_dlname=`source "$curr_lafile" && echo "$dlname"` +- if test -n "$dlprefile_dlname" ; then ++ if test -n "$dlprefile_dlname"; then + func_basename "$dlprefile_dlname" +- dlprefile_dlbasename="$func_basename_result" ++ dlprefile_dlbasename=$func_basename_result + else + # no lafile. user explicitly requested -dlpreopen . + $sharedlib_from_linklib_cmd "$dlprefile" +@@ -3368,7 +4580,7 @@ + fi + fi + $opt_dry_run || { +- if test -n "$dlprefile_dlbasename" ; then ++ if test -n "$dlprefile_dlbasename"; then + eval '$ECHO ": $dlprefile_dlbasename" >> "$nlist"' + else + func_warning "Could not compute DLL name from $name" +@@ -3424,6 +4636,11 @@ + echo '/* NONE */' >> "$output_objdir/$my_dlsyms" + fi + ++ func_show_eval '$RM "${nlist}I"' ++ if test -n "$global_symbol_to_import"; then ++ eval "$global_symbol_to_import"' < "$nlist"S > "$nlist"I' ++ fi ++ + echo >> "$output_objdir/$my_dlsyms" "\ + + /* The mapping between symbol names and symbols. */ +@@ -3432,11 +4649,30 @@ + void *address; + } lt_dlsymlist; + extern LT_DLSYM_CONST lt_dlsymlist +-lt_${my_prefix}_LTX_preloaded_symbols[]; ++lt_${my_prefix}_LTX_preloaded_symbols[];\ ++" ++ ++ if test -s "$nlist"I; then ++ echo >> "$output_objdir/$my_dlsyms" "\ ++static void lt_syminit(void) ++{ ++ LT_DLSYM_CONST lt_dlsymlist *symbol = lt_${my_prefix}_LTX_preloaded_symbols; ++ for (; symbol->name; ++symbol) ++ {" ++ $SED 's/.*/ if (STREQ (symbol->name, \"&\")) symbol->address = (void *) \&&;/' < "$nlist"I >> "$output_objdir/$my_dlsyms" ++ echo >> "$output_objdir/$my_dlsyms" "\ ++ } ++}" ++ fi ++ echo >> "$output_objdir/$my_dlsyms" "\ + LT_DLSYM_CONST lt_dlsymlist + lt_${my_prefix}_LTX_preloaded_symbols[] = +-{\ +- { \"$my_originator\", (void *) 0 }," ++{ {\"$my_originator\", (void *) 0}," ++ ++ if test -s "$nlist"I; then ++ echo >> "$output_objdir/$my_dlsyms" "\ ++ {\"@INIT@\", (void *) <_syminit}," ++ fi + + case $need_lib_prefix in + no) +@@ -3478,9 +4714,7 @@ + *-*-hpux*) + pic_flag_for_symtable=" $pic_flag" ;; + *) +- if test "X$my_pic_p" != Xno; then +- pic_flag_for_symtable=" $pic_flag" +- fi ++ $my_pic_p && pic_flag_for_symtable=" $pic_flag" + ;; + esac + ;; +@@ -3497,10 +4731,10 @@ + func_show_eval '(cd $output_objdir && $LTCC$symtab_cflags -c$no_builtin_flag$pic_flag_for_symtable "$my_dlsyms")' 'exit $?' + + # Clean up the generated files. +- func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T"' ++ func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T" "${nlist}I"' + + # Transform the symbol file into the correct name. +- symfileobj="$output_objdir/${my_outputname}S.$objext" ++ symfileobj=$output_objdir/${my_outputname}S.$objext + case $host in + *cygwin* | *mingw* | *cegcc* ) + if test -f "$output_objdir/$my_outputname.def"; then +@@ -3518,7 +4752,7 @@ + esac + ;; + *) +- func_fatal_error "unknown suffix for \`$my_dlsyms'" ++ func_fatal_error "unknown suffix for '$my_dlsyms'" + ;; + esac + else +@@ -3532,6 +4766,32 @@ + fi + } + ++# func_cygming_gnu_implib_p ARG ++# This predicate returns with zero status (TRUE) if ++# ARG is a GNU/binutils-style import library. Returns ++# with nonzero status (FALSE) otherwise. ++func_cygming_gnu_implib_p () ++{ ++ $debug_cmd ++ ++ func_to_tool_file "$1" func_convert_file_msys_to_w32 ++ func_cygming_gnu_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $EGREP ' (_head_[A-Za-z0-9_]+_[ad]l*|[A-Za-z0-9_]+_[ad]l*_iname)$'` ++ test -n "$func_cygming_gnu_implib_tmp" ++} ++ ++# func_cygming_ms_implib_p ARG ++# This predicate returns with zero status (TRUE) if ++# ARG is an MS-style import library. Returns ++# with nonzero status (FALSE) otherwise. ++func_cygming_ms_implib_p () ++{ ++ $debug_cmd ++ ++ func_to_tool_file "$1" func_convert_file_msys_to_w32 ++ func_cygming_ms_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $GREP '_NULL_IMPORT_DESCRIPTOR'` ++ test -n "$func_cygming_ms_implib_tmp" ++} ++ + # func_win32_libid arg + # return the library type of file 'arg' + # +@@ -3541,8 +4801,9 @@ + # Despite the name, also deal with 64 bit binaries. + func_win32_libid () + { +- $opt_debug +- win32_libid_type="unknown" ++ $debug_cmd ++ ++ win32_libid_type=unknown + win32_fileres=`file -L $1 2>/dev/null` + case $win32_fileres in + *ar\ archive\ import\ library*) # definitely import +@@ -3552,16 +4813,29 @@ + # Keep the egrep pattern in sync with the one in _LT_CHECK_MAGIC_METHOD. + if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | + $EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' >/dev/null; then +- func_to_tool_file "$1" func_convert_file_msys_to_w32 +- win32_nmres=`eval $NM -f posix -A \"$func_to_tool_file_result\" | +- $SED -n -e ' ++ case $nm_interface in ++ "MS dumpbin") ++ if func_cygming_ms_implib_p "$1" || ++ func_cygming_gnu_implib_p "$1" ++ then ++ win32_nmres=import ++ else ++ win32_nmres= ++ fi ++ ;; ++ *) ++ func_to_tool_file "$1" func_convert_file_msys_to_w32 ++ win32_nmres=`eval $NM -f posix -A \"$func_to_tool_file_result\" | ++ $SED -n -e ' + 1,100{ + / I /{ +- s,.*,import, ++ s|.*|import| + p + q + } + }'` ++ ;; ++ esac + case $win32_nmres in + import*) win32_libid_type="x86 archive import";; + *) win32_libid_type="x86 archive static";; +@@ -3593,7 +4867,8 @@ + # $sharedlib_from_linklib_result + func_cygming_dll_for_implib () + { +- $opt_debug ++ $debug_cmd ++ + sharedlib_from_linklib_result=`$DLLTOOL --identify-strict --identify "$1"` + } + +@@ -3610,7 +4885,8 @@ + # specified import library. + func_cygming_dll_for_implib_fallback_core () + { +- $opt_debug ++ $debug_cmd ++ + match_literal=`$ECHO "$1" | $SED "$sed_make_literal_regex"` + $OBJDUMP -s --section "$1" "$2" 2>/dev/null | + $SED '/^Contents of section '"$match_literal"':/{ +@@ -3646,8 +4922,8 @@ + /./p' | + # we now have a list, one entry per line, of the stringified + # contents of the appropriate section of all members of the +- # archive which possess that section. Heuristic: eliminate +- # all those which have a first or second character that is ++ # archive that possess that section. Heuristic: eliminate ++ # all those that have a first or second character that is + # a '.' (that is, objdump's representation of an unprintable + # character.) This should work for all archives with less than + # 0x302f exports -- but will fail for DLLs whose name actually +@@ -3658,30 +4934,6 @@ + $SED -e '/^\./d;/^.\./d;q' + } + +-# func_cygming_gnu_implib_p ARG +-# This predicate returns with zero status (TRUE) if +-# ARG is a GNU/binutils-style import library. Returns +-# with nonzero status (FALSE) otherwise. +-func_cygming_gnu_implib_p () +-{ +- $opt_debug +- func_to_tool_file "$1" func_convert_file_msys_to_w32 +- func_cygming_gnu_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $EGREP ' (_head_[A-Za-z0-9_]+_[ad]l*|[A-Za-z0-9_]+_[ad]l*_iname)$'` +- test -n "$func_cygming_gnu_implib_tmp" +-} +- +-# func_cygming_ms_implib_p ARG +-# This predicate returns with zero status (TRUE) if +-# ARG is an MS-style import library. Returns +-# with nonzero status (FALSE) otherwise. +-func_cygming_ms_implib_p () +-{ +- $opt_debug +- func_to_tool_file "$1" func_convert_file_msys_to_w32 +- func_cygming_ms_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $GREP '_NULL_IMPORT_DESCRIPTOR'` +- test -n "$func_cygming_ms_implib_tmp" +-} +- + # func_cygming_dll_for_implib_fallback ARG + # Platform-specific function to extract the + # name of the DLL associated with the specified +@@ -3695,16 +4947,17 @@ + # $sharedlib_from_linklib_result + func_cygming_dll_for_implib_fallback () + { +- $opt_debug +- if func_cygming_gnu_implib_p "$1" ; then ++ $debug_cmd ++ ++ if func_cygming_gnu_implib_p "$1"; then + # binutils import library + sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$7' "$1"` +- elif func_cygming_ms_implib_p "$1" ; then ++ elif func_cygming_ms_implib_p "$1"; then + # ms-generated import library + sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$6' "$1"` + else + # unknown +- sharedlib_from_linklib_result="" ++ sharedlib_from_linklib_result= + fi + } + +@@ -3712,10 +4965,11 @@ + # func_extract_an_archive dir oldlib + func_extract_an_archive () + { +- $opt_debug +- f_ex_an_ar_dir="$1"; shift +- f_ex_an_ar_oldlib="$1" +- if test "$lock_old_archive_extraction" = yes; then ++ $debug_cmd ++ ++ f_ex_an_ar_dir=$1; shift ++ f_ex_an_ar_oldlib=$1 ++ if test yes = "$lock_old_archive_extraction"; then + lockfile=$f_ex_an_ar_oldlib.lock + until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do + func_echo "Waiting for $lockfile to be removed" +@@ -3724,7 +4978,7 @@ + fi + func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" \ + 'stat=$?; rm -f "$lockfile"; exit $stat' +- if test "$lock_old_archive_extraction" = yes; then ++ if test yes = "$lock_old_archive_extraction"; then + $opt_dry_run || rm -f "$lockfile" + fi + if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then +@@ -3738,22 +4992,23 @@ + # func_extract_archives gentop oldlib ... + func_extract_archives () + { +- $opt_debug +- my_gentop="$1"; shift ++ $debug_cmd ++ ++ my_gentop=$1; shift + my_oldlibs=${1+"$@"} +- my_oldobjs="" +- my_xlib="" +- my_xabs="" +- my_xdir="" ++ my_oldobjs= ++ my_xlib= ++ my_xabs= ++ my_xdir= + + for my_xlib in $my_oldlibs; do + # Extract the objects. + case $my_xlib in +- [\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;; ++ [\\/]* | [A-Za-z]:[\\/]*) my_xabs=$my_xlib ;; + *) my_xabs=`pwd`"/$my_xlib" ;; + esac + func_basename "$my_xlib" +- my_xlib="$func_basename_result" ++ my_xlib=$func_basename_result + my_xlib_u=$my_xlib + while :; do + case " $extracted_archives " in +@@ -3765,7 +5020,7 @@ + esac + done + extracted_archives="$extracted_archives $my_xlib_u" +- my_xdir="$my_gentop/$my_xlib_u" ++ my_xdir=$my_gentop/$my_xlib_u + + func_mkdir_p "$my_xdir" + +@@ -3778,19 +5033,20 @@ + cd $my_xdir || exit $? + darwin_archive=$my_xabs + darwin_curdir=`pwd` +- darwin_base_archive=`basename "$darwin_archive"` ++ func_basename "$darwin_archive" ++ darwin_base_archive=$func_basename_result + darwin_arches=`$LIPO -info "$darwin_archive" 2>/dev/null | $GREP Architectures 2>/dev/null || true` + if test -n "$darwin_arches"; then + darwin_arches=`$ECHO "$darwin_arches" | $SED -e 's/.*are://'` + darwin_arch= + func_verbose "$darwin_base_archive has multiple architectures $darwin_arches" +- for darwin_arch in $darwin_arches ; do +- func_mkdir_p "unfat-$$/${darwin_base_archive}-${darwin_arch}" +- $LIPO -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}" +- cd "unfat-$$/${darwin_base_archive}-${darwin_arch}" +- func_extract_an_archive "`pwd`" "${darwin_base_archive}" ++ for darwin_arch in $darwin_arches; do ++ func_mkdir_p "unfat-$$/$darwin_base_archive-$darwin_arch" ++ $LIPO -thin $darwin_arch -output "unfat-$$/$darwin_base_archive-$darwin_arch/$darwin_base_archive" "$darwin_archive" ++ cd "unfat-$$/$darwin_base_archive-$darwin_arch" ++ func_extract_an_archive "`pwd`" "$darwin_base_archive" + cd "$darwin_curdir" +- $RM "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" ++ $RM "unfat-$$/$darwin_base_archive-$darwin_arch/$darwin_base_archive" + done # $darwin_arches + ## Okay now we've a bunch of thin objects, gotta fatten them up :) + darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$basename" | sort -u` +@@ -3815,7 +5071,7 @@ + my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | sort | $NL2SP` + done + +- func_extract_archives_result="$my_oldobjs" ++ func_extract_archives_result=$my_oldobjs + } + + +@@ -3830,7 +5086,7 @@ + # + # ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR + # variable will take. If 'yes', then the emitted script +-# will assume that the directory in which it is stored is ++# will assume that the directory where it is stored is + # the $objdir directory. This is a cygwin/mingw-specific + # behavior. + func_emit_wrapper () +@@ -3841,7 +5097,7 @@ + #! $SHELL + + # $output - temporary wrapper script for $objdir/$outputname +-# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION ++# Generated by $PROGRAM (GNU $PACKAGE) $VERSION + # + # The $output program cannot be directly executed until all the libtool + # libraries that it depends on are installed. +@@ -3898,9 +5154,9 @@ + + # Very basic option parsing. These options are (a) specific to + # the libtool wrapper, (b) are identical between the wrapper +-# /script/ and the wrapper /executable/ which is used only on ++# /script/ and the wrapper /executable/ that is used only on + # windows platforms, and (c) all begin with the string "--lt-" +-# (application programs are unlikely to have options which match ++# (application programs are unlikely to have options that match + # this pattern). + # + # There are only two supported options: --lt-debug and +@@ -3933,7 +5189,7 @@ + + # Print the debug banner immediately: + if test -n \"\$lt_option_debug\"; then +- echo \"${outputname}:${output}:\${LINENO}: libtool wrapper (GNU $PACKAGE$TIMESTAMP) $VERSION\" 1>&2 ++ echo \"$outputname:$output:\$LINENO: libtool wrapper (GNU $PACKAGE) $VERSION\" 1>&2 + fi + } + +@@ -3944,7 +5200,7 @@ + lt_dump_args_N=1; + for lt_arg + do +- \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[\$lt_dump_args_N]: \$lt_arg\" ++ \$ECHO \"$outputname:$output:\$LINENO: newargv[\$lt_dump_args_N]: \$lt_arg\" + lt_dump_args_N=\`expr \$lt_dump_args_N + 1\` + done + } +@@ -3958,7 +5214,7 @@ + *-*-mingw | *-*-os2* | *-cegcc*) + $ECHO "\ + if test -n \"\$lt_option_debug\"; then +- \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir\\\\\$program\" 1>&2 ++ \$ECHO \"$outputname:$output:\$LINENO: newargv[0]: \$progdir\\\\\$program\" 1>&2 + func_lt_dump_args \${1+\"\$@\"} 1>&2 + fi + exec \"\$progdir\\\\\$program\" \${1+\"\$@\"} +@@ -3968,7 +5224,7 @@ + *) + $ECHO "\ + if test -n \"\$lt_option_debug\"; then +- \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir/\$program\" 1>&2 ++ \$ECHO \"$outputname:$output:\$LINENO: newargv[0]: \$progdir/\$program\" 1>&2 + func_lt_dump_args \${1+\"\$@\"} 1>&2 + fi + exec \"\$progdir/\$program\" \${1+\"\$@\"} +@@ -4043,13 +5299,13 @@ + test -n \"\$absdir\" && thisdir=\"\$absdir\" + " + +- if test "$fast_install" = yes; then ++ if test yes = "$fast_install"; then + $ECHO "\ + program=lt-'$outputname'$exeext + progdir=\"\$thisdir/$objdir\" + + if test ! -f \"\$progdir/\$program\" || +- { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\ ++ { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | $SED 1q\`; \\ + test \"X\$file\" != \"X\$progdir/\$program\"; }; then + + file=\"\$\$-\$program\" +@@ -4101,7 +5357,7 @@ + fi + + # Export our shlibpath_var if we have one. +- if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then ++ if test yes = "$shlibpath_overrides_runpath" && test -n "$shlibpath_var" && test -n "$temp_rpath"; then + $ECHO "\ + # Add our own library path to $shlibpath_var + $shlibpath_var=\"$temp_rpath\$$shlibpath_var\" +@@ -4121,7 +5377,7 @@ + fi + else + # The program doesn't exist. +- \$ECHO \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2 ++ \$ECHO \"\$0: error: '\$progdir/\$program' does not exist\" 1>&2 + \$ECHO \"This script is just a wrapper for \$program.\" 1>&2 + \$ECHO \"See the $PACKAGE documentation for more information.\" 1>&2 + exit 1 +@@ -4140,7 +5396,7 @@ + cat < + #include + ++#define STREQ(s1, s2) (strcmp ((s1), (s2)) == 0) ++ + /* declarations of non-ANSI functions */ +-#if defined(__MINGW32__) ++#if defined __MINGW32__ + # ifdef __STRICT_ANSI__ + int _putenv (const char *); + # endif +-#elif defined(__CYGWIN__) ++#elif defined __CYGWIN__ + # ifdef __STRICT_ANSI__ + char *realpath (const char *, char *); + int putenv (char *); + int setenv (const char *, const char *, int); + # endif +-/* #elif defined (other platforms) ... */ ++/* #elif defined other_platform || defined ... */ + #endif + + /* portability defines, excluding path handling macros */ +-#if defined(_MSC_VER) ++#if defined _MSC_VER + # define setmode _setmode + # define stat _stat + # define chmod _chmod + # define getcwd _getcwd + # define putenv _putenv + # define S_IXUSR _S_IEXEC +-# ifndef _INTPTR_T_DEFINED +-# define _INTPTR_T_DEFINED +-# define intptr_t int +-# endif +-#elif defined(__MINGW32__) ++#elif defined __MINGW32__ + # define setmode _setmode + # define stat _stat + # define chmod _chmod + # define getcwd _getcwd + # define putenv _putenv +-#elif defined(__CYGWIN__) ++#elif defined __CYGWIN__ + # define HAVE_SETENV + # define FOPEN_WB "wb" +-/* #elif defined (other platforms) ... */ ++/* #elif defined other platforms ... */ + #endif + +-#if defined(PATH_MAX) ++#if defined PATH_MAX + # define LT_PATHMAX PATH_MAX +-#elif defined(MAXPATHLEN) ++#elif defined MAXPATHLEN + # define LT_PATHMAX MAXPATHLEN + #else + # define LT_PATHMAX 1024 +@@ -4234,8 +5488,8 @@ + # define PATH_SEPARATOR ':' + #endif + +-#if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \ +- defined (__OS2__) ++#if defined _WIN32 || defined __MSDOS__ || defined __DJGPP__ || \ ++ defined __OS2__ + # define HAVE_DOS_BASED_FILE_SYSTEM + # define FOPEN_WB "wb" + # ifndef DIR_SEPARATOR_2 +@@ -4268,10 +5522,10 @@ + + #define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type))) + #define XFREE(stale) do { \ +- if (stale) { free ((void *) stale); stale = 0; } \ ++ if (stale) { free (stale); stale = 0; } \ + } while (0) + +-#if defined(LT_DEBUGWRAPPER) ++#if defined LT_DEBUGWRAPPER + static int lt_debug = 1; + #else + static int lt_debug = 0; +@@ -4304,7 +5558,7 @@ + const char * LIB_PATH_VARNAME = "$shlibpath_var"; + EOF + +- if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then ++ if test yes = "$shlibpath_overrides_runpath" && test -n "$shlibpath_var" && test -n "$temp_rpath"; then + func_to_host_path "$temp_rpath" + cat < 0) && IS_PATH_SEPARATOR (new_value[len-1])) ++ size_t len = strlen (new_value); ++ while ((len > 0) && IS_PATH_SEPARATOR (new_value[len-1])) + { +- new_value[len-1] = '\0'; ++ new_value[--len] = '\0'; + } + lt_setenv (name, new_value); + XFREE (new_value); +@@ -5082,7 +6336,8 @@ + # True if ARG is an import lib, as indicated by $file_magic_cmd + func_win32_import_lib_p () + { +- $opt_debug ++ $debug_cmd ++ + case `eval $file_magic_cmd \"\$1\" 2>/dev/null | $SED -e 10q` in + *import*) : ;; + *) false ;; +@@ -5092,17 +6347,18 @@ + # func_mode_link arg... + func_mode_link () + { +- $opt_debug ++ $debug_cmd ++ + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) + # It is impossible to link a dll without this setting, and + # we shouldn't force the makefile maintainer to figure out +- # which system we are compiling for in order to pass an extra ++ # what system we are compiling for in order to pass an extra + # flag for every libtool invocation. + # allow_undefined=no + + # FIXME: Unfortunately, there are problems with the above when trying +- # to make a dll which has undefined symbols, in which case not ++ # to make a dll that has undefined symbols, in which case not + # even a static library is built. For now, we need to specify + # -no-undefined on the libtool link line when we can be certain + # that all symbols are satisfied, otherwise we get a static library. +@@ -5149,7 +6405,7 @@ + non_pic_objects= + precious_files_regex= + prefer_static_libs=no +- preload=no ++ preload=false + prev= + prevarg= + release= +@@ -5161,7 +6417,7 @@ + vinfo= + vinfo_number=no + weak_libs= +- single_module="${wl}-single_module" ++ single_module=$wl-single_module + func_infer_tag $base_compile + + # We need to know -static, to get the right output filenames. +@@ -5169,15 +6425,15 @@ + do + case $arg in + -shared) +- test "$build_libtool_libs" != yes && \ +- func_fatal_configuration "can not build a shared library" ++ test yes != "$build_libtool_libs" \ ++ && func_fatal_configuration "cannot build a shared library" + build_old_libs=no + break + ;; + -all-static | -static | -static-libtool-libs) + case $arg in + -all-static) +- if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then ++ if test yes = "$build_libtool_libs" && test -z "$link_static_flag"; then + func_warning "complete static linking is impossible in this configuration" + fi + if test -n "$link_static_flag"; then +@@ -5210,7 +6466,7 @@ + + # Go through the arguments, transforming them on the way. + while test "$#" -gt 0; do +- arg="$1" ++ arg=$1 + shift + func_quote_for_eval "$arg" + qarg=$func_quote_for_eval_unquoted_result +@@ -5227,21 +6483,21 @@ + + case $prev in + bindir) +- bindir="$arg" ++ bindir=$arg + prev= + continue + ;; + dlfiles|dlprefiles) +- if test "$preload" = no; then ++ $preload || { + # Add the symbol object into the linking commands. + func_append compile_command " @SYMFILE@" + func_append finalize_command " @SYMFILE@" +- preload=yes +- fi ++ preload=: ++ } + case $arg in + *.la | *.lo) ;; # We handle these cases below. + force) +- if test "$dlself" = no; then ++ if test no = "$dlself"; then + dlself=needless + export_dynamic=yes + fi +@@ -5249,9 +6505,9 @@ + continue + ;; + self) +- if test "$prev" = dlprefiles; then ++ if test dlprefiles = "$prev"; then + dlself=yes +- elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then ++ elif test dlfiles = "$prev" && test yes != "$dlopen_self"; then + dlself=yes + else + dlself=needless +@@ -5261,7 +6517,7 @@ + continue + ;; + *) +- if test "$prev" = dlfiles; then ++ if test dlfiles = "$prev"; then + func_append dlfiles " $arg" + else + func_append dlprefiles " $arg" +@@ -5272,14 +6528,14 @@ + esac + ;; + expsyms) +- export_symbols="$arg" ++ export_symbols=$arg + test -f "$arg" \ +- || func_fatal_error "symbol file \`$arg' does not exist" ++ || func_fatal_error "symbol file '$arg' does not exist" + prev= + continue + ;; + expsyms_regex) +- export_symbols_regex="$arg" ++ export_symbols_regex=$arg + prev= + continue + ;; +@@ -5297,7 +6553,13 @@ + continue + ;; + inst_prefix) +- inst_prefix_dir="$arg" ++ inst_prefix_dir=$arg ++ prev= ++ continue ++ ;; ++ mllvm) ++ # Clang does not use LLVM to link, so we can simply discard any ++ # '-mllvm $arg' options when doing the link step. + prev= + continue + ;; +@@ -5321,21 +6583,21 @@ + + if test -z "$pic_object" || + test -z "$non_pic_object" || +- test "$pic_object" = none && +- test "$non_pic_object" = none; then +- func_fatal_error "cannot find name of object for \`$arg'" ++ test none = "$pic_object" && ++ test none = "$non_pic_object"; then ++ func_fatal_error "cannot find name of object for '$arg'" + fi + + # Extract subdirectory from the argument. + func_dirname "$arg" "/" "" +- xdir="$func_dirname_result" +- +- if test "$pic_object" != none; then ++ xdir=$func_dirname_result ++ ++ if test none != "$pic_object"; then + # Prepend the subdirectory the object is found in. +- pic_object="$xdir$pic_object" +- +- if test "$prev" = dlfiles; then +- if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then ++ pic_object=$xdir$pic_object ++ ++ if test dlfiles = "$prev"; then ++ if test yes = "$build_libtool_libs" && test yes = "$dlopen_support"; then + func_append dlfiles " $pic_object" + prev= + continue +@@ -5346,7 +6608,7 @@ + fi + + # CHECK ME: I think I busted this. -Ossama +- if test "$prev" = dlprefiles; then ++ if test dlprefiles = "$prev"; then + # Preload the old-style object. + func_append dlprefiles " $pic_object" + prev= +@@ -5354,23 +6616,23 @@ + + # A PIC object. + func_append libobjs " $pic_object" +- arg="$pic_object" ++ arg=$pic_object + fi + + # Non-PIC object. +- if test "$non_pic_object" != none; then ++ if test none != "$non_pic_object"; then + # Prepend the subdirectory the object is found in. +- non_pic_object="$xdir$non_pic_object" ++ non_pic_object=$xdir$non_pic_object + + # A standard non-PIC object + func_append non_pic_objects " $non_pic_object" +- if test -z "$pic_object" || test "$pic_object" = none ; then +- arg="$non_pic_object" ++ if test -z "$pic_object" || test none = "$pic_object"; then ++ arg=$non_pic_object + fi + else + # If the PIC object exists, use it instead. + # $xdir was prepended to $pic_object above. +- non_pic_object="$pic_object" ++ non_pic_object=$pic_object + func_append non_pic_objects " $non_pic_object" + fi + else +@@ -5378,7 +6640,7 @@ + if $opt_dry_run; then + # Extract subdirectory from the argument. + func_dirname "$arg" "/" "" +- xdir="$func_dirname_result" ++ xdir=$func_dirname_result + + func_lo2o "$arg" + pic_object=$xdir$objdir/$func_lo2o_result +@@ -5386,24 +6648,24 @@ + func_append libobjs " $pic_object" + func_append non_pic_objects " $non_pic_object" + else +- func_fatal_error "\`$arg' is not a valid libtool object" ++ func_fatal_error "'$arg' is not a valid libtool object" + fi + fi + done + else +- func_fatal_error "link input file \`$arg' does not exist" ++ func_fatal_error "link input file '$arg' does not exist" + fi + arg=$save_arg + prev= + continue + ;; + precious_regex) +- precious_files_regex="$arg" ++ precious_files_regex=$arg + prev= + continue + ;; + release) +- release="-$arg" ++ release=-$arg + prev= + continue + ;; +@@ -5415,7 +6677,7 @@ + func_fatal_error "only absolute run-paths are allowed" + ;; + esac +- if test "$prev" = rpath; then ++ if test rpath = "$prev"; then + case "$rpath " in + *" $arg "*) ;; + *) func_append rpath " $arg" ;; +@@ -5430,7 +6692,7 @@ + continue + ;; + shrext) +- shrext_cmds="$arg" ++ shrext_cmds=$arg + prev= + continue + ;; +@@ -5470,7 +6732,7 @@ + esac + fi # test -n "$prev" + +- prevarg="$arg" ++ prevarg=$arg + + case $arg in + -all-static) +@@ -5484,7 +6746,7 @@ + + -allow-undefined) + # FIXME: remove this flag sometime in the future. +- func_fatal_error "\`-allow-undefined' must not be used because it is the default" ++ func_fatal_error "'-allow-undefined' must not be used because it is the default" + ;; + + -avoid-version) +@@ -5516,7 +6778,7 @@ + if test -n "$export_symbols" || test -n "$export_symbols_regex"; then + func_fatal_error "more than one -exported-symbols argument is not allowed" + fi +- if test "X$arg" = "X-export-symbols"; then ++ if test X-export-symbols = "X$arg"; then + prev=expsyms + else + prev=expsyms_regex +@@ -5550,9 +6812,9 @@ + func_stripname "-L" '' "$arg" + if test -z "$func_stripname_result"; then + if test "$#" -gt 0; then +- func_fatal_error "require no space between \`-L' and \`$1'" ++ func_fatal_error "require no space between '-L' and '$1'" + else +- func_fatal_error "need path for \`-L' option" ++ func_fatal_error "need path for '-L' option" + fi + fi + func_resolve_sysroot "$func_stripname_result" +@@ -5563,8 +6825,8 @@ + *) + absdir=`cd "$dir" && pwd` + test -z "$absdir" && \ +- func_fatal_error "cannot determine absolute directory name of \`$dir'" +- dir="$absdir" ++ func_fatal_error "cannot determine absolute directory name of '$dir'" ++ dir=$absdir + ;; + esac + case "$deplibs " in +@@ -5599,7 +6861,7 @@ + ;; + + -l*) +- if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then ++ if test X-lc = "X$arg" || test X-lm = "X$arg"; then + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc* | *-*-haiku*) + # These systems don't actually have a C or math library (as such) +@@ -5607,11 +6869,11 @@ + ;; + *-*-os2*) + # These systems don't actually have a C library (as such) +- test "X$arg" = "X-lc" && continue ++ test X-lc = "X$arg" && continue + ;; +- *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) ++ *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-bitrig*) + # Do not include libc due to us having libc/libc_r. +- test "X$arg" = "X-lc" && continue ++ test X-lc = "X$arg" && continue + ;; + *-*-rhapsody* | *-*-darwin1.[012]) + # Rhapsody C and math libraries are in the System framework +@@ -5620,16 +6882,16 @@ + ;; + *-*-sco3.2v5* | *-*-sco5v6*) + # Causes problems with __ctype +- test "X$arg" = "X-lc" && continue ++ test X-lc = "X$arg" && continue + ;; + *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) + # Compiler inserts libc in the correct place for threads to work +- test "X$arg" = "X-lc" && continue ++ test X-lc = "X$arg" && continue + ;; + esac +- elif test "X$arg" = "X-lc_r"; then ++ elif test X-lc_r = "X$arg"; then + case $host in +- *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) ++ *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-bitrig*) + # Do not include libc_r directly, use -pthread flag. + continue + ;; +@@ -5639,6 +6901,11 @@ + continue + ;; + ++ -mllvm) ++ prev=mllvm ++ continue ++ ;; ++ + -module) + module=yes + continue +@@ -5668,7 +6935,7 @@ + ;; + + -multi_module) +- single_module="${wl}-multi_module" ++ single_module=$wl-multi_module + continue + ;; + +@@ -5682,8 +6949,8 @@ + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin* | *-cegcc*) + # The PATH hackery in wrapper scripts is required on Windows + # and Darwin in order for the loader to find any dlls it needs. +- func_warning "\`-no-install' is ignored for $host" +- func_warning "assuming \`-no-fast-install' instead" ++ func_warning "'-no-install' is ignored for $host" ++ func_warning "assuming '-no-fast-install' instead" + fast_install=no + ;; + *) no_install=yes ;; +@@ -5788,14 +7055,14 @@ + func_stripname '-Wc,' '' "$arg" + args=$func_stripname_result + arg= +- save_ifs="$IFS"; IFS=',' ++ save_ifs=$IFS; IFS=, + for flag in $args; do +- IFS="$save_ifs" ++ IFS=$save_ifs + func_quote_for_eval "$flag" + func_append arg " $func_quote_for_eval_result" + func_append compiler_flags " $func_quote_for_eval_result" + done +- IFS="$save_ifs" ++ IFS=$save_ifs + func_stripname ' ' '' "$arg" + arg=$func_stripname_result + ;; +@@ -5804,15 +7071,15 @@ + func_stripname '-Wl,' '' "$arg" + args=$func_stripname_result + arg= +- save_ifs="$IFS"; IFS=',' ++ save_ifs=$IFS; IFS=, + for flag in $args; do +- IFS="$save_ifs" ++ IFS=$save_ifs + func_quote_for_eval "$flag" + func_append arg " $wl$func_quote_for_eval_result" + func_append compiler_flags " $wl$func_quote_for_eval_result" + func_append linker_flags " $func_quote_for_eval_result" + done +- IFS="$save_ifs" ++ IFS=$save_ifs + func_stripname ' ' '' "$arg" + arg=$func_stripname_result + ;; +@@ -5835,7 +7102,7 @@ + # -msg_* for osf cc + -msg_*) + func_quote_for_eval "$arg" +- arg="$func_quote_for_eval_result" ++ arg=$func_quote_for_eval_result + ;; + + # Flags to be passed through unchanged, with rationale: +@@ -5850,12 +7117,13 @@ + # @file GCC response files + # -tp=* Portland pgcc target processor selection + # --sysroot=* for sysroot support +- # -O*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization ++ # -O*, -g*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization ++ # -stdlib=* select c++ std lib with clang + -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \ + -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \ +- -O*|-flto*|-fwhopr*|-fuse-linker-plugin) ++ -O*|-g*|-flto*|-fwhopr*|-fuse-linker-plugin|-stdlib=*) + func_quote_for_eval "$arg" +- arg="$func_quote_for_eval_result" ++ arg=$func_quote_for_eval_result + func_append compile_command " $arg" + func_append finalize_command " $arg" + func_append compiler_flags " $arg" +@@ -5865,7 +7133,7 @@ + # Some other compiler flag. + -* | +*) + func_quote_for_eval "$arg" +- arg="$func_quote_for_eval_result" ++ arg=$func_quote_for_eval_result + ;; + + *.$objext) +@@ -5886,21 +7154,21 @@ + + if test -z "$pic_object" || + test -z "$non_pic_object" || +- test "$pic_object" = none && +- test "$non_pic_object" = none; then +- func_fatal_error "cannot find name of object for \`$arg'" ++ test none = "$pic_object" && ++ test none = "$non_pic_object"; then ++ func_fatal_error "cannot find name of object for '$arg'" + fi + + # Extract subdirectory from the argument. + func_dirname "$arg" "/" "" +- xdir="$func_dirname_result" +- +- if test "$pic_object" != none; then ++ xdir=$func_dirname_result ++ ++ test none = "$pic_object" || { + # Prepend the subdirectory the object is found in. +- pic_object="$xdir$pic_object" +- +- if test "$prev" = dlfiles; then +- if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then ++ pic_object=$xdir$pic_object ++ ++ if test dlfiles = "$prev"; then ++ if test yes = "$build_libtool_libs" && test yes = "$dlopen_support"; then + func_append dlfiles " $pic_object" + prev= + continue +@@ -5911,7 +7179,7 @@ + fi + + # CHECK ME: I think I busted this. -Ossama +- if test "$prev" = dlprefiles; then ++ if test dlprefiles = "$prev"; then + # Preload the old-style object. + func_append dlprefiles " $pic_object" + prev= +@@ -5919,23 +7187,23 @@ + + # A PIC object. + func_append libobjs " $pic_object" +- arg="$pic_object" +- fi ++ arg=$pic_object ++ } + + # Non-PIC object. +- if test "$non_pic_object" != none; then ++ if test none != "$non_pic_object"; then + # Prepend the subdirectory the object is found in. +- non_pic_object="$xdir$non_pic_object" ++ non_pic_object=$xdir$non_pic_object + + # A standard non-PIC object + func_append non_pic_objects " $non_pic_object" +- if test -z "$pic_object" || test "$pic_object" = none ; then +- arg="$non_pic_object" ++ if test -z "$pic_object" || test none = "$pic_object"; then ++ arg=$non_pic_object + fi + else + # If the PIC object exists, use it instead. + # $xdir was prepended to $pic_object above. +- non_pic_object="$pic_object" ++ non_pic_object=$pic_object + func_append non_pic_objects " $non_pic_object" + fi + else +@@ -5943,7 +7211,7 @@ + if $opt_dry_run; then + # Extract subdirectory from the argument. + func_dirname "$arg" "/" "" +- xdir="$func_dirname_result" ++ xdir=$func_dirname_result + + func_lo2o "$arg" + pic_object=$xdir$objdir/$func_lo2o_result +@@ -5951,7 +7219,7 @@ + func_append libobjs " $pic_object" + func_append non_pic_objects " $non_pic_object" + else +- func_fatal_error "\`$arg' is not a valid libtool object" ++ func_fatal_error "'$arg' is not a valid libtool object" + fi + fi + ;; +@@ -5967,11 +7235,11 @@ + # A libtool-controlled library. + + func_resolve_sysroot "$arg" +- if test "$prev" = dlfiles; then ++ if test dlfiles = "$prev"; then + # This library was specified with -dlopen. + func_append dlfiles " $func_resolve_sysroot_result" + prev= +- elif test "$prev" = dlprefiles; then ++ elif test dlprefiles = "$prev"; then + # The library was specified with -dlpreopen. + func_append dlprefiles " $func_resolve_sysroot_result" + prev= +@@ -5986,7 +7254,7 @@ + # Unknown arguments in both finalize_command and compile_command need + # to be aesthetically quoted because they are evaled later. + func_quote_for_eval "$arg" +- arg="$func_quote_for_eval_result" ++ arg=$func_quote_for_eval_result + ;; + esac # arg + +@@ -5998,9 +7266,9 @@ + done # argument parsing loop + + test -n "$prev" && \ +- func_fatal_help "the \`$prevarg' option requires an argument" +- +- if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then ++ func_fatal_help "the '$prevarg' option requires an argument" ++ ++ if test yes = "$export_dynamic" && test -n "$export_dynamic_flag_spec"; then + eval arg=\"$export_dynamic_flag_spec\" + func_append compile_command " $arg" + func_append finalize_command " $arg" +@@ -6009,12 +7277,12 @@ + oldlibs= + # calculate the name of the file, without its directory + func_basename "$output" +- outputname="$func_basename_result" +- libobjs_save="$libobjs" ++ outputname=$func_basename_result ++ libobjs_save=$libobjs + + if test -n "$shlibpath_var"; then + # get the directories listed in $shlibpath_var +- eval shlib_search_path=\`\$ECHO \"\${$shlibpath_var}\" \| \$SED \'s/:/ /g\'\` ++ eval shlib_search_path=\`\$ECHO \"\$$shlibpath_var\" \| \$SED \'s/:/ /g\'\` + else + shlib_search_path= + fi +@@ -6022,7 +7290,7 @@ + eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\" + + func_dirname "$output" "/" "" +- output_objdir="$func_dirname_result$objdir" ++ output_objdir=$func_dirname_result$objdir + func_to_tool_file "$output_objdir/" + tool_output_objdir=$func_to_tool_file_result + # Create the object directory. +@@ -6045,7 +7313,7 @@ + # Find all interdependent deplibs by searching for libraries + # that are linked more than once (e.g. -la -lb -la) + for deplib in $deplibs; do +- if $opt_preserve_dup_deps ; then ++ if $opt_preserve_dup_deps; then + case "$libs " in + *" $deplib "*) func_append specialdeplibs " $deplib" ;; + esac +@@ -6053,7 +7321,7 @@ + func_append libs " $deplib" + done + +- if test "$linkmode" = lib; then ++ if test lib = "$linkmode"; then + libs="$predeps $libs $compiler_lib_search_path $postdeps" + + # Compute libraries that are listed more than once in $predeps +@@ -6085,7 +7353,7 @@ + case $file in + *.la) ;; + *) +- func_fatal_help "libraries can \`-dlopen' only libtool libraries: $file" ++ func_fatal_help "libraries can '-dlopen' only libtool libraries: $file" + ;; + esac + done +@@ -6093,7 +7361,7 @@ + prog) + compile_deplibs= + finalize_deplibs= +- alldeplibs=no ++ alldeplibs=false + newdlfiles= + newdlprefiles= + passes="conv scan dlopen dlpreopen link" +@@ -6105,29 +7373,29 @@ + for pass in $passes; do + # The preopen pass in lib mode reverses $deplibs; put it back here + # so that -L comes before libs that need it for instance... +- if test "$linkmode,$pass" = "lib,link"; then ++ if test lib,link = "$linkmode,$pass"; then + ## FIXME: Find the place where the list is rebuilt in the wrong + ## order, and fix it there properly + tmp_deplibs= + for deplib in $deplibs; do + tmp_deplibs="$deplib $tmp_deplibs" + done +- deplibs="$tmp_deplibs" ++ deplibs=$tmp_deplibs + fi + +- if test "$linkmode,$pass" = "lib,link" || +- test "$linkmode,$pass" = "prog,scan"; then +- libs="$deplibs" ++ if test lib,link = "$linkmode,$pass" || ++ test prog,scan = "$linkmode,$pass"; then ++ libs=$deplibs + deplibs= + fi +- if test "$linkmode" = prog; then ++ if test prog = "$linkmode"; then + case $pass in +- dlopen) libs="$dlfiles" ;; +- dlpreopen) libs="$dlprefiles" ;; ++ dlopen) libs=$dlfiles ;; ++ dlpreopen) libs=$dlprefiles ;; + link) libs="$deplibs %DEPLIBS% $dependency_libs" ;; + esac + fi +- if test "$linkmode,$pass" = "lib,dlpreopen"; then ++ if test lib,dlpreopen = "$linkmode,$pass"; then + # Collect and forward deplibs of preopened libtool libs + for lib in $dlprefiles; do + # Ignore non-libtool-libs +@@ -6148,26 +7416,26 @@ + esac + done + done +- libs="$dlprefiles" ++ libs=$dlprefiles + fi +- if test "$pass" = dlopen; then ++ if test dlopen = "$pass"; then + # Collect dlpreopened libraries +- save_deplibs="$deplibs" ++ save_deplibs=$deplibs + deplibs= + fi + + for deplib in $libs; do + lib= +- found=no ++ found=false + case $deplib in + -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \ + |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*) +- if test "$linkmode,$pass" = "prog,link"; then ++ if test prog,link = "$linkmode,$pass"; then + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + else + func_append compiler_flags " $deplib" +- if test "$linkmode" = lib ; then ++ if test lib = "$linkmode"; then + case "$new_inherited_linker_flags " in + *" $deplib "*) ;; + * ) func_append new_inherited_linker_flags " $deplib" ;; +@@ -6177,13 +7445,13 @@ + continue + ;; + -l*) +- if test "$linkmode" != lib && test "$linkmode" != prog; then +- func_warning "\`-l' is ignored for archives/objects" ++ if test lib != "$linkmode" && test prog != "$linkmode"; then ++ func_warning "'-l' is ignored for archives/objects" + continue + fi + func_stripname '-l' '' "$deplib" + name=$func_stripname_result +- if test "$linkmode" = lib; then ++ if test lib = "$linkmode"; then + searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path" + else + searchdirs="$newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path" +@@ -6191,31 +7459,22 @@ + for searchdir in $searchdirs; do + for search_ext in .la $std_shrext .so .a; do + # Search the libtool library +- lib="$searchdir/lib${name}${search_ext}" ++ lib=$searchdir/lib$name$search_ext + if test -f "$lib"; then +- if test "$search_ext" = ".la"; then +- found=yes ++ if test .la = "$search_ext"; then ++ found=: + else +- found=no ++ found=false + fi + break 2 + fi + done + done +- if test "$found" != yes; then +- # deplib doesn't seem to be a libtool library +- if test "$linkmode,$pass" = "prog,link"; then +- compile_deplibs="$deplib $compile_deplibs" +- finalize_deplibs="$deplib $finalize_deplibs" +- else +- deplibs="$deplib $deplibs" +- test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" +- fi +- continue +- else # deplib is a libtool library ++ if $found; then ++ # deplib is a libtool library + # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib, + # We need to do some special things here, and not later. +- if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then ++ if test yes = "$allow_libtool_libs_with_static_runtimes"; then + case " $predeps $postdeps " in + *" $deplib "*) + if func_lalib_p "$lib"; then +@@ -6223,19 +7482,19 @@ + old_library= + func_source "$lib" + for l in $old_library $library_names; do +- ll="$l" ++ ll=$l + done +- if test "X$ll" = "X$old_library" ; then # only static version available +- found=no ++ if test "X$ll" = "X$old_library"; then # only static version available ++ found=false + func_dirname "$lib" "" "." +- ladir="$func_dirname_result" ++ ladir=$func_dirname_result + lib=$ladir/$old_library +- if test "$linkmode,$pass" = "prog,link"; then ++ if test prog,link = "$linkmode,$pass"; then + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + else + deplibs="$deplib $deplibs" +- test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" ++ test lib = "$linkmode" && newdependency_libs="$deplib $newdependency_libs" + fi + continue + fi +@@ -6244,15 +7503,25 @@ + *) ;; + esac + fi ++ else ++ # deplib doesn't seem to be a libtool library ++ if test prog,link = "$linkmode,$pass"; then ++ compile_deplibs="$deplib $compile_deplibs" ++ finalize_deplibs="$deplib $finalize_deplibs" ++ else ++ deplibs="$deplib $deplibs" ++ test lib = "$linkmode" && newdependency_libs="$deplib $newdependency_libs" ++ fi ++ continue + fi + ;; # -l + *.ltframework) +- if test "$linkmode,$pass" = "prog,link"; then ++ if test prog,link = "$linkmode,$pass"; then + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + else + deplibs="$deplib $deplibs" +- if test "$linkmode" = lib ; then ++ if test lib = "$linkmode"; then + case "$new_inherited_linker_flags " in + *" $deplib "*) ;; + * ) func_append new_inherited_linker_flags " $deplib" ;; +@@ -6265,18 +7534,18 @@ + case $linkmode in + lib) + deplibs="$deplib $deplibs" +- test "$pass" = conv && continue ++ test conv = "$pass" && continue + newdependency_libs="$deplib $newdependency_libs" + func_stripname '-L' '' "$deplib" + func_resolve_sysroot "$func_stripname_result" + func_append newlib_search_path " $func_resolve_sysroot_result" + ;; + prog) +- if test "$pass" = conv; then ++ if test conv = "$pass"; then + deplibs="$deplib $deplibs" + continue + fi +- if test "$pass" = scan; then ++ if test scan = "$pass"; then + deplibs="$deplib $deplibs" + else + compile_deplibs="$deplib $compile_deplibs" +@@ -6287,13 +7556,13 @@ + func_append newlib_search_path " $func_resolve_sysroot_result" + ;; + *) +- func_warning "\`-L' is ignored for archives/objects" ++ func_warning "'-L' is ignored for archives/objects" + ;; + esac # linkmode + continue + ;; # -L + -R*) +- if test "$pass" = link; then ++ if test link = "$pass"; then + func_stripname '-R' '' "$deplib" + func_resolve_sysroot "$func_stripname_result" + dir=$func_resolve_sysroot_result +@@ -6311,7 +7580,7 @@ + lib=$func_resolve_sysroot_result + ;; + *.$libext) +- if test "$pass" = conv; then ++ if test conv = "$pass"; then + deplibs="$deplib $deplibs" + continue + fi +@@ -6322,21 +7591,26 @@ + case " $dlpreconveniencelibs " in + *" $deplib "*) ;; + *) +- valid_a_lib=no ++ valid_a_lib=false + case $deplibs_check_method in + match_pattern*) + set dummy $deplibs_check_method; shift + match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` + if eval "\$ECHO \"$deplib\"" 2>/dev/null | $SED 10q \ + | $EGREP "$match_pattern_regex" > /dev/null; then +- valid_a_lib=yes ++ valid_a_lib=: + fi + ;; + pass_all) +- valid_a_lib=yes ++ valid_a_lib=: + ;; + esac +- if test "$valid_a_lib" != yes; then ++ if $valid_a_lib; then ++ echo ++ $ECHO "*** Warning: Linking the shared library $output against the" ++ $ECHO "*** static library $deplib is not portable!" ++ deplibs="$deplib $deplibs" ++ else + echo + $ECHO "*** Warning: Trying to link with static lib archive $deplib." + echo "*** I have the capability to make that library automatically link in when" +@@ -6344,18 +7618,13 @@ + echo "*** shared version of the library, which you do not appear to have" + echo "*** because the file extensions .$libext of this argument makes me believe" + echo "*** that it is just a static archive that I should not use here." +- else +- echo +- $ECHO "*** Warning: Linking the shared library $output against the" +- $ECHO "*** static library $deplib is not portable!" +- deplibs="$deplib $deplibs" + fi + ;; + esac + continue + ;; + prog) +- if test "$pass" != link; then ++ if test link != "$pass"; then + deplibs="$deplib $deplibs" + else + compile_deplibs="$deplib $compile_deplibs" +@@ -6366,10 +7635,10 @@ + esac # linkmode + ;; # *.$libext + *.lo | *.$objext) +- if test "$pass" = conv; then ++ if test conv = "$pass"; then + deplibs="$deplib $deplibs" +- elif test "$linkmode" = prog; then +- if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then ++ elif test prog = "$linkmode"; then ++ if test dlpreopen = "$pass" || test yes != "$dlopen_support" || test no = "$build_libtool_libs"; then + # If there is no dlopen support or we're linking statically, + # we need to preload. + func_append newdlprefiles " $deplib" +@@ -6382,22 +7651,20 @@ + continue + ;; + %DEPLIBS%) +- alldeplibs=yes ++ alldeplibs=: + continue + ;; + esac # case $deplib + +- if test "$found" = yes || test -f "$lib"; then : +- else +- func_fatal_error "cannot find the library \`$lib' or unhandled argument \`$deplib'" +- fi ++ $found || test -f "$lib" \ ++ || func_fatal_error "cannot find the library '$lib' or unhandled argument '$deplib'" + + # Check to see that this really is a libtool archive. + func_lalib_unsafe_p "$lib" \ +- || func_fatal_error "\`$lib' is not a valid libtool archive" ++ || func_fatal_error "'$lib' is not a valid libtool archive" + + func_dirname "$lib" "" "." +- ladir="$func_dirname_result" ++ ladir=$func_dirname_result + + dlname= + dlopen= +@@ -6427,30 +7694,30 @@ + done + fi + dependency_libs=`$ECHO " $dependency_libs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` +- if test "$linkmode,$pass" = "lib,link" || +- test "$linkmode,$pass" = "prog,scan" || +- { test "$linkmode" != prog && test "$linkmode" != lib; }; then ++ if test lib,link = "$linkmode,$pass" || ++ test prog,scan = "$linkmode,$pass" || ++ { test prog != "$linkmode" && test lib != "$linkmode"; }; then + test -n "$dlopen" && func_append dlfiles " $dlopen" + test -n "$dlpreopen" && func_append dlprefiles " $dlpreopen" + fi + +- if test "$pass" = conv; then ++ if test conv = "$pass"; then + # Only check for convenience libraries + deplibs="$lib $deplibs" + if test -z "$libdir"; then + if test -z "$old_library"; then +- func_fatal_error "cannot find name of link library for \`$lib'" ++ func_fatal_error "cannot find name of link library for '$lib'" + fi + # It is a libtool convenience library, so add in its objects. + func_append convenience " $ladir/$objdir/$old_library" + func_append old_convenience " $ladir/$objdir/$old_library" +- elif test "$linkmode" != prog && test "$linkmode" != lib; then +- func_fatal_error "\`$lib' is not a convenience library" ++ elif test prog != "$linkmode" && test lib != "$linkmode"; then ++ func_fatal_error "'$lib' is not a convenience library" + fi + tmp_libs= + for deplib in $dependency_libs; do + deplibs="$deplib $deplibs" +- if $opt_preserve_dup_deps ; then ++ if $opt_preserve_dup_deps; then + case "$tmp_libs " in + *" $deplib "*) func_append specialdeplibs " $deplib" ;; + esac +@@ -6464,26 +7731,26 @@ + # Get the name of the library we link against. + linklib= + if test -n "$old_library" && +- { test "$prefer_static_libs" = yes || +- test "$prefer_static_libs,$installed" = "built,no"; }; then ++ { test yes = "$prefer_static_libs" || ++ test built,no = "$prefer_static_libs,$installed"; }; then + linklib=$old_library + else + for l in $old_library $library_names; do +- linklib="$l" ++ linklib=$l + done + fi + if test -z "$linklib"; then +- func_fatal_error "cannot find name of link library for \`$lib'" ++ func_fatal_error "cannot find name of link library for '$lib'" + fi + + # This library was specified with -dlopen. +- if test "$pass" = dlopen; then +- if test -z "$libdir"; then +- func_fatal_error "cannot -dlopen a convenience library: \`$lib'" +- fi ++ if test dlopen = "$pass"; then ++ test -z "$libdir" \ ++ && func_fatal_error "cannot -dlopen a convenience library: '$lib'" + if test -z "$dlname" || +- test "$dlopen_support" != yes || +- test "$build_libtool_libs" = no; then ++ test yes != "$dlopen_support" || ++ test no = "$build_libtool_libs" ++ then + # If there is no dlname, no dlopen support or we're linking + # statically, we need to preload. We also need to preload any + # dependent libraries so libltdl's deplib preloader doesn't +@@ -6497,40 +7764,40 @@ + + # We need an absolute path. + case $ladir in +- [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;; ++ [\\/]* | [A-Za-z]:[\\/]*) abs_ladir=$ladir ;; + *) + abs_ladir=`cd "$ladir" && pwd` + if test -z "$abs_ladir"; then +- func_warning "cannot determine absolute directory name of \`$ladir'" ++ func_warning "cannot determine absolute directory name of '$ladir'" + func_warning "passing it literally to the linker, although it might fail" +- abs_ladir="$ladir" ++ abs_ladir=$ladir + fi + ;; + esac + func_basename "$lib" +- laname="$func_basename_result" ++ laname=$func_basename_result + + # Find the relevant object directory and library name. +- if test "X$installed" = Xyes; then ++ if test yes = "$installed"; then + if test ! -f "$lt_sysroot$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then +- func_warning "library \`$lib' was moved." +- dir="$ladir" +- absdir="$abs_ladir" +- libdir="$abs_ladir" ++ func_warning "library '$lib' was moved." ++ dir=$ladir ++ absdir=$abs_ladir ++ libdir=$abs_ladir + else +- dir="$lt_sysroot$libdir" +- absdir="$lt_sysroot$libdir" ++ dir=$lt_sysroot$libdir ++ absdir=$lt_sysroot$libdir + fi +- test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes ++ test yes = "$hardcode_automatic" && avoidtemprpath=yes + else + if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then +- dir="$ladir" +- absdir="$abs_ladir" ++ dir=$ladir ++ absdir=$abs_ladir + # Remove this search path later + func_append notinst_path " $abs_ladir" + else +- dir="$ladir/$objdir" +- absdir="$abs_ladir/$objdir" ++ dir=$ladir/$objdir ++ absdir=$abs_ladir/$objdir + # Remove this search path later + func_append notinst_path " $abs_ladir" + fi +@@ -6539,11 +7806,11 @@ + name=$func_stripname_result + + # This library was specified with -dlpreopen. +- if test "$pass" = dlpreopen; then +- if test -z "$libdir" && test "$linkmode" = prog; then +- func_fatal_error "only libraries may -dlpreopen a convenience library: \`$lib'" ++ if test dlpreopen = "$pass"; then ++ if test -z "$libdir" && test prog = "$linkmode"; then ++ func_fatal_error "only libraries may -dlpreopen a convenience library: '$lib'" + fi +- case "$host" in ++ case $host in + # special handling for platforms with PE-DLLs. + *cygwin* | *mingw* | *cegcc* ) + # Linker will automatically link against shared library if both +@@ -6587,9 +7854,9 @@ + + if test -z "$libdir"; then + # Link the convenience library +- if test "$linkmode" = lib; then ++ if test lib = "$linkmode"; then + deplibs="$dir/$old_library $deplibs" +- elif test "$linkmode,$pass" = "prog,link"; then ++ elif test prog,link = "$linkmode,$pass"; then + compile_deplibs="$dir/$old_library $compile_deplibs" + finalize_deplibs="$dir/$old_library $finalize_deplibs" + else +@@ -6599,14 +7866,14 @@ + fi + + +- if test "$linkmode" = prog && test "$pass" != link; then ++ if test prog = "$linkmode" && test link != "$pass"; then + func_append newlib_search_path " $ladir" + deplibs="$lib $deplibs" + +- linkalldeplibs=no +- if test "$link_all_deplibs" != no || test -z "$library_names" || +- test "$build_libtool_libs" = no; then +- linkalldeplibs=yes ++ linkalldeplibs=false ++ if test no != "$link_all_deplibs" || test -z "$library_names" || ++ test no = "$build_libtool_libs"; then ++ linkalldeplibs=: + fi + + tmp_libs= +@@ -6618,14 +7885,14 @@ + ;; + esac + # Need to link against all dependency_libs? +- if test "$linkalldeplibs" = yes; then ++ if $linkalldeplibs; then + deplibs="$deplib $deplibs" + else + # Need to hardcode shared library paths + # or/and link against static libraries + newdependency_libs="$deplib $newdependency_libs" + fi +- if $opt_preserve_dup_deps ; then ++ if $opt_preserve_dup_deps; then + case "$tmp_libs " in + *" $deplib "*) func_append specialdeplibs " $deplib" ;; + esac +@@ -6635,15 +7902,15 @@ + continue + fi # $linkmode = prog... + +- if test "$linkmode,$pass" = "prog,link"; then ++ if test prog,link = "$linkmode,$pass"; then + if test -n "$library_names" && +- { { test "$prefer_static_libs" = no || +- test "$prefer_static_libs,$installed" = "built,yes"; } || ++ { { test no = "$prefer_static_libs" || ++ test built,yes = "$prefer_static_libs,$installed"; } || + test -z "$old_library"; }; then + # We need to hardcode the library path +- if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then ++ if test -n "$shlibpath_var" && test -z "$avoidtemprpath"; then + # Make sure the rpath contains only unique directories. +- case "$temp_rpath:" in ++ case $temp_rpath: in + *"$absdir:"*) ;; + *) func_append temp_rpath "$absdir:" ;; + esac +@@ -6672,9 +7939,9 @@ + esac + fi # $linkmode,$pass = prog,link... + +- if test "$alldeplibs" = yes && +- { test "$deplibs_check_method" = pass_all || +- { test "$build_libtool_libs" = yes && ++ if $alldeplibs && ++ { test pass_all = "$deplibs_check_method" || ++ { test yes = "$build_libtool_libs" && + test -n "$library_names"; }; }; then + # We only need to search for static libraries + continue +@@ -6683,11 +7950,11 @@ + + link_static=no # Whether the deplib will be linked statically + use_static_libs=$prefer_static_libs +- if test "$use_static_libs" = built && test "$installed" = yes; then ++ if test built = "$use_static_libs" && test yes = "$installed"; then + use_static_libs=no + fi + if test -n "$library_names" && +- { test "$use_static_libs" = no || test -z "$old_library"; }; then ++ { test no = "$use_static_libs" || test -z "$old_library"; }; then + case $host in + *cygwin* | *mingw* | *cegcc*) + # No point in relinking DLLs because paths are not encoded +@@ -6695,7 +7962,7 @@ + need_relink=no + ;; + *) +- if test "$installed" = no; then ++ if test no = "$installed"; then + func_append notinst_deplibs " $lib" + need_relink=yes + fi +@@ -6705,24 +7972,24 @@ + + # Warn about portability, can't link against -module's on some + # systems (darwin). Don't bleat about dlopened modules though! +- dlopenmodule="" ++ dlopenmodule= + for dlpremoduletest in $dlprefiles; do + if test "X$dlpremoduletest" = "X$lib"; then +- dlopenmodule="$dlpremoduletest" ++ dlopenmodule=$dlpremoduletest + break + fi + done +- if test -z "$dlopenmodule" && test "$shouldnotlink" = yes && test "$pass" = link; then ++ if test -z "$dlopenmodule" && test yes = "$shouldnotlink" && test link = "$pass"; then + echo +- if test "$linkmode" = prog; then ++ if test prog = "$linkmode"; then + $ECHO "*** Warning: Linking the executable $output against the loadable module" + else + $ECHO "*** Warning: Linking the shared library $output against the loadable module" + fi + $ECHO "*** $linklib is not portable!" + fi +- if test "$linkmode" = lib && +- test "$hardcode_into_libs" = yes; then ++ if test lib = "$linkmode" && ++ test yes = "$hardcode_into_libs"; then + # Hardcode the library path. + # Skip directories that are in the system default run-time + # search path. +@@ -6750,43 +8017,43 @@ + # figure out the soname + set dummy $library_names + shift +- realname="$1" ++ realname=$1 + shift + libname=`eval "\\$ECHO \"$libname_spec\""` + # use dlname if we got it. it's perfectly good, no? + if test -n "$dlname"; then +- soname="$dlname" ++ soname=$dlname + elif test -n "$soname_spec"; then + # bleh windows + case $host in + *cygwin* | mingw* | *cegcc*) + func_arith $current - $age + major=$func_arith_result +- versuffix="-$major" ++ versuffix=-$major + ;; + esac + eval soname=\"$soname_spec\" + else +- soname="$realname" ++ soname=$realname + fi + + # Make a new name for the extract_expsyms_cmds to use +- soroot="$soname" ++ soroot=$soname + func_basename "$soroot" +- soname="$func_basename_result" ++ soname=$func_basename_result + func_stripname 'lib' '.dll' "$soname" + newlib=libimp-$func_stripname_result.a + + # If the library has no export list, then create one now + if test -f "$output_objdir/$soname-def"; then : + else +- func_verbose "extracting exported symbol list from \`$soname'" ++ func_verbose "extracting exported symbol list from '$soname'" + func_execute_cmds "$extract_expsyms_cmds" 'exit $?' + fi + + # Create $newlib + if test -f "$output_objdir/$newlib"; then :; else +- func_verbose "generating import library for \`$soname'" ++ func_verbose "generating import library for '$soname'" + func_execute_cmds "$old_archive_from_expsyms_cmds" 'exit $?' + fi + # make sure the library variables are pointing to the new library +@@ -6794,58 +8061,58 @@ + linklib=$newlib + fi # test -n "$old_archive_from_expsyms_cmds" + +- if test "$linkmode" = prog || test "$opt_mode" != relink; then ++ if test prog = "$linkmode" || test relink != "$opt_mode"; then + add_shlibpath= + add_dir= + add= + lib_linked=yes + case $hardcode_action in + immediate | unsupported) +- if test "$hardcode_direct" = no; then +- add="$dir/$linklib" ++ if test no = "$hardcode_direct"; then ++ add=$dir/$linklib + case $host in +- *-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;; +- *-*-sysv4*uw2*) add_dir="-L$dir" ;; ++ *-*-sco3.2v5.0.[024]*) add_dir=-L$dir ;; ++ *-*-sysv4*uw2*) add_dir=-L$dir ;; + *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \ +- *-*-unixware7*) add_dir="-L$dir" ;; ++ *-*-unixware7*) add_dir=-L$dir ;; + *-*-darwin* ) +- # if the lib is a (non-dlopened) module then we can not ++ # if the lib is a (non-dlopened) module then we cannot + # link against it, someone is ignoring the earlier warnings + if /usr/bin/file -L $add 2> /dev/null | +- $GREP ": [^:]* bundle" >/dev/null ; then ++ $GREP ": [^:]* bundle" >/dev/null; then + if test "X$dlopenmodule" != "X$lib"; then + $ECHO "*** Warning: lib $linklib is a module, not a shared library" +- if test -z "$old_library" ; then ++ if test -z "$old_library"; then + echo + echo "*** And there doesn't seem to be a static archive available" + echo "*** The link will probably fail, sorry" + else +- add="$dir/$old_library" ++ add=$dir/$old_library + fi + elif test -n "$old_library"; then +- add="$dir/$old_library" ++ add=$dir/$old_library + fi + fi + esac +- elif test "$hardcode_minus_L" = no; then ++ elif test no = "$hardcode_minus_L"; then + case $host in +- *-*-sunos*) add_shlibpath="$dir" ;; ++ *-*-sunos*) add_shlibpath=$dir ;; + esac +- add_dir="-L$dir" +- add="-l$name" +- elif test "$hardcode_shlibpath_var" = no; then +- add_shlibpath="$dir" +- add="-l$name" ++ add_dir=-L$dir ++ add=-l$name ++ elif test no = "$hardcode_shlibpath_var"; then ++ add_shlibpath=$dir ++ add=-l$name + else + lib_linked=no + fi + ;; + relink) +- if test "$hardcode_direct" = yes && +- test "$hardcode_direct_absolute" = no; then +- add="$dir/$linklib" +- elif test "$hardcode_minus_L" = yes; then +- add_dir="-L$absdir" ++ if test yes = "$hardcode_direct" && ++ test no = "$hardcode_direct_absolute"; then ++ add=$dir/$linklib ++ elif test yes = "$hardcode_minus_L"; then ++ add_dir=-L$absdir + # Try looking first in the location we're being installed to. + if test -n "$inst_prefix_dir"; then + case $libdir in +@@ -6854,10 +8121,10 @@ + ;; + esac + fi +- add="-l$name" +- elif test "$hardcode_shlibpath_var" = yes; then +- add_shlibpath="$dir" +- add="-l$name" ++ add=-l$name ++ elif test yes = "$hardcode_shlibpath_var"; then ++ add_shlibpath=$dir ++ add=-l$name + else + lib_linked=no + fi +@@ -6865,7 +8132,7 @@ + *) lib_linked=no ;; + esac + +- if test "$lib_linked" != yes; then ++ if test yes != "$lib_linked"; then + func_fatal_configuration "unsupported hardcode properties" + fi + +@@ -6875,15 +8142,15 @@ + *) func_append compile_shlibpath "$add_shlibpath:" ;; + esac + fi +- if test "$linkmode" = prog; then ++ if test prog = "$linkmode"; then + test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs" + test -n "$add" && compile_deplibs="$add $compile_deplibs" + else + test -n "$add_dir" && deplibs="$add_dir $deplibs" + test -n "$add" && deplibs="$add $deplibs" +- if test "$hardcode_direct" != yes && +- test "$hardcode_minus_L" != yes && +- test "$hardcode_shlibpath_var" = yes; then ++ if test yes != "$hardcode_direct" && ++ test yes != "$hardcode_minus_L" && ++ test yes = "$hardcode_shlibpath_var"; then + case :$finalize_shlibpath: in + *":$libdir:"*) ;; + *) func_append finalize_shlibpath "$libdir:" ;; +@@ -6892,33 +8159,33 @@ + fi + fi + +- if test "$linkmode" = prog || test "$opt_mode" = relink; then ++ if test prog = "$linkmode" || test relink = "$opt_mode"; then + add_shlibpath= + add_dir= + add= + # Finalize command for both is simple: just hardcode it. +- if test "$hardcode_direct" = yes && +- test "$hardcode_direct_absolute" = no; then +- add="$libdir/$linklib" +- elif test "$hardcode_minus_L" = yes; then +- add_dir="-L$libdir" +- add="-l$name" +- elif test "$hardcode_shlibpath_var" = yes; then ++ if test yes = "$hardcode_direct" && ++ test no = "$hardcode_direct_absolute"; then ++ add=$libdir/$linklib ++ elif test yes = "$hardcode_minus_L"; then ++ add_dir=-L$libdir ++ add=-l$name ++ elif test yes = "$hardcode_shlibpath_var"; then + case :$finalize_shlibpath: in + *":$libdir:"*) ;; + *) func_append finalize_shlibpath "$libdir:" ;; + esac +- add="-l$name" +- elif test "$hardcode_automatic" = yes; then ++ add=-l$name ++ elif test yes = "$hardcode_automatic"; then + if test -n "$inst_prefix_dir" && +- test -f "$inst_prefix_dir$libdir/$linklib" ; then +- add="$inst_prefix_dir$libdir/$linklib" ++ test -f "$inst_prefix_dir$libdir/$linklib"; then ++ add=$inst_prefix_dir$libdir/$linklib + else +- add="$libdir/$linklib" ++ add=$libdir/$linklib + fi + else + # We cannot seem to hardcode it, guess we'll fake it. +- add_dir="-L$libdir" ++ add_dir=-L$libdir + # Try looking first in the location we're being installed to. + if test -n "$inst_prefix_dir"; then + case $libdir in +@@ -6927,10 +8194,10 @@ + ;; + esac + fi +- add="-l$name" ++ add=-l$name + fi + +- if test "$linkmode" = prog; then ++ if test prog = "$linkmode"; then + test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs" + test -n "$add" && finalize_deplibs="$add $finalize_deplibs" + else +@@ -6938,43 +8205,43 @@ + test -n "$add" && deplibs="$add $deplibs" + fi + fi +- elif test "$linkmode" = prog; then ++ elif test prog = "$linkmode"; then + # Here we assume that one of hardcode_direct or hardcode_minus_L + # is not unsupported. This is valid on all known static and + # shared platforms. +- if test "$hardcode_direct" != unsupported; then +- test -n "$old_library" && linklib="$old_library" ++ if test unsupported != "$hardcode_direct"; then ++ test -n "$old_library" && linklib=$old_library + compile_deplibs="$dir/$linklib $compile_deplibs" + finalize_deplibs="$dir/$linklib $finalize_deplibs" + else + compile_deplibs="-l$name -L$dir $compile_deplibs" + finalize_deplibs="-l$name -L$dir $finalize_deplibs" + fi +- elif test "$build_libtool_libs" = yes; then ++ elif test yes = "$build_libtool_libs"; then + # Not a shared library +- if test "$deplibs_check_method" != pass_all; then ++ if test pass_all != "$deplibs_check_method"; then + # We're trying link a shared library against a static one + # but the system doesn't support it. + + # Just print a warning and add the library to dependency_libs so + # that the program can be linked against the static library. + echo +- $ECHO "*** Warning: This system can not link to static lib archive $lib." ++ $ECHO "*** Warning: This system cannot link to static lib archive $lib." + echo "*** I have the capability to make that library automatically link in when" + echo "*** you link to this library. But I can only do this if you have a" + echo "*** shared version of the library, which you do not appear to have." +- if test "$module" = yes; then ++ if test yes = "$module"; then + echo "*** But as you try to build a module library, libtool will still create " + echo "*** a static module, that should work as long as the dlopening application" + echo "*** is linked with the -dlopen flag to resolve symbols at runtime." + if test -z "$global_symbol_pipe"; then + echo + echo "*** However, this would only work if libtool was able to extract symbol" +- echo "*** lists from a program, using \`nm' or equivalent, but libtool could" ++ echo "*** lists from a program, using 'nm' or equivalent, but libtool could" + echo "*** not find such a program. So, this module is probably useless." +- echo "*** \`nm' from GNU binutils and a full rebuild may help." ++ echo "*** 'nm' from GNU binutils and a full rebuild may help." + fi +- if test "$build_old_libs" = no; then ++ if test no = "$build_old_libs"; then + build_libtool_libs=module + build_old_libs=yes + else +@@ -6987,11 +8254,11 @@ + fi + fi # link shared/static library? + +- if test "$linkmode" = lib; then ++ if test lib = "$linkmode"; then + if test -n "$dependency_libs" && +- { test "$hardcode_into_libs" != yes || +- test "$build_old_libs" = yes || +- test "$link_static" = yes; }; then ++ { test yes != "$hardcode_into_libs" || ++ test yes = "$build_old_libs" || ++ test yes = "$link_static"; }; then + # Extract -R from dependency_libs + temp_deplibs= + for libdir in $dependency_libs; do +@@ -7005,12 +8272,12 @@ + *) func_append temp_deplibs " $libdir";; + esac + done +- dependency_libs="$temp_deplibs" ++ dependency_libs=$temp_deplibs + fi + + func_append newlib_search_path " $absdir" + # Link against this library +- test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs" ++ test no = "$link_static" && newdependency_libs="$abs_ladir/$laname $newdependency_libs" + # ... and its dependency_libs + tmp_libs= + for deplib in $dependency_libs; do +@@ -7020,7 +8287,7 @@ + func_resolve_sysroot "$func_stripname_result";; + *) func_resolve_sysroot "$deplib" ;; + esac +- if $opt_preserve_dup_deps ; then ++ if $opt_preserve_dup_deps; then + case "$tmp_libs " in + *" $func_resolve_sysroot_result "*) + func_append specialdeplibs " $func_resolve_sysroot_result" ;; +@@ -7029,12 +8296,12 @@ + func_append tmp_libs " $func_resolve_sysroot_result" + done + +- if test "$link_all_deplibs" != no; then ++ if test no != "$link_all_deplibs"; then + # Add the search paths of all dependency libraries + for deplib in $dependency_libs; do + path= + case $deplib in +- -L*) path="$deplib" ;; ++ -L*) path=$deplib ;; + *.la) + func_resolve_sysroot "$deplib" + deplib=$func_resolve_sysroot_result +@@ -7042,12 +8309,12 @@ + dir=$func_dirname_result + # We need an absolute path. + case $dir in +- [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;; ++ [\\/]* | [A-Za-z]:[\\/]*) absdir=$dir ;; + *) + absdir=`cd "$dir" && pwd` + if test -z "$absdir"; then +- func_warning "cannot determine absolute directory name of \`$dir'" +- absdir="$dir" ++ func_warning "cannot determine absolute directory name of '$dir'" ++ absdir=$dir + fi + ;; + esac +@@ -7055,35 +8322,35 @@ + case $host in + *-*-darwin*) + depdepl= +- eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib` +- if test -n "$deplibrary_names" ; then +- for tmp in $deplibrary_names ; do ++ eval deplibrary_names=`$SED -n -e 's/^library_names=\(.*\)$/\1/p' $deplib` ++ if test -n "$deplibrary_names"; then ++ for tmp in $deplibrary_names; do + depdepl=$tmp + done +- if test -f "$absdir/$objdir/$depdepl" ; then +- depdepl="$absdir/$objdir/$depdepl" +- darwin_install_name=`${OTOOL} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` ++ if test -f "$absdir/$objdir/$depdepl"; then ++ depdepl=$absdir/$objdir/$depdepl ++ darwin_install_name=`$OTOOL -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` + if test -z "$darwin_install_name"; then +- darwin_install_name=`${OTOOL64} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` ++ darwin_install_name=`$OTOOL64 -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` + fi +- func_append compiler_flags " ${wl}-dylib_file ${wl}${darwin_install_name}:${depdepl}" +- func_append linker_flags " -dylib_file ${darwin_install_name}:${depdepl}" ++ func_append compiler_flags " $wl-dylib_file $wl$darwin_install_name:$depdepl" ++ func_append linker_flags " -dylib_file $darwin_install_name:$depdepl" + path= + fi + fi + ;; + *) +- path="-L$absdir/$objdir" ++ path=-L$absdir/$objdir + ;; + esac + else +- eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` ++ eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` + test -z "$libdir" && \ +- func_fatal_error "\`$deplib' is not a valid libtool archive" ++ func_fatal_error "'$deplib' is not a valid libtool archive" + test "$absdir" != "$libdir" && \ +- func_warning "\`$deplib' seems to be moved" +- +- path="-L$absdir" ++ func_warning "'$deplib' seems to be moved" ++ ++ path=-L$absdir + fi + ;; + esac +@@ -7095,23 +8362,23 @@ + fi # link_all_deplibs != no + fi # linkmode = lib + done # for deplib in $libs +- if test "$pass" = link; then +- if test "$linkmode" = "prog"; then ++ if test link = "$pass"; then ++ if test prog = "$linkmode"; then + compile_deplibs="$new_inherited_linker_flags $compile_deplibs" + finalize_deplibs="$new_inherited_linker_flags $finalize_deplibs" + else + compiler_flags="$compiler_flags "`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` + fi + fi +- dependency_libs="$newdependency_libs" +- if test "$pass" = dlpreopen; then ++ dependency_libs=$newdependency_libs ++ if test dlpreopen = "$pass"; then + # Link the dlpreopened libraries before other libraries + for deplib in $save_deplibs; do + deplibs="$deplib $deplibs" + done + fi +- if test "$pass" != dlopen; then +- if test "$pass" != conv; then ++ if test dlopen != "$pass"; then ++ test conv = "$pass" || { + # Make sure lib_search_path contains only unique directories. + lib_search_path= + for dir in $newlib_search_path; do +@@ -7121,12 +8388,12 @@ + esac + done + newlib_search_path= +- fi +- +- if test "$linkmode,$pass" != "prog,link"; then +- vars="deplibs" ++ } ++ ++ if test prog,link = "$linkmode,$pass"; then ++ vars="compile_deplibs finalize_deplibs" + else +- vars="compile_deplibs finalize_deplibs" ++ vars=deplibs + fi + for var in $vars dependency_libs; do + # Add libraries to $var in reverse order +@@ -7187,59 +8454,59 @@ + # Last step: remove runtime libs from dependency_libs + # (they stay in deplibs) + tmp_libs= +- for i in $dependency_libs ; do ++ for i in $dependency_libs; do + case " $predeps $postdeps $compiler_lib_search_path " in + *" $i "*) +- i="" ++ i= + ;; + esac +- if test -n "$i" ; then ++ if test -n "$i"; then + func_append tmp_libs " $i" + fi + done + dependency_libs=$tmp_libs + done # for pass +- if test "$linkmode" = prog; then +- dlfiles="$newdlfiles" ++ if test prog = "$linkmode"; then ++ dlfiles=$newdlfiles + fi +- if test "$linkmode" = prog || test "$linkmode" = lib; then +- dlprefiles="$newdlprefiles" ++ if test prog = "$linkmode" || test lib = "$linkmode"; then ++ dlprefiles=$newdlprefiles + fi + + case $linkmode in + oldlib) +- if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then +- func_warning "\`-dlopen' is ignored for archives" ++ if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; then ++ func_warning "'-dlopen' is ignored for archives" + fi + + case " $deplibs" in + *\ -l* | *\ -L*) +- func_warning "\`-l' and \`-L' are ignored for archives" ;; ++ func_warning "'-l' and '-L' are ignored for archives" ;; + esac + + test -n "$rpath" && \ +- func_warning "\`-rpath' is ignored for archives" ++ func_warning "'-rpath' is ignored for archives" + + test -n "$xrpath" && \ +- func_warning "\`-R' is ignored for archives" ++ func_warning "'-R' is ignored for archives" + + test -n "$vinfo" && \ +- func_warning "\`-version-info/-version-number' is ignored for archives" ++ func_warning "'-version-info/-version-number' is ignored for archives" + + test -n "$release" && \ +- func_warning "\`-release' is ignored for archives" ++ func_warning "'-release' is ignored for archives" + + test -n "$export_symbols$export_symbols_regex" && \ +- func_warning "\`-export-symbols' is ignored for archives" ++ func_warning "'-export-symbols' is ignored for archives" + + # Now set the variables for building old libraries. + build_libtool_libs=no +- oldlibs="$output" ++ oldlibs=$output + func_append objs "$old_deplibs" + ;; + + lib) +- # Make sure we only generate libraries of the form `libNAME.la'. ++ # Make sure we only generate libraries of the form 'libNAME.la'. + case $outputname in + lib*) + func_stripname 'lib' '.la' "$outputname" +@@ -7248,10 +8515,10 @@ + eval libname=\"$libname_spec\" + ;; + *) +- test "$module" = no && \ +- func_fatal_help "libtool library \`$output' must begin with \`lib'" +- +- if test "$need_lib_prefix" != no; then ++ test no = "$module" \ ++ && func_fatal_help "libtool library '$output' must begin with 'lib'" ++ ++ if test no != "$need_lib_prefix"; then + # Add the "lib" prefix for modules if required + func_stripname '' '.la' "$outputname" + name=$func_stripname_result +@@ -7265,8 +8532,8 @@ + esac + + if test -n "$objs"; then +- if test "$deplibs_check_method" != pass_all; then +- func_fatal_error "cannot build libtool library \`$output' from non-libtool objects on this host:$objs" ++ if test pass_all != "$deplibs_check_method"; then ++ func_fatal_error "cannot build libtool library '$output' from non-libtool objects on this host:$objs" + else + echo + $ECHO "*** Warning: Linking the shared library $output against the non-libtool" +@@ -7275,21 +8542,21 @@ + fi + fi + +- test "$dlself" != no && \ +- func_warning "\`-dlopen self' is ignored for libtool libraries" ++ test no = "$dlself" \ ++ || func_warning "'-dlopen self' is ignored for libtool libraries" + + set dummy $rpath + shift +- test "$#" -gt 1 && \ +- func_warning "ignoring multiple \`-rpath's for a libtool library" +- +- install_libdir="$1" ++ test 1 -lt "$#" \ ++ && func_warning "ignoring multiple '-rpath's for a libtool library" ++ ++ install_libdir=$1 + + oldlibs= + if test -z "$rpath"; then +- if test "$build_libtool_libs" = yes; then ++ if test yes = "$build_libtool_libs"; then + # Building a libtool convenience library. +- # Some compilers have problems with a `.al' extension so ++ # Some compilers have problems with a '.al' extension so + # convenience libraries should have the same extension an + # archive normally would. + oldlibs="$output_objdir/$libname.$libext $oldlibs" +@@ -7298,20 +8565,20 @@ + fi + + test -n "$vinfo" && \ +- func_warning "\`-version-info/-version-number' is ignored for convenience libraries" ++ func_warning "'-version-info/-version-number' is ignored for convenience libraries" + + test -n "$release" && \ +- func_warning "\`-release' is ignored for convenience libraries" ++ func_warning "'-release' is ignored for convenience libraries" + else + + # Parse the version information argument. +- save_ifs="$IFS"; IFS=':' ++ save_ifs=$IFS; IFS=: + set dummy $vinfo 0 0 0 + shift +- IFS="$save_ifs" ++ IFS=$save_ifs + + test -n "$7" && \ +- func_fatal_help "too many parameters to \`-version-info'" ++ func_fatal_help "too many parameters to '-version-info'" + + # convert absolute version numbers to libtool ages + # this retains compatibility with .la files and attempts +@@ -7319,42 +8586,42 @@ + + case $vinfo_number in + yes) +- number_major="$1" +- number_minor="$2" +- number_revision="$3" ++ number_major=$1 ++ number_minor=$2 ++ number_revision=$3 + # + # There are really only two kinds -- those that + # use the current revision as the major version + # and those that subtract age and use age as + # a minor version. But, then there is irix +- # which has an extra 1 added just for fun ++ # that has an extra 1 added just for fun + # + case $version_type in + # correct linux to gnu/linux during the next big refactor + darwin|linux|osf|windows|none) + func_arith $number_major + $number_minor + current=$func_arith_result +- age="$number_minor" +- revision="$number_revision" ++ age=$number_minor ++ revision=$number_revision + ;; + freebsd-aout|freebsd-elf|qnx|sunos) +- current="$number_major" +- revision="$number_minor" +- age="0" ++ current=$number_major ++ revision=$number_minor ++ age=0 + ;; + irix|nonstopux) + func_arith $number_major + $number_minor + current=$func_arith_result +- age="$number_minor" +- revision="$number_minor" ++ age=$number_minor ++ revision=$number_minor + lt_irix_increment=no + ;; + esac + ;; + no) +- current="$1" +- revision="$2" +- age="$3" ++ current=$1 ++ revision=$2 ++ age=$3 + ;; + esac + +@@ -7362,30 +8629,30 @@ + case $current in + 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; + *) +- func_error "CURRENT \`$current' must be a nonnegative integer" +- func_fatal_error "\`$vinfo' is not valid version information" ++ func_error "CURRENT '$current' must be a nonnegative integer" ++ func_fatal_error "'$vinfo' is not valid version information" + ;; + esac + + case $revision in + 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; + *) +- func_error "REVISION \`$revision' must be a nonnegative integer" +- func_fatal_error "\`$vinfo' is not valid version information" ++ func_error "REVISION '$revision' must be a nonnegative integer" ++ func_fatal_error "'$vinfo' is not valid version information" + ;; + esac + + case $age in + 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; + *) +- func_error "AGE \`$age' must be a nonnegative integer" +- func_fatal_error "\`$vinfo' is not valid version information" ++ func_error "AGE '$age' must be a nonnegative integer" ++ func_fatal_error "'$vinfo' is not valid version information" + ;; + esac + + if test "$age" -gt "$current"; then +- func_error "AGE \`$age' is greater than the current interface number \`$current'" +- func_fatal_error "\`$vinfo' is not valid version information" ++ func_error "AGE '$age' is greater than the current interface number '$current'" ++ func_fatal_error "'$vinfo' is not valid version information" + fi + + # Calculate the version variables. +@@ -7400,26 +8667,35 @@ + # verstring for coding it into the library header + func_arith $current - $age + major=.$func_arith_result +- versuffix="$major.$age.$revision" ++ versuffix=$major.$age.$revision + # Darwin ld doesn't like 0 for these options... + func_arith $current + 1 + minor_current=$func_arith_result +- xlcverstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision" ++ xlcverstring="$wl-compatibility_version $wl$minor_current $wl-current_version $wl$minor_current.$revision" + verstring="-compatibility_version $minor_current -current_version $minor_current.$revision" ++ # On Darwin other compilers ++ case $CC in ++ nagfor*) ++ verstring="$wl-compatibility_version $wl$minor_current $wl-current_version $wl$minor_current.$revision" ++ ;; ++ *) ++ verstring="-compatibility_version $minor_current -current_version $minor_current.$revision" ++ ;; ++ esac + ;; + + freebsd-aout) +- major=".$current" +- versuffix=".$current.$revision"; ++ major=.$current ++ versuffix=.$current.$revision + ;; + + freebsd-elf) +- major=".$current" +- versuffix=".$current" ++ major=.$current ++ versuffix=.$current + ;; + + irix | nonstopux) +- if test "X$lt_irix_increment" = "Xno"; then ++ if test no = "$lt_irix_increment"; then + func_arith $current - $age + else + func_arith $current - $age + 1 +@@ -7430,69 +8706,69 @@ + nonstopux) verstring_prefix=nonstopux ;; + *) verstring_prefix=sgi ;; + esac +- verstring="$verstring_prefix$major.$revision" ++ verstring=$verstring_prefix$major.$revision + + # Add in all the interfaces that we are compatible with. + loop=$revision +- while test "$loop" -ne 0; do ++ while test 0 -ne "$loop"; do + func_arith $revision - $loop + iface=$func_arith_result + func_arith $loop - 1 + loop=$func_arith_result +- verstring="$verstring_prefix$major.$iface:$verstring" ++ verstring=$verstring_prefix$major.$iface:$verstring + done + +- # Before this point, $major must not contain `.'. ++ # Before this point, $major must not contain '.'. + major=.$major +- versuffix="$major.$revision" ++ versuffix=$major.$revision + ;; + + linux) # correct to gnu/linux during the next big refactor + func_arith $current - $age + major=.$func_arith_result +- versuffix="$major.$age.$revision" ++ versuffix=$major.$age.$revision + ;; + + osf) + func_arith $current - $age + major=.$func_arith_result +- versuffix=".$current.$age.$revision" +- verstring="$current.$age.$revision" ++ versuffix=.$current.$age.$revision ++ verstring=$current.$age.$revision + + # Add in all the interfaces that we are compatible with. + loop=$age +- while test "$loop" -ne 0; do ++ while test 0 -ne "$loop"; do + func_arith $current - $loop + iface=$func_arith_result + func_arith $loop - 1 + loop=$func_arith_result +- verstring="$verstring:${iface}.0" ++ verstring=$verstring:$iface.0 + done + + # Make executables depend on our current version. +- func_append verstring ":${current}.0" ++ func_append verstring ":$current.0" + ;; + + qnx) +- major=".$current" +- versuffix=".$current" ++ major=.$current ++ versuffix=.$current + ;; + + sunos) +- major=".$current" +- versuffix=".$current.$revision" ++ major=.$current ++ versuffix=.$current.$revision + ;; + + windows) + # Use '-' rather than '.', since we only want one +- # extension on DOS 8.3 filesystems. ++ # extension on DOS 8.3 file systems. + func_arith $current - $age + major=$func_arith_result +- versuffix="-$major" ++ versuffix=-$major + ;; + + *) +- func_fatal_configuration "unknown library version type \`$version_type'" ++ func_fatal_configuration "unknown library version type '$version_type'" + ;; + esac + +@@ -7506,42 +8782,45 @@ + verstring= + ;; + *) +- verstring="0.0" ++ verstring=0.0 + ;; + esac +- if test "$need_version" = no; then ++ if test no = "$need_version"; then + versuffix= + else +- versuffix=".0.0" ++ versuffix=.0.0 + fi + fi + + # Remove version info from name if versioning should be avoided +- if test "$avoid_version" = yes && test "$need_version" = no; then ++ if test yes,no = "$avoid_version,$need_version"; then + major= + versuffix= +- verstring="" ++ verstring= + fi + + # Check to see if the archive will have undefined symbols. +- if test "$allow_undefined" = yes; then +- if test "$allow_undefined_flag" = unsupported; then +- func_warning "undefined symbols not allowed in $host shared libraries" +- build_libtool_libs=no +- build_old_libs=yes ++ if test yes = "$allow_undefined"; then ++ if test unsupported = "$allow_undefined_flag"; then ++ if test yes = "$build_old_libs"; then ++ func_warning "undefined symbols not allowed in $host shared libraries; building static only" ++ build_libtool_libs=no ++ else ++ func_fatal_error "can't build $host shared library unless -no-undefined is specified" ++ fi + fi + else + # Don't allow undefined symbols. +- allow_undefined_flag="$no_undefined_flag" ++ allow_undefined_flag=$no_undefined_flag + fi + + fi + +- func_generate_dlsyms "$libname" "$libname" "yes" ++ func_generate_dlsyms "$libname" "$libname" : + func_append libobjs " $symfileobj" +- test "X$libobjs" = "X " && libobjs= +- +- if test "$opt_mode" != relink; then ++ test " " = "$libobjs" && libobjs= ++ ++ if test relink != "$opt_mode"; then + # Remove our outputs, but don't remove object files since they + # may have been created when compiling PIC objects. + removelist= +@@ -7550,8 +8829,8 @@ + case $p in + *.$objext | *.gcno) + ;; +- $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*) +- if test "X$precious_files_regex" != "X"; then ++ $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/$libname$release.*) ++ if test -n "$precious_files_regex"; then + if $ECHO "$p" | $EGREP -e "$precious_files_regex" >/dev/null 2>&1 + then + continue +@@ -7567,11 +8846,11 @@ + fi + + # Now set the variables for building old libraries. +- if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then ++ if test yes = "$build_old_libs" && test convenience != "$build_libtool_libs"; then + func_append oldlibs " $output_objdir/$libname.$libext" + + # Transform .lo files to .o files. +- oldobjs="$objs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; $lo2o" | $NL2SP` ++ oldobjs="$objs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.$libext$/d; $lo2o" | $NL2SP` + fi + + # Eliminate all temporary directories. +@@ -7592,13 +8871,13 @@ + *) func_append finalize_rpath " $libdir" ;; + esac + done +- if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then ++ if test yes != "$hardcode_into_libs" || test yes = "$build_old_libs"; then + dependency_libs="$temp_xrpath $dependency_libs" + fi + fi + + # Make sure dlfiles contains only unique files that won't be dlpreopened +- old_dlfiles="$dlfiles" ++ old_dlfiles=$dlfiles + dlfiles= + for lib in $old_dlfiles; do + case " $dlprefiles $dlfiles " in +@@ -7608,7 +8887,7 @@ + done + + # Make sure dlprefiles contains only unique files +- old_dlprefiles="$dlprefiles" ++ old_dlprefiles=$dlprefiles + dlprefiles= + for lib in $old_dlprefiles; do + case "$dlprefiles " in +@@ -7617,7 +8896,7 @@ + esac + done + +- if test "$build_libtool_libs" = yes; then ++ if test yes = "$build_libtool_libs"; then + if test -n "$rpath"; then + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc* | *-*-haiku*) +@@ -7641,7 +8920,7 @@ + ;; + *) + # Add libc to deplibs on all other systems if necessary. +- if test "$build_libtool_need_lc" = "yes"; then ++ if test yes = "$build_libtool_need_lc"; then + func_append deplibs " -lc" + fi + ;; +@@ -7657,9 +8936,9 @@ + # I'm not sure if I'm treating the release correctly. I think + # release should show up in the -l (ie -lgmp5) so we don't want to + # add it in twice. Is that correct? +- release="" +- versuffix="" +- major="" ++ release= ++ versuffix= ++ major= + newdeplibs= + droppeddeps=no + case $deplibs_check_method in +@@ -7688,20 +8967,20 @@ + -l*) + func_stripname -l '' "$i" + name=$func_stripname_result +- if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then ++ if test yes = "$allow_libtool_libs_with_static_runtimes"; then + case " $predeps $postdeps " in + *" $i "*) + func_append newdeplibs " $i" +- i="" ++ i= + ;; + esac + fi +- if test -n "$i" ; then ++ if test -n "$i"; then + libname=`eval "\\$ECHO \"$libname_spec\""` + deplib_matches=`eval "\\$ECHO \"$library_names_spec\""` + set dummy $deplib_matches; shift + deplib_match=$1 +- if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then ++ if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0; then + func_append newdeplibs " $i" + else + droppeddeps=yes +@@ -7731,20 +9010,20 @@ + $opt_dry_run || $RM conftest + if $LTCC $LTCFLAGS -o conftest conftest.c $i; then + ldd_output=`ldd conftest` +- if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then ++ if test yes = "$allow_libtool_libs_with_static_runtimes"; then + case " $predeps $postdeps " in + *" $i "*) + func_append newdeplibs " $i" +- i="" ++ i= + ;; + esac + fi +- if test -n "$i" ; then ++ if test -n "$i"; then + libname=`eval "\\$ECHO \"$libname_spec\""` + deplib_matches=`eval "\\$ECHO \"$library_names_spec\""` + set dummy $deplib_matches; shift + deplib_match=$1 +- if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then ++ if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0; then + func_append newdeplibs " $i" + else + droppeddeps=yes +@@ -7781,24 +9060,24 @@ + -l*) + func_stripname -l '' "$a_deplib" + name=$func_stripname_result +- if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then ++ if test yes = "$allow_libtool_libs_with_static_runtimes"; then + case " $predeps $postdeps " in + *" $a_deplib "*) + func_append newdeplibs " $a_deplib" +- a_deplib="" ++ a_deplib= + ;; + esac + fi +- if test -n "$a_deplib" ; then ++ if test -n "$a_deplib"; then + libname=`eval "\\$ECHO \"$libname_spec\""` + if test -n "$file_magic_glob"; then + libnameglob=`func_echo_all "$libname" | $SED -e $file_magic_glob` + else + libnameglob=$libname + fi +- test "$want_nocaseglob" = yes && nocaseglob=`shopt -p nocaseglob` ++ test yes = "$want_nocaseglob" && nocaseglob=`shopt -p nocaseglob` + for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do +- if test "$want_nocaseglob" = yes; then ++ if test yes = "$want_nocaseglob"; then + shopt -s nocaseglob + potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null` + $nocaseglob +@@ -7816,25 +9095,25 @@ + # We might still enter an endless loop, since a link + # loop can be closed while we follow links, + # but so what? +- potlib="$potent_lib" ++ potlib=$potent_lib + while test -h "$potlib" 2>/dev/null; do +- potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'` ++ potliblink=`ls -ld $potlib | $SED 's/.* -> //'` + case $potliblink in +- [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";; +- *) potlib=`$ECHO "$potlib" | $SED 's,[^/]*$,,'`"$potliblink";; ++ [\\/]* | [A-Za-z]:[\\/]*) potlib=$potliblink;; ++ *) potlib=`$ECHO "$potlib" | $SED 's|[^/]*$||'`"$potliblink";; + esac + done + if eval $file_magic_cmd \"\$potlib\" 2>/dev/null | + $SED -e 10q | + $EGREP "$file_magic_regex" > /dev/null; then + func_append newdeplibs " $a_deplib" +- a_deplib="" ++ a_deplib= + break 2 + fi + done + done + fi +- if test -n "$a_deplib" ; then ++ if test -n "$a_deplib"; then + droppeddeps=yes + echo + $ECHO "*** Warning: linker path does not have real file for library $a_deplib." +@@ -7842,7 +9121,7 @@ + echo "*** you link to this library. But I can only do this if you have a" + echo "*** shared version of the library, which you do not appear to have" + echo "*** because I did check the linker path looking for a file starting" +- if test -z "$potlib" ; then ++ if test -z "$potlib"; then + $ECHO "*** with $libname but no candidates were found. (...for file magic test)" + else + $ECHO "*** with $libname and none of the candidates passed a file format test" +@@ -7865,30 +9144,30 @@ + -l*) + func_stripname -l '' "$a_deplib" + name=$func_stripname_result +- if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then ++ if test yes = "$allow_libtool_libs_with_static_runtimes"; then + case " $predeps $postdeps " in + *" $a_deplib "*) + func_append newdeplibs " $a_deplib" +- a_deplib="" ++ a_deplib= + ;; + esac + fi +- if test -n "$a_deplib" ; then ++ if test -n "$a_deplib"; then + libname=`eval "\\$ECHO \"$libname_spec\""` + for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do + potential_libs=`ls $i/$libname[.-]* 2>/dev/null` + for potent_lib in $potential_libs; do +- potlib="$potent_lib" # see symlink-check above in file_magic test ++ potlib=$potent_lib # see symlink-check above in file_magic test + if eval "\$ECHO \"$potent_lib\"" 2>/dev/null | $SED 10q | \ + $EGREP "$match_pattern_regex" > /dev/null; then + func_append newdeplibs " $a_deplib" +- a_deplib="" ++ a_deplib= + break 2 + fi + done + done + fi +- if test -n "$a_deplib" ; then ++ if test -n "$a_deplib"; then + droppeddeps=yes + echo + $ECHO "*** Warning: linker path does not have real file for library $a_deplib." +@@ -7896,7 +9175,7 @@ + echo "*** you link to this library. But I can only do this if you have a" + echo "*** shared version of the library, which you do not appear to have" + echo "*** because I did check the linker path looking for a file starting" +- if test -z "$potlib" ; then ++ if test -z "$potlib"; then + $ECHO "*** with $libname but no candidates were found. (...for regex pattern test)" + else + $ECHO "*** with $libname and none of the candidates passed a file format test" +@@ -7912,18 +9191,18 @@ + done # Gone through all deplibs. + ;; + none | unknown | *) +- newdeplibs="" ++ newdeplibs= + tmp_deplibs=`$ECHO " $deplibs" | $SED 's/ -lc$//; s/ -[LR][^ ]*//g'` +- if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then +- for i in $predeps $postdeps ; do ++ if test yes = "$allow_libtool_libs_with_static_runtimes"; then ++ for i in $predeps $postdeps; do + # can't use Xsed below, because $i might contain '/' +- tmp_deplibs=`$ECHO " $tmp_deplibs" | $SED "s,$i,,"` ++ tmp_deplibs=`$ECHO " $tmp_deplibs" | $SED "s|$i||"` + done + fi + case $tmp_deplibs in + *[!\ \ ]*) + echo +- if test "X$deplibs_check_method" = "Xnone"; then ++ if test none = "$deplibs_check_method"; then + echo "*** Warning: inter-library dependencies are not supported in this platform." + else + echo "*** Warning: inter-library dependencies are not known to be supported." +@@ -7947,8 +9226,8 @@ + ;; + esac + +- if test "$droppeddeps" = yes; then +- if test "$module" = yes; then ++ if test yes = "$droppeddeps"; then ++ if test yes = "$module"; then + echo + echo "*** Warning: libtool could not satisfy all declared inter-library" + $ECHO "*** dependencies of module $libname. Therefore, libtool will create" +@@ -7957,12 +9236,12 @@ + if test -z "$global_symbol_pipe"; then + echo + echo "*** However, this would only work if libtool was able to extract symbol" +- echo "*** lists from a program, using \`nm' or equivalent, but libtool could" ++ echo "*** lists from a program, using 'nm' or equivalent, but libtool could" + echo "*** not find such a program. So, this module is probably useless." +- echo "*** \`nm' from GNU binutils and a full rebuild may help." ++ echo "*** 'nm' from GNU binutils and a full rebuild may help." + fi +- if test "$build_old_libs" = no; then +- oldlibs="$output_objdir/$libname.$libext" ++ if test no = "$build_old_libs"; then ++ oldlibs=$output_objdir/$libname.$libext + build_libtool_libs=module + build_old_libs=yes + else +@@ -7973,14 +9252,14 @@ + echo "*** automatically added whenever a program is linked with this library" + echo "*** or is declared to -dlopen it." + +- if test "$allow_undefined" = no; then ++ if test no = "$allow_undefined"; then + echo + echo "*** Since this library must not contain undefined symbols," + echo "*** because either the platform does not support them or" + echo "*** it was explicitly requested with -no-undefined," + echo "*** libtool will only create a static version of it." +- if test "$build_old_libs" = no; then +- oldlibs="$output_objdir/$libname.$libext" ++ if test no = "$build_old_libs"; then ++ oldlibs=$output_objdir/$libname.$libext + build_libtool_libs=module + build_old_libs=yes + else +@@ -8026,7 +9305,7 @@ + *) func_append new_libs " $deplib" ;; + esac + done +- deplibs="$new_libs" ++ deplibs=$new_libs + + # All the library-specific variables (install_libdir is set above). + library_names= +@@ -8034,25 +9313,25 @@ + dlname= + + # Test again, we may have decided not to build it any more +- if test "$build_libtool_libs" = yes; then +- # Remove ${wl} instances when linking with ld. ++ if test yes = "$build_libtool_libs"; then ++ # Remove $wl instances when linking with ld. + # FIXME: should test the right _cmds variable. + case $archive_cmds in + *\$LD\ *) wl= ;; + esac +- if test "$hardcode_into_libs" = yes; then ++ if test yes = "$hardcode_into_libs"; then + # Hardcode the library paths + hardcode_libdirs= + dep_rpath= +- rpath="$finalize_rpath" +- test "$opt_mode" != relink && rpath="$compile_rpath$rpath" ++ rpath=$finalize_rpath ++ test relink = "$opt_mode" || rpath=$compile_rpath$rpath + for libdir in $rpath; do + if test -n "$hardcode_libdir_flag_spec"; then + if test -n "$hardcode_libdir_separator"; then + func_replace_sysroot "$libdir" + libdir=$func_replace_sysroot_result + if test -z "$hardcode_libdirs"; then +- hardcode_libdirs="$libdir" ++ hardcode_libdirs=$libdir + else + # Just accumulate the unique libdirs. + case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in +@@ -8077,7 +9356,7 @@ + # Substitute the hardcoded libdirs into the rpath. + if test -n "$hardcode_libdir_separator" && + test -n "$hardcode_libdirs"; then +- libdir="$hardcode_libdirs" ++ libdir=$hardcode_libdirs + eval "dep_rpath=\"$hardcode_libdir_flag_spec\"" + fi + if test -n "$runpath_var" && test -n "$perm_rpath"; then +@@ -8091,8 +9370,8 @@ + test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs" + fi + +- shlibpath="$finalize_shlibpath" +- test "$opt_mode" != relink && shlibpath="$compile_shlibpath$shlibpath" ++ shlibpath=$finalize_shlibpath ++ test relink = "$opt_mode" || shlibpath=$compile_shlibpath$shlibpath + if test -n "$shlibpath"; then + eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var" + fi +@@ -8102,19 +9381,19 @@ + eval library_names=\"$library_names_spec\" + set dummy $library_names + shift +- realname="$1" ++ realname=$1 + shift + + if test -n "$soname_spec"; then + eval soname=\"$soname_spec\" + else +- soname="$realname" ++ soname=$realname + fi + if test -z "$dlname"; then + dlname=$soname + fi + +- lib="$output_objdir/$realname" ++ lib=$output_objdir/$realname + linknames= + for link + do +@@ -8128,7 +9407,7 @@ + delfiles= + if test -n "$export_symbols" && test -n "$include_expsyms"; then + $opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp" +- export_symbols="$output_objdir/$libname.uexp" ++ export_symbols=$output_objdir/$libname.uexp + func_append delfiles " $export_symbols" + fi + +@@ -8137,31 +9416,31 @@ + cygwin* | mingw* | cegcc*) + if test -n "$export_symbols" && test -z "$export_symbols_regex"; then + # exporting using user supplied symfile +- if test "x`$SED 1q $export_symbols`" != xEXPORTS; then ++ func_dll_def_p "$export_symbols" || { + # and it's NOT already a .def file. Must figure out + # which of the given symbols are data symbols and tag + # them as such. So, trigger use of export_symbols_cmds. + # export_symbols gets reassigned inside the "prepare + # the list of exported symbols" if statement, so the + # include_expsyms logic still works. +- orig_export_symbols="$export_symbols" ++ orig_export_symbols=$export_symbols + export_symbols= + always_export_symbols=yes +- fi ++ } + fi + ;; + esac + + # Prepare the list of exported symbols + if test -z "$export_symbols"; then +- if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then +- func_verbose "generating symbol list for \`$libname.la'" +- export_symbols="$output_objdir/$libname.exp" ++ if test yes = "$always_export_symbols" || test -n "$export_symbols_regex"; then ++ func_verbose "generating symbol list for '$libname.la'" ++ export_symbols=$output_objdir/$libname.exp + $opt_dry_run || $RM $export_symbols + cmds=$export_symbols_cmds +- save_ifs="$IFS"; IFS='~' ++ save_ifs=$IFS; IFS='~' + for cmd1 in $cmds; do +- IFS="$save_ifs" ++ IFS=$save_ifs + # Take the normal branch if the nm_file_list_spec branch + # doesn't work or if tool conversion is not needed. + case $nm_file_list_spec~$to_tool_file_cmd in +@@ -8175,7 +9454,7 @@ + try_normal_branch=no + ;; + esac +- if test "$try_normal_branch" = yes \ ++ if test yes = "$try_normal_branch" \ + && { test "$len" -lt "$max_cmd_len" \ + || test "$max_cmd_len" -le -1; } + then +@@ -8186,7 +9465,7 @@ + output_la=$func_basename_result + save_libobjs=$libobjs + save_output=$output +- output=${output_objdir}/${output_la}.nm ++ output=$output_objdir/$output_la.nm + func_to_tool_file "$output" + libobjs=$nm_file_list_spec$func_to_tool_file_result + func_append delfiles " $output" +@@ -8209,8 +9488,8 @@ + break + fi + done +- IFS="$save_ifs" +- if test -n "$export_symbols_regex" && test "X$skipped_export" != "X:"; then ++ IFS=$save_ifs ++ if test -n "$export_symbols_regex" && test : != "$skipped_export"; then + func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' + func_show_eval '$MV "${export_symbols}T" "$export_symbols"' + fi +@@ -8218,16 +9497,16 @@ + fi + + if test -n "$export_symbols" && test -n "$include_expsyms"; then +- tmp_export_symbols="$export_symbols" +- test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols" ++ tmp_export_symbols=$export_symbols ++ test -n "$orig_export_symbols" && tmp_export_symbols=$orig_export_symbols + $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"' + fi + +- if test "X$skipped_export" != "X:" && test -n "$orig_export_symbols"; then ++ if test : != "$skipped_export" && test -n "$orig_export_symbols"; then + # The given exports_symbols file has to be filtered, so filter it. +- func_verbose "filter symbol list for \`$libname.la' to tag DATA exports" ++ func_verbose "filter symbol list for '$libname.la' to tag DATA exports" + # FIXME: $output_objdir/$libname.filter potentially contains lots of +- # 's' commands which not all seds can handle. GNU sed should be fine ++ # 's' commands, which not all seds can handle. GNU sed should be fine + # though. Also, the filter scales superlinearly with the number of + # global variables. join(1) would be nice here, but unfortunately + # isn't a blessed tool. +@@ -8246,11 +9525,11 @@ + ;; + esac + done +- deplibs="$tmp_deplibs" ++ deplibs=$tmp_deplibs + + if test -n "$convenience"; then + if test -n "$whole_archive_flag_spec" && +- test "$compiler_needs_object" = yes && ++ test yes = "$compiler_needs_object" && + test -z "$libobjs"; then + # extract the archives, so we have objects to list. + # TODO: could optimize this to just extract one archive. +@@ -8261,7 +9540,7 @@ + eval libobjs=\"\$libobjs $whole_archive_flag_spec\" + test "X$libobjs" = "X " && libobjs= + else +- gentop="$output_objdir/${outputname}x" ++ gentop=$output_objdir/${outputname}x + func_append generated " $gentop" + + func_extract_archives $gentop $convenience +@@ -8270,18 +9549,18 @@ + fi + fi + +- if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then ++ if test yes = "$thread_safe" && test -n "$thread_safe_flag_spec"; then + eval flag=\"$thread_safe_flag_spec\" + func_append linker_flags " $flag" + fi + + # Make a backup of the uninstalled library when relinking +- if test "$opt_mode" = relink; then ++ if test relink = "$opt_mode"; then + $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $? + fi + + # Do each of the archive commands. +- if test "$module" = yes && test -n "$module_cmds" ; then ++ if test yes = "$module" && test -n "$module_cmds"; then + if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then + eval test_cmds=\"$module_expsym_cmds\" + cmds=$module_expsym_cmds +@@ -8299,7 +9578,7 @@ + fi + fi + +- if test "X$skipped_export" != "X:" && ++ if test : != "$skipped_export" && + func_len " $test_cmds" && + len=$func_len_result && + test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then +@@ -8332,8 +9611,8 @@ + last_robj= + k=1 + +- if test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "$with_gnu_ld" = yes; then +- output=${output_objdir}/${output_la}.lnkscript ++ if test -n "$save_libobjs" && test : != "$skipped_export" && test yes = "$with_gnu_ld"; then ++ output=$output_objdir/$output_la.lnkscript + func_verbose "creating GNU ld script: $output" + echo 'INPUT (' > $output + for obj in $save_libobjs +@@ -8345,14 +9624,14 @@ + func_append delfiles " $output" + func_to_tool_file "$output" + output=$func_to_tool_file_result +- elif test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "X$file_list_spec" != X; then +- output=${output_objdir}/${output_la}.lnk ++ elif test -n "$save_libobjs" && test : != "$skipped_export" && test -n "$file_list_spec"; then ++ output=$output_objdir/$output_la.lnk + func_verbose "creating linker input file list: $output" + : > $output + set x $save_libobjs + shift + firstobj= +- if test "$compiler_needs_object" = yes; then ++ if test yes = "$compiler_needs_object"; then + firstobj="$1 " + shift + fi +@@ -8367,7 +9646,7 @@ + else + if test -n "$save_libobjs"; then + func_verbose "creating reloadable object files..." +- output=$output_objdir/$output_la-${k}.$objext ++ output=$output_objdir/$output_la-$k.$objext + eval test_cmds=\"$reload_cmds\" + func_len " $test_cmds" + len0=$func_len_result +@@ -8379,13 +9658,13 @@ + func_len " $obj" + func_arith $len + $func_len_result + len=$func_arith_result +- if test "X$objlist" = X || ++ if test -z "$objlist" || + test "$len" -lt "$max_cmd_len"; then + func_append objlist " $obj" + else + # The command $test_cmds is almost too long, add a + # command to the queue. +- if test "$k" -eq 1 ; then ++ if test 1 -eq "$k"; then + # The first file doesn't have a previous command to add. + reload_objs=$objlist + eval concat_cmds=\"$reload_cmds\" +@@ -8395,10 +9674,10 @@ + reload_objs="$objlist $last_robj" + eval concat_cmds=\"\$concat_cmds~$reload_cmds~\$RM $last_robj\" + fi +- last_robj=$output_objdir/$output_la-${k}.$objext ++ last_robj=$output_objdir/$output_la-$k.$objext + func_arith $k + 1 + k=$func_arith_result +- output=$output_objdir/$output_la-${k}.$objext ++ output=$output_objdir/$output_la-$k.$objext + objlist=" $obj" + func_len " $last_robj" + func_arith $len0 + $func_len_result +@@ -8410,9 +9689,9 @@ + # files will link in the last one created. + test -z "$concat_cmds" || concat_cmds=$concat_cmds~ + reload_objs="$objlist $last_robj" +- eval concat_cmds=\"\${concat_cmds}$reload_cmds\" ++ eval concat_cmds=\"\$concat_cmds$reload_cmds\" + if test -n "$last_robj"; then +- eval concat_cmds=\"\${concat_cmds}~\$RM $last_robj\" ++ eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\" + fi + func_append delfiles " $output" + +@@ -8420,9 +9699,9 @@ + output= + fi + +- if ${skipped_export-false}; then +- func_verbose "generating symbol list for \`$libname.la'" +- export_symbols="$output_objdir/$libname.exp" ++ ${skipped_export-false} && { ++ func_verbose "generating symbol list for '$libname.la'" ++ export_symbols=$output_objdir/$libname.exp + $opt_dry_run || $RM $export_symbols + libobjs=$output + # Append the command to create the export file. +@@ -8431,16 +9710,16 @@ + if test -n "$last_robj"; then + eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\" + fi +- fi ++ } + + test -n "$save_libobjs" && + func_verbose "creating a temporary reloadable object file: $output" + + # Loop through the commands generated above and execute them. +- save_ifs="$IFS"; IFS='~' ++ save_ifs=$IFS; IFS='~' + for cmd in $concat_cmds; do +- IFS="$save_ifs" +- $opt_silent || { ++ IFS=$save_ifs ++ $opt_quiet || { + func_quote_for_expand "$cmd" + eval "func_echo $func_quote_for_expand_result" + } +@@ -8448,7 +9727,7 @@ + lt_exit=$? + + # Restore the uninstalled library and exit +- if test "$opt_mode" = relink; then ++ if test relink = "$opt_mode"; then + ( cd "$output_objdir" && \ + $RM "${realname}T" && \ + $MV "${realname}U" "$realname" ) +@@ -8457,7 +9736,7 @@ + exit $lt_exit + } + done +- IFS="$save_ifs" ++ IFS=$save_ifs + + if test -n "$export_symbols_regex" && ${skipped_export-false}; then + func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' +@@ -8465,18 +9744,18 @@ + fi + fi + +- if ${skipped_export-false}; then ++ ${skipped_export-false} && { + if test -n "$export_symbols" && test -n "$include_expsyms"; then +- tmp_export_symbols="$export_symbols" +- test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols" ++ tmp_export_symbols=$export_symbols ++ test -n "$orig_export_symbols" && tmp_export_symbols=$orig_export_symbols + $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"' + fi + + if test -n "$orig_export_symbols"; then + # The given exports_symbols file has to be filtered, so filter it. +- func_verbose "filter symbol list for \`$libname.la' to tag DATA exports" ++ func_verbose "filter symbol list for '$libname.la' to tag DATA exports" + # FIXME: $output_objdir/$libname.filter potentially contains lots of +- # 's' commands which not all seds can handle. GNU sed should be fine ++ # 's' commands, which not all seds can handle. GNU sed should be fine + # though. Also, the filter scales superlinearly with the number of + # global variables. join(1) would be nice here, but unfortunately + # isn't a blessed tool. +@@ -8485,7 +9764,7 @@ + export_symbols=$output_objdir/$libname.def + $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols + fi +- fi ++ } + + libobjs=$output + # Restore the value of output. +@@ -8499,7 +9778,7 @@ + # value of $libobjs for piecewise linking. + + # Do each of the archive commands. +- if test "$module" = yes && test -n "$module_cmds" ; then ++ if test yes = "$module" && test -n "$module_cmds"; then + if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then + cmds=$module_expsym_cmds + else +@@ -8521,7 +9800,7 @@ + + # Add any objects from preloaded convenience libraries + if test -n "$dlprefiles"; then +- gentop="$output_objdir/${outputname}x" ++ gentop=$output_objdir/${outputname}x + func_append generated " $gentop" + + func_extract_archives $gentop $dlprefiles +@@ -8529,11 +9808,12 @@ + test "X$libobjs" = "X " && libobjs= + fi + +- save_ifs="$IFS"; IFS='~' ++ save_ifs=$IFS; IFS='~' + for cmd in $cmds; do +- IFS="$save_ifs" ++ IFS=$sp$nl + eval cmd=\"$cmd\" +- $opt_silent || { ++ IFS=$save_ifs ++ $opt_quiet || { + func_quote_for_expand "$cmd" + eval "func_echo $func_quote_for_expand_result" + } +@@ -8541,7 +9821,7 @@ + lt_exit=$? + + # Restore the uninstalled library and exit +- if test "$opt_mode" = relink; then ++ if test relink = "$opt_mode"; then + ( cd "$output_objdir" && \ + $RM "${realname}T" && \ + $MV "${realname}U" "$realname" ) +@@ -8550,10 +9830,10 @@ + exit $lt_exit + } + done +- IFS="$save_ifs" ++ IFS=$save_ifs + + # Restore the uninstalled library and exit +- if test "$opt_mode" = relink; then ++ if test relink = "$opt_mode"; then + $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $? + + if test -n "$convenience"; then +@@ -8573,39 +9853,39 @@ + done + + # If -module or -export-dynamic was specified, set the dlname. +- if test "$module" = yes || test "$export_dynamic" = yes; then ++ if test yes = "$module" || test yes = "$export_dynamic"; then + # On all known operating systems, these are identical. +- dlname="$soname" ++ dlname=$soname + fi + fi + ;; + + obj) +- if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then +- func_warning "\`-dlopen' is ignored for objects" ++ if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; then ++ func_warning "'-dlopen' is ignored for objects" + fi + + case " $deplibs" in + *\ -l* | *\ -L*) +- func_warning "\`-l' and \`-L' are ignored for objects" ;; ++ func_warning "'-l' and '-L' are ignored for objects" ;; + esac + + test -n "$rpath" && \ +- func_warning "\`-rpath' is ignored for objects" ++ func_warning "'-rpath' is ignored for objects" + + test -n "$xrpath" && \ +- func_warning "\`-R' is ignored for objects" ++ func_warning "'-R' is ignored for objects" + + test -n "$vinfo" && \ +- func_warning "\`-version-info' is ignored for objects" ++ func_warning "'-version-info' is ignored for objects" + + test -n "$release" && \ +- func_warning "\`-release' is ignored for objects" ++ func_warning "'-release' is ignored for objects" + + case $output in + *.lo) + test -n "$objs$old_deplibs" && \ +- func_fatal_error "cannot build library object \`$output' from non-libtool objects" ++ func_fatal_error "cannot build library object '$output' from non-libtool objects" + + libobj=$output + func_lo2o "$libobj" +@@ -8613,7 +9893,7 @@ + ;; + *) + libobj= +- obj="$output" ++ obj=$output + ;; + esac + +@@ -8636,7 +9916,7 @@ + eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\" + reload_conv_objs=$reload_objs\ `$ECHO "$tmp_whole_archive_flags" | $SED 's|,| |g'` + else +- gentop="$output_objdir/${obj}x" ++ gentop=$output_objdir/${obj}x + func_append generated " $gentop" + + func_extract_archives $gentop $convenience +@@ -8645,12 +9925,12 @@ + fi + + # If we're not building shared, we need to use non_pic_objs +- test "$build_libtool_libs" != yes && libobjs="$non_pic_objects" ++ test yes = "$build_libtool_libs" || libobjs=$non_pic_objects + + # Create the old-style object. +- reload_objs="$objs$old_deplibs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; /\.lib$/d; $lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test +- +- output="$obj" ++ reload_objs=$objs$old_deplibs' '`$ECHO "$libobjs" | $SP2NL | $SED "/\.$libext$/d; /\.lib$/d; $lo2o" | $NL2SP`' '$reload_conv_objs ++ ++ output=$obj + func_execute_cmds "$reload_cmds" 'exit $?' + + # Exit if we aren't doing a library object file. +@@ -8662,7 +9942,7 @@ + exit $EXIT_SUCCESS + fi + +- if test "$build_libtool_libs" != yes; then ++ test yes = "$build_libtool_libs" || { + if test -n "$gentop"; then + func_show_eval '${RM}r "$gentop"' + fi +@@ -8672,12 +9952,12 @@ + # $show "echo timestamp > $libobj" + # $opt_dry_run || eval "echo timestamp > $libobj" || exit $? + exit $EXIT_SUCCESS +- fi +- +- if test -n "$pic_flag" || test "$pic_mode" != default; then ++ } ++ ++ if test -n "$pic_flag" || test default != "$pic_mode"; then + # Only do commands if we really have different PIC objects. + reload_objs="$libobjs $reload_conv_objs" +- output="$libobj" ++ output=$libobj + func_execute_cmds "$reload_cmds" 'exit $?' + fi + +@@ -8694,16 +9974,14 @@ + output=$func_stripname_result.exe;; + esac + test -n "$vinfo" && \ +- func_warning "\`-version-info' is ignored for programs" ++ func_warning "'-version-info' is ignored for programs" + + test -n "$release" && \ +- func_warning "\`-release' is ignored for programs" +- +- test "$preload" = yes \ +- && test "$dlopen_support" = unknown \ +- && test "$dlopen_self" = unknown \ +- && test "$dlopen_self_static" = unknown && \ +- func_warning "\`LT_INIT([dlopen])' not used. Assuming no dlopen support." ++ func_warning "'-release' is ignored for programs" ++ ++ $preload \ ++ && test unknown,unknown,unknown = "$dlopen_support,$dlopen_self,$dlopen_self_static" \ ++ && func_warning "'LT_INIT([dlopen])' not used. Assuming no dlopen support." + + case $host in + *-*-rhapsody* | *-*-darwin1.[012]) +@@ -8717,11 +9995,11 @@ + *-*-darwin*) + # Don't allow lazy linking, it breaks C++ global constructors + # But is supposedly fixed on 10.4 or later (yay!). +- if test "$tagname" = CXX ; then ++ if test CXX = "$tagname"; then + case ${MACOSX_DEPLOYMENT_TARGET-10.0} in + 10.[0123]) +- func_append compile_command " ${wl}-bind_at_load" +- func_append finalize_command " ${wl}-bind_at_load" ++ func_append compile_command " $wl-bind_at_load" ++ func_append finalize_command " $wl-bind_at_load" + ;; + esac + fi +@@ -8757,7 +10035,7 @@ + *) func_append new_libs " $deplib" ;; + esac + done +- compile_deplibs="$new_libs" ++ compile_deplibs=$new_libs + + + func_append compile_command " $compile_deplibs" +@@ -8781,7 +10059,7 @@ + if test -n "$hardcode_libdir_flag_spec"; then + if test -n "$hardcode_libdir_separator"; then + if test -z "$hardcode_libdirs"; then +- hardcode_libdirs="$libdir" ++ hardcode_libdirs=$libdir + else + # Just accumulate the unique libdirs. + case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in +@@ -8804,7 +10082,7 @@ + fi + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) +- testbindir=`${ECHO} "$libdir" | ${SED} -e 's*/lib$*/bin*'` ++ testbindir=`$ECHO "$libdir" | $SED -e 's*/lib$*/bin*'` + case :$dllsearchpath: in + *":$libdir:"*) ;; + ::) dllsearchpath=$libdir;; +@@ -8821,10 +10099,10 @@ + # Substitute the hardcoded libdirs into the rpath. + if test -n "$hardcode_libdir_separator" && + test -n "$hardcode_libdirs"; then +- libdir="$hardcode_libdirs" ++ libdir=$hardcode_libdirs + eval rpath=\" $hardcode_libdir_flag_spec\" + fi +- compile_rpath="$rpath" ++ compile_rpath=$rpath + + rpath= + hardcode_libdirs= +@@ -8832,7 +10110,7 @@ + if test -n "$hardcode_libdir_flag_spec"; then + if test -n "$hardcode_libdir_separator"; then + if test -z "$hardcode_libdirs"; then +- hardcode_libdirs="$libdir" ++ hardcode_libdirs=$libdir + else + # Just accumulate the unique libdirs. + case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in +@@ -8857,45 +10135,43 @@ + # Substitute the hardcoded libdirs into the rpath. + if test -n "$hardcode_libdir_separator" && + test -n "$hardcode_libdirs"; then +- libdir="$hardcode_libdirs" ++ libdir=$hardcode_libdirs + eval rpath=\" $hardcode_libdir_flag_spec\" + fi +- finalize_rpath="$rpath" +- +- if test -n "$libobjs" && test "$build_old_libs" = yes; then ++ finalize_rpath=$rpath ++ ++ if test -n "$libobjs" && test yes = "$build_old_libs"; then + # Transform all the library objects into standard objects. + compile_command=`$ECHO "$compile_command" | $SP2NL | $SED "$lo2o" | $NL2SP` + finalize_command=`$ECHO "$finalize_command" | $SP2NL | $SED "$lo2o" | $NL2SP` + fi + +- func_generate_dlsyms "$outputname" "@PROGRAM@" "no" ++ func_generate_dlsyms "$outputname" "@PROGRAM@" false + + # template prelinking step + if test -n "$prelink_cmds"; then + func_execute_cmds "$prelink_cmds" 'exit $?' + fi + +- wrappers_required=yes ++ wrappers_required=: + case $host in + *cegcc* | *mingw32ce*) + # Disable wrappers for cegcc and mingw32ce hosts, we are cross compiling anyway. +- wrappers_required=no ++ wrappers_required=false + ;; + *cygwin* | *mingw* ) +- if test "$build_libtool_libs" != yes; then +- wrappers_required=no +- fi ++ test yes = "$build_libtool_libs" || wrappers_required=false + ;; + *) +- if test "$need_relink" = no || test "$build_libtool_libs" != yes; then +- wrappers_required=no ++ if test no = "$need_relink" || test yes != "$build_libtool_libs"; then ++ wrappers_required=false + fi + ;; + esac +- if test "$wrappers_required" = no; then ++ $wrappers_required || { + # Replace the output file specification. + compile_command=`$ECHO "$compile_command" | $SED 's%@OUTPUT@%'"$output"'%g'` +- link_command="$compile_command$compile_rpath" ++ link_command=$compile_command$compile_rpath + + # We have no uninstalled library dependencies, so finalize right now. + exit_status=0 +@@ -8908,12 +10184,12 @@ + fi + + # Delete the generated files. +- if test -f "$output_objdir/${outputname}S.${objext}"; then +- func_show_eval '$RM "$output_objdir/${outputname}S.${objext}"' ++ if test -f "$output_objdir/${outputname}S.$objext"; then ++ func_show_eval '$RM "$output_objdir/${outputname}S.$objext"' + fi + + exit $exit_status +- fi ++ } + + if test -n "$compile_shlibpath$finalize_shlibpath"; then + compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command" +@@ -8943,9 +10219,9 @@ + fi + fi + +- if test "$no_install" = yes; then ++ if test yes = "$no_install"; then + # We don't need to create a wrapper script. +- link_command="$compile_var$compile_command$compile_rpath" ++ link_command=$compile_var$compile_command$compile_rpath + # Replace the output file specification. + link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output"'%g'` + # Delete the old output file. +@@ -8962,27 +10238,28 @@ + exit $EXIT_SUCCESS + fi + +- if test "$hardcode_action" = relink; then +- # Fast installation is not supported +- link_command="$compile_var$compile_command$compile_rpath" +- relink_command="$finalize_var$finalize_command$finalize_rpath" +- +- func_warning "this platform does not like uninstalled shared libraries" +- func_warning "\`$output' will be relinked during installation" +- else +- if test "$fast_install" != no; then +- link_command="$finalize_var$compile_command$finalize_rpath" +- if test "$fast_install" = yes; then +- relink_command=`$ECHO "$compile_var$compile_command$compile_rpath" | $SED 's%@OUTPUT@%\$progdir/\$file%g'` +- else +- # fast_install is set to needless +- relink_command= +- fi +- else +- link_command="$compile_var$compile_command$compile_rpath" +- relink_command="$finalize_var$finalize_command$finalize_rpath" +- fi +- fi ++ case $hardcode_action,$fast_install in ++ relink,*) ++ # Fast installation is not supported ++ link_command=$compile_var$compile_command$compile_rpath ++ relink_command=$finalize_var$finalize_command$finalize_rpath ++ ++ func_warning "this platform does not like uninstalled shared libraries" ++ func_warning "'$output' will be relinked during installation" ++ ;; ++ *,yes) ++ link_command=$finalize_var$compile_command$finalize_rpath ++ relink_command=`$ECHO "$compile_var$compile_command$compile_rpath" | $SED 's%@OUTPUT@%\$progdir/\$file%g'` ++ ;; ++ *,no) ++ link_command=$compile_var$compile_command$compile_rpath ++ relink_command=$finalize_var$finalize_command$finalize_rpath ++ ;; ++ *,needless) ++ link_command=$finalize_var$compile_command$finalize_rpath ++ relink_command= ++ ;; ++ esac + + # Replace the output file specification. + link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'` +@@ -9039,8 +10316,8 @@ + func_dirname_and_basename "$output" "" "." + output_name=$func_basename_result + output_path=$func_dirname_result +- cwrappersource="$output_path/$objdir/lt-$output_name.c" +- cwrapper="$output_path/$output_name.exe" ++ cwrappersource=$output_path/$objdir/lt-$output_name.c ++ cwrapper=$output_path/$output_name.exe + $RM $cwrappersource $cwrapper + trap "$RM $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15 + +@@ -9061,7 +10338,7 @@ + trap "$RM $func_ltwrapper_scriptname_result; exit $EXIT_FAILURE" 1 2 15 + $opt_dry_run || { + # note: this script will not be executed, so do not chmod. +- if test "x$build" = "x$host" ; then ++ if test "x$build" = "x$host"; then + $cwrapper --lt-dump-script > $func_ltwrapper_scriptname_result + else + func_emit_wrapper no > $func_ltwrapper_scriptname_result +@@ -9084,25 +10361,27 @@ + # See if we need to build an old-fashioned archive. + for oldlib in $oldlibs; do + +- if test "$build_libtool_libs" = convenience; then +- oldobjs="$libobjs_save $symfileobj" +- addlibs="$convenience" +- build_libtool_libs=no +- else +- if test "$build_libtool_libs" = module; then +- oldobjs="$libobjs_save" ++ case $build_libtool_libs in ++ convenience) ++ oldobjs="$libobjs_save $symfileobj" ++ addlibs=$convenience + build_libtool_libs=no +- else ++ ;; ++ module) ++ oldobjs=$libobjs_save ++ addlibs=$old_convenience ++ build_libtool_libs=no ++ ;; ++ *) + oldobjs="$old_deplibs $non_pic_objects" +- if test "$preload" = yes && test -f "$symfileobj"; then +- func_append oldobjs " $symfileobj" +- fi +- fi +- addlibs="$old_convenience" +- fi ++ $preload && test -f "$symfileobj" \ ++ && func_append oldobjs " $symfileobj" ++ addlibs=$old_convenience ++ ;; ++ esac + + if test -n "$addlibs"; then +- gentop="$output_objdir/${outputname}x" ++ gentop=$output_objdir/${outputname}x + func_append generated " $gentop" + + func_extract_archives $gentop $addlibs +@@ -9110,13 +10389,13 @@ + fi + + # Do each command in the archive commands. +- if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then ++ if test -n "$old_archive_from_new_cmds" && test yes = "$build_libtool_libs"; then + cmds=$old_archive_from_new_cmds + else + + # Add any objects from preloaded convenience libraries + if test -n "$dlprefiles"; then +- gentop="$output_objdir/${outputname}x" ++ gentop=$output_objdir/${outputname}x + func_append generated " $gentop" + + func_extract_archives $gentop $dlprefiles +@@ -9137,7 +10416,7 @@ + : + else + echo "copying selected object files to avoid basename conflicts..." +- gentop="$output_objdir/${outputname}x" ++ gentop=$output_objdir/${outputname}x + func_append generated " $gentop" + func_mkdir_p "$gentop" + save_oldobjs=$oldobjs +@@ -9146,7 +10425,7 @@ + for obj in $save_oldobjs + do + func_basename "$obj" +- objbase="$func_basename_result" ++ objbase=$func_basename_result + case " $oldobjs " in + " ") oldobjs=$obj ;; + *[\ /]"$objbase "*) +@@ -9215,18 +10494,18 @@ + else + # the above command should be used before it gets too long + oldobjs=$objlist +- if test "$obj" = "$last_oldobj" ; then ++ if test "$obj" = "$last_oldobj"; then + RANLIB=$save_RANLIB + fi + test -z "$concat_cmds" || concat_cmds=$concat_cmds~ +- eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\" ++ eval concat_cmds=\"\$concat_cmds$old_archive_cmds\" + objlist= + len=$len0 + fi + done + RANLIB=$save_RANLIB + oldobjs=$objlist +- if test "X$oldobjs" = "X" ; then ++ if test -z "$oldobjs"; then + eval cmds=\"\$concat_cmds\" + else + eval cmds=\"\$concat_cmds~\$old_archive_cmds\" +@@ -9243,7 +10522,7 @@ + case $output in + *.la) + old_library= +- test "$build_old_libs" = yes && old_library="$libname.$libext" ++ test yes = "$build_old_libs" && old_library=$libname.$libext + func_verbose "creating $output" + + # Preserve any variables that may affect compiler behavior +@@ -9258,31 +10537,31 @@ + fi + done + # Quote the link command for shipping. +- relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)" ++ relink_command="(cd `pwd`; $SHELL \"$progpath\" $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)" + relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"` +- if test "$hardcode_automatic" = yes ; then ++ if test yes = "$hardcode_automatic"; then + relink_command= + fi + + # Only create the output if not a dry run. + $opt_dry_run || { + for installed in no yes; do +- if test "$installed" = yes; then ++ if test yes = "$installed"; then + if test -z "$install_libdir"; then + break + fi +- output="$output_objdir/$outputname"i ++ output=$output_objdir/${outputname}i + # Replace all uninstalled libtool libraries with the installed ones + newdependency_libs= + for deplib in $dependency_libs; do + case $deplib in + *.la) + func_basename "$deplib" +- name="$func_basename_result" ++ name=$func_basename_result + func_resolve_sysroot "$deplib" +- eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $func_resolve_sysroot_result` ++ eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $func_resolve_sysroot_result` + test -z "$libdir" && \ +- func_fatal_error "\`$deplib' is not a valid libtool archive" ++ func_fatal_error "'$deplib' is not a valid libtool archive" + func_append newdependency_libs " ${lt_sysroot:+=}$libdir/$name" + ;; + -L*) +@@ -9298,23 +10577,23 @@ + *) func_append newdependency_libs " $deplib" ;; + esac + done +- dependency_libs="$newdependency_libs" ++ dependency_libs=$newdependency_libs + newdlfiles= + + for lib in $dlfiles; do + case $lib in + *.la) + func_basename "$lib" +- name="$func_basename_result" +- eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` ++ name=$func_basename_result ++ eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $lib` + test -z "$libdir" && \ +- func_fatal_error "\`$lib' is not a valid libtool archive" ++ func_fatal_error "'$lib' is not a valid libtool archive" + func_append newdlfiles " ${lt_sysroot:+=}$libdir/$name" + ;; + *) func_append newdlfiles " $lib" ;; + esac + done +- dlfiles="$newdlfiles" ++ dlfiles=$newdlfiles + newdlprefiles= + for lib in $dlprefiles; do + case $lib in +@@ -9324,34 +10603,34 @@ + # didn't already link the preopened objects directly into + # the library: + func_basename "$lib" +- name="$func_basename_result" +- eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` ++ name=$func_basename_result ++ eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $lib` + test -z "$libdir" && \ +- func_fatal_error "\`$lib' is not a valid libtool archive" ++ func_fatal_error "'$lib' is not a valid libtool archive" + func_append newdlprefiles " ${lt_sysroot:+=}$libdir/$name" + ;; + esac + done +- dlprefiles="$newdlprefiles" ++ dlprefiles=$newdlprefiles + else + newdlfiles= + for lib in $dlfiles; do + case $lib in +- [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; ++ [\\/]* | [A-Za-z]:[\\/]*) abs=$lib ;; + *) abs=`pwd`"/$lib" ;; + esac + func_append newdlfiles " $abs" + done +- dlfiles="$newdlfiles" ++ dlfiles=$newdlfiles + newdlprefiles= + for lib in $dlprefiles; do + case $lib in +- [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; ++ [\\/]* | [A-Za-z]:[\\/]*) abs=$lib ;; + *) abs=`pwd`"/$lib" ;; + esac + func_append newdlprefiles " $abs" + done +- dlprefiles="$newdlprefiles" ++ dlprefiles=$newdlprefiles + fi + $RM $output + # place dlname in correct position for cygwin +@@ -9367,10 +10646,9 @@ + case $host,$output,$installed,$module,$dlname in + *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll) + # If a -bindir argument was supplied, place the dll there. +- if test "x$bindir" != x ; +- then ++ if test -n "$bindir"; then + func_relative_path "$install_libdir" "$bindir" +- tdlname=$func_relative_path_result$dlname ++ tdlname=$func_relative_path_result/$dlname + else + # Otherwise fall back on heuristic. + tdlname=../bin/$dlname +@@ -9379,7 +10657,7 @@ + esac + $ECHO > $output "\ + # $outputname - a libtool library file +-# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION ++# Generated by $PROGRAM (GNU $PACKAGE) $VERSION + # + # Please DO NOT delete this file! + # It is necessary for linking the library. +@@ -9393,7 +10671,7 @@ + # The name of the static archive. + old_library='$old_library' + +-# Linker flags that can not go in dependency_libs. ++# Linker flags that cannot go in dependency_libs. + inherited_linker_flags='$new_inherited_linker_flags' + + # Libraries that this one depends upon. +@@ -9419,7 +10697,7 @@ + + # Directory that this library needs to be installed in: + libdir='$install_libdir'" +- if test "$installed" = no && test "$need_relink" = yes; then ++ if test no,yes = "$installed,$need_relink"; then + $ECHO >> $output "\ + relink_command=\"$relink_command\"" + fi +@@ -9434,27 +10712,29 @@ + exit $EXIT_SUCCESS + } + +-{ test "$opt_mode" = link || test "$opt_mode" = relink; } && +- func_mode_link ${1+"$@"} ++if test link = "$opt_mode" || test relink = "$opt_mode"; then ++ func_mode_link ${1+"$@"} ++fi + + + # func_mode_uninstall arg... + func_mode_uninstall () + { +- $opt_debug +- RM="$nonopt" ++ $debug_cmd ++ ++ RM=$nonopt + files= +- rmforce= ++ rmforce=false + exit_status=0 + + # This variable tells wrapper scripts just to set variables rather + # than running their programs. +- libtool_install_magic="$magic" ++ libtool_install_magic=$magic + + for arg + do + case $arg in +- -f) func_append RM " $arg"; rmforce=yes ;; ++ -f) func_append RM " $arg"; rmforce=: ;; + -*) func_append RM " $arg" ;; + *) func_append files " $arg" ;; + esac +@@ -9467,18 +10747,18 @@ + + for file in $files; do + func_dirname "$file" "" "." +- dir="$func_dirname_result" +- if test "X$dir" = X.; then +- odir="$objdir" ++ dir=$func_dirname_result ++ if test . = "$dir"; then ++ odir=$objdir + else +- odir="$dir/$objdir" ++ odir=$dir/$objdir + fi + func_basename "$file" +- name="$func_basename_result" +- test "$opt_mode" = uninstall && odir="$dir" ++ name=$func_basename_result ++ test uninstall = "$opt_mode" && odir=$dir + + # Remember odir for removal later, being careful to avoid duplicates +- if test "$opt_mode" = clean; then ++ if test clean = "$opt_mode"; then + case " $rmdirs " in + *" $odir "*) ;; + *) func_append rmdirs " $odir" ;; +@@ -9493,11 +10773,11 @@ + elif test -d "$file"; then + exit_status=1 + continue +- elif test "$rmforce" = yes; then ++ elif $rmforce; then + continue + fi + +- rmfiles="$file" ++ rmfiles=$file + + case $name in + *.la) +@@ -9511,7 +10791,7 @@ + done + test -n "$old_library" && func_append rmfiles " $odir/$old_library" + +- case "$opt_mode" in ++ case $opt_mode in + clean) + case " $library_names " in + *" $dlname "*) ;; +@@ -9522,12 +10802,12 @@ + uninstall) + if test -n "$library_names"; then + # Do each command in the postuninstall commands. +- func_execute_cmds "$postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1' ++ func_execute_cmds "$postuninstall_cmds" '$rmforce || exit_status=1' + fi + + if test -n "$old_library"; then + # Do each command in the old_postuninstall commands. +- func_execute_cmds "$old_postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1' ++ func_execute_cmds "$old_postuninstall_cmds" '$rmforce || exit_status=1' + fi + # FIXME: should reinstall the best remaining shared library. + ;; +@@ -9543,21 +10823,19 @@ + func_source $dir/$name + + # Add PIC object to the list of files to remove. +- if test -n "$pic_object" && +- test "$pic_object" != none; then ++ if test -n "$pic_object" && test none != "$pic_object"; then + func_append rmfiles " $dir/$pic_object" + fi + + # Add non-PIC object to the list of files to remove. +- if test -n "$non_pic_object" && +- test "$non_pic_object" != none; then ++ if test -n "$non_pic_object" && test none != "$non_pic_object"; then + func_append rmfiles " $dir/$non_pic_object" + fi + fi + ;; + + *) +- if test "$opt_mode" = clean ; then ++ if test clean = "$opt_mode"; then + noexename=$name + case $file in + *.exe) +@@ -9584,12 +10862,12 @@ + + # note $name still contains .exe if it was in $file originally + # as does the version of $file that was added into $rmfiles +- func_append rmfiles " $odir/$name $odir/${name}S.${objext}" +- if test "$fast_install" = yes && test -n "$relink_command"; then ++ func_append rmfiles " $odir/$name $odir/${name}S.$objext" ++ if test yes = "$fast_install" && test -n "$relink_command"; then + func_append rmfiles " $odir/lt-$name" + fi +- if test "X$noexename" != "X$name" ; then +- func_append rmfiles " $odir/lt-${noexename}.c" ++ if test "X$noexename" != "X$name"; then ++ func_append rmfiles " $odir/lt-$noexename.c" + fi + fi + fi +@@ -9598,7 +10876,7 @@ + func_show_eval "$RM $rmfiles" 'exit_status=1' + done + +- # Try to remove the ${objdir}s in the directories where we deleted files ++ # Try to remove the $objdir's in the directories where we deleted files + for dir in $rmdirs; do + if test -d "$dir"; then + func_show_eval "rmdir $dir >/dev/null 2>&1" +@@ -9608,16 +10886,17 @@ + exit $exit_status + } + +-{ test "$opt_mode" = uninstall || test "$opt_mode" = clean; } && +- func_mode_uninstall ${1+"$@"} ++if test uninstall = "$opt_mode" || test clean = "$opt_mode"; then ++ func_mode_uninstall ${1+"$@"} ++fi + + test -z "$opt_mode" && { +- help="$generic_help" ++ help=$generic_help + func_fatal_help "you must specify a MODE" + } + + test -z "$exec_cmd" && \ +- func_fatal_help "invalid operation mode \`$opt_mode'" ++ func_fatal_help "invalid operation mode '$opt_mode'" + + if test -n "$exec_cmd"; then + eval exec "$exec_cmd" +@@ -9628,7 +10907,7 @@ + + + # The TAGs below are defined such that we never get into a situation +-# in which we disable both kinds of libraries. Given conflicting ++# where we disable both kinds of libraries. Given conflicting + # choices, we go for a static library, that is the most portable, + # since we can't tell whether shared libraries were disabled because + # the user asked for that or because the platform doesn't support +@@ -9651,5 +10930,3 @@ + # mode:shell-script + # sh-indentation:2 + # End: +-# vi:sw=2 +- +diff -r c0e311e010fc Modules/_ctypes/libffi/m4/ax_gcc_archflag.m4 +--- a/Modules/_ctypes/libffi/m4/ax_gcc_archflag.m4 ++++ b/Modules/_ctypes/libffi/m4/ax_gcc_archflag.m4 +@@ -155,7 +155,7 @@ + sparc*) + AC_PATH_PROG([PRTDIAG], [prtdiag], [prtdiag], [$PATH:/usr/platform/`uname -i`/sbin/:/usr/platform/`uname -m`/sbin/]) + cputype=`(((grep cpu /proc/cpuinfo | cut -d: -f2) ; ($PRTDIAG -v |grep -i sparc) ; grep -i cpu /var/run/dmesg.boot ) | head -n 1) 2> /dev/null` +- cputype=`echo "$cputype" | tr -d ' -' |tr $as_cr_LETTERS $as_cr_letters` ++ cputype=`echo "$cputype" | tr -d ' -' | sed 's/SPARCIIi/SPARCII/' | tr $as_cr_LETTERS $as_cr_letters` + case $cputype in + *ultrasparciv*) ax_gcc_arch="ultrasparc4 ultrasparc3 ultrasparc v9" ;; + *ultrasparciii*) ax_gcc_arch="ultrasparc3 ultrasparc v9" ;; +diff -r c0e311e010fc Modules/_ctypes/libffi/m4/libtool.m4 +--- a/Modules/_ctypes/libffi/m4/libtool.m4 ++++ b/Modules/_ctypes/libffi/m4/libtool.m4 +@@ -1,8 +1,6 @@ + # libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- + # +-# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, +-# 2006, 2007, 2008, 2009, 2010, 2011 Free Software +-# Foundation, Inc. ++# Copyright (C) 1996-2001, 2003-2013 Free Software Foundation, Inc. + # Written by Gordon Matzigkeit, 1996 + # + # This file is free software; the Free Software Foundation gives +@@ -39,7 +37,7 @@ + # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + ]) + +-# serial 57 LT_INIT ++# serial 58 LT_INIT + + + # LT_PREREQ(VERSION) +@@ -91,7 +89,7 @@ + _LT_SET_OPTIONS([$0], [$1]) + + # This can be used to rebuild libtool when needed +-LIBTOOL_DEPS="$ltmain" ++LIBTOOL_DEPS=$ltmain + + # Always use our own libtool. + LIBTOOL='$(SHELL) $(top_builddir)/libtool' +@@ -130,7 +128,7 @@ + # _LT_FILEUTILS_DEFAULTS + # ---------------------- + # It is okay to use these file commands and assume they have been set +-# sensibly after `m4_require([_LT_FILEUTILS_DEFAULTS])'. ++# sensibly after 'm4_require([_LT_FILEUTILS_DEFAULTS])'. + m4_defun([_LT_FILEUTILS_DEFAULTS], + [: ${CP="cp -f"} + : ${MV="mv -f"} +@@ -179,13 +177,13 @@ + m4_require([_LT_WITH_SYSROOT])dnl + + _LT_CONFIG_LIBTOOL_INIT([ +-# See if we are running on zsh, and set the options which allow our ++# See if we are running on zsh, and set the options that allow our + # commands through without removal of \ escapes INIT. +-if test -n "\${ZSH_VERSION+set}" ; then ++if test -n "\${ZSH_VERSION+set}"; then + setopt NO_GLOB_SUBST + fi + ]) +-if test -n "${ZSH_VERSION+set}" ; then ++if test -n "${ZSH_VERSION+set}"; then + setopt NO_GLOB_SUBST + fi + +@@ -198,7 +196,7 @@ + # AIX sometimes has problems with the GCC collect2 program. For some + # reason, if we set the COLLECT_NAMES environment variable, the problems + # vanish in a puff of smoke. +- if test "X${COLLECT_NAMES+set}" != Xset; then ++ if test set != "${COLLECT_NAMES+set}"; then + COLLECT_NAMES= + export COLLECT_NAMES + fi +@@ -209,14 +207,14 @@ + ofile=libtool + can_build_shared=yes + +-# All known linkers require a `.a' archive for static linking (except MSVC, ++# All known linkers require a '.a' archive for static linking (except MSVC, + # which needs '.lib'). + libext=a + +-with_gnu_ld="$lt_cv_prog_gnu_ld" +- +-old_CC="$CC" +-old_CFLAGS="$CFLAGS" ++with_gnu_ld=$lt_cv_prog_gnu_ld ++ ++old_CC=$CC ++old_CFLAGS=$CFLAGS + + # Set sane defaults for various variables + test -z "$CC" && CC=cc +@@ -269,14 +267,14 @@ + + # _LT_PROG_LTMAIN + # --------------- +-# Note that this code is called both from `configure', and `config.status' ++# Note that this code is called both from 'configure', and 'config.status' + # now that we use AC_CONFIG_COMMANDS to generate libtool. Notably, +-# `config.status' has no value for ac_aux_dir unless we are using Automake, ++# 'config.status' has no value for ac_aux_dir unless we are using Automake, + # so we pass a copy along to make sure it has a sensible value anyway. + m4_defun([_LT_PROG_LTMAIN], + [m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl + _LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir']) +-ltmain="$ac_aux_dir/ltmain.sh" ++ltmain=$ac_aux_dir/ltmain.sh + ])# _LT_PROG_LTMAIN + + +@@ -286,7 +284,7 @@ + + # So that we can recreate a full libtool script including additional + # tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS +-# in macros and then make a single call at the end using the `libtool' ++# in macros and then make a single call at the end using the 'libtool' + # label. + + +@@ -421,8 +419,8 @@ + + # _LT_CONFIG_STATUS_DECLARE([VARNAME]) + # ------------------------------------ +-# Quote a variable value, and forward it to `config.status' so that its +-# declaration there will have the same value as in `configure'. VARNAME ++# Quote a variable value, and forward it to 'config.status' so that its ++# declaration there will have the same value as in 'configure'. VARNAME + # must have a single quote delimited value for this to work. + m4_define([_LT_CONFIG_STATUS_DECLARE], + [$1='`$ECHO "$][$1" | $SED "$delay_single_quote_subst"`']) +@@ -446,7 +444,7 @@ + # Output comment and list of tags supported by the script + m4_defun([_LT_LIBTOOL_TAGS], + [_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl +-available_tags="_LT_TAGS"dnl ++available_tags='_LT_TAGS'dnl + ]) + + +@@ -474,7 +472,7 @@ + # _LT_LIBTOOL_CONFIG_VARS + # ----------------------- + # Produce commented declarations of non-tagged libtool config variables +-# suitable for insertion in the LIBTOOL CONFIG section of the `libtool' ++# suitable for insertion in the LIBTOOL CONFIG section of the 'libtool' + # script. Tagged libtool config variables (even for the LIBTOOL CONFIG + # section) are produced by _LT_LIBTOOL_TAG_VARS. + m4_defun([_LT_LIBTOOL_CONFIG_VARS], +@@ -500,8 +498,8 @@ + # Send accumulated output to $CONFIG_STATUS. Thanks to the lists of + # variables for single and double quote escaping we saved from calls + # to _LT_DECL, we can put quote escaped variables declarations +-# into `config.status', and then the shell code to quote escape them in +-# for loops in `config.status'. Finally, any additional code accumulated ++# into 'config.status', and then the shell code to quote escape them in ++# for loops in 'config.status'. Finally, any additional code accumulated + # from calls to _LT_CONFIG_LIBTOOL_INIT is expanded. + m4_defun([_LT_CONFIG_COMMANDS], + [AC_PROVIDE_IFELSE([LT_OUTPUT], +@@ -547,7 +545,7 @@ + ]], lt_decl_quote_varnames); do + case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in + *[[\\\\\\\`\\"\\\$]]*) +- eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ++ eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes + ;; + *) + eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" +@@ -560,7 +558,7 @@ + ]], lt_decl_dquote_varnames); do + case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in + *[[\\\\\\\`\\"\\\$]]*) +- eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ++ eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes + ;; + *) + eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" +@@ -576,7 +574,7 @@ + # Generate a child script FILE with all initialization necessary to + # reuse the environment learned by the parent script, and make the + # file executable. If COMMENT is supplied, it is inserted after the +-# `#!' sequence but before initialization text begins. After this ++# '#!' sequence but before initialization text begins. After this + # macro, additional text can be appended to FILE to form the body of + # the child script. The macro ends with non-zero status if the + # file could not be fully written (such as if the disk is full). +@@ -598,7 +596,7 @@ + _AS_PREPARE + exec AS_MESSAGE_FD>&1 + _ASEOF +-test $lt_write_fail = 0 && chmod +x $1[]dnl ++test 0 = "$lt_write_fail" && chmod +x $1[]dnl + m4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_INIT + + # LT_OUTPUT +@@ -621,7 +619,7 @@ + } >&AS_MESSAGE_LOG_FD + + lt_cl_help="\ +-\`$as_me' creates a local libtool stub from the current configuration, ++'$as_me' creates a local libtool stub from the current configuration, + for use in further configure time tests before the real libtool is + generated. + +@@ -643,7 +641,7 @@ + This config.lt script is free software; the Free Software Foundation + gives unlimited permision to copy, distribute and modify it." + +-while test $[#] != 0 ++while test 0 != $[#] + do + case $[1] in + --version | --v* | -V ) +@@ -656,10 +654,10 @@ + lt_cl_silent=: ;; + + -*) AC_MSG_ERROR([unrecognized option: $[1] +-Try \`$[0] --help' for more information.]) ;; ++Try '$[0] --help' for more information.]) ;; + + *) AC_MSG_ERROR([unrecognized argument: $[1] +-Try \`$[0] --help' for more information.]) ;; ++Try '$[0] --help' for more information.]) ;; + esac + shift + done +@@ -685,7 +683,7 @@ + # open by configure. Here we exec the FD to /dev/null, effectively closing + # config.log, so it can be properly (re)opened and appended to by config.lt. + lt_cl_success=: +-test "$silent" = yes && ++test yes = "$silent" && + lt_config_lt_args="$lt_config_lt_args --quiet" + exec AS_MESSAGE_LOG_FD>/dev/null + $SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false +@@ -705,13 +703,13 @@ + _LT_CONFIG_SAVE_COMMANDS([ + m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl + m4_if(_LT_TAG, [C], [ +- # See if we are running on zsh, and set the options which allow our ++ # See if we are running on zsh, and set the options that allow our + # commands through without removal of \ escapes. +- if test -n "${ZSH_VERSION+set}" ; then ++ if test -n "${ZSH_VERSION+set}"; then + setopt NO_GLOB_SUBST + fi + +- cfgfile="${ofile}T" ++ cfgfile=${ofile}T + trap "$RM \"$cfgfile\"; exit 1" 1 2 15 + $RM "$cfgfile" + +@@ -719,7 +717,7 @@ + #! $SHELL + + # `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. +-# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION ++# Generated automatically by $as_me ($PACKAGE) $VERSION + # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: + # NOTE: Changes made to this file will be lost: look at ltmain.sh. + # +@@ -739,7 +737,7 @@ + # AIX sometimes has problems with the GCC collect2 program. For some + # reason, if we set the COLLECT_NAMES environment variable, the problems + # vanish in a puff of smoke. +-if test "X${COLLECT_NAMES+set}" != Xset; then ++if test set != "${COLLECT_NAMES+set}"; then + COLLECT_NAMES= + export COLLECT_NAMES + fi +@@ -756,8 +754,6 @@ + sed '$q' "$ltmain" >> "$cfgfile" \ + || (rm -f "$cfgfile"; exit 1) + +- _LT_PROG_REPLACE_SHELLFNS +- + mv -f "$cfgfile" "$ofile" || + (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") + chmod +x "$ofile" +@@ -775,7 +771,6 @@ + [m4_if([$1], [], [ + PACKAGE='$PACKAGE' + VERSION='$VERSION' +- TIMESTAMP='$TIMESTAMP' + RM='$RM' + ofile='$ofile'], []) + ])dnl /_LT_CONFIG_SAVE_COMMANDS +@@ -974,7 +969,7 @@ + + AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod], + [lt_cv_apple_cc_single_mod=no +- if test -z "${LT_MULTI_MODULE}"; then ++ if test -z "$LT_MULTI_MODULE"; then + # By default we will add the -single_module flag. You can override + # by either setting the environment variable LT_MULTI_MODULE + # non-empty at configure time, or by adding -multi_module to the +@@ -992,7 +987,7 @@ + cat conftest.err >&AS_MESSAGE_LOG_FD + # Otherwise, if the output was created with a 0 exit code from + # the compiler, it worked. +- elif test -f libconftest.dylib && test $_lt_result -eq 0; then ++ elif test -f libconftest.dylib && test 0 = "$_lt_result"; then + lt_cv_apple_cc_single_mod=yes + else + cat conftest.err >&AS_MESSAGE_LOG_FD +@@ -1010,7 +1005,7 @@ + AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], + [lt_cv_ld_exported_symbols_list=yes], + [lt_cv_ld_exported_symbols_list=no]) +- LDFLAGS="$save_LDFLAGS" ++ LDFLAGS=$save_LDFLAGS + ]) + + AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load], +@@ -1032,7 +1027,7 @@ + _lt_result=$? + if test -s conftest.err && $GREP force_load conftest.err; then + cat conftest.err >&AS_MESSAGE_LOG_FD +- elif test -f conftest && test $_lt_result -eq 0 && $GREP forced_load conftest >/dev/null 2>&1 ; then ++ elif test -f conftest && test 0 = "$_lt_result" && $GREP forced_load conftest >/dev/null 2>&1; then + lt_cv_ld_force_load=yes + else + cat conftest.err >&AS_MESSAGE_LOG_FD +@@ -1042,32 +1037,32 @@ + ]) + case $host_os in + rhapsody* | darwin1.[[012]]) +- _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;; ++ _lt_dar_allow_undefined='$wl-undefined ${wl}suppress' ;; + darwin1.*) +- _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; ++ _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; + darwin*) # darwin 5.x on + # if running on 10.5 or later, the deployment target defaults + # to the OS version, if on x86, and 10.4, the deployment + # target defaults to 10.4. Don't you love it? + case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in + 10.0,*86*-darwin8*|10.0,*-darwin[[91]]*) +- _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; ++ _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; + 10.[[012]]*) +- _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; ++ _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; + 10.*) +- _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; ++ _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; + esac + ;; + esac +- if test "$lt_cv_apple_cc_single_mod" = "yes"; then ++ if test yes = "$lt_cv_apple_cc_single_mod"; then + _lt_dar_single_mod='$single_module' + fi +- if test "$lt_cv_ld_exported_symbols_list" = "yes"; then +- _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym' ++ if test yes = "$lt_cv_ld_exported_symbols_list"; then ++ _lt_dar_export_syms=' $wl-exported_symbols_list,$output_objdir/$libname-symbols.expsym' + else +- _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}' ++ _lt_dar_export_syms='~$NMEDIT -s $output_objdir/$libname-symbols.expsym $lib' + fi +- if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then ++ if test : != "$DSYMUTIL" && test no = "$lt_cv_ld_force_load"; then + _lt_dsymutil='~$DSYMUTIL $lib || :' + else + _lt_dsymutil= +@@ -1087,29 +1082,29 @@ + _LT_TAGVAR(hardcode_direct, $1)=no + _LT_TAGVAR(hardcode_automatic, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported +- if test "$lt_cv_ld_force_load" = "yes"; then +- _LT_TAGVAR(whole_archive_flag_spec, $1)='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' ++ if test yes = "$lt_cv_ld_force_load"; then ++ _LT_TAGVAR(whole_archive_flag_spec, $1)='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience $wl-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' + m4_case([$1], [F77], [_LT_TAGVAR(compiler_needs_object, $1)=yes], + [FC], [_LT_TAGVAR(compiler_needs_object, $1)=yes]) + else + _LT_TAGVAR(whole_archive_flag_spec, $1)='' + fi + _LT_TAGVAR(link_all_deplibs, $1)=yes +- _LT_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined" ++ _LT_TAGVAR(allow_undefined_flag, $1)=$_lt_dar_allow_undefined + case $cc_basename in +- ifort*) _lt_dar_can_shared=yes ;; ++ ifort*|nagfor*) _lt_dar_can_shared=yes ;; + *) _lt_dar_can_shared=$GCC ;; + esac +- if test "$_lt_dar_can_shared" = "yes"; then ++ if test yes = "$_lt_dar_can_shared"; then + output_verbose_link_cmd=func_echo_all +- _LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" +- _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" +- _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" +- _LT_TAGVAR(module_expsym_cmds, $1)="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" ++ _LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dsymutil" ++ _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dsymutil" ++ _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil" ++ _LT_TAGVAR(module_expsym_cmds, $1)="sed -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil" + m4_if([$1], [CXX], +-[ if test "$lt_cv_apple_cc_single_mod" != "yes"; then +- _LT_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dsymutil}" +- _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dar_export_syms}${_lt_dsymutil}" ++[ if test yes != "$lt_cv_apple_cc_single_mod"; then ++ _LT_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dsymutil" ++ _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dar_export_syms$_lt_dsymutil" + fi + ],[]) + else +@@ -1129,7 +1124,7 @@ + # Allow to override them for all tags through lt_cv_aix_libpath. + m4_defun([_LT_SYS_MODULE_PATH_AIX], + [m4_require([_LT_DECL_SED])dnl +-if test "${lt_cv_aix_libpath+set}" = set; then ++if test set = "${lt_cv_aix_libpath+set}"; then + aix_libpath=$lt_cv_aix_libpath + else + AC_CACHE_VAL([_LT_TAGVAR([lt_cv_aix_libpath_], [$1])], +@@ -1147,7 +1142,7 @@ + _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + fi],[]) + if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then +- _LT_TAGVAR([lt_cv_aix_libpath_], [$1])="/usr/lib:/lib" ++ _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=/usr/lib:/lib + fi + ]) + aix_libpath=$_LT_TAGVAR([lt_cv_aix_libpath_], [$1]) +@@ -1167,8 +1162,8 @@ + # ----------------------- + # Find how we can fake an echo command that does not interpret backslash. + # In particular, with Autoconf 2.60 or later we add some code to the start +-# of the generated configure script which will find a shell with a builtin +-# printf (which we can use as an echo command). ++# of the generated configure script that will find a shell with a builtin ++# printf (that we can use as an echo command). + m4_defun([_LT_PROG_ECHO_BACKSLASH], + [ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' + ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO +@@ -1196,10 +1191,10 @@ + # Invoke $ECHO with all args, space-separated. + func_echo_all () + { +- $ECHO "$*" ++ $ECHO "$*" + } + +-case "$ECHO" in ++case $ECHO in + printf*) AC_MSG_RESULT([printf]) ;; + print*) AC_MSG_RESULT([print -r]) ;; + *) AC_MSG_RESULT([cat]) ;; +@@ -1225,16 +1220,17 @@ + AC_DEFUN([_LT_WITH_SYSROOT], + [AC_MSG_CHECKING([for sysroot]) + AC_ARG_WITH([sysroot], +-[ --with-sysroot[=DIR] Search for dependent libraries within DIR +- (or the compiler's sysroot if not specified).], ++[AS_HELP_STRING([--with-sysroot@<:@=DIR@:>@], ++ [Search for dependent libraries within DIR (or the compiler's sysroot ++ if not specified).])], + [], [with_sysroot=no]) + + dnl lt_sysroot will always be passed unquoted. We quote it here + dnl in case the user passed a directory name. + lt_sysroot= +-case ${with_sysroot} in #( ++case $with_sysroot in #( + yes) +- if test "$GCC" = yes; then ++ if test yes = "$GCC"; then + lt_sysroot=`$CC --print-sysroot 2>/dev/null` + fi + ;; #( +@@ -1244,14 +1240,14 @@ + no|'') + ;; #( + *) +- AC_MSG_RESULT([${with_sysroot}]) ++ AC_MSG_RESULT([$with_sysroot]) + AC_MSG_ERROR([The sysroot must be an absolute path.]) + ;; + esac + + AC_MSG_RESULT([${lt_sysroot:-no}]) + _LT_DECL([], [lt_sysroot], [0], [The root where to search for ]dnl +-[dependent libraries, and in which our libraries should be installed.])]) ++[dependent libraries, and where our libraries should be installed.])]) + + # _LT_ENABLE_LOCK + # --------------- +@@ -1259,31 +1255,33 @@ + [AC_ARG_ENABLE([libtool-lock], + [AS_HELP_STRING([--disable-libtool-lock], + [avoid locking (might break parallel builds)])]) +-test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes ++test no = "$enable_libtool_lock" || enable_libtool_lock=yes + + # Some flags need to be propagated to the compiler or linker for good + # libtool support. + case $host in + ia64-*-hpux*) +- # Find out which ABI we are using. ++ # Find out what ABI is being produced by ac_compile, and set mode ++ # options accordingly. + echo 'int i;' > conftest.$ac_ext + if AC_TRY_EVAL(ac_compile); then + case `/usr/bin/file conftest.$ac_objext` in + *ELF-32*) +- HPUX_IA64_MODE="32" ++ HPUX_IA64_MODE=32 + ;; + *ELF-64*) +- HPUX_IA64_MODE="64" ++ HPUX_IA64_MODE=64 + ;; + esac + fi + rm -rf conftest* + ;; + *-*-irix6*) +- # Find out which ABI we are using. ++ # Find out what ABI is being produced by ac_compile, and set linker ++ # options accordingly. + echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext + if AC_TRY_EVAL(ac_compile); then +- if test "$lt_cv_prog_gnu_ld" = yes; then ++ if test yes = "$lt_cv_prog_gnu_ld"; then + case `/usr/bin/file conftest.$ac_objext` in + *32-bit*) + LD="${LD-ld} -melf32bsmip" +@@ -1312,9 +1310,46 @@ + rm -rf conftest* + ;; + +-x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \ ++mips64*-*linux*) ++ # Find out what ABI is being produced by ac_compile, and set linker ++ # options accordingly. ++ echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext ++ if AC_TRY_EVAL(ac_compile); then ++ emul=elf ++ case `/usr/bin/file conftest.$ac_objext` in ++ *32-bit*) ++ emul="${emul}32" ++ ;; ++ *64-bit*) ++ emul="${emul}64" ++ ;; ++ esac ++ case `/usr/bin/file conftest.$ac_objext` in ++ *MSB*) ++ emul="${emul}btsmip" ++ ;; ++ *LSB*) ++ emul="${emul}ltsmip" ++ ;; ++ esac ++ case `/usr/bin/file conftest.$ac_objext` in ++ *N32*) ++ emul="${emul}n32" ++ ;; ++ esac ++ LD="${LD-ld} -m $emul" ++ fi ++ rm -rf conftest* ++ ;; ++ ++x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \ + s390*-*linux*|s390*-*tpf*|sparc*-*linux*) +- # Find out which ABI we are using. ++ # Find out what ABI is being produced by ac_compile, and set linker ++ # options accordingly. Note that the listed cases only cover the ++ # situations where additional linker options are needed (such as when ++ # doing 32-bit compilation for a host where ld defaults to 64-bit, or ++ # vice versa); the common cases where no linker options are needed do ++ # not appear in the list. + echo 'int i;' > conftest.$ac_ext + if AC_TRY_EVAL(ac_compile); then + case `/usr/bin/file conftest.o` in +@@ -1326,14 +1361,17 @@ + x86_64-*linux*) + case `/usr/bin/file conftest.o` in + *x86-64*) +- LD="${LD-ld} -m elf32_x86_64" +- ;; ++ LD="${LD-ld} -m elf32_x86_64" ++ ;; + *) +- LD="${LD-ld} -m elf_i386" +- ;; ++ LD="${LD-ld} -m elf_i386" ++ ;; + esac + ;; +- ppc64-*linux*|powerpc64-*linux*) ++ powerpc64le-*linux*) ++ LD="${LD-ld} -m elf32lppclinux" ++ ;; ++ powerpc64-*linux*) + LD="${LD-ld} -m elf32ppclinux" + ;; + s390x-*linux*) +@@ -1352,7 +1390,10 @@ + x86_64-*linux*) + LD="${LD-ld} -m elf_x86_64" + ;; +- ppc*-*linux*|powerpc*-*linux*) ++ powerpcle-*linux*) ++ LD="${LD-ld} -m elf64lppc" ++ ;; ++ powerpc-*linux*) + LD="${LD-ld} -m elf64ppc" + ;; + s390*-*linux*|s390*-*tpf*) +@@ -1370,19 +1411,20 @@ + + *-*-sco3.2v5*) + # On SCO OpenServer 5, we need -belf to get full-featured binaries. +- SAVE_CFLAGS="$CFLAGS" ++ SAVE_CFLAGS=$CFLAGS + CFLAGS="$CFLAGS -belf" + AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf, + [AC_LANG_PUSH(C) + AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no]) + AC_LANG_POP]) +- if test x"$lt_cv_cc_needs_belf" != x"yes"; then ++ if test yes != "$lt_cv_cc_needs_belf"; then + # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf +- CFLAGS="$SAVE_CFLAGS" ++ CFLAGS=$SAVE_CFLAGS + fi + ;; + *-*solaris*) +- # Find out which ABI we are using. ++ # Find out what ABI is being produced by ac_compile, and set linker ++ # options accordingly. + echo 'int i;' > conftest.$ac_ext + if AC_TRY_EVAL(ac_compile); then + case `/usr/bin/file conftest.o` in +@@ -1390,7 +1432,7 @@ + case $lt_cv_prog_gnu_ld in + yes*) + case $host in +- i?86-*-solaris*) ++ i?86-*-solaris*|x86_64-*-solaris*) + LD="${LD-ld} -m elf_x86_64" + ;; + sparc*-*-solaris*) +@@ -1399,7 +1441,7 @@ + esac + # GNU ld 2.21 introduced _sol2 emulations. Use them if available. + if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then +- LD="${LD-ld}_sol2" ++ LD=${LD-ld}_sol2 + fi + ;; + *) +@@ -1415,7 +1457,7 @@ + ;; + esac + +-need_locks="$enable_libtool_lock" ++need_locks=$enable_libtool_lock + ])# _LT_ENABLE_LOCK + + +@@ -1434,11 +1476,11 @@ + [echo conftest.$ac_objext > conftest.lst + lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&AS_MESSAGE_LOG_FD' + AC_TRY_EVAL([lt_ar_try]) +- if test "$ac_status" -eq 0; then ++ if test 0 -eq "$ac_status"; then + # Ensure the archiver fails upon bogus file names. + rm -f conftest.$ac_objext libconftest.a + AC_TRY_EVAL([lt_ar_try]) +- if test "$ac_status" -ne 0; then ++ if test 0 -ne "$ac_status"; then + lt_cv_ar_at_file=@ + fi + fi +@@ -1446,7 +1488,7 @@ + ]) + ]) + +-if test "x$lt_cv_ar_at_file" = xno; then ++if test no = "$lt_cv_ar_at_file"; then + archiver_list_spec= + else + archiver_list_spec=$lt_cv_ar_at_file +@@ -1477,7 +1519,7 @@ + + if test -n "$RANLIB"; then + case $host_os in +- openbsd*) ++ bitrig* | openbsd*) + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib" + ;; + *) +@@ -1513,7 +1555,7 @@ + [$2=no + m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4]) + echo "$lt_simple_compile_test_code" > conftest.$ac_ext +- lt_compiler_flag="$3" ++ lt_compiler_flag="$3" ## exclude from sc_useless_quotes_in_assignment + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins +@@ -1540,7 +1582,7 @@ + $RM conftest* + ]) + +-if test x"[$]$2" = xyes; then ++if test yes = "[$]$2"; then + m4_if([$5], , :, [$5]) + else + m4_if([$6], , :, [$6]) +@@ -1562,7 +1604,7 @@ + m4_require([_LT_DECL_SED])dnl + AC_CACHE_CHECK([$1], [$2], + [$2=no +- save_LDFLAGS="$LDFLAGS" ++ save_LDFLAGS=$LDFLAGS + LDFLAGS="$LDFLAGS $3" + echo "$lt_simple_link_test_code" > conftest.$ac_ext + if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then +@@ -1581,10 +1623,10 @@ + fi + fi + $RM -r conftest* +- LDFLAGS="$save_LDFLAGS" ++ LDFLAGS=$save_LDFLAGS + ]) + +-if test x"[$]$2" = xyes; then ++if test yes = "[$]$2"; then + m4_if([$4], , :, [$4]) + else + m4_if([$5], , :, [$5]) +@@ -1605,7 +1647,7 @@ + AC_MSG_CHECKING([the maximum length of command line arguments]) + AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl + i=0 +- teststring="ABCD" ++ teststring=ABCD + + case $build_os in + msdosdjgpp*) +@@ -1645,7 +1687,7 @@ + lt_cv_sys_max_cmd_len=8192; + ;; + +- netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) ++ bitrig* | darwin* | dragonfly* | freebsd* | netbsd* | openbsd*) + # This has been around since 386BSD, at least. Likely further. + if test -x /sbin/sysctl; then + lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` +@@ -1696,22 +1738,22 @@ + *) + lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` + if test -n "$lt_cv_sys_max_cmd_len" && \ +- test undefined != "$lt_cv_sys_max_cmd_len"; then ++ test undefined != "$lt_cv_sys_max_cmd_len"; then + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` + else + # Make teststring a little bigger before we do anything with it. + # a 1K string should be a reasonable start. +- for i in 1 2 3 4 5 6 7 8 ; do ++ for i in 1 2 3 4 5 6 7 8; do + teststring=$teststring$teststring + done + SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} + # If test is not a shell built-in, we'll probably end up computing a + # maximum length that is only half of the actual maximum length, but + # we can't tell. +- while { test "X"`env echo "$teststring$teststring" 2>/dev/null` \ ++ while { test X`env echo "$teststring$teststring" 2>/dev/null` \ + = "X$teststring$teststring"; } >/dev/null 2>&1 && +- test $i != 17 # 1/2 MB should be enough ++ test 17 != "$i" # 1/2 MB should be enough + do + i=`expr $i + 1` + teststring=$teststring$teststring +@@ -1727,7 +1769,7 @@ + ;; + esac + ]) +-if test -n $lt_cv_sys_max_cmd_len ; then ++if test -n "$lt_cv_sys_max_cmd_len"; then + AC_MSG_RESULT($lt_cv_sys_max_cmd_len) + else + AC_MSG_RESULT(none) +@@ -1755,7 +1797,7 @@ + # ---------------------------------------------------------------- + m4_defun([_LT_TRY_DLOPEN_SELF], + [m4_require([_LT_HEADER_DLFCN])dnl +-if test "$cross_compiling" = yes; then : ++if test yes = "$cross_compiling"; then : + [$4] + else + lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 +@@ -1804,7 +1846,7 @@ + + /* When -fvisbility=hidden is used, assume the code has been annotated + correspondingly for the symbols needed. */ +-#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) ++#if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) + int fnord () __attribute__((visibility("default"))); + #endif + +@@ -1830,7 +1872,7 @@ + return status; + }] + _LT_EOF +- if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then ++ if AC_TRY_EVAL(ac_link) && test -s "conftest$ac_exeext" 2>/dev/null; then + (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null + lt_status=$? + case x$lt_status in +@@ -1851,7 +1893,7 @@ + # ------------------ + AC_DEFUN([LT_SYS_DLOPEN_SELF], + [m4_require([_LT_HEADER_DLFCN])dnl +-if test "x$enable_dlopen" != xyes; then ++if test yes != "$enable_dlopen"; then + enable_dlopen=unknown + enable_dlopen_self=unknown + enable_dlopen_self_static=unknown +@@ -1861,44 +1903,52 @@ + + case $host_os in + beos*) +- lt_cv_dlopen="load_add_on" ++ lt_cv_dlopen=load_add_on + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes + ;; + + mingw* | pw32* | cegcc*) +- lt_cv_dlopen="LoadLibrary" ++ lt_cv_dlopen=LoadLibrary + lt_cv_dlopen_libs= + ;; + + cygwin*) +- lt_cv_dlopen="dlopen" ++ lt_cv_dlopen=dlopen + lt_cv_dlopen_libs= + ;; + + darwin*) +- # if libdl is installed we need to link against it ++ # if libdl is installed we need to link against it + AC_CHECK_LIB([dl], [dlopen], +- [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[ +- lt_cv_dlopen="dyld" ++ [lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl],[ ++ lt_cv_dlopen=dyld + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes + ]) + ;; + ++ tpf*) ++ # Don't try to run any link tests for TPF. We know it's impossible ++ # because TPF is a cross-compiler, and we know how we open DSOs. ++ lt_cv_dlopen=dlopen ++ lt_cv_dlopen_libs= ++ lt_cv_dlopen_self=no ++ ;; ++ + *) + AC_CHECK_FUNC([shl_load], +- [lt_cv_dlopen="shl_load"], ++ [lt_cv_dlopen=shl_load], + [AC_CHECK_LIB([dld], [shl_load], +- [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"], ++ [lt_cv_dlopen=shl_load lt_cv_dlopen_libs=-ldld], + [AC_CHECK_FUNC([dlopen], +- [lt_cv_dlopen="dlopen"], ++ [lt_cv_dlopen=dlopen], + [AC_CHECK_LIB([dl], [dlopen], +- [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"], ++ [lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl], + [AC_CHECK_LIB([svld], [dlopen], +- [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"], ++ [lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-lsvld], + [AC_CHECK_LIB([dld], [dld_link], +- [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"]) ++ [lt_cv_dlopen=dld_link lt_cv_dlopen_libs=-ldld]) + ]) + ]) + ]) +@@ -1907,21 +1957,21 @@ + ;; + esac + +- if test "x$lt_cv_dlopen" != xno; then ++ if test no = "$lt_cv_dlopen"; then ++ enable_dlopen=no ++ else + enable_dlopen=yes +- else +- enable_dlopen=no + fi + + case $lt_cv_dlopen in + dlopen) +- save_CPPFLAGS="$CPPFLAGS" +- test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" +- +- save_LDFLAGS="$LDFLAGS" ++ save_CPPFLAGS=$CPPFLAGS ++ test yes = "$ac_cv_header_dlfcn_h" && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" ++ ++ save_LDFLAGS=$LDFLAGS + wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" + +- save_LIBS="$LIBS" ++ save_LIBS=$LIBS + LIBS="$lt_cv_dlopen_libs $LIBS" + + AC_CACHE_CHECK([whether a program can dlopen itself], +@@ -1931,7 +1981,7 @@ + lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross) + ]) + +- if test "x$lt_cv_dlopen_self" = xyes; then ++ if test yes = "$lt_cv_dlopen_self"; then + wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" + AC_CACHE_CHECK([whether a statically linked program can dlopen itself], + lt_cv_dlopen_self_static, [dnl +@@ -1941,9 +1991,9 @@ + ]) + fi + +- CPPFLAGS="$save_CPPFLAGS" +- LDFLAGS="$save_LDFLAGS" +- LIBS="$save_LIBS" ++ CPPFLAGS=$save_CPPFLAGS ++ LDFLAGS=$save_LDFLAGS ++ LIBS=$save_LIBS + ;; + esac + +@@ -2035,8 +2085,8 @@ + m4_require([_LT_FILEUTILS_DEFAULTS])dnl + _LT_COMPILER_C_O([$1]) + +-hard_links="nottested" +-if test "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then ++hard_links=nottested ++if test no = "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" && test no != "$need_locks"; then + # do not overwrite the value of need_locks provided by the user + AC_MSG_CHECKING([if we can lock with hard links]) + hard_links=yes +@@ -2046,8 +2096,8 @@ + ln conftest.a conftest.b 2>&5 || hard_links=no + ln conftest.a conftest.b 2>/dev/null && hard_links=no + AC_MSG_RESULT([$hard_links]) +- if test "$hard_links" = no; then +- AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe]) ++ if test no = "$hard_links"; then ++ AC_MSG_WARN(['$CC' does not support '-c -o', so 'make -j' may be unsafe]) + need_locks=warn + fi + else +@@ -2074,8 +2124,8 @@ + _LT_DECL([], [objdir], [0], + [The name of the directory that contains temporary libtool files])dnl + m4_pattern_allow([LT_OBJDIR])dnl +-AC_DEFINE_UNQUOTED(LT_OBJDIR, "$lt_cv_objdir/", +- [Define to the sub-directory in which libtool stores uninstalled libraries.]) ++AC_DEFINE_UNQUOTED([LT_OBJDIR], "$lt_cv_objdir/", ++ [Define to the sub-directory where libtool stores uninstalled libraries.]) + ])# _LT_CHECK_OBJDIR + + +@@ -2087,15 +2137,15 @@ + _LT_TAGVAR(hardcode_action, $1)= + if test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" || + test -n "$_LT_TAGVAR(runpath_var, $1)" || +- test "X$_LT_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then ++ test yes = "$_LT_TAGVAR(hardcode_automatic, $1)"; then + + # We can hardcode non-existent directories. +- if test "$_LT_TAGVAR(hardcode_direct, $1)" != no && ++ if test no != "$_LT_TAGVAR(hardcode_direct, $1)" && + # If the only mechanism to avoid hardcoding is shlibpath_var, we + # have to relink, otherwise we might link with an installed library + # when we should be linking with a yet-to-be-installed one +- ## test "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" != no && +- test "$_LT_TAGVAR(hardcode_minus_L, $1)" != no; then ++ ## test no != "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" && ++ test no != "$_LT_TAGVAR(hardcode_minus_L, $1)"; then + # Linking always hardcodes the temporary library directory. + _LT_TAGVAR(hardcode_action, $1)=relink + else +@@ -2109,12 +2159,12 @@ + fi + AC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)]) + +-if test "$_LT_TAGVAR(hardcode_action, $1)" = relink || +- test "$_LT_TAGVAR(inherit_rpath, $1)" = yes; then ++if test relink = "$_LT_TAGVAR(hardcode_action, $1)" || ++ test yes = "$_LT_TAGVAR(inherit_rpath, $1)"; then + # Fast installation is not supported + enable_fast_install=no +-elif test "$shlibpath_overrides_runpath" = yes || +- test "$enable_shared" = no; then ++elif test yes = "$shlibpath_overrides_runpath" || ++ test no = "$enable_shared"; then + # Fast installation is not necessary + enable_fast_install=needless + fi +@@ -2138,7 +2188,7 @@ + # FIXME - insert some real tests, host_os isn't really good enough + case $host_os in + darwin*) +- if test -n "$STRIP" ; then ++ if test -n "$STRIP"; then + striplib="$STRIP -x" + old_striplib="$STRIP -S" + AC_MSG_RESULT([yes]) +@@ -2169,14 +2219,14 @@ + AC_MSG_CHECKING([dynamic linker characteristics]) + m4_if([$1], + [], [ +-if test "$GCC" = yes; then ++if test yes = "$GCC"; then + case $host_os in +- darwin*) lt_awk_arg="/^libraries:/,/LR/" ;; +- *) lt_awk_arg="/^libraries:/" ;; ++ darwin*) lt_awk_arg='/^libraries:/,/LR/' ;; ++ *) lt_awk_arg='/^libraries:/' ;; + esac + case $host_os in +- mingw* | cegcc*) lt_sed_strip_eq="s,=\([[A-Za-z]]:\),\1,g" ;; +- *) lt_sed_strip_eq="s,=/,/,g" ;; ++ mingw* | cegcc*) lt_sed_strip_eq='s|=\([[A-Za-z]]:\)|\1|g' ;; ++ *) lt_sed_strip_eq='s|=/|/|g' ;; + esac + lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` + case $lt_search_path_spec in +@@ -2192,28 +2242,35 @@ + ;; + esac + # Ok, now we have the path, separated by spaces, we can step through it +- # and add multilib dir if necessary. ++ # and add multilib dir if necessary... + lt_tmp_lt_search_path_spec= +- lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` ++ lt_multi_os_dir=/`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` ++ # ...but if some path component already ends with the multilib dir we assume ++ # that all is fine and trust -print-search-dirs as is (GCC 4.2? or newer). ++ case "$lt_multi_os_dir; $lt_search_path_spec " in ++ "/; "* | "/.; "* | "/./; "* | *"$lt_multi_os_dir "* | *"$lt_multi_os_dir/ "*) ++ lt_multi_os_dir= ++ ;; ++ esac + for lt_sys_path in $lt_search_path_spec; do +- if test -d "$lt_sys_path/$lt_multi_os_dir"; then +- lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir" +- else ++ if test -d "$lt_sys_path$lt_multi_os_dir"; then ++ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path$lt_multi_os_dir" ++ elif test -n "$lt_multi_os_dir"; then + test -d "$lt_sys_path" && \ + lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" + fi + done + lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' +-BEGIN {RS=" "; FS="/|\n";} { +- lt_foo=""; +- lt_count=0; ++BEGIN {RS = " "; FS = "/|\n";} { ++ lt_foo = ""; ++ lt_count = 0; + for (lt_i = NF; lt_i > 0; lt_i--) { + if ($lt_i != "" && $lt_i != ".") { + if ($lt_i == "..") { + lt_count++; + } else { + if (lt_count == 0) { +- lt_foo="/" $lt_i lt_foo; ++ lt_foo = "/" $lt_i lt_foo; + } else { + lt_count--; + } +@@ -2227,7 +2284,7 @@ + # for these hosts. + case $host_os in + mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ +- $SED 's,/\([[A-Za-z]]:\),\1,g'` ;; ++ $SED 's|/\([[A-Za-z]]:\)|\1|g'` ;; + esac + sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` + else +@@ -2236,7 +2293,7 @@ + library_names_spec= + libname_spec='lib$name' + soname_spec= +-shrext_cmds=".so" ++shrext_cmds=.so + postinstall_cmds= + postuninstall_cmds= + finish_cmds= +@@ -2256,11 +2313,11 @@ + case $host_os in + aix3*) + version_type=linux # correct to gnu/linux during the next big refactor +- library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' ++ library_names_spec='$libname$release$shared_ext$versuffix $libname.a' + shlibpath_var=LIBPATH + + # AIX 3 has no versioning support, so we append a major version to the name. +- soname_spec='${libname}${release}${shared_ext}$major' ++ soname_spec='$libname$release$shared_ext$major' + ;; + + aix[[4-9]]*) +@@ -2268,40 +2325,40 @@ + need_lib_prefix=no + need_version=no + hardcode_into_libs=yes +- if test "$host_cpu" = ia64; then ++ if test ia64 = "$host_cpu"; then + # AIX 5 supports IA64 +- library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' ++ library_names_spec='$libname$release$shared_ext$major $libname$release$shared_ext$versuffix $libname$shared_ext' + shlibpath_var=LD_LIBRARY_PATH + else + # With GCC up to 2.95.x, collect2 would create an import file + # for dependence libraries. The import file would start with +- # the line `#! .'. This would cause the generated library to +- # depend on `.', always an invalid library. This was fixed in ++ # the line '#! .'. This would cause the generated library to ++ # depend on '.', always an invalid library. This was fixed in + # development snapshots of GCC prior to 3.0. + case $host_os in + aix4 | aix4.[[01]] | aix4.[[01]].*) + if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' + echo ' yes ' +- echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then ++ echo '#endif'; } | $CC -E - | $GREP yes > /dev/null; then + : + else + can_build_shared=no + fi + ;; + esac +- # AIX (on Power*) has no versioning support, so currently we can not hardcode correct ++ # AIX (on Power*) has no versioning support, so currently we cannot hardcode correct + # soname into executable. Probably we can add versioning support to + # collect2, so additional links can be useful in future. +- if test "$aix_use_runtimelinking" = yes; then ++ if test yes = "$aix_use_runtimelinking"; then + # If using run time linking (on AIX 4.2 or later) use lib.so + # instead of lib.a to let people know that these are not + # typical AIX shared libraries. +- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' ++ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + else + # We preserve .a as extension for shared libraries through AIX4.2 + # and later when we are not doing run time linking. +- library_names_spec='${libname}${release}.a $libname.a' +- soname_spec='${libname}${release}${shared_ext}$major' ++ library_names_spec='$libname$release.a $libname.a' ++ soname_spec='$libname$release$shared_ext$major' + fi + shlibpath_var=LIBPATH + fi +@@ -2312,18 +2369,18 @@ + powerpc) + # Since July 2007 AmigaOS4 officially supports .so libraries. + # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. +- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' ++ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + ;; + m68k) + library_names_spec='$libname.ixlibrary $libname.a' + # Create ${libname}_ixlibrary.a entries in /sys/libs. +- finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ++ finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' + ;; + esac + ;; + + beos*) +- library_names_spec='${libname}${shared_ext}' ++ library_names_spec='$libname$shared_ext' + dynamic_linker="$host_os ld.so" + shlibpath_var=LIBRARY_PATH + ;; +@@ -2331,8 +2388,8 @@ + bsdi[[45]]*) + version_type=linux # correct to gnu/linux during the next big refactor + need_version=no +- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' +- soname_spec='${libname}${release}${shared_ext}$major' ++ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' ++ soname_spec='$libname$release$shared_ext$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" +@@ -2344,7 +2401,7 @@ + + cygwin* | mingw* | pw32* | cegcc*) + version_type=windows +- shrext_cmds=".dll" ++ shrext_cmds=.dll + need_version=no + need_lib_prefix=no + +@@ -2353,8 +2410,8 @@ + # gcc + library_names_spec='$libname.dll.a' + # DLL is installed to $(libdir)/../bin by postinstall_cmds +- postinstall_cmds='base_file=`basename \${file}`~ +- dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ ++ postinstall_cmds='base_file=`basename \$file`~ ++ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname~ +@@ -2370,17 +2427,17 @@ + case $host_os in + cygwin*) + # Cygwin DLLs use 'cyg' prefix rather than 'lib' +- soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' ++ soname_spec='`echo $libname | sed -e 's/^lib/cyg/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext' + m4_if([$1], [],[ + sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"]) + ;; + mingw* | cegcc*) + # MinGW DLLs use traditional 'lib' prefix +- soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' ++ soname_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext' + ;; + pw32*) + # pw32 DLLs use 'pw' prefix rather than 'lib' +- library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' ++ library_names_spec='`echo $libname | sed -e 's/^lib/pw/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext' + ;; + esac + dynamic_linker='Win32 ld.exe' +@@ -2389,8 +2446,8 @@ + *,cl*) + # Native MSVC + libname_spec='$name' +- soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' +- library_names_spec='${libname}.dll.lib' ++ soname_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext' ++ library_names_spec='$libname.dll.lib' + + case $build_os in + mingw*) +@@ -2417,7 +2474,7 @@ + sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + ;; + *) +- sys_lib_search_path_spec="$LIB" ++ sys_lib_search_path_spec=$LIB + if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then + # It is most probably a Windows format PATH. + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` +@@ -2430,8 +2487,8 @@ + esac + + # DLL is installed to $(libdir)/../bin by postinstall_cmds +- postinstall_cmds='base_file=`basename \${file}`~ +- dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ ++ postinstall_cmds='base_file=`basename \$file`~ ++ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname' +@@ -2444,7 +2501,7 @@ + + *) + # Assume MSVC wrapper +- library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib' ++ library_names_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext $libname.lib' + dynamic_linker='Win32 ld.exe' + ;; + esac +@@ -2457,8 +2514,8 @@ + version_type=darwin + need_lib_prefix=no + need_version=no +- library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext' +- soname_spec='${libname}${release}${major}$shared_ext' ++ library_names_spec='$libname$release$major$shared_ext $libname$shared_ext' ++ soname_spec='$libname$release$major$shared_ext' + shlibpath_overrides_runpath=yes + shlibpath_var=DYLD_LIBRARY_PATH + shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' +@@ -2471,8 +2528,8 @@ + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no +- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' +- soname_spec='${libname}${release}${shared_ext}$major' ++ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' ++ soname_spec='$libname$release$shared_ext$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +@@ -2490,12 +2547,12 @@ + version_type=freebsd-$objformat + case $version_type in + freebsd-elf*) +- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' ++ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext $libname$shared_ext' + need_version=no + need_lib_prefix=no + ;; + freebsd-*) +- library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' ++ library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' + need_version=yes + ;; + esac +@@ -2520,26 +2577,15 @@ + esac + ;; + +-gnu*) +- version_type=linux # correct to gnu/linux during the next big refactor +- need_lib_prefix=no +- need_version=no +- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' +- soname_spec='${libname}${release}${shared_ext}$major' +- shlibpath_var=LD_LIBRARY_PATH +- shlibpath_overrides_runpath=no +- hardcode_into_libs=yes +- ;; +- + haiku*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + dynamic_linker="$host_os runtime_loader" +- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' +- soname_spec='${libname}${release}${shared_ext}$major' ++ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' ++ soname_spec='$libname$release$shared_ext$major' + shlibpath_var=LIBRARY_PATH +- shlibpath_overrides_runpath=yes ++ shlibpath_overrides_runpath=no + sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' + hardcode_into_libs=yes + ;; +@@ -2557,9 +2603,9 @@ + dynamic_linker="$host_os dld.so" + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. +- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' +- soname_spec='${libname}${release}${shared_ext}$major' +- if test "X$HPUX_IA64_MODE" = X32; then ++ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' ++ soname_spec='$libname$release$shared_ext$major' ++ if test 32 = "$HPUX_IA64_MODE"; then + sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" + else + sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" +@@ -2572,8 +2618,8 @@ + dynamic_linker="$host_os dld.sl" + shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. +- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' +- soname_spec='${libname}${release}${shared_ext}$major' ++ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' ++ soname_spec='$libname$release$shared_ext$major' + sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; +@@ -2582,8 +2628,8 @@ + dynamic_linker="$host_os dld.sl" + shlibpath_var=SHLIB_PATH + shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH +- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' +- soname_spec='${libname}${release}${shared_ext}$major' ++ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' ++ soname_spec='$libname$release$shared_ext$major' + ;; + esac + # HP-UX runs *really* slowly unless shared libraries are mode 555, ... +@@ -2596,8 +2642,8 @@ + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no +- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' +- soname_spec='${libname}${release}${shared_ext}$major' ++ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' ++ soname_spec='$libname$release$shared_ext$major' + dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no +@@ -2608,7 +2654,7 @@ + case $host_os in + nonstopux*) version_type=nonstopux ;; + *) +- if test "$lt_cv_prog_gnu_ld" = yes; then ++ if test yes = "$lt_cv_prog_gnu_ld"; then + version_type=linux # correct to gnu/linux during the next big refactor + else + version_type=irix +@@ -2616,8 +2662,8 @@ + esac + need_lib_prefix=no + need_version=no +- soname_spec='${libname}${release}${shared_ext}$major' +- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' ++ soname_spec='$libname$release$shared_ext$major' ++ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$release$shared_ext $libname$shared_ext' + case $host_os in + irix5* | nonstopux*) + libsuff= shlibsuff= +@@ -2636,8 +2682,8 @@ + esac + shlibpath_var=LD_LIBRARY${shlibsuff}_PATH + shlibpath_overrides_runpath=no +- sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" +- sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" ++ sys_lib_search_path_spec="/usr/lib$libsuff /lib$libsuff /usr/local/lib$libsuff" ++ sys_lib_dlsearch_path_spec="/usr/lib$libsuff /lib$libsuff" + hardcode_into_libs=yes + ;; + +@@ -2646,13 +2692,33 @@ + dynamic_linker=no + ;; + ++linux*android*) ++ version_type=none # Android doesn't support versioned libraries. ++ need_lib_prefix=no ++ need_version=no ++ library_names_spec='$libname$release$shared_ext' ++ soname_spec='$libname$release$shared_ext' ++ finish_cmds= ++ shlibpath_var=LD_LIBRARY_PATH ++ shlibpath_overrides_runpath=yes ++ ++ # This implies no fast_install, which is unacceptable. ++ # Some rework will be needed to allow for fast_install ++ # before this can be enabled. ++ hardcode_into_libs=yes ++ ++ dynamic_linker='Android linker' ++ # Don't embed -rpath directories since the linker doesn't support them. ++ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' ++ ;; ++ + # This must be glibc/ELF. +-linux* | k*bsd*-gnu | kopensolaris*-gnu) ++linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no +- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' +- soname_spec='${libname}${release}${shared_ext}$major' ++ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' ++ soname_spec='$libname$release$shared_ext$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no +@@ -2677,14 +2743,10 @@ + # before this can be enabled. + hardcode_into_libs=yes + +- # Add ABI-specific directories to the system library path. +- sys_lib_dlsearch_path_spec="/lib64 /usr/lib64 /lib /usr/lib" +- + # Append ld.so.conf contents to the search path + if test -f /etc/ld.so.conf; then + lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` +- sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec $lt_ld_extra" +- ++ sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" + fi + + # We used to test for /lib/ld.so.1 and disable shared libraries on +@@ -2701,12 +2763,12 @@ + need_lib_prefix=no + need_version=no + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then +- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' ++ library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + dynamic_linker='NetBSD (a.out) ld.so' + else +- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' +- soname_spec='${libname}${release}${shared_ext}$major' ++ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' ++ soname_spec='$libname$release$shared_ext$major' + dynamic_linker='NetBSD ld.elf_so' + fi + shlibpath_var=LD_LIBRARY_PATH +@@ -2716,7 +2778,7 @@ + + newsos6) + version_type=linux # correct to gnu/linux during the next big refactor +- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' ++ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; +@@ -2725,45 +2787,34 @@ + version_type=qnx + need_lib_prefix=no + need_version=no +- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' +- soname_spec='${libname}${release}${shared_ext}$major' ++ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' ++ soname_spec='$libname$release$shared_ext$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='ldqnx.so' + ;; + +-openbsd*) ++openbsd* | bitrig*) + version_type=sunos +- sys_lib_dlsearch_path_spec="/usr/lib" ++ sys_lib_dlsearch_path_spec=/usr/lib + need_lib_prefix=no +- # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. +- case $host_os in +- openbsd3.3 | openbsd3.3.*) need_version=yes ;; +- *) need_version=no ;; +- esac +- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' ++ if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then ++ need_version=no ++ else ++ need_version=yes ++ fi ++ library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + shlibpath_var=LD_LIBRARY_PATH +- if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then +- case $host_os in +- openbsd2.[[89]] | openbsd2.[[89]].*) +- shlibpath_overrides_runpath=no +- ;; +- *) +- shlibpath_overrides_runpath=yes +- ;; +- esac +- else +- shlibpath_overrides_runpath=yes +- fi ++ shlibpath_overrides_runpath=yes + ;; + + os2*) + libname_spec='$name' +- shrext_cmds=".dll" ++ shrext_cmds=.dll + need_lib_prefix=no +- library_names_spec='$libname${shared_ext} $libname.a' ++ library_names_spec='$libname$shared_ext $libname.a' + dynamic_linker='OS/2 ld.exe' + shlibpath_var=LIBPATH + ;; +@@ -2772,11 +2823,11 @@ + version_type=osf + need_lib_prefix=no + need_version=no +- soname_spec='${libname}${release}${shared_ext}$major' +- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' ++ soname_spec='$libname$release$shared_ext$major' ++ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" +- sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ++ sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + + rdos*) +@@ -2787,8 +2838,8 @@ + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no +- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' +- soname_spec='${libname}${release}${shared_ext}$major' ++ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' ++ soname_spec='$libname$release$shared_ext$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes +@@ -2798,11 +2849,11 @@ + + sunos4*) + version_type=sunos +- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' ++ library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' + finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes +- if test "$with_gnu_ld" = yes; then ++ if test yes = "$with_gnu_ld"; then + need_lib_prefix=no + fi + need_version=yes +@@ -2810,8 +2861,8 @@ + + sysv4 | sysv4.3*) + version_type=linux # correct to gnu/linux during the next big refactor +- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' +- soname_spec='${libname}${release}${shared_ext}$major' ++ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' ++ soname_spec='$libname$release$shared_ext$major' + shlibpath_var=LD_LIBRARY_PATH + case $host_vendor in + sni) +@@ -2832,10 +2883,10 @@ + ;; + + sysv4*MP*) +- if test -d /usr/nec ;then ++ if test -d /usr/nec; then + version_type=linux # correct to gnu/linux during the next big refactor +- library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' +- soname_spec='$libname${shared_ext}.$major' ++ library_names_spec='$libname$shared_ext.$versuffix $libname$shared_ext.$major $libname$shared_ext' ++ soname_spec='$libname$shared_ext.$major' + shlibpath_var=LD_LIBRARY_PATH + fi + ;; +@@ -2844,12 +2895,12 @@ + version_type=freebsd-elf + need_lib_prefix=no + need_version=no +- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' +- soname_spec='${libname}${release}${shared_ext}$major' ++ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext $libname$shared_ext' ++ soname_spec='$libname$release$shared_ext$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes +- if test "$with_gnu_ld" = yes; then ++ if test yes = "$with_gnu_ld"; then + sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' + else + sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' +@@ -2867,7 +2918,7 @@ + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no +- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' ++ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes +@@ -2875,8 +2926,8 @@ + + uts4*) + version_type=linux # correct to gnu/linux during the next big refactor +- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' +- soname_spec='${libname}${release}${shared_ext}$major' ++ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' ++ soname_spec='$libname$release$shared_ext$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +@@ -2885,18 +2936,18 @@ + ;; + esac + AC_MSG_RESULT([$dynamic_linker]) +-test "$dynamic_linker" = no && can_build_shared=no ++test no = "$dynamic_linker" && can_build_shared=no + + variables_saved_for_relink="PATH $shlibpath_var $runpath_var" +-if test "$GCC" = yes; then ++if test yes = "$GCC"; then + variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" + fi + +-if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then +- sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" ++if test set = "${lt_cv_sys_lib_search_path_spec+set}"; then ++ sys_lib_search_path_spec=$lt_cv_sys_lib_search_path_spec + fi +-if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then +- sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" ++if test set = "${lt_cv_sys_lib_dlsearch_path_spec+set}"; then ++ sys_lib_dlsearch_path_spec=$lt_cv_sys_lib_dlsearch_path_spec + fi + + _LT_DECL([], [variables_saved_for_relink], [1], +@@ -2938,32 +2989,32 @@ + + # _LT_PATH_TOOL_PREFIX(TOOL) + # -------------------------- +-# find a file program which can recognize shared library ++# find a file program that can recognize shared library + AC_DEFUN([_LT_PATH_TOOL_PREFIX], + [m4_require([_LT_DECL_EGREP])dnl + AC_MSG_CHECKING([for $1]) + AC_CACHE_VAL(lt_cv_path_MAGIC_CMD, + [case $MAGIC_CMD in + [[\\/*] | ?:[\\/]*]) +- lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. ++ lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path. + ;; + *) +- lt_save_MAGIC_CMD="$MAGIC_CMD" +- lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR ++ lt_save_MAGIC_CMD=$MAGIC_CMD ++ lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR + dnl $ac_dummy forces splitting on constant user-supplied paths. + dnl POSIX.2 word splitting is done only on the output of word expansions, + dnl not every word. This closes a longstanding sh security hole. + ac_dummy="m4_if([$2], , $PATH, [$2])" + for ac_dir in $ac_dummy; do +- IFS="$lt_save_ifs" ++ IFS=$lt_save_ifs + test -z "$ac_dir" && ac_dir=. +- if test -f $ac_dir/$1; then +- lt_cv_path_MAGIC_CMD="$ac_dir/$1" ++ if test -f "$ac_dir/$1"; then ++ lt_cv_path_MAGIC_CMD=$ac_dir/"$1" + if test -n "$file_magic_test_file"; then + case $deplibs_check_method in + "file_magic "*) + file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` +- MAGIC_CMD="$lt_cv_path_MAGIC_CMD" ++ MAGIC_CMD=$lt_cv_path_MAGIC_CMD + if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | + $EGREP "$file_magic_regex" > /dev/null; then + : +@@ -2986,11 +3037,11 @@ + break + fi + done +- IFS="$lt_save_ifs" +- MAGIC_CMD="$lt_save_MAGIC_CMD" ++ IFS=$lt_save_ifs ++ MAGIC_CMD=$lt_save_MAGIC_CMD + ;; + esac]) +-MAGIC_CMD="$lt_cv_path_MAGIC_CMD" ++MAGIC_CMD=$lt_cv_path_MAGIC_CMD + if test -n "$MAGIC_CMD"; then + AC_MSG_RESULT($MAGIC_CMD) + else +@@ -3008,7 +3059,7 @@ + + # _LT_PATH_MAGIC + # -------------- +-# find a file program which can recognize a shared library ++# find a file program that can recognize a shared library + m4_defun([_LT_PATH_MAGIC], + [_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH) + if test -z "$lt_cv_path_MAGIC_CMD"; then +@@ -3035,16 +3086,16 @@ + AC_ARG_WITH([gnu-ld], + [AS_HELP_STRING([--with-gnu-ld], + [assume the C compiler uses GNU ld @<:@default=no@:>@])], +- [test "$withval" = no || with_gnu_ld=yes], ++ [test no = "$withval" || with_gnu_ld=yes], + [with_gnu_ld=no])dnl + + ac_prog=ld +-if test "$GCC" = yes; then ++if test yes = "$GCC"; then + # Check if gcc -print-prog-name=ld gives a path. + AC_MSG_CHECKING([for ld used by $CC]) + case $host in + *-*-mingw*) +- # gcc leaves a trailing carriage return which upsets mingw ++ # gcc leaves a trailing carriage return, which upsets mingw + ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; + *) + ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; +@@ -3058,7 +3109,7 @@ + while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do + ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` + done +- test -z "$LD" && LD="$ac_prog" ++ test -z "$LD" && LD=$ac_prog + ;; + "") + # If it fails, then pretend we aren't using GCC. +@@ -3069,37 +3120,37 @@ + with_gnu_ld=unknown + ;; + esac +-elif test "$with_gnu_ld" = yes; then ++elif test yes = "$with_gnu_ld"; then + AC_MSG_CHECKING([for GNU ld]) + else + AC_MSG_CHECKING([for non-GNU ld]) + fi + AC_CACHE_VAL(lt_cv_path_LD, + [if test -z "$LD"; then +- lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR ++ lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR + for ac_dir in $PATH; do +- IFS="$lt_save_ifs" ++ IFS=$lt_save_ifs + test -z "$ac_dir" && ac_dir=. + if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then +- lt_cv_path_LD="$ac_dir/$ac_prog" ++ lt_cv_path_LD=$ac_dir/$ac_prog + # Check to see if the program is GNU ld. I'd rather use --version, + # but apparently some variants of GNU ld only accept -v. + # Break only if it was the GNU/non-GNU ld that we prefer. + case `"$lt_cv_path_LD" -v 2>&1 /dev/null 2>&1; then ++ if ( file / ) >/dev/null 2>&1; then + lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' + lt_cv_file_magic_cmd='func_win32_libid' + else +@@ -3255,10 +3305,6 @@ + fi + ;; + +-gnu*) +- lt_cv_deplibs_check_method=pass_all +- ;; +- + haiku*) + lt_cv_deplibs_check_method=pass_all + ;; +@@ -3297,7 +3343,7 @@ + ;; + + # This must be glibc/ELF. +-linux* | k*bsd*-gnu | kopensolaris*-gnu) ++linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) + lt_cv_deplibs_check_method=pass_all + ;; + +@@ -3319,8 +3365,8 @@ + lt_cv_deplibs_check_method=pass_all + ;; + +-openbsd*) +- if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then ++openbsd* | bitrig*) ++ if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then + lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$' + else + lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' +@@ -3413,33 +3459,33 @@ + AC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM, + [if test -n "$NM"; then + # Let the user override the test. +- lt_cv_path_NM="$NM" ++ lt_cv_path_NM=$NM + else +- lt_nm_to_check="${ac_tool_prefix}nm" ++ lt_nm_to_check=${ac_tool_prefix}nm + if test -n "$ac_tool_prefix" && test "$build" = "$host"; then + lt_nm_to_check="$lt_nm_to_check nm" + fi + for lt_tmp_nm in $lt_nm_to_check; do +- lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR ++ lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR + for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do +- IFS="$lt_save_ifs" ++ IFS=$lt_save_ifs + test -z "$ac_dir" && ac_dir=. +- tmp_nm="$ac_dir/$lt_tmp_nm" +- if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then ++ tmp_nm=$ac_dir/$lt_tmp_nm ++ if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext"; then + # Check to see if the nm accepts a BSD-compat flag. +- # Adding the `sed 1q' prevents false positives on HP-UX, which says: ++ # Adding the 'sed 1q' prevents false positives on HP-UX, which says: + # nm: unknown option "B" ignored + # Tru64's nm complains that /dev/null is an invalid object file + case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in + */dev/null* | *'Invalid file or object type'*) + lt_cv_path_NM="$tmp_nm -B" +- break ++ break 2 + ;; + *) + case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in + */dev/null*) + lt_cv_path_NM="$tmp_nm -p" +- break ++ break 2 + ;; + *) + lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but +@@ -3450,21 +3496,21 @@ + esac + fi + done +- IFS="$lt_save_ifs" ++ IFS=$lt_save_ifs + done + : ${lt_cv_path_NM=no} + fi]) +-if test "$lt_cv_path_NM" != "no"; then +- NM="$lt_cv_path_NM" ++if test no != "$lt_cv_path_NM"; then ++ NM=$lt_cv_path_NM + else + # Didn't find any BSD compatible name lister, look for dumpbin. + if test -n "$DUMPBIN"; then : + # Let the user override the test. + else + AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :) +- case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in ++ case `$DUMPBIN -symbols -headers /dev/null 2>&1 | sed '1q'` in + *COFF*) +- DUMPBIN="$DUMPBIN -symbols" ++ DUMPBIN="$DUMPBIN -symbols -headers" + ;; + *) + DUMPBIN=: +@@ -3472,8 +3518,8 @@ + esac + fi + AC_SUBST([DUMPBIN]) +- if test "$DUMPBIN" != ":"; then +- NM="$DUMPBIN" ++ if test : != "$DUMPBIN"; then ++ NM=$DUMPBIN + fi + fi + test -z "$NM" && NM=nm +@@ -3519,8 +3565,8 @@ + + case $host_os in + cygwin* | mingw* | pw32* | cegcc*) +- # two different shell functions defined in ltmain.sh +- # decide which to use based on capabilities of $DLLTOOL ++ # two different shell functions defined in ltmain.sh; ++ # decide which one to use based on capabilities of $DLLTOOL + case `$DLLTOOL --help 2>&1` in + *--identify-strict*) + lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib +@@ -3532,7 +3578,7 @@ + ;; + *) + # fallback: assume linklib IS sharedlib +- lt_cv_sharedlib_from_linklib_cmd="$ECHO" ++ lt_cv_sharedlib_from_linklib_cmd=$ECHO + ;; + esac + ]) +@@ -3559,13 +3605,28 @@ + lt_cv_path_mainfest_tool=yes + fi + rm -f conftest*]) +-if test "x$lt_cv_path_mainfest_tool" != xyes; then ++if test yes != "$lt_cv_path_mainfest_tool"; then + MANIFEST_TOOL=: + fi + _LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl + ])# _LT_PATH_MANIFEST_TOOL + + ++# _LT_DLL_DEF_P([FILE]) ++# --------------------- ++# True iff FILE is a Windows DLL '.def' file. ++# Keep in sync with func_dll_def_p in the libtool script ++AC_DEFUN([_LT_DLL_DEF_P], ++[dnl ++ test DEF = "`$SED -n dnl ++ -e '\''s/^[[ ]]*//'\'' dnl Strip leading whitespace ++ -e '\''/^\(;.*\)*$/d'\'' dnl Delete empty lines and comments ++ -e '\''s/^\(EXPORTS\|LIBRARY\)\([[ ]].*\)*$/DEF/p'\'' dnl ++ -e q dnl Only consider the first "real" line ++ $1`" dnl ++])# _LT_DLL_DEF_P ++ ++ + # LT_LIB_M + # -------- + # check for math library +@@ -3577,11 +3638,11 @@ + # These system don't have libm, or don't need it + ;; + *-ncr-sysv4.3*) +- AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw") ++ AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM=-lmw) + AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm") + ;; + *) +- AC_CHECK_LIB(m, cos, LIBM="-lm") ++ AC_CHECK_LIB(m, cos, LIBM=-lm) + ;; + esac + AC_SUBST([LIBM]) +@@ -3600,7 +3661,7 @@ + + _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= + +-if test "$GCC" = yes; then ++if test yes = "$GCC"; then + case $cc_basename in + nvcc*) + _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -Xcompiler -fno-builtin' ;; +@@ -3652,7 +3713,7 @@ + symcode='[[ABCDGISTW]]' + ;; + hpux*) +- if test "$host_cpu" = ia64; then ++ if test ia64 = "$host_cpu"; then + symcode='[[ABCDEGRST]]' + fi + ;; +@@ -3685,14 +3746,44 @@ + symcode='[[ABCDGIRSTW]]' ;; + esac + ++if test "$lt_cv_nm_interface" = "MS dumpbin"; then ++ # Gets list of data symbols to import. ++ lt_cv_sys_global_symbol_to_import="sed -n -e 's/^I .* \(.*\)$/\1/p'" ++ # Adjust the below global symbol transforms to fixup imported variables. ++ lt_cdecl_hook=" -e 's/^I .* \(.*\)$/extern __declspec(dllimport) char \1;/p'" ++ lt_c_name_hook=" -e 's/^I .* \(.*\)$/ {\"\1\", (void *) 0},/p'" ++ lt_c_name_lib_hook="\ ++ -e 's/^I .* \(lib.*\)$/ {\"\1\", (void *) 0},/p'\ ++ -e 's/^I .* \(.*\)$/ {\"lib\1\", (void *) 0},/p'" ++else ++ # Disable hooks by default. ++ lt_cv_sys_global_symbol_to_import= ++ lt_cdecl_hook= ++ lt_c_name_hook= ++ lt_c_name_lib_hook= ++fi ++ + # Transform an extracted symbol line into a proper C declaration. + # Some systems (esp. on ia64) link data and code symbols differently, + # so use this general approach. +-lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" ++lt_cv_sys_global_symbol_to_cdecl="sed -n"\ ++$lt_cdecl_hook\ ++" -e 's/^T .* \(.*\)$/extern int \1();/p'"\ ++" -e 's/^$symcode$symcode* .* \(.*\)$/extern char \1;/p'" + + # Transform an extracted symbol line into symbol name and symbol address +-lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p'" +-lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \(lib[[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"lib\2\", (void *) \&\2},/p'" ++lt_cv_sys_global_symbol_to_c_name_address="sed -n"\ ++$lt_c_name_hook\ ++" -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ ++" -e 's/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/p'" ++ ++# Transform an extracted symbol line into symbol name with lib prefix and ++# symbol address. ++lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n"\ ++$lt_c_name_lib_hook\ ++" -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ ++" -e 's/^$symcode$symcode* .* \(lib.*\)$/ {\"\1\", (void *) \&\1},/p'"\ ++" -e 's/^$symcode$symcode* .* \(.*\)$/ {\"lib\1\", (void *) \&\1},/p'" + + # Handle CRLF in mingw tool chain + opt_cr= +@@ -3710,21 +3801,24 @@ + + # Write the raw and C identifiers. + if test "$lt_cv_nm_interface" = "MS dumpbin"; then +- # Fake it for dumpbin and say T for any non-static function +- # and D for any global variable. ++ # Fake it for dumpbin and say T for any non-static function, ++ # D for any global variable and I for any imported variable. + # Also find C++ and __fastcall symbols from MSVC++, + # which start with @ or ?. + lt_cv_sys_global_symbol_pipe="$AWK ['"\ + " {last_section=section; section=\$ 3};"\ + " /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\ + " /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ ++" /^ *Symbol name *: /{split(\$ 0,sn,\":\"); si=substr(sn[2],2)};"\ ++" /^ *Type *: code/{print \"T\",si,substr(si,length(prfx))};"\ ++" /^ *Type *: data/{print \"I\",si,substr(si,length(prfx))};"\ + " \$ 0!~/External *\|/{next};"\ + " / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ + " {if(hide[section]) next};"\ +-" {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\ +-" {split(\$ 0, a, /\||\r/); split(a[2], s)};"\ +-" s[1]~/^[@?]/{print s[1], s[1]; next};"\ +-" s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\ ++" {f=\"D\"}; \$ 0~/\(\).*\|/{f=\"T\"};"\ ++" {split(\$ 0,a,/\||\r/); split(a[2],s)};"\ ++" s[1]~/^[@?]/{print f,s[1],s[1]; next};"\ ++" s[1]~prfx {split(s[1],t,\"@\"); print f,t[1],substr(t[1],length(prfx))}"\ + " ' prfx=^$ac_symprfx]" + else + lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" +@@ -3764,11 +3858,11 @@ + if $GREP ' nm_test_func$' "$nlist" >/dev/null; then + cat <<_LT_EOF > conftest.$ac_ext + /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ +-#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) +-/* DATA imports from DLLs on WIN32 con't be const, because runtime ++#if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE ++/* DATA imports from DLLs on WIN32 can't be const, because runtime + relocations are performed -- see ld's documentation on pseudo-relocs. */ + # define LT@&t@_DLSYM_CONST +-#elif defined(__osf__) ++#elif defined __osf__ + /* This system does not cope well with relocations in const data. */ + # define LT@&t@_DLSYM_CONST + #else +@@ -3794,7 +3888,7 @@ + { + { "@PROGRAM@", (void *) 0 }, + _LT_EOF +- $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext ++ $SED "s/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext + cat <<\_LT_EOF >> conftest.$ac_ext + {0, (void *) 0} + }; +@@ -3814,9 +3908,9 @@ + mv conftest.$ac_objext conftstm.$ac_objext + lt_globsym_save_LIBS=$LIBS + lt_globsym_save_CFLAGS=$CFLAGS +- LIBS="conftstm.$ac_objext" ++ LIBS=conftstm.$ac_objext + CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)" +- if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then ++ if AC_TRY_EVAL(ac_link) && test -s conftest$ac_exeext; then + pipe_works=yes + fi + LIBS=$lt_globsym_save_LIBS +@@ -3837,7 +3931,7 @@ + rm -rf conftest* conftst* + + # Do not use the global_symbol_pipe unless it works. +- if test "$pipe_works" = yes; then ++ if test yes = "$pipe_works"; then + break + else + lt_cv_sys_global_symbol_pipe= +@@ -3864,12 +3958,16 @@ + [Take the output of nm and produce a listing of raw symbols and C names]) + _LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1], + [Transform the output of nm in a proper C declaration]) ++_LT_DECL([global_symbol_to_import], [lt_cv_sys_global_symbol_to_import], [1], ++ [Transform the output of nm into a list of symbols to manually relocate]) + _LT_DECL([global_symbol_to_c_name_address], + [lt_cv_sys_global_symbol_to_c_name_address], [1], + [Transform the output of nm in a C name address pair]) + _LT_DECL([global_symbol_to_c_name_address_lib_prefix], + [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1], + [Transform the output of nm in a C name address pair when lib prefix is needed]) ++_LT_DECL([nm_interface], [lt_cv_nm_interface], [1], ++ [The name lister interface]) + _LT_DECL([], [nm_file_list_spec], [1], + [Specify filename containing input files for $NM]) + ]) # _LT_CMD_GLOBAL_SYMBOLS +@@ -3885,17 +3983,18 @@ + + m4_if([$1], [CXX], [ + # C++ specific cases for pic, static, wl, etc. +- if test "$GXX" = yes; then ++ if test yes = "$GXX"; then + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' + + case $host_os in + aix*) + # All AIX code is PIC. +- if test "$host_cpu" = ia64; then ++ if test ia64 = "$host_cpu"; then + # AIX 5 now supports IA64 processor + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + fi ++ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + + amigaos*) +@@ -3906,8 +4005,8 @@ + ;; + m68k) + # FIXME: we need at least 68020 code to build shared libraries, but +- # adding the `-m68020' flag to GCC prevents building anything better, +- # like `-m68040'. ++ # adding the '-m68020' flag to GCC prevents building anything better, ++ # like '-m68040'. + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' + ;; + esac +@@ -3972,7 +4071,7 @@ + case $host_os in + aix[[4-9]]*) + # All AIX code is PIC. +- if test "$host_cpu" = ia64; then ++ if test ia64 = "$host_cpu"; then + # AIX 5 now supports IA64 processor + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + else +@@ -4013,14 +4112,14 @@ + case $cc_basename in + CC*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' +- _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' +- if test "$host_cpu" != ia64; then ++ _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive' ++ if test ia64 != "$host_cpu"; then + _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' + fi + ;; + aCC*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' +- _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' ++ _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive' + case $host_cpu in + hppa*64*|ia64*) + # +Z the default +@@ -4049,7 +4148,7 @@ + ;; + esac + ;; +- linux* | k*bsd*-gnu | kopensolaris*-gnu) ++ linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) + case $cc_basename in + KCC*) + # KAI C++ Compiler +@@ -4057,7 +4156,7 @@ + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + ecpc* ) +- # old Intel C++ for x86_64 which still supported -KPIC. ++ # old Intel C++ for x86_64, which still supported -KPIC. + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' +@@ -4202,17 +4301,18 @@ + fi + ], + [ +- if test "$GCC" = yes; then ++ if test yes = "$GCC"; then + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' + + case $host_os in + aix*) + # All AIX code is PIC. +- if test "$host_cpu" = ia64; then ++ if test ia64 = "$host_cpu"; then + # AIX 5 now supports IA64 processor + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + fi ++ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + + amigaos*) +@@ -4223,8 +4323,8 @@ + ;; + m68k) + # FIXME: we need at least 68020 code to build shared libraries, but +- # adding the `-m68020' flag to GCC prevents building anything better, +- # like `-m68040'. ++ # adding the '-m68020' flag to GCC prevents building anything better, ++ # like '-m68040'. + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' + ;; + esac +@@ -4311,7 +4411,7 @@ + case $host_os in + aix*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' +- if test "$host_cpu" = ia64; then ++ if test ia64 = "$host_cpu"; then + # AIX 5 now supports IA64 processor + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + else +@@ -4319,6 +4419,20 @@ + fi + ;; + ++ darwin* | rhapsody*) ++ # PIC is the default on this platform ++ # Common symbols not allowed in MH_DYLIB files ++ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' ++ case $cc_basename in ++ nagfor*) ++ # NAG Fortran compiler ++ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,' ++ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' ++ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ++ ;; ++ esac ++ ;; ++ + mingw* | cygwin* | pw32* | os2* | cegcc*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). +@@ -4339,7 +4453,7 @@ + ;; + esac + # Is there a better lt_prog_compiler_static that works with the bundled CC? +- _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' ++ _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive' + ;; + + irix5* | irix6* | nonstopux*) +@@ -4348,9 +4462,9 @@ + _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + +- linux* | k*bsd*-gnu | kopensolaris*-gnu) ++ linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) + case $cc_basename in +- # old Intel for x86_64 which still supported -KPIC. ++ # old Intel for x86_64, which still supported -KPIC. + ecc*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' +@@ -4375,6 +4489,12 @@ + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; ++ tcc*) ++ # Fabrice Bellard et al's Tiny C Compiler ++ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' ++ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ++ _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ++ ;; + pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) + # Portland Group compilers (*not* the Pentium gcc compiler, + # which looks to be a dead project) +@@ -4472,7 +4592,7 @@ + ;; + + sysv4*MP*) +- if test -d /usr/nec ;then ++ if test -d /usr/nec; then + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + fi +@@ -4501,7 +4621,7 @@ + fi + ]) + case $host_os in +- # For platforms which do not support PIC, -DPIC is meaningless: ++ # For platforms that do not support PIC, -DPIC is meaningless: + *djgpp*) + _LT_TAGVAR(lt_prog_compiler_pic, $1)= + ;; +@@ -4577,7 +4697,7 @@ + fi + ;; + pw32*) +- _LT_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds" ++ _LT_TAGVAR(export_symbols_cmds, $1)=$ltdll_cmds + ;; + cygwin* | mingw* | cegcc*) + case $cc_basename in +@@ -4623,9 +4743,9 @@ + # included in the symbol list + _LT_TAGVAR(include_expsyms, $1)= + # exclude_expsyms can be an extended regexp of symbols to exclude +- # it will be wrapped by ` (' and `)$', so one must not match beginning or +- # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', +- # as well as any symbol that contains `d'. ++ # it will be wrapped by ' (' and ')$', so one must not match beginning or ++ # end of line. Example: 'a|bc|.*d.*' will exclude the symbols 'a' and 'bc', ++ # as well as any symbol that contains 'd'. + _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] + # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out + # platforms (ab)use it in PIC code, but their linkers get confused if +@@ -4641,7 +4761,7 @@ + # FIXME: the MSVC++ port hasn't been tested in a loooong time + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. +- if test "$GCC" != yes; then ++ if test yes != "$GCC"; then + with_gnu_ld=no + fi + ;; +@@ -4649,7 +4769,7 @@ + # we just hope/assume this is gcc and not c89 (= MSVC++) + with_gnu_ld=yes + ;; +- openbsd*) ++ openbsd* | bitrig*) + with_gnu_ld=no + ;; + esac +@@ -4659,7 +4779,7 @@ + # On some targets, GNU ld is compatible enough with the native linker + # that we're better off using the native interface for both. + lt_use_gnu_ld_interface=no +- if test "$with_gnu_ld" = yes; then ++ if test yes = "$with_gnu_ld"; then + case $host_os in + aix*) + # The AIX port of GNU ld has always aspired to compatibility +@@ -4681,24 +4801,24 @@ + esac + fi + +- if test "$lt_use_gnu_ld_interface" = yes; then ++ if test yes = "$lt_use_gnu_ld_interface"; then + # If archive_cmds runs LD, not CC, wlarc should be empty +- wlarc='${wl}' ++ wlarc='$wl' + + # Set some defaults for GNU ld with shared library support. These + # are reset later if shared libraries are not supported. Putting them + # here allows them to be overridden if necessary. + runpath_var=LD_RUN_PATH +- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' +- _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' ++ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' ++ _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' + # ancient GNU ld didn't support --whole-archive et. al. + if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then +- _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' ++ _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive' + else + _LT_TAGVAR(whole_archive_flag_spec, $1)= + fi + supports_anon_versioning=no +- case `$LD -v 2>&1` in ++ case `$LD -v | $SED -e 's/([^)]\+)\s\+//' 2>&1` in + *GNU\ gold*) supports_anon_versioning=yes ;; + *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11 + *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... +@@ -4711,7 +4831,7 @@ + case $host_os in + aix[[3-9]]*) + # On AIX/PPC, the GNU linker is very broken +- if test "$host_cpu" != ia64; then ++ if test ia64 != "$host_cpu"; then + _LT_TAGVAR(ld_shlibs, $1)=no + cat <<_LT_EOF 1>&2 + +@@ -4730,7 +4850,7 @@ + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support +- _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' ++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='' + ;; + m68k) +@@ -4746,7 +4866,7 @@ + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + # Joseph Beckenbach says some releases of gcc + # support --undefined. This deserves some investigation. FIXME +- _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' ++ _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi +@@ -4756,7 +4876,7 @@ + # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, + # as there is no search path for DLLs. + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' +- _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols' ++ _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-all-symbols' + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_TAGVAR(always_export_symbols, $1)=no + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes +@@ -4764,61 +4884,61 @@ + _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'] + + if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then +- _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' +- # If the export-symbols file already is a .def file (1st line +- # is EXPORTS), use it as is; otherwise, prepend... +- _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then +- cp $export_symbols $output_objdir/$soname.def; +- else +- echo EXPORTS > $output_objdir/$soname.def; +- cat $export_symbols >> $output_objdir/$soname.def; +- fi~ +- $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' ++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' ++ # If the export-symbols file already is a .def file, use it as ++ # is; otherwise, prepend EXPORTS... ++ _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then ++ cp $export_symbols $output_objdir/$soname.def; ++ else ++ echo EXPORTS > $output_objdir/$soname.def; ++ cat $export_symbols >> $output_objdir/$soname.def; ++ fi~ ++ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + haiku*) +- _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' ++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + _LT_TAGVAR(link_all_deplibs, $1)=yes + ;; + + interix[[3-9]]*) + _LT_TAGVAR(hardcode_direct, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no +- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' +- _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' ++ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' ++ _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' + # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. + # Instead, shared libraries are loaded at an image base (0x10000000 by + # default) and relocated if they conflict, which is a slow very memory + # consuming and fragmenting process. To avoid this, we pick a random, + # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link + # time. Moving up from 0x10000000 also allows more sbrk(2) space. +- _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' +- _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ++ _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + ;; + + gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) + tmp_diet=no +- if test "$host_os" = linux-dietlibc; then ++ if test linux-dietlibc = "$host_os"; then + case $cc_basename in + diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) + esac + fi + if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ +- && test "$tmp_diet" = no ++ && test no = "$tmp_diet" + then + tmp_addflag=' $pic_flag' + tmp_sharedflag='-shared' + case $cc_basename,$host_cpu in + pgcc*) # Portland Group C compiler +- _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' ++ _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' + tmp_addflag=' $pic_flag' + ;; + pgf77* | pgf90* | pgf95* | pgfortran*) + # Portland Group f77 and f90 compilers +- _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' ++ _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' + tmp_addflag=' $pic_flag -Mnomain' ;; + ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 + tmp_addflag=' -i_dynamic' ;; +@@ -4829,42 +4949,44 @@ + lf95*) # Lahey Fortran 8.1 + _LT_TAGVAR(whole_archive_flag_spec, $1)= + tmp_sharedflag='--shared' ;; ++ nagfor*) # NAGFOR 5.3 ++ tmp_sharedflag='-Wl,-shared' ;; + xl[[cC]]* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below) + tmp_sharedflag='-qmkshrobj' + tmp_addflag= ;; + nvcc*) # Cuda Compiler Driver 2.2 +- _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' ++ _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' + _LT_TAGVAR(compiler_needs_object, $1)=yes + ;; + esac + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) # Sun C 5.9 +- _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' ++ _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' + _LT_TAGVAR(compiler_needs_object, $1)=yes + tmp_sharedflag='-G' ;; + *Sun\ F*) # Sun Fortran 8.3 + tmp_sharedflag='-G' ;; + esac +- _LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' +- +- if test "x$supports_anon_versioning" = xyes; then ++ _LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' ++ ++ if test yes = "$supports_anon_versioning"; then + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ +- cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ +- echo "local: *; };" >> $output_objdir/$libname.ver~ +- $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' ++ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ ++ echo "local: *; };" >> $output_objdir/$libname.ver~ ++ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib' + fi + + case $cc_basename in + xlf* | bgf* | bgxlf* | mpixlf*) + # IBM XL Fortran 10.1 on PPC cannot create shared libs itself + _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive' +- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' ++ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' + _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' +- if test "x$supports_anon_versioning" = xyes; then ++ if test yes = "$supports_anon_versioning"; then + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ +- cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ +- echo "local: *; };" >> $output_objdir/$libname.ver~ +- $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' ++ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ ++ echo "local: *; };" >> $output_objdir/$libname.ver~ ++ $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' + fi + ;; + esac +@@ -4878,8 +5000,8 @@ + _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' + wlarc= + else +- _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' +- _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' ++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' ++ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' + fi + ;; + +@@ -4897,8 +5019,8 @@ + + _LT_EOF + elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then +- _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' +- _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' ++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' ++ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi +@@ -4910,7 +5032,7 @@ + _LT_TAGVAR(ld_shlibs, $1)=no + cat <<_LT_EOF 1>&2 + +-*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not ++*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 cannot + *** reliably create shared libraries on SCO systems. Therefore, libtool + *** is disabling shared libraries support. We urge you to upgrade GNU + *** binutils to release 2.16.91.0.3 or newer. Another option is to modify +@@ -4925,9 +5047,9 @@ + # DT_RUNPATH tag from executables and libraries. But doing so + # requires that you compile everything twice, which is a pain. + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then +- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' +- _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' +- _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' ++ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' ++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' ++ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi +@@ -4944,15 +5066,15 @@ + + *) + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then +- _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' +- _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' ++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' ++ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + +- if test "$_LT_TAGVAR(ld_shlibs, $1)" = no; then ++ if test no = "$_LT_TAGVAR(ld_shlibs, $1)"; then + runpath_var= + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= + _LT_TAGVAR(export_dynamic_flag_spec, $1)= +@@ -4968,7 +5090,7 @@ + # Note: this linker hardcodes the directories in LIBPATH if there + # are no directories specified by -L. + _LT_TAGVAR(hardcode_minus_L, $1)=yes +- if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then ++ if test yes = "$GCC" && test -z "$lt_prog_compiler_static"; then + # Neither direct hardcoding nor static linking is supported with a + # broken collect2. + _LT_TAGVAR(hardcode_direct, $1)=unsupported +@@ -4976,12 +5098,12 @@ + ;; + + aix[[4-9]]*) +- if test "$host_cpu" = ia64; then ++ if test ia64 = "$host_cpu"; then + # On IA64, the linker does run time linking by default, so we don't + # have to do anything special. + aix_use_runtimelinking=no + exp_sym_flag='-Bexport' +- no_entry_flag="" ++ no_entry_flag= + else + # If we're using GNU nm, then we don't want the "-C" option. + # -C means demangle to AIX nm, but means don't demangle with GNU nm +@@ -4999,7 +5121,7 @@ + # need to do runtime linking. + case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) + for ld_flag in $LDFLAGS; do +- if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then ++ if (test x-brtl = "x$ld_flag" || test x-Wl,-brtl = "x$ld_flag"); then + aix_use_runtimelinking=yes + break + fi +@@ -5022,13 +5144,13 @@ + _LT_TAGVAR(hardcode_direct_absolute, $1)=yes + _LT_TAGVAR(hardcode_libdir_separator, $1)=':' + _LT_TAGVAR(link_all_deplibs, $1)=yes +- _LT_TAGVAR(file_list_spec, $1)='${wl}-f,' +- +- if test "$GCC" = yes; then ++ _LT_TAGVAR(file_list_spec, $1)='$wl-f,' ++ ++ if test yes = "$GCC"; then + case $host_os in aix4.[[012]]|aix4.[[012]].*) + # We only want to do this on AIX 4.2 and lower, the check + # below for broken collect2 doesn't work under 4.3+ +- collect2name=`${CC} -print-prog-name=collect2` ++ collect2name=`$CC -print-prog-name=collect2` + if test -f "$collect2name" && + strings "$collect2name" | $GREP resolve_lib_name >/dev/null + then +@@ -5047,61 +5169,61 @@ + ;; + esac + shared_flag='-shared' +- if test "$aix_use_runtimelinking" = yes; then +- shared_flag="$shared_flag "'${wl}-G' ++ if test yes = "$aix_use_runtimelinking"; then ++ shared_flag="$shared_flag "'$wl-G' + fi + else + # not using gcc +- if test "$host_cpu" = ia64; then ++ if test ia64 = "$host_cpu"; then + # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release + # chokes on -Wl,-G. The following line is correct: + shared_flag='-G' + else +- if test "$aix_use_runtimelinking" = yes; then +- shared_flag='${wl}-G' ++ if test yes = "$aix_use_runtimelinking"; then ++ shared_flag='$wl-G' + else +- shared_flag='${wl}-bM:SRE' ++ shared_flag='$wl-bM:SRE' + fi + fi + fi + +- _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall' ++ _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-bexpall' + # It seems that -bexpall does not export symbols beginning with + # underscore (_), so it is better to generate a list of symbols to export. + _LT_TAGVAR(always_export_symbols, $1)=yes +- if test "$aix_use_runtimelinking" = yes; then ++ if test yes = "$aix_use_runtimelinking"; then + # Warning - without using the other runtime loading flags (-brtl), + # -berok will link without error, but may produce a broken library. + _LT_TAGVAR(allow_undefined_flag, $1)='-berok' + # Determine the default libpath from the value encoded in an + # empty executable. + _LT_SYS_MODULE_PATH_AIX([$1]) +- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" +- _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" ++ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath" ++ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag + else +- if test "$host_cpu" = ia64; then +- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' ++ if test ia64 = "$host_cpu"; then ++ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $libdir:/usr/lib:/lib' + _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" +- _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" ++ _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\$wl$no_entry_flag"' $compiler_flags $wl$allow_undefined_flag '"\$wl$exp_sym_flag:\$export_symbols" + else + # Determine the default libpath from the value encoded in an + # empty executable. + _LT_SYS_MODULE_PATH_AIX([$1]) +- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" ++ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath" + # Warning - without using the other run time loading flags, + # -berok will link without error, but may produce a broken library. +- _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' +- _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' +- if test "$with_gnu_ld" = yes; then ++ _LT_TAGVAR(no_undefined_flag, $1)=' $wl-bernotok' ++ _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-berok' ++ if test yes = "$with_gnu_ld"; then + # We only use this code for GNU lds that support --whole-archive. +- _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' ++ _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive' + else + # Exported symbols can be pulled into shared objects from archives + _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' + fi + _LT_TAGVAR(archive_cmds_need_lc, $1)=yes + # This is similar to how AIX traditionally builds its shared libraries. +- _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' ++ _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $wl-bnoentry $compiler_flags $wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + fi + fi + ;; +@@ -5110,7 +5232,7 @@ + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support +- _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' ++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='' + ;; + m68k) +@@ -5140,16 +5262,17 @@ + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. +- shrext_cmds=".dll" ++ shrext_cmds=.dll + # FIXME: Setting linknames here is a bad hack. +- _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' +- _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then +- sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; +- else +- sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; +- fi~ +- $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ +- linknames=' ++ _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames=' ++ _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then ++ cp "$export_symbols" "$output_objdir/$soname.def"; ++ echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp"; ++ else ++ $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp; ++ fi~ ++ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ ++ linknames=' + # The linker will not automatically build a static lib if we build a DLL. + # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes +@@ -5158,18 +5281,18 @@ + # Don't use ranlib + _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib' + _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~ +- lt_tool_outputfile="@TOOL_OUTPUT@"~ +- case $lt_outputfile in +- *.exe|*.EXE) ;; +- *) +- lt_outputfile="$lt_outputfile.exe" +- lt_tool_outputfile="$lt_tool_outputfile.exe" +- ;; +- esac~ +- if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then +- $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; +- $RM "$lt_outputfile.manifest"; +- fi' ++ lt_tool_outputfile="@TOOL_OUTPUT@"~ ++ case $lt_outputfile in ++ *.exe|*.EXE) ;; ++ *) ++ lt_outputfile=$lt_outputfile.exe ++ lt_tool_outputfile=$lt_tool_outputfile.exe ++ ;; ++ esac~ ++ if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then ++ $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; ++ $RM "$lt_outputfile.manifest"; ++ fi' + ;; + *) + # Assume MSVC wrapper +@@ -5178,7 +5301,7 @@ + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. +- shrext_cmds=".dll" ++ shrext_cmds=.dll + # FIXME: Setting linknames here is a bad hack. + _LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' + # The linker will automatically build a .lib file if we build a DLL. +@@ -5228,33 +5351,33 @@ + ;; + + hpux9*) +- if test "$GCC" = yes; then +- _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' ++ if test yes = "$GCC"; then ++ _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' + else +- _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' ++ _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' + fi +- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' ++ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_TAGVAR(hardcode_direct, $1)=yes + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + _LT_TAGVAR(hardcode_minus_L, $1)=yes +- _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' ++ _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' + ;; + + hpux10*) +- if test "$GCC" = yes && test "$with_gnu_ld" = no; then +- _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ++ if test yes,no = "$GCC,$with_gnu_ld"; then ++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + else + _LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' + fi +- if test "$with_gnu_ld" = no; then +- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' ++ if test no = "$with_gnu_ld"; then ++ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_direct_absolute, $1)=yes +- _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' ++ _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + _LT_TAGVAR(hardcode_minus_L, $1)=yes +@@ -5262,25 +5385,25 @@ + ;; + + hpux11*) +- if test "$GCC" = yes && test "$with_gnu_ld" = no; then ++ if test yes,no = "$GCC,$with_gnu_ld"; then + case $host_cpu in + hppa*64*) +- _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) +- _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) +- _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + else + case $host_cpu in + hppa*64*) +- _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ++ _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) +- _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ++ _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + m4_if($1, [], [ +@@ -5288,14 +5411,14 @@ + # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) + _LT_LINKER_OPTION([if $CC understands -b], + _LT_TAGVAR(lt_cv_prog_compiler__b, $1), [-b], +- [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'], ++ [_LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'], + [_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'])], +- [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags']) ++ [_LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags']) + ;; + esac + fi +- if test "$with_gnu_ld" = no; then +- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' ++ if test no = "$with_gnu_ld"; then ++ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + + case $host_cpu in +@@ -5306,7 +5429,7 @@ + *) + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_direct_absolute, $1)=yes +- _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' ++ _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. +@@ -5317,16 +5440,16 @@ + ;; + + irix5* | irix6* | nonstopux*) +- if test "$GCC" = yes; then +- _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' ++ if test yes = "$GCC"; then ++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' + # Try to use the -exported_symbol ld option, if it does not + # work, assume that -exports_file does not work either and + # implicitly export all symbols. + # This should be the same for all languages, so no per-tag cache variable. + AC_CACHE_CHECK([whether the $host_os linker accepts -exported_symbol], + [lt_cv_irix_exported_symbol], +- [save_LDFLAGS="$LDFLAGS" +- LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" ++ [save_LDFLAGS=$LDFLAGS ++ LDFLAGS="$LDFLAGS -shared $wl-exported_symbol ${wl}foo $wl-update_registry $wl/dev/null" + AC_LINK_IFELSE( + [AC_LANG_SOURCE( + [AC_LANG_CASE([C], [[int foo (void) { return 0; }]], +@@ -5339,16 +5462,16 @@ + end]])])], + [lt_cv_irix_exported_symbol=yes], + [lt_cv_irix_exported_symbol=no]) +- LDFLAGS="$save_LDFLAGS"]) +- if test "$lt_cv_irix_exported_symbol" = yes; then +- _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' ++ LDFLAGS=$save_LDFLAGS]) ++ if test yes = "$lt_cv_irix_exported_symbol"; then ++ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations $wl-exports_file $wl$export_symbols -o $lib' + fi + else +- _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' +- _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' ++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' ++ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -exports_file $export_symbols -o $lib' + fi + _LT_TAGVAR(archive_cmds_need_lc, $1)='no' +- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' ++ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_TAGVAR(inherit_rpath, $1)=yes + _LT_TAGVAR(link_all_deplibs, $1)=yes +@@ -5368,7 +5491,7 @@ + newsos6) + _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_direct, $1)=yes +- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' ++ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; +@@ -5376,27 +5499,19 @@ + *nto* | *qnx*) + ;; + +- openbsd*) ++ openbsd* | bitrig*) + if test -f /usr/libexec/ld.so; then + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_TAGVAR(hardcode_direct_absolute, $1)=yes +- if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then ++ if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' +- _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' +- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' +- _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' ++ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags $wl-retain-symbols-file,$export_symbols' ++ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' ++ _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' + else +- case $host_os in +- openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*) +- _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' +- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' +- ;; +- *) +- _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' +- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' +- ;; +- esac ++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' ++ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' + fi + else + _LT_TAGVAR(ld_shlibs, $1)=no +@@ -5412,28 +5527,28 @@ + ;; + + osf3*) +- if test "$GCC" = yes; then +- _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' +- _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' ++ if test yes = "$GCC"; then ++ _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*' ++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' + else + _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' +- _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' ++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' + fi + _LT_TAGVAR(archive_cmds_need_lc, $1)='no' +- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' ++ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + ;; + + osf4* | osf5*) # as osf3* with the addition of -msym flag +- if test "$GCC" = yes; then +- _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' +- _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' +- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' ++ if test yes = "$GCC"; then ++ _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*' ++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $pic_flag $libobjs $deplibs $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' ++ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' + else + _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' +- _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' ++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ +- $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp' ++ $CC -shared$allow_undefined_flag $wl-input $wl$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib~$RM $lib.exp' + + # Both c and cxx compiler support -rpath directly + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' +@@ -5444,24 +5559,24 @@ + + solaris*) + _LT_TAGVAR(no_undefined_flag, $1)=' -z defs' +- if test "$GCC" = yes; then +- wlarc='${wl}' +- _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ++ if test yes = "$GCC"; then ++ wlarc='$wl' ++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl-z ${wl}text $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ +- $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' ++ $CC -shared $pic_flag $wl-z ${wl}text $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' + else + case `$CC -V 2>&1` in + *"Compilers 5.0"*) + wlarc='' +- _LT_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' ++ _LT_TAGVAR(archive_cmds, $1)='$LD -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ +- $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' ++ $LD -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' + ;; + *) +- wlarc='${wl}' +- _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags' ++ wlarc='$wl' ++ _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ +- $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' ++ $CC -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' + ;; + esac + fi +@@ -5471,11 +5586,11 @@ + solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; + *) + # The compiler driver will combine and reorder linker options, +- # but understands `-z linker_flag'. GCC discards it without `$wl', ++ # but understands '-z linker_flag'. GCC discards it without '$wl', + # but is careful enough not to reorder. + # Supported since Solaris 2.6 (maybe 2.5.1?) +- if test "$GCC" = yes; then +- _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' ++ if test yes = "$GCC"; then ++ _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract' + else + _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' + fi +@@ -5485,10 +5600,10 @@ + ;; + + sunos4*) +- if test "x$host_vendor" = xsequent; then ++ if test sequent = "$host_vendor"; then + # Use $CC to link under sequent, because it throws in some extra .o + # files that make .init and .fini sections work. +- _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' ++ _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h $soname -o $lib $libobjs $deplibs $compiler_flags' + else + _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' + fi +@@ -5537,43 +5652,43 @@ + ;; + + sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) +- _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' ++ _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text' + _LT_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + runpath_var='LD_RUN_PATH' + +- if test "$GCC" = yes; then +- _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' +- _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ++ if test yes = "$GCC"; then ++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ++ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + else +- _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' +- _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ++ _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ++ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + ;; + + sysv5* | sco3.2v5* | sco5v6*) +- # Note: We can NOT use -z defs as we might desire, because we do not ++ # Note: We CANNOT use -z defs as we might desire, because we do not + # link with -lc, and that would cause any symbols used from libc to + # always be unresolved, which means just about no library would + # ever link correctly. If we're not using GNU ld we use -z text + # though, which does catch some bad symbols but isn't as heavy-handed + # as -z defs. +- _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' +- _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' ++ _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text' ++ _LT_TAGVAR(allow_undefined_flag, $1)='$wl-z,nodefs' + _LT_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no +- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir' ++ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R,$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=':' + _LT_TAGVAR(link_all_deplibs, $1)=yes +- _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' ++ _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Bexport' + runpath_var='LD_RUN_PATH' + +- if test "$GCC" = yes; then +- _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' +- _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ++ if test yes = "$GCC"; then ++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ++ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + else +- _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' +- _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ++ _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ++ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + ;; + +@@ -5588,17 +5703,17 @@ + ;; + esac + +- if test x$host_vendor = xsni; then ++ if test sni = "$host_vendor"; then + case $host in + sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) +- _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Blargedynsym' ++ _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Blargedynsym' + ;; + esac + fi + fi + ]) + AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) +-test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no ++test no = "$_LT_TAGVAR(ld_shlibs, $1)" && can_build_shared=no + + _LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld + +@@ -5615,7 +5730,7 @@ + # Assume -lc should be added + _LT_TAGVAR(archive_cmds_need_lc, $1)=yes + +- if test "$enable_shared" = yes && test "$GCC" = yes; then ++ if test yes,yes = "$GCC,$enable_shared"; then + case $_LT_TAGVAR(archive_cmds, $1) in + *'~'*) + # FIXME: we may have to deal with multi-command sequences. +@@ -5695,12 +5810,12 @@ + _LT_TAGDECL([], [hardcode_libdir_separator], [1], + [Whether we need a single "-rpath" flag with a separated argument]) + _LT_TAGDECL([], [hardcode_direct], [0], +- [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes ++ [Set to "yes" if using DIR/libNAME$shared_ext during linking hardcodes + DIR into the resulting binary]) + _LT_TAGDECL([], [hardcode_direct_absolute], [0], +- [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes ++ [Set to "yes" if using DIR/libNAME$shared_ext during linking hardcodes + DIR into the resulting binary and the resulting library dependency is +- "absolute", i.e impossible to change by setting ${shlibpath_var} if the ++ "absolute", i.e impossible to change by setting $shlibpath_var if the + library is relocated]) + _LT_TAGDECL([], [hardcode_minus_L], [0], + [Set to "yes" if using the -LDIR flag during linking hardcodes DIR +@@ -5741,10 +5856,10 @@ + # ------------------------ + # Ensure that the configuration variables for a C compiler are suitably + # defined. These variables are subsequently used by _LT_CONFIG to write +-# the compiler configuration to `libtool'. ++# the compiler configuration to 'libtool'. + m4_defun([_LT_LANG_C_CONFIG], + [m4_require([_LT_DECL_EGREP])dnl +-lt_save_CC="$CC" ++lt_save_CC=$CC + AC_LANG_PUSH(C) + + # Source file extension for C test sources. +@@ -5784,18 +5899,18 @@ + LT_SYS_DLOPEN_SELF + _LT_CMD_STRIPLIB + +- # Report which library types will actually be built ++ # Report what library types will actually be built + AC_MSG_CHECKING([if libtool supports shared libraries]) + AC_MSG_RESULT([$can_build_shared]) + + AC_MSG_CHECKING([whether to build shared libraries]) +- test "$can_build_shared" = "no" && enable_shared=no ++ test no = "$can_build_shared" && enable_shared=no + + # On AIX, shared libraries and static libraries use the same namespace, and + # are all built from PIC. + case $host_os in + aix3*) +- test "$enable_shared" = yes && enable_static=no ++ test yes = "$enable_shared" && enable_static=no + if test -n "$RANLIB"; then + archive_cmds="$archive_cmds~\$RANLIB \$lib" + postinstall_cmds='$RANLIB $lib' +@@ -5803,8 +5918,8 @@ + ;; + + aix[[4-9]]*) +- if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then +- test "$enable_shared" = yes && enable_static=no ++ if test ia64 != "$host_cpu" && test no = "$aix_use_runtimelinking"; then ++ test yes = "$enable_shared" && enable_static=no + fi + ;; + esac +@@ -5812,13 +5927,13 @@ + + AC_MSG_CHECKING([whether to build static libraries]) + # Make sure either enable_shared or enable_static is yes. +- test "$enable_shared" = yes || enable_static=yes ++ test yes = "$enable_shared" || enable_static=yes + AC_MSG_RESULT([$enable_static]) + + _LT_CONFIG($1) + fi + AC_LANG_POP +-CC="$lt_save_CC" ++CC=$lt_save_CC + ])# _LT_LANG_C_CONFIG + + +@@ -5826,14 +5941,14 @@ + # -------------------------- + # Ensure that the configuration variables for a C++ compiler are suitably + # defined. These variables are subsequently used by _LT_CONFIG to write +-# the compiler configuration to `libtool'. ++# the compiler configuration to 'libtool'. + m4_defun([_LT_LANG_CXX_CONFIG], + [m4_require([_LT_FILEUTILS_DEFAULTS])dnl + m4_require([_LT_DECL_EGREP])dnl + m4_require([_LT_PATH_MANIFEST_TOOL])dnl +-if test -n "$CXX" && ( test "X$CXX" != "Xno" && +- ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || +- (test "X$CXX" != "Xg++"))) ; then ++if test -n "$CXX" && ( test no != "$CXX" && ++ ( (test g++ = "$CXX" && `g++ -v >/dev/null 2>&1` ) || ++ (test g++ != "$CXX"))); then + AC_PROG_CXXCPP + else + _lt_caught_CXX_error=yes +@@ -5875,7 +5990,7 @@ + # the CXX compiler isn't working. Some variables (like enable_shared) + # are currently assumed to apply to all compilers on this platform, + # and will be corrupted by setting them based on a non-working compiler. +-if test "$_lt_caught_CXX_error" != yes; then ++if test yes != "$_lt_caught_CXX_error"; then + # Code to be used in simple compile tests + lt_simple_compile_test_code="int some_variable = 0;" + +@@ -5917,35 +6032,35 @@ + if test -n "$compiler"; then + # We don't want -fno-exception when compiling C++ code, so set the + # no_builtin_flag separately +- if test "$GXX" = yes; then ++ if test yes = "$GXX"; then + _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' + else + _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= + fi + +- if test "$GXX" = yes; then ++ if test yes = "$GXX"; then + # Set up default GNU C++ configuration + + LT_PATH_LD + + # Check if GNU C++ uses GNU ld as the underlying linker, since the + # archiving commands below assume that GNU ld is being used. +- if test "$with_gnu_ld" = yes; then +- _LT_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' +- _LT_TAGVAR(archive_expsym_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' +- +- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' +- _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' ++ if test yes = "$with_gnu_ld"; then ++ _LT_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' ++ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' ++ ++ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' ++ _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' + + # If archive_cmds runs LD, not CC, wlarc should be empty + # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to + # investigate it a little bit more. (MM) +- wlarc='${wl}' ++ wlarc='$wl' + + # ancient GNU ld didn't support --whole-archive et. al. + if eval "`$CC -print-prog-name=ld` --help 2>&1" | + $GREP 'no-whole-archive' > /dev/null; then +- _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' ++ _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive' + else + _LT_TAGVAR(whole_archive_flag_spec, $1)= + fi +@@ -5981,12 +6096,12 @@ + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + aix[[4-9]]*) +- if test "$host_cpu" = ia64; then ++ if test ia64 = "$host_cpu"; then + # On IA64, the linker does run time linking by default, so we don't + # have to do anything special. + aix_use_runtimelinking=no + exp_sym_flag='-Bexport' +- no_entry_flag="" ++ no_entry_flag= + else + aix_use_runtimelinking=no + +@@ -6020,13 +6135,13 @@ + _LT_TAGVAR(hardcode_direct_absolute, $1)=yes + _LT_TAGVAR(hardcode_libdir_separator, $1)=':' + _LT_TAGVAR(link_all_deplibs, $1)=yes +- _LT_TAGVAR(file_list_spec, $1)='${wl}-f,' +- +- if test "$GXX" = yes; then ++ _LT_TAGVAR(file_list_spec, $1)='$wl-f,' ++ ++ if test yes = "$GXX"; then + case $host_os in aix4.[[012]]|aix4.[[012]].*) + # We only want to do this on AIX 4.2 and lower, the check + # below for broken collect2 doesn't work under 4.3+ +- collect2name=`${CC} -print-prog-name=collect2` ++ collect2name=`$CC -print-prog-name=collect2` + if test -f "$collect2name" && + strings "$collect2name" | $GREP resolve_lib_name >/dev/null + then +@@ -6044,56 +6159,56 @@ + fi + esac + shared_flag='-shared' +- if test "$aix_use_runtimelinking" = yes; then +- shared_flag="$shared_flag "'${wl}-G' ++ if test yes = "$aix_use_runtimelinking"; then ++ shared_flag=$shared_flag' $wl-G' + fi + else + # not using gcc +- if test "$host_cpu" = ia64; then ++ if test ia64 = "$host_cpu"; then + # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release + # chokes on -Wl,-G. The following line is correct: + shared_flag='-G' + else +- if test "$aix_use_runtimelinking" = yes; then +- shared_flag='${wl}-G' ++ if test yes = "$aix_use_runtimelinking"; then ++ shared_flag='$wl-G' + else +- shared_flag='${wl}-bM:SRE' ++ shared_flag='$wl-bM:SRE' + fi + fi + fi + +- _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall' ++ _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-bexpall' + # It seems that -bexpall does not export symbols beginning with + # underscore (_), so it is better to generate a list of symbols to + # export. + _LT_TAGVAR(always_export_symbols, $1)=yes +- if test "$aix_use_runtimelinking" = yes; then ++ if test yes = "$aix_use_runtimelinking"; then + # Warning - without using the other runtime loading flags (-brtl), + # -berok will link without error, but may produce a broken library. + _LT_TAGVAR(allow_undefined_flag, $1)='-berok' + # Determine the default libpath from the value encoded in an empty + # executable. + _LT_SYS_MODULE_PATH_AIX([$1]) +- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" +- +- _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" ++ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath" ++ ++ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag + else +- if test "$host_cpu" = ia64; then +- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' ++ if test ia64 = "$host_cpu"; then ++ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $libdir:/usr/lib:/lib' + _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" +- _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" ++ _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\$wl$no_entry_flag"' $compiler_flags $wl$allow_undefined_flag '"\$wl$exp_sym_flag:\$export_symbols" + else + # Determine the default libpath from the value encoded in an + # empty executable. + _LT_SYS_MODULE_PATH_AIX([$1]) +- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" ++ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath" + # Warning - without using the other run time loading flags, + # -berok will link without error, but may produce a broken library. +- _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' +- _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' +- if test "$with_gnu_ld" = yes; then ++ _LT_TAGVAR(no_undefined_flag, $1)=' $wl-bernotok' ++ _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-berok' ++ if test yes = "$with_gnu_ld"; then + # We only use this code for GNU lds that support --whole-archive. +- _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' ++ _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive' + else + # Exported symbols can be pulled into shared objects from archives + _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' +@@ -6101,7 +6216,7 @@ + _LT_TAGVAR(archive_cmds_need_lc, $1)=yes + # This is similar to how AIX traditionally builds its shared + # libraries. +- _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' ++ _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $wl-bnoentry $compiler_flags $wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + fi + fi + ;; +@@ -6111,7 +6226,7 @@ + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + # Joseph Beckenbach says some releases of gcc + # support --undefined. This deserves some investigation. FIXME +- _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' ++ _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi +@@ -6139,57 +6254,58 @@ + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. +- shrext_cmds=".dll" ++ shrext_cmds=.dll + # FIXME: Setting linknames here is a bad hack. +- _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' +- _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then +- $SED -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; +- else +- $SED -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; +- fi~ +- $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ +- linknames=' ++ _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames=' ++ _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then ++ cp "$export_symbols" "$output_objdir/$soname.def"; ++ echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp"; ++ else ++ $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp; ++ fi~ ++ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ ++ linknames=' + # The linker will not automatically build a static lib if we build a DLL. + # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + # Don't use ranlib + _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib' + _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~ +- lt_tool_outputfile="@TOOL_OUTPUT@"~ +- case $lt_outputfile in +- *.exe|*.EXE) ;; +- *) +- lt_outputfile="$lt_outputfile.exe" +- lt_tool_outputfile="$lt_tool_outputfile.exe" +- ;; +- esac~ +- func_to_tool_file "$lt_outputfile"~ +- if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then +- $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; +- $RM "$lt_outputfile.manifest"; +- fi' ++ lt_tool_outputfile="@TOOL_OUTPUT@"~ ++ case $lt_outputfile in ++ *.exe|*.EXE) ;; ++ *) ++ lt_outputfile=$lt_outputfile.exe ++ lt_tool_outputfile=$lt_tool_outputfile.exe ++ ;; ++ esac~ ++ func_to_tool_file "$lt_outputfile"~ ++ if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then ++ $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; ++ $RM "$lt_outputfile.manifest"; ++ fi' + ;; + *) + # g++ + # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, + # as there is no search path for DLLs. + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' +- _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols' ++ _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-all-symbols' + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_TAGVAR(always_export_symbols, $1)=no + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + + if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then +- _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' +- # If the export-symbols file already is a .def file (1st line +- # is EXPORTS), use it as is; otherwise, prepend... +- _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then +- cp $export_symbols $output_objdir/$soname.def; +- else +- echo EXPORTS > $output_objdir/$soname.def; +- cat $export_symbols >> $output_objdir/$soname.def; +- fi~ +- $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' ++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' ++ # If the export-symbols file already is a .def file, use it as ++ # is; otherwise, prepend EXPORTS... ++ _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then ++ cp $export_symbols $output_objdir/$soname.def; ++ else ++ echo EXPORTS > $output_objdir/$soname.def; ++ cat $export_symbols >> $output_objdir/$soname.def; ++ fi~ ++ $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi +@@ -6234,18 +6350,15 @@ + _LT_TAGVAR(ld_shlibs, $1)=yes + ;; + +- gnu*) +- ;; +- + haiku*) +- _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' ++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + _LT_TAGVAR(link_all_deplibs, $1)=yes + ;; + + hpux9*) +- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' ++ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: +- _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' ++ _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, + # but as the default +@@ -6257,7 +6370,7 @@ + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + aCC*) +- _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' ++ _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -b $wl+b $wl$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. +@@ -6266,11 +6379,11 @@ + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. +- output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ++ output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' + ;; + *) +- if test "$GXX" = yes; then +- _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' ++ if test yes = "$GXX"; then ++ _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' + else + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no +@@ -6280,15 +6393,15 @@ + ;; + + hpux10*|hpux11*) +- if test $with_gnu_ld = no; then +- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' ++ if test no = "$with_gnu_ld"; then ++ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + + case $host_cpu in + hppa*64*|ia64*) + ;; + *) +- _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' ++ _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' + ;; + esac + fi +@@ -6314,13 +6427,13 @@ + aCC*) + case $host_cpu in + hppa*64*) +- _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ++ _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + ia64*) +- _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ++ _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + *) +- _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ++ _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + esac + # Commands to make compiler produce verbose output that lists +@@ -6331,20 +6444,20 @@ + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. +- output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ++ output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' + ;; + *) +- if test "$GXX" = yes; then +- if test $with_gnu_ld = no; then ++ if test yes = "$GXX"; then ++ if test no = "$with_gnu_ld"; then + case $host_cpu in + hppa*64*) +- _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC $wl+h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + ia64*) +- _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + *) +- _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + esac + fi +@@ -6359,22 +6472,22 @@ + interix[[3-9]]*) + _LT_TAGVAR(hardcode_direct, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no +- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' +- _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' ++ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' ++ _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' + # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. + # Instead, shared libraries are loaded at an image base (0x10000000 by + # default) and relocated if they conflict, which is a slow very memory + # consuming and fragmenting process. To avoid this, we pick a random, + # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link + # time. Moving up from 0x10000000 also allows more sbrk(2) space. +- _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' +- _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ++ _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + ;; + irix5* | irix6*) + case $cc_basename in + CC*) + # SGI C++ +- _LT_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' ++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' + + # Archives containing C++ object files must be created using + # "CC -ar", where "CC" is the IRIX C++ compiler. This is +@@ -6383,22 +6496,22 @@ + _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs' + ;; + *) +- if test "$GXX" = yes; then +- if test "$with_gnu_ld" = no; then +- _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' ++ if test yes = "$GXX"; then ++ if test no = "$with_gnu_ld"; then ++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' + else +- _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` -o $lib' ++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` -o $lib' + fi + fi + _LT_TAGVAR(link_all_deplibs, $1)=yes + ;; + esac +- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' ++ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_TAGVAR(inherit_rpath, $1)=yes + ;; + +- linux* | k*bsd*-gnu | kopensolaris*-gnu) ++ linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) + case $cc_basename in + KCC*) + # Kuck and Associates, Inc. (KAI) C++ Compiler +@@ -6406,8 +6519,8 @@ + # KCC will only create a shared library if the output file + # ends with ".so" (or ".sl" for HP-UX), so rename the library + # to its proper name (with version) after linking. +- _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' +- _LT_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib' ++ _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' ++ _LT_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib $wl-retain-symbols-file,$export_symbols; mv \$templib $lib' + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. +@@ -6416,10 +6529,10 @@ + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. +- output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' +- +- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' +- _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' ++ output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ++ ++ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' ++ _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' + + # Archives containing C++ object files must be created using + # "CC -Bstatic", where "CC" is the KAI C++ compiler. +@@ -6433,59 +6546,59 @@ + # earlier do not add the objects themselves. + case `$CC -V 2>&1` in + *"Version 7."*) +- _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' +- _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' ++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' ++ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' + ;; + *) # Version 8.0 or newer + tmp_idyn= + case $host_cpu in + ia64*) tmp_idyn=' -i_dynamic';; + esac +- _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' +- _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' ++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' ++ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' + ;; + esac + _LT_TAGVAR(archive_cmds_need_lc, $1)=no +- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' +- _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' +- _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' ++ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' ++ _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' ++ _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive' + ;; + pgCC* | pgcpp*) + # Portland Group C++ compiler + case `$CC -V` in + *pgCC\ [[1-5]].* | *pgcpp\ [[1-5]].*) + _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~ +- rm -rf $tpldir~ +- $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~ +- compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"' ++ rm -rf $tpldir~ ++ $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~ ++ compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"' + _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~ +- rm -rf $tpldir~ +- $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~ +- $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~ +- $RANLIB $oldlib' ++ rm -rf $tpldir~ ++ $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~ ++ $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~ ++ $RANLIB $oldlib' + _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~ +- rm -rf $tpldir~ +- $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ +- $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' ++ rm -rf $tpldir~ ++ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ ++ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~ +- rm -rf $tpldir~ +- $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ +- $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' ++ rm -rf $tpldir~ ++ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ ++ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' + ;; + *) # Version 6 and above use weak symbols +- _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' +- _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' ++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' ++ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' + ;; + esac + +- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' +- _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' +- _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' ++ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl--rpath $wl$libdir' ++ _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' ++ _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' + ;; + cxx*) + # Compaq C++ +- _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' +- _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols' ++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' ++ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib $wl-retain-symbols-file $wl$export_symbols' + + runpath_var=LD_RUN_PATH + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' +@@ -6499,18 +6612,18 @@ + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. +- output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed' ++ output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed' + ;; + xl* | mpixl* | bgxl*) + # IBM XL 8.0 on PPC, with GNU ld +- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' +- _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' +- _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' +- if test "x$supports_anon_versioning" = xyes; then ++ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' ++ _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' ++ _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' ++ if test yes = "$supports_anon_versioning"; then + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ +- cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ +- echo "local: *; };" >> $output_objdir/$libname.ver~ +- $CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' ++ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ ++ echo "local: *; };" >> $output_objdir/$libname.ver~ ++ $CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib' + fi + ;; + *) +@@ -6518,10 +6631,10 @@ + *Sun\ C*) + # Sun C++ 5.9 + _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' +- _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' +- _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols' ++ _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ++ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-retain-symbols-file $wl$export_symbols' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' +- _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' ++ _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' + _LT_TAGVAR(compiler_needs_object, $1)=yes + + # Not sure whether something based on +@@ -6579,22 +6692,17 @@ + _LT_TAGVAR(ld_shlibs, $1)=yes + ;; + +- openbsd2*) +- # C++ shared libraries are fairly broken +- _LT_TAGVAR(ld_shlibs, $1)=no +- ;; +- +- openbsd*) ++ openbsd* | bitrig*) + if test -f /usr/libexec/ld.so; then + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_TAGVAR(hardcode_direct_absolute, $1)=yes + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' +- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' +- if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then +- _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib' +- _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' +- _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' ++ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' ++ if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`"; then ++ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-retain-symbols-file,$export_symbols -o $lib' ++ _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' ++ _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive' + fi + output_verbose_link_cmd=func_echo_all + else +@@ -6610,9 +6718,9 @@ + # KCC will only create a shared library if the output file + # ends with ".so" (or ".sl" for HP-UX), so rename the library + # to its proper name (with version) after linking. +- _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' +- +- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' ++ _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' ++ ++ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + + # Archives containing C++ object files must be created using +@@ -6630,17 +6738,17 @@ + cxx*) + case $host in + osf3*) +- _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' +- _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && func_echo_all "${wl}-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' +- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' ++ _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*' ++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $soname `test -n "$verstring" && func_echo_all "$wl-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' ++ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' + ;; + *) + _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' +- _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' ++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ +- echo "-hidden">> $lib.exp~ +- $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname ${wl}-input ${wl}$lib.exp `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~ +- $RM $lib.exp' ++ echo "-hidden">> $lib.exp~ ++ $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname $wl-input $wl$lib.exp `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib~ ++ $RM $lib.exp' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' + ;; + esac +@@ -6655,21 +6763,21 @@ + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. +- output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ++ output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' + ;; + *) +- if test "$GXX" = yes && test "$with_gnu_ld" = no; then +- _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' ++ if test yes,no = "$GXX,$with_gnu_ld"; then ++ _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*' + case $host in + osf3*) +- _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' ++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' + ;; + *) +- _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' ++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' + ;; + esac + +- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' ++ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + + # Commands to make compiler produce verbose output that lists +@@ -6715,9 +6823,9 @@ + # Sun C++ 4.2, 5.x and Centerline C++ + _LT_TAGVAR(archive_cmds_need_lc,$1)=yes + _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' +- _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ++ _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ +- $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' ++ $CC -G$allow_undefined_flag $wl-M $wl$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' + + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no +@@ -6725,7 +6833,7 @@ + solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; + *) + # The compiler driver will combine and reorder linker options, +- # but understands `-z linker_flag'. ++ # but understands '-z linker_flag'. + # Supported since Solaris 2.6 (maybe 2.5.1?) + _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' + ;; +@@ -6742,30 +6850,30 @@ + ;; + gcx*) + # Green Hills C++ Compiler +- _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' ++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib' + + # The C++ compiler must be used to create the archive. + _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs' + ;; + *) + # GNU C++ compiler with Solaris linker +- if test "$GXX" = yes && test "$with_gnu_ld" = no; then +- _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs' ++ if test yes,no = "$GXX,$with_gnu_ld"; then ++ _LT_TAGVAR(no_undefined_flag, $1)=' $wl-z ${wl}defs' + if $CC --version | $GREP -v '^2\.7' > /dev/null; then +- _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' ++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ +- $CC -shared $pic_flag -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' ++ $CC -shared $pic_flag -nostdlib $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' + else +- # g++ 2.7 appears to require `-G' NOT `-shared' on this ++ # g++ 2.7 appears to require '-G' NOT '-shared' on this + # platform. +- _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' ++ _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ +- $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' ++ $CC -G -nostdlib $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when +@@ -6773,11 +6881,11 @@ + output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' + fi + +- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir' ++ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $wl$libdir' + case $host_os in + solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; + *) +- _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' ++ _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract' + ;; + esac + fi +@@ -6786,52 +6894,52 @@ + ;; + + sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) +- _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' ++ _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text' + _LT_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + runpath_var='LD_RUN_PATH' + + case $cc_basename in + CC*) +- _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' +- _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ++ _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ++ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) +- _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' +- _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ++ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + ;; + + sysv5* | sco3.2v5* | sco5v6*) +- # Note: We can NOT use -z defs as we might desire, because we do not ++ # Note: We CANNOT use -z defs as we might desire, because we do not + # link with -lc, and that would cause any symbols used from libc to + # always be unresolved, which means just about no library would + # ever link correctly. If we're not using GNU ld we use -z text + # though, which does catch some bad symbols but isn't as heavy-handed + # as -z defs. +- _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' +- _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' ++ _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text' ++ _LT_TAGVAR(allow_undefined_flag, $1)='$wl-z,nodefs' + _LT_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no +- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir' ++ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R,$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=':' + _LT_TAGVAR(link_all_deplibs, $1)=yes +- _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' ++ _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Bexport' + runpath_var='LD_RUN_PATH' + + case $cc_basename in + CC*) +- _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' +- _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ++ _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ++ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(old_archive_cmds, $1)='$CC -Tprelink_objects $oldobjs~ +- '"$_LT_TAGVAR(old_archive_cmds, $1)" ++ '"$_LT_TAGVAR(old_archive_cmds, $1)" + _LT_TAGVAR(reload_cmds, $1)='$CC -Tprelink_objects $reload_objs~ +- '"$_LT_TAGVAR(reload_cmds, $1)" ++ '"$_LT_TAGVAR(reload_cmds, $1)" + ;; + *) +- _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' +- _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ++ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + ;; +@@ -6862,10 +6970,10 @@ + esac + + AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) +- test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no +- +- _LT_TAGVAR(GCC, $1)="$GXX" +- _LT_TAGVAR(LD, $1)="$LD" ++ test no = "$_LT_TAGVAR(ld_shlibs, $1)" && can_build_shared=no ++ ++ _LT_TAGVAR(GCC, $1)=$GXX ++ _LT_TAGVAR(LD, $1)=$LD + + ## CAVEAT EMPTOR: + ## There is no encapsulation within the following macros, do not change +@@ -6892,7 +7000,7 @@ + lt_cv_path_LD=$lt_save_path_LD + lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld + lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld +-fi # test "$_lt_caught_CXX_error" != yes ++fi # test yes != "$_lt_caught_CXX_error" + + AC_LANG_POP + ])# _LT_LANG_CXX_CONFIG +@@ -6914,9 +7022,9 @@ + AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH]) + func_stripname_cnf () + { +- case ${2} in +- .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;; +- *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;; ++ case @S|@2 in ++ .*) func_stripname_result=`$ECHO "@S|@3" | $SED "s%^@S|@1%%; s%\\\\@S|@2\$%%"`;; ++ *) func_stripname_result=`$ECHO "@S|@3" | $SED "s%^@S|@1%%; s%@S|@2\$%%"`;; + esac + } # func_stripname_cnf + ])# _LT_FUNC_STRIPNAME_CNF +@@ -7004,13 +7112,13 @@ + pre_test_object_deps_done=no + + for p in `eval "$output_verbose_link_cmd"`; do +- case ${prev}${p} in ++ case $prev$p in + + -L* | -R* | -l*) + # Some compilers place space between "-{L,R}" and the path. + # Remove the space. +- if test $p = "-L" || +- test $p = "-R"; then ++ if test x-L = "$p" || ++ test x-R = "$p"; then + prev=$p + continue + fi +@@ -7026,16 +7134,16 @@ + case $p in + =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;; + esac +- if test "$pre_test_object_deps_done" = no; then +- case ${prev} in ++ if test no = "$pre_test_object_deps_done"; then ++ case $prev in + -L | -R) + # Internal compiler library paths should come after those + # provided the user. The postdeps already come after the + # user supplied libs so there is no need to process them. + if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then +- _LT_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}" ++ _LT_TAGVAR(compiler_lib_search_path, $1)=$prev$p + else +- _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}" ++ _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} $prev$p" + fi + ;; + # The "-l" case would never come before the object being +@@ -7043,9 +7151,9 @@ + esac + else + if test -z "$_LT_TAGVAR(postdeps, $1)"; then +- _LT_TAGVAR(postdeps, $1)="${prev}${p}" ++ _LT_TAGVAR(postdeps, $1)=$prev$p + else +- _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} ${prev}${p}" ++ _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} $prev$p" + fi + fi + prev= +@@ -7060,15 +7168,15 @@ + continue + fi + +- if test "$pre_test_object_deps_done" = no; then ++ if test no = "$pre_test_object_deps_done"; then + if test -z "$_LT_TAGVAR(predep_objects, $1)"; then +- _LT_TAGVAR(predep_objects, $1)="$p" ++ _LT_TAGVAR(predep_objects, $1)=$p + else + _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p" + fi + else + if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then +- _LT_TAGVAR(postdep_objects, $1)="$p" ++ _LT_TAGVAR(postdep_objects, $1)=$p + else + _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p" + fi +@@ -7115,7 +7223,7 @@ + ;; + esac + +- if test "$solaris_use_stlport4" != yes; then ++ if test yes != "$solaris_use_stlport4"; then + _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun' + fi + ;; +@@ -7138,7 +7246,7 @@ + # Adding this requires a known-good setup of shared libraries for + # Sun compiler versions before 5.6, else PIC objects from an old + # archive will be linked into the output, leading to subtle bugs. +- if test "$solaris_use_stlport4" != yes; then ++ if test yes != "$solaris_use_stlport4"; then + _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun' + fi + ;; +@@ -7152,7 +7260,7 @@ + esac + _LT_TAGVAR(compiler_lib_search_dirs, $1)= + if test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then +- _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | ${SED} -e 's! -L! !g' -e 's!^ !!'` ++ _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | $SED -e 's! -L! !g' -e 's!^ !!'` + fi + _LT_TAGDECL([], [compiler_lib_search_dirs], [1], + [The directories searched by this compiler when creating a shared library]) +@@ -7172,10 +7280,10 @@ + # -------------------------- + # Ensure that the configuration variables for a Fortran 77 compiler are + # suitably defined. These variables are subsequently used by _LT_CONFIG +-# to write the compiler configuration to `libtool'. ++# to write the compiler configuration to 'libtool'. + m4_defun([_LT_LANG_F77_CONFIG], + [AC_LANG_PUSH(Fortran 77) +-if test -z "$F77" || test "X$F77" = "Xno"; then ++if test -z "$F77" || test no = "$F77"; then + _lt_disable_F77=yes + fi + +@@ -7212,7 +7320,7 @@ + # the F77 compiler isn't working. Some variables (like enable_shared) + # are currently assumed to apply to all compilers on this platform, + # and will be corrupted by setting them based on a non-working compiler. +-if test "$_lt_disable_F77" != yes; then ++if test yes != "$_lt_disable_F77"; then + # Code to be used in simple compile tests + lt_simple_compile_test_code="\ + subroutine t +@@ -7234,7 +7342,7 @@ + _LT_LINKER_BOILERPLATE + + # Allow CC to be a program name with arguments. +- lt_save_CC="$CC" ++ lt_save_CC=$CC + lt_save_GCC=$GCC + lt_save_CFLAGS=$CFLAGS + CC=${F77-"f77"} +@@ -7248,21 +7356,21 @@ + AC_MSG_RESULT([$can_build_shared]) + + AC_MSG_CHECKING([whether to build shared libraries]) +- test "$can_build_shared" = "no" && enable_shared=no ++ test no = "$can_build_shared" && enable_shared=no + + # On AIX, shared libraries and static libraries use the same namespace, and + # are all built from PIC. + case $host_os in + aix3*) +- test "$enable_shared" = yes && enable_static=no ++ test yes = "$enable_shared" && enable_static=no + if test -n "$RANLIB"; then + archive_cmds="$archive_cmds~\$RANLIB \$lib" + postinstall_cmds='$RANLIB $lib' + fi + ;; + aix[[4-9]]*) +- if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then +- test "$enable_shared" = yes && enable_static=no ++ if test ia64 != "$host_cpu" && test no = "$aix_use_runtimelinking"; then ++ test yes = "$enable_shared" && enable_static=no + fi + ;; + esac +@@ -7270,11 +7378,11 @@ + + AC_MSG_CHECKING([whether to build static libraries]) + # Make sure either enable_shared or enable_static is yes. +- test "$enable_shared" = yes || enable_static=yes ++ test yes = "$enable_shared" || enable_static=yes + AC_MSG_RESULT([$enable_static]) + +- _LT_TAGVAR(GCC, $1)="$G77" +- _LT_TAGVAR(LD, $1)="$LD" ++ _LT_TAGVAR(GCC, $1)=$G77 ++ _LT_TAGVAR(LD, $1)=$LD + + ## CAVEAT EMPTOR: + ## There is no encapsulation within the following macros, do not change +@@ -7291,9 +7399,9 @@ + fi # test -n "$compiler" + + GCC=$lt_save_GCC +- CC="$lt_save_CC" +- CFLAGS="$lt_save_CFLAGS" +-fi # test "$_lt_disable_F77" != yes ++ CC=$lt_save_CC ++ CFLAGS=$lt_save_CFLAGS ++fi # test yes != "$_lt_disable_F77" + + AC_LANG_POP + ])# _LT_LANG_F77_CONFIG +@@ -7303,11 +7411,11 @@ + # ------------------------- + # Ensure that the configuration variables for a Fortran compiler are + # suitably defined. These variables are subsequently used by _LT_CONFIG +-# to write the compiler configuration to `libtool'. ++# to write the compiler configuration to 'libtool'. + m4_defun([_LT_LANG_FC_CONFIG], + [AC_LANG_PUSH(Fortran) + +-if test -z "$FC" || test "X$FC" = "Xno"; then ++if test -z "$FC" || test no = "$FC"; then + _lt_disable_FC=yes + fi + +@@ -7344,7 +7452,7 @@ + # the FC compiler isn't working. Some variables (like enable_shared) + # are currently assumed to apply to all compilers on this platform, + # and will be corrupted by setting them based on a non-working compiler. +-if test "$_lt_disable_FC" != yes; then ++if test yes != "$_lt_disable_FC"; then + # Code to be used in simple compile tests + lt_simple_compile_test_code="\ + subroutine t +@@ -7366,7 +7474,7 @@ + _LT_LINKER_BOILERPLATE + + # Allow CC to be a program name with arguments. +- lt_save_CC="$CC" ++ lt_save_CC=$CC + lt_save_GCC=$GCC + lt_save_CFLAGS=$CFLAGS + CC=${FC-"f95"} +@@ -7382,21 +7490,21 @@ + AC_MSG_RESULT([$can_build_shared]) + + AC_MSG_CHECKING([whether to build shared libraries]) +- test "$can_build_shared" = "no" && enable_shared=no ++ test no = "$can_build_shared" && enable_shared=no + + # On AIX, shared libraries and static libraries use the same namespace, and + # are all built from PIC. + case $host_os in + aix3*) +- test "$enable_shared" = yes && enable_static=no ++ test yes = "$enable_shared" && enable_static=no + if test -n "$RANLIB"; then + archive_cmds="$archive_cmds~\$RANLIB \$lib" + postinstall_cmds='$RANLIB $lib' + fi + ;; + aix[[4-9]]*) +- if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then +- test "$enable_shared" = yes && enable_static=no ++ if test ia64 != "$host_cpu" && test no = "$aix_use_runtimelinking"; then ++ test yes = "$enable_shared" && enable_static=no + fi + ;; + esac +@@ -7404,11 +7512,11 @@ + + AC_MSG_CHECKING([whether to build static libraries]) + # Make sure either enable_shared or enable_static is yes. +- test "$enable_shared" = yes || enable_static=yes ++ test yes = "$enable_shared" || enable_static=yes + AC_MSG_RESULT([$enable_static]) + +- _LT_TAGVAR(GCC, $1)="$ac_cv_fc_compiler_gnu" +- _LT_TAGVAR(LD, $1)="$LD" ++ _LT_TAGVAR(GCC, $1)=$ac_cv_fc_compiler_gnu ++ _LT_TAGVAR(LD, $1)=$LD + + ## CAVEAT EMPTOR: + ## There is no encapsulation within the following macros, do not change +@@ -7428,7 +7536,7 @@ + GCC=$lt_save_GCC + CC=$lt_save_CC + CFLAGS=$lt_save_CFLAGS +-fi # test "$_lt_disable_FC" != yes ++fi # test yes != "$_lt_disable_FC" + + AC_LANG_POP + ])# _LT_LANG_FC_CONFIG +@@ -7438,7 +7546,7 @@ + # -------------------------- + # Ensure that the configuration variables for the GNU Java Compiler compiler + # are suitably defined. These variables are subsequently used by _LT_CONFIG +-# to write the compiler configuration to `libtool'. ++# to write the compiler configuration to 'libtool'. + m4_defun([_LT_LANG_GCJ_CONFIG], + [AC_REQUIRE([LT_PROG_GCJ])dnl + AC_LANG_SAVE +@@ -7472,7 +7580,7 @@ + CFLAGS=$GCJFLAGS + compiler=$CC + _LT_TAGVAR(compiler, $1)=$CC +-_LT_TAGVAR(LD, $1)="$LD" ++_LT_TAGVAR(LD, $1)=$LD + _LT_CC_BASENAME([$compiler]) + + # GCJ did not exist at the time GCC didn't implicitly link libc in. +@@ -7509,7 +7617,7 @@ + # -------------------------- + # Ensure that the configuration variables for the GNU Go compiler + # are suitably defined. These variables are subsequently used by _LT_CONFIG +-# to write the compiler configuration to `libtool'. ++# to write the compiler configuration to 'libtool'. + m4_defun([_LT_LANG_GO_CONFIG], + [AC_REQUIRE([LT_PROG_GO])dnl + AC_LANG_SAVE +@@ -7543,7 +7651,7 @@ + CFLAGS=$GOFLAGS + compiler=$CC + _LT_TAGVAR(compiler, $1)=$CC +-_LT_TAGVAR(LD, $1)="$LD" ++_LT_TAGVAR(LD, $1)=$LD + _LT_CC_BASENAME([$compiler]) + + # Go did not exist at the time GCC didn't implicitly link libc in. +@@ -7580,7 +7688,7 @@ + # ------------------------- + # Ensure that the configuration variables for the Windows resource compiler + # are suitably defined. These variables are subsequently used by _LT_CONFIG +-# to write the compiler configuration to `libtool'. ++# to write the compiler configuration to 'libtool'. + m4_defun([_LT_LANG_RC_CONFIG], + [AC_REQUIRE([LT_PROG_RC])dnl + AC_LANG_SAVE +@@ -7596,7 +7704,7 @@ + lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }' + + # Code to be used in simple link tests +-lt_simple_link_test_code="$lt_simple_compile_test_code" ++lt_simple_link_test_code=$lt_simple_compile_test_code + + # ltmain only uses $CC for tagged configurations so make sure $CC is set. + _LT_TAG_COMPILER +@@ -7606,7 +7714,7 @@ + _LT_LINKER_BOILERPLATE + + # Allow CC to be a program name with arguments. +-lt_save_CC="$CC" ++lt_save_CC=$CC + lt_save_CFLAGS=$CFLAGS + lt_save_GCC=$GCC + GCC= +@@ -7635,7 +7743,7 @@ + [m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ], + [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ], + [AC_CHECK_TOOL(GCJ, gcj,) +- test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2" ++ test set = "${GCJFLAGS+set}" || GCJFLAGS="-g -O2" + AC_SUBST(GCJFLAGS)])])[]dnl + ]) + +@@ -7746,7 +7854,7 @@ + # Add /usr/xpg4/bin/sed as it is typically found on Solaris + # along with /bin/sed that truncates output. + for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do +- test ! -f $lt_ac_sed && continue ++ test ! -f "$lt_ac_sed" && continue + cat /dev/null > conftest.in + lt_ac_count=0 + echo $ECHO_N "0123456789$ECHO_C" >conftest.in +@@ -7763,9 +7871,9 @@ + $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break + cmp -s conftest.out conftest.nl || break + # 10000 chars as input seems more than enough +- test $lt_ac_count -gt 10 && break ++ test 10 -lt "$lt_ac_count" && break + lt_ac_count=`expr $lt_ac_count + 1` +- if test $lt_ac_count -gt $lt_ac_max; then ++ if test "$lt_ac_count" -gt "$lt_ac_max"; then + lt_ac_max=$lt_ac_count + lt_cv_path_SED=$lt_ac_sed + fi +@@ -7789,27 +7897,7 @@ + # Find out whether the shell is Bourne or XSI compatible, + # or has some other useful features. + m4_defun([_LT_CHECK_SHELL_FEATURES], +-[AC_MSG_CHECKING([whether the shell understands some XSI constructs]) +-# Try some XSI features +-xsi_shell=no +-( _lt_dummy="a/b/c" +- test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \ +- = c,a/b,b/c, \ +- && eval 'test $(( 1 + 1 )) -eq 2 \ +- && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \ +- && xsi_shell=yes +-AC_MSG_RESULT([$xsi_shell]) +-_LT_CONFIG_LIBTOOL_INIT([xsi_shell='$xsi_shell']) +- +-AC_MSG_CHECKING([whether the shell understands "+="]) +-lt_shell_append=no +-( foo=bar; set foo baz; eval "$[1]+=\$[2]" && test "$foo" = barbaz ) \ +- >/dev/null 2>&1 \ +- && lt_shell_append=yes +-AC_MSG_RESULT([$lt_shell_append]) +-_LT_CONFIG_LIBTOOL_INIT([lt_shell_append='$lt_shell_append']) +- +-if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then ++[if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then + lt_unset=unset + else + lt_unset=false +@@ -7833,102 +7921,9 @@ + ])# _LT_CHECK_SHELL_FEATURES + + +-# _LT_PROG_FUNCTION_REPLACE (FUNCNAME, REPLACEMENT-BODY) +-# ------------------------------------------------------ +-# In `$cfgfile', look for function FUNCNAME delimited by `^FUNCNAME ()$' and +-# '^} FUNCNAME ', and replace its body with REPLACEMENT-BODY. +-m4_defun([_LT_PROG_FUNCTION_REPLACE], +-[dnl { +-sed -e '/^$1 ()$/,/^} # $1 /c\ +-$1 ()\ +-{\ +-m4_bpatsubsts([$2], [$], [\\], [^\([ ]\)], [\\\1]) +-} # Extended-shell $1 implementation' "$cfgfile" > $cfgfile.tmp \ +- && mv -f "$cfgfile.tmp" "$cfgfile" \ +- || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +-test 0 -eq $? || _lt_function_replace_fail=: +-]) +- +- +-# _LT_PROG_REPLACE_SHELLFNS +-# ------------------------- +-# Replace existing portable implementations of several shell functions with +-# equivalent extended shell implementations where those features are available.. +-m4_defun([_LT_PROG_REPLACE_SHELLFNS], +-[if test x"$xsi_shell" = xyes; then +- _LT_PROG_FUNCTION_REPLACE([func_dirname], [dnl +- case ${1} in +- */*) func_dirname_result="${1%/*}${2}" ;; +- * ) func_dirname_result="${3}" ;; +- esac]) +- +- _LT_PROG_FUNCTION_REPLACE([func_basename], [dnl +- func_basename_result="${1##*/}"]) +- +- _LT_PROG_FUNCTION_REPLACE([func_dirname_and_basename], [dnl +- case ${1} in +- */*) func_dirname_result="${1%/*}${2}" ;; +- * ) func_dirname_result="${3}" ;; +- esac +- func_basename_result="${1##*/}"]) +- +- _LT_PROG_FUNCTION_REPLACE([func_stripname], [dnl +- # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are +- # positional parameters, so assign one to ordinary parameter first. +- func_stripname_result=${3} +- func_stripname_result=${func_stripname_result#"${1}"} +- func_stripname_result=${func_stripname_result%"${2}"}]) +- +- _LT_PROG_FUNCTION_REPLACE([func_split_long_opt], [dnl +- func_split_long_opt_name=${1%%=*} +- func_split_long_opt_arg=${1#*=}]) +- +- _LT_PROG_FUNCTION_REPLACE([func_split_short_opt], [dnl +- func_split_short_opt_arg=${1#??} +- func_split_short_opt_name=${1%"$func_split_short_opt_arg"}]) +- +- _LT_PROG_FUNCTION_REPLACE([func_lo2o], [dnl +- case ${1} in +- *.lo) func_lo2o_result=${1%.lo}.${objext} ;; +- *) func_lo2o_result=${1} ;; +- esac]) +- +- _LT_PROG_FUNCTION_REPLACE([func_xform], [ func_xform_result=${1%.*}.lo]) +- +- _LT_PROG_FUNCTION_REPLACE([func_arith], [ func_arith_result=$(( $[*] ))]) +- +- _LT_PROG_FUNCTION_REPLACE([func_len], [ func_len_result=${#1}]) +-fi +- +-if test x"$lt_shell_append" = xyes; then +- _LT_PROG_FUNCTION_REPLACE([func_append], [ eval "${1}+=\\${2}"]) +- +- _LT_PROG_FUNCTION_REPLACE([func_append_quoted], [dnl +- func_quote_for_eval "${2}" +-dnl m4 expansion turns \\\\ into \\, and then the shell eval turns that into \ +- eval "${1}+=\\\\ \\$func_quote_for_eval_result"]) +- +- # Save a `func_append' function call where possible by direct use of '+=' +- sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \ +- && mv -f "$cfgfile.tmp" "$cfgfile" \ +- || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +- test 0 -eq $? || _lt_function_replace_fail=: +-else +- # Save a `func_append' function call even when '+=' is not available +- sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \ +- && mv -f "$cfgfile.tmp" "$cfgfile" \ +- || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +- test 0 -eq $? || _lt_function_replace_fail=: +-fi +- +-if test x"$_lt_function_replace_fail" = x":"; then +- AC_MSG_WARN([Unable to substitute extended shell functions in $ofile]) +-fi +-]) +- + # _LT_PATH_CONVERSION_FUNCTIONS + # ----------------------------- +-# Determine which file name conversion functions should be used by ++# Determine what file name conversion functions should be used by + # func_to_host_file (and, implicitly, by func_to_host_path). These are needed + # for certain cross-compile configurations and native mingw. + m4_defun([_LT_PATH_CONVERSION_FUNCTIONS], +diff -r c0e311e010fc Modules/_ctypes/libffi/m4/ltoptions.m4 +--- a/Modules/_ctypes/libffi/m4/ltoptions.m4 ++++ b/Modules/_ctypes/libffi/m4/ltoptions.m4 +@@ -1,14 +1,14 @@ + # Helper functions for option handling. -*- Autoconf -*- + # +-# Copyright (C) 2004, 2005, 2007, 2008, 2009 Free Software Foundation, +-# Inc. ++# Copyright (C) 2004-2005, 2007-2009, 2011-2013 Free Software ++# Foundation, Inc. + # Written by Gary V. Vaughan, 2004 + # + # This file is free software; the Free Software Foundation gives + # unlimited permission to copy and/or distribute it, with or without + # modifications, as long as this notice is preserved. + +-# serial 7 ltoptions.m4 ++# serial 8 ltoptions.m4 + + # This is to help aclocal find these macros, as it can't see m4_define. + AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])]) +@@ -29,7 +29,7 @@ + [m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl + m4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]), + _LT_MANGLE_DEFUN([$1], [$2]), +- [m4_warning([Unknown $1 option `$2'])])[]dnl ++ [m4_warning([Unknown $1 option '$2'])])[]dnl + ]) + + +@@ -75,13 +75,13 @@ + dnl + dnl If no reference was made to various pairs of opposing options, then + dnl we run the default mode handler for the pair. For example, if neither +- dnl `shared' nor `disable-shared' was passed, we enable building of shared ++ dnl 'shared' nor 'disable-shared' was passed, we enable building of shared + dnl archives by default: + _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED]) + _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC]) + _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC]) + _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install], +- [_LT_ENABLE_FAST_INSTALL]) ++ [_LT_ENABLE_FAST_INSTALL]) + ]) + ])# _LT_SET_OPTIONS + +@@ -112,7 +112,7 @@ + [_LT_SET_OPTION([LT_INIT], [dlopen]) + AC_DIAGNOSE([obsolete], + [$0: Remove this warning and the call to _LT_SET_OPTION when you +-put the `dlopen' option into LT_INIT's first parameter.]) ++put the 'dlopen' option into LT_INIT's first parameter.]) + ]) + + dnl aclocal-1.4 backwards compatibility: +@@ -148,7 +148,7 @@ + _LT_SET_OPTION([LT_INIT], [win32-dll]) + AC_DIAGNOSE([obsolete], + [$0: Remove this warning and the call to _LT_SET_OPTION when you +-put the `win32-dll' option into LT_INIT's first parameter.]) ++put the 'win32-dll' option into LT_INIT's first parameter.]) + ]) + + dnl aclocal-1.4 backwards compatibility: +@@ -157,9 +157,9 @@ + + # _LT_ENABLE_SHARED([DEFAULT]) + # ---------------------------- +-# implement the --enable-shared flag, and supports the `shared' and +-# `disable-shared' LT_INIT options. +-# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. ++# implement the --enable-shared flag, and supports the 'shared' and ++# 'disable-shared' LT_INIT options. ++# DEFAULT is either 'yes' or 'no'. If omitted, it defaults to 'yes'. + m4_define([_LT_ENABLE_SHARED], + [m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl + AC_ARG_ENABLE([shared], +@@ -172,14 +172,14 @@ + *) + enable_shared=no + # Look at the argument we got. We use all the common list separators. +- lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," ++ lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, + for pkg in $enableval; do +- IFS="$lt_save_ifs" ++ IFS=$lt_save_ifs + if test "X$pkg" = "X$p"; then + enable_shared=yes + fi + done +- IFS="$lt_save_ifs" ++ IFS=$lt_save_ifs + ;; + esac], + [enable_shared=]_LT_ENABLE_SHARED_DEFAULT) +@@ -211,9 +211,9 @@ + + # _LT_ENABLE_STATIC([DEFAULT]) + # ---------------------------- +-# implement the --enable-static flag, and support the `static' and +-# `disable-static' LT_INIT options. +-# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. ++# implement the --enable-static flag, and support the 'static' and ++# 'disable-static' LT_INIT options. ++# DEFAULT is either 'yes' or 'no'. If omitted, it defaults to 'yes'. + m4_define([_LT_ENABLE_STATIC], + [m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl + AC_ARG_ENABLE([static], +@@ -226,14 +226,14 @@ + *) + enable_static=no + # Look at the argument we got. We use all the common list separators. +- lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," ++ lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, + for pkg in $enableval; do +- IFS="$lt_save_ifs" ++ IFS=$lt_save_ifs + if test "X$pkg" = "X$p"; then + enable_static=yes + fi + done +- IFS="$lt_save_ifs" ++ IFS=$lt_save_ifs + ;; + esac], + [enable_static=]_LT_ENABLE_STATIC_DEFAULT) +@@ -265,9 +265,9 @@ + + # _LT_ENABLE_FAST_INSTALL([DEFAULT]) + # ---------------------------------- +-# implement the --enable-fast-install flag, and support the `fast-install' +-# and `disable-fast-install' LT_INIT options. +-# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. ++# implement the --enable-fast-install flag, and support the 'fast-install' ++# and 'disable-fast-install' LT_INIT options. ++# DEFAULT is either 'yes' or 'no'. If omitted, it defaults to 'yes'. + m4_define([_LT_ENABLE_FAST_INSTALL], + [m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl + AC_ARG_ENABLE([fast-install], +@@ -280,14 +280,14 @@ + *) + enable_fast_install=no + # Look at the argument we got. We use all the common list separators. +- lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," ++ lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, + for pkg in $enableval; do +- IFS="$lt_save_ifs" ++ IFS=$lt_save_ifs + if test "X$pkg" = "X$p"; then + enable_fast_install=yes + fi + done +- IFS="$lt_save_ifs" ++ IFS=$lt_save_ifs + ;; + esac], + [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT) +@@ -304,14 +304,14 @@ + [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install]) + AC_DIAGNOSE([obsolete], + [$0: Remove this warning and the call to _LT_SET_OPTION when you put +-the `fast-install' option into LT_INIT's first parameter.]) ++the 'fast-install' option into LT_INIT's first parameter.]) + ]) + + AU_DEFUN([AC_DISABLE_FAST_INSTALL], + [_LT_SET_OPTION([LT_INIT], [disable-fast-install]) + AC_DIAGNOSE([obsolete], + [$0: Remove this warning and the call to _LT_SET_OPTION when you put +-the `disable-fast-install' option into LT_INIT's first parameter.]) ++the 'disable-fast-install' option into LT_INIT's first parameter.]) + ]) + + dnl aclocal-1.4 backwards compatibility: +@@ -321,9 +321,9 @@ + + # _LT_WITH_PIC([MODE]) + # -------------------- +-# implement the --with-pic flag, and support the `pic-only' and `no-pic' ++# implement the --with-pic flag, and support the 'pic-only' and 'no-pic' + # LT_INIT options. +-# MODE is either `yes' or `no'. If omitted, it defaults to `both'. ++# MODE is either 'yes' or 'no'. If omitted, it defaults to 'both'. + m4_define([_LT_WITH_PIC], + [AC_ARG_WITH([pic], + [AS_HELP_STRING([--with-pic@<:@=PKGS@:>@], +@@ -334,19 +334,17 @@ + *) + pic_mode=default + # Look at the argument we got. We use all the common list separators. +- lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," ++ lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, + for lt_pkg in $withval; do +- IFS="$lt_save_ifs" ++ IFS=$lt_save_ifs + if test "X$lt_pkg" = "X$lt_p"; then + pic_mode=yes + fi + done +- IFS="$lt_save_ifs" ++ IFS=$lt_save_ifs + ;; + esac], +- [pic_mode=default]) +- +-test -z "$pic_mode" && pic_mode=m4_default([$1], [default]) ++ [pic_mode=m4_default([$1], [default])]) + + _LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl + ])# _LT_WITH_PIC +@@ -359,7 +357,7 @@ + [_LT_SET_OPTION([LT_INIT], [pic-only]) + AC_DIAGNOSE([obsolete], + [$0: Remove this warning and the call to _LT_SET_OPTION when you +-put the `pic-only' option into LT_INIT's first parameter.]) ++put the 'pic-only' option into LT_INIT's first parameter.]) + ]) + + dnl aclocal-1.4 backwards compatibility: +diff -r c0e311e010fc Modules/_ctypes/libffi/m4/ltsugar.m4 +--- a/Modules/_ctypes/libffi/m4/ltsugar.m4 ++++ b/Modules/_ctypes/libffi/m4/ltsugar.m4 +@@ -1,6 +1,7 @@ + # ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*- + # +-# Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc. ++# Copyright (C) 2004-2005, 2007-2008, 2011-2013 Free Software ++# Foundation, Inc. + # Written by Gary V. Vaughan, 2004 + # + # This file is free software; the Free Software Foundation gives +@@ -33,7 +34,7 @@ + # ------------ + # Manipulate m4 lists. + # These macros are necessary as long as will still need to support +-# Autoconf-2.59 which quotes differently. ++# Autoconf-2.59, which quotes differently. + m4_define([lt_car], [[$1]]) + m4_define([lt_cdr], + [m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])], +@@ -44,7 +45,7 @@ + + # lt_append(MACRO-NAME, STRING, [SEPARATOR]) + # ------------------------------------------ +-# Redefine MACRO-NAME to hold its former content plus `SEPARATOR'`STRING'. ++# Redefine MACRO-NAME to hold its former content plus 'SEPARATOR''STRING'. + # Note that neither SEPARATOR nor STRING are expanded; they are appended + # to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked). + # No SEPARATOR is output if MACRO-NAME was previously undefined (different +diff -r c0e311e010fc Modules/_ctypes/libffi/m4/ltversion.m4 +--- a/Modules/_ctypes/libffi/m4/ltversion.m4 ++++ b/Modules/_ctypes/libffi/m4/ltversion.m4 +@@ -1,6 +1,6 @@ + # ltversion.m4 -- version numbers -*- Autoconf -*- + # +-# Copyright (C) 2004 Free Software Foundation, Inc. ++# Copyright (C) 2004, 2011-2013 Free Software Foundation, Inc. + # Written by Scott James Remnant, 2004 + # + # This file is free software; the Free Software Foundation gives +@@ -9,15 +9,15 @@ + + # @configure_input@ + +-# serial 3337 ltversion.m4 ++# serial 4038 ltversion.m4 + # This file is part of GNU Libtool + +-m4_define([LT_PACKAGE_VERSION], [2.4.2]) +-m4_define([LT_PACKAGE_REVISION], [1.3337]) ++m4_define([LT_PACKAGE_VERSION], [2.4.2.418]) ++m4_define([LT_PACKAGE_REVISION], [2.4.2.418]) + + AC_DEFUN([LTVERSION_VERSION], +-[macro_version='2.4.2' +-macro_revision='1.3337' ++[macro_version='2.4.2.418' ++macro_revision='2.4.2.418' + _LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?]) + _LT_DECL(, macro_revision, 0) + ]) +diff -r c0e311e010fc Modules/_ctypes/libffi/m4/lt~obsolete.m4 +--- a/Modules/_ctypes/libffi/m4/lt~obsolete.m4 ++++ b/Modules/_ctypes/libffi/m4/lt~obsolete.m4 +@@ -1,6 +1,7 @@ + # lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*- + # +-# Copyright (C) 2004, 2005, 2007, 2009 Free Software Foundation, Inc. ++# Copyright (C) 2004-2005, 2007, 2009, 2011-2013 Free Software ++# Foundation, Inc. + # Written by Scott James Remnant, 2004. + # + # This file is free software; the Free Software Foundation gives +@@ -11,7 +12,7 @@ + + # These exist entirely to fool aclocal when bootstrapping libtool. + # +-# In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN) ++# In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN), + # which have later been changed to m4_define as they aren't part of the + # exported API, or moved to Autoconf or Automake where they belong. + # +@@ -25,7 +26,7 @@ + # included after everything else. This provides aclocal with the + # AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything + # because those macros already exist, or will be overwritten later. +-# We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6. ++# We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6. + # + # Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here. + # Yes, that means every name once taken will need to remain here until +diff -r c0e311e010fc Modules/_ctypes/libffi/man/Makefile.in +--- a/Modules/_ctypes/libffi/man/Makefile.in ++++ b/Modules/_ctypes/libffi/man/Makefile.in +@@ -1,7 +1,7 @@ +-# Makefile.in generated by automake 1.12.2 from Makefile.am. ++# Makefile.in generated by automake 1.13.4 from Makefile.am. + # @configure_input@ + +-# Copyright (C) 1994-2012 Free Software Foundation, Inc. ++# Copyright (C) 1994-2013 Free Software Foundation, Inc. + + # This Makefile.in is free software; the Free Software Foundation + # gives unlimited permission to copy and/or distribute it, +@@ -14,23 +14,51 @@ + + @SET_MAKE@ + VPATH = @srcdir@ +-am__make_dryrun = \ +- { \ +- am__dry=no; \ ++am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' ++am__make_running_with_option = \ ++ case $${target_option-} in \ ++ ?) ;; \ ++ *) echo "am__make_running_with_option: internal error: invalid" \ ++ "target option '$${target_option-}' specified" >&2; \ ++ exit 1;; \ ++ esac; \ ++ has_opt=no; \ ++ sane_makeflags=$$MAKEFLAGS; \ ++ if $(am__is_gnu_make); then \ ++ sane_makeflags=$$MFLAGS; \ ++ else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ +- echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ +- | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ +- *) \ +- for am__flg in $$MAKEFLAGS; do \ +- case $$am__flg in \ +- *=*|--*) ;; \ +- *n*) am__dry=yes; break;; \ +- esac; \ +- done;; \ ++ bs=\\; \ ++ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ ++ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ +- test $$am__dry = yes; \ +- } ++ fi; \ ++ skip_next=no; \ ++ strip_trailopt () \ ++ { \ ++ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ ++ }; \ ++ for flg in $$sane_makeflags; do \ ++ test $$skip_next = yes && { skip_next=no; continue; }; \ ++ case $$flg in \ ++ *=*|--*) continue;; \ ++ -*I) strip_trailopt 'I'; skip_next=yes;; \ ++ -*I?*) strip_trailopt 'I';; \ ++ -*O) strip_trailopt 'O'; skip_next=yes;; \ ++ -*O?*) strip_trailopt 'O';; \ ++ -*l) strip_trailopt 'l'; skip_next=yes;; \ ++ -*l?*) strip_trailopt 'l';; \ ++ -[dEDm]) skip_next=yes;; \ ++ -[JT]) skip_next=yes;; \ ++ esac; \ ++ case $$flg in \ ++ *$$target_option*) has_opt=yes; break;; \ ++ esac; \ ++ done; \ ++ test $$has_opt = yes ++am__make_dryrun = (target_option=n; $(am__make_running_with_option)) ++am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) + pkgdatadir = $(datadir)/@PACKAGE@ + pkgincludedir = $(includedir)/@PACKAGE@ + pkglibdir = $(libdir)/@PACKAGE@ +@@ -51,7 +79,7 @@ + host_triplet = @host@ + target_triplet = @target@ + subdir = man +-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ++DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am + ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 + am__aclocal_m4_deps = $(top_srcdir)/m4/asmcfi.m4 \ + $(top_srcdir)/m4/ax_append_flag.m4 \ +@@ -73,6 +101,18 @@ + CONFIG_HEADER = $(top_builddir)/fficonfig.h + CONFIG_CLEAN_FILES = + CONFIG_CLEAN_VPATH_FILES = ++AM_V_P = $(am__v_P_@AM_V@) ++am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) ++am__v_P_0 = false ++am__v_P_1 = : ++AM_V_GEN = $(am__v_GEN_@AM_V@) ++am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) ++am__v_GEN_0 = @echo " GEN " $@; ++am__v_GEN_1 = ++AM_V_at = $(am__v_at_@AM_V@) ++am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) ++am__v_at_0 = @ ++am__v_at_1 = + SOURCES = + DIST_SOURCES = + am__can_run_installinfo = \ +@@ -111,10 +151,12 @@ + am__installdirs = "$(DESTDIR)$(man3dir)" + NROFF = nroff + MANS = $(man_MANS) ++am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) + DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) + ACLOCAL = @ACLOCAL@ + ALLOCA = @ALLOCA@ + AMTAR = @AMTAR@ ++AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ + AM_LTLDFLAGS = @AM_LTLDFLAGS@ + AM_RUNTESTFLAGS = @AM_RUNTESTFLAGS@ + AR = @AR@ +@@ -130,6 +172,10 @@ + CFLAGS = @CFLAGS@ + CPP = @CPP@ + CPPFLAGS = @CPPFLAGS@ ++CXX = @CXX@ ++CXXCPP = @CXXCPP@ ++CXXDEPMODE = @CXXDEPMODE@ ++CXXFLAGS = @CXXFLAGS@ + CYGPATH_W = @CYGPATH_W@ + DEFS = @DEFS@ + DEPDIR = @DEPDIR@ +@@ -145,6 +191,7 @@ + FGREP = @FGREP@ + GREP = @GREP@ + HAVE_LONG_DOUBLE = @HAVE_LONG_DOUBLE@ ++HAVE_LONG_DOUBLE_VARIANT = @HAVE_LONG_DOUBLE_VARIANT@ + INSTALL = @INSTALL@ + INSTALL_DATA = @INSTALL_DATA@ + INSTALL_PROGRAM = @INSTALL_PROGRAM@ +@@ -191,6 +238,7 @@ + abs_top_srcdir = @abs_top_srcdir@ + ac_ct_AR = @ac_ct_AR@ + ac_ct_CC = @ac_ct_CC@ ++ac_ct_CXX = @ac_ct_CXX@ + ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ + am__include = @am__include@ + am__leading_dot = @am__leading_dot@ +@@ -330,29 +378,14 @@ + } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^3][0-9a-z]*$$,3,;x' \ + -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ + dir='$(DESTDIR)$(man3dir)'; $(am__uninstall_files_from_dir) +-tags: TAGS +-TAGS: ++tags TAGS: + +-ctags: CTAGS +-CTAGS: ++ctags CTAGS: + + cscope cscopelist: + + + distdir: $(DISTFILES) +- @list='$(MANS)'; if test -n "$$list"; then \ +- list=`for p in $$list; do \ +- if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ +- if test -f "$$d$$p"; then echo "$$d$$p"; else :; fi; done`; \ +- if test -n "$$list" && \ +- grep 'ab help2man is required to generate this page' $$list >/dev/null; then \ +- echo "error: found man pages containing the 'missing help2man' replacement text:" >&2; \ +- grep -l 'ab help2man is required to generate this page' $$list | sed 's/^/ /' >&2; \ +- echo " to fix them, install help2man, remove and regenerate the man pages;" >&2; \ +- echo " typically 'make maintainer-clean' will remove them" >&2; \ +- exit 1; \ +- else :; fi; \ +- else :; fi + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ +@@ -490,16 +523,17 @@ + .MAKE: install-am install-strip + + .PHONY: all all-am check check-am clean clean-generic clean-libtool \ +- distclean distclean-generic distclean-libtool distdir dvi \ +- dvi-am html html-am info info-am install install-am \ +- install-data install-data-am install-dvi install-dvi-am \ +- install-exec install-exec-am install-html install-html-am \ +- install-info install-info-am install-man install-man3 \ +- install-pdf install-pdf-am install-ps install-ps-am \ +- install-strip installcheck installcheck-am installdirs \ +- maintainer-clean maintainer-clean-generic mostlyclean \ +- mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ +- uninstall uninstall-am uninstall-man uninstall-man3 ++ cscopelist-am ctags-am distclean distclean-generic \ ++ distclean-libtool distdir dvi dvi-am html html-am info info-am \ ++ install install-am install-data install-data-am install-dvi \ ++ install-dvi-am install-exec install-exec-am install-html \ ++ install-html-am install-info install-info-am install-man \ ++ install-man3 install-pdf install-pdf-am install-ps \ ++ install-ps-am install-strip installcheck installcheck-am \ ++ installdirs maintainer-clean maintainer-clean-generic \ ++ mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ ++ ps ps-am tags-am uninstall uninstall-am uninstall-man \ ++ uninstall-man3 + + + # Tell versions [3.59,3.63) of GNU make to not export all variables. +diff -r c0e311e010fc Modules/_ctypes/libffi/mdate-sh +--- a/Modules/_ctypes/libffi/mdate-sh ++++ b/Modules/_ctypes/libffi/mdate-sh +@@ -1,10 +1,9 @@ + #!/bin/sh + # Get modification time of a file or directory and pretty-print it. + +-scriptversion=2005-06-29.22 ++scriptversion=2010-08-21.06; # UTC + +-# Copyright (C) 1995, 1996, 1997, 2003, 2004, 2005 Free Software +-# Foundation, Inc. ++# Copyright (C) 1995-2013 Free Software Foundation, Inc. + # written by Ulrich Drepper , June 1995 + # + # This program is free software; you can redistribute it and/or modify +@@ -18,8 +17,7 @@ + # GNU General Public License for more details. + # + # You should have received a copy of the GNU General Public License +-# along with this program; if not, write to the Free Software Foundation, +-# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ++# along with this program. If not, see . + + # As a special exception to the GNU General Public License, if you + # distribute this file as part of a program that contains a +@@ -30,16 +28,26 @@ + # bugs to or send patches to + # . + ++if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then ++ emulate sh ++ NULLCMD=: ++ # 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 ++fi ++ + case $1 in + '') +- echo "$0: No file. Try \`$0 --help' for more information." 1>&2 ++ echo "$0: No file. Try '$0 --help' for more information." 1>&2 + exit 1; + ;; + -h | --h*) + cat <<\EOF + Usage: mdate-sh [--help] [--version] FILE + +-Pretty-print the modification time of FILE. ++Pretty-print the modification day of FILE, in the format: ++1 January 1970 + + Report bugs to . + EOF +@@ -51,6 +59,13 @@ + ;; + esac + ++error () ++{ ++ echo "$0: $1" >&2 ++ exit 1 ++} ++ ++ + # Prevent date giving response in another language. + LANG=C + export LANG +@@ -60,7 +75,7 @@ + export LC_TIME + + # GNU ls changes its time format in response to the TIME_STYLE +-# variable. Since we cannot assume `unset' works, revert this ++# variable. Since we cannot assume 'unset' works, revert this + # variable to its documented default. + if test "${TIME_STYLE+set}" = set; then + TIME_STYLE=posix-long-iso +@@ -75,27 +90,32 @@ + else + ls_command='ls -l -d' + fi ++# Avoid user/group names that might have spaces, when possible. ++if ls -n /dev/null 1>/dev/null 2>&1; then ++ ls_command="$ls_command -n" ++fi + +-# A `ls -l' line looks as follows on OS/2. ++# A 'ls -l' line looks as follows on OS/2. + # drwxrwx--- 0 Aug 11 2001 foo + # This differs from Unix, which adds ownership information. + # drwxrwx--- 2 root root 4096 Aug 11 2001 foo + # + # To find the date, we split the line on spaces and iterate on words + # until we find a month. This cannot work with files whose owner is a +-# user named `Jan', or `Feb', etc. However, it's unlikely that `/' ++# user named "Jan", or "Feb", etc. However, it's unlikely that '/' + # will be owned by a user whose name is a month. So we first look at + # the extended ls output of the root directory to decide how many + # words should be skipped to get the date. + + # On HPUX /bin/sh, "set" interprets "-rw-r--r--" as options, so the "x" below. +-set x`ls -l -d /` ++set x`$ls_command /` + + # Find which argument is the month. + month= + command= + until test $month + do ++ test $# -gt 0 || error "failed parsing '$ls_command /' output" + shift + # Add another shift to the command. + command="$command shift;" +@@ -115,8 +135,10 @@ + esac + done + ++test -n "$month" || error "failed parsing '$ls_command /' output" ++ + # Get the extended ls output of the file or directory. +-set dummy x`eval "$ls_command \"\$save_arg1\""` ++set dummy x`eval "$ls_command \"\\\$save_arg1\""` + + # Remove all preceding arguments + eval $command +@@ -197,5 +219,6 @@ + # eval: (add-hook 'write-file-hooks 'time-stamp) + # time-stamp-start: "scriptversion=" + # time-stamp-format: "%:y-%02m-%02d.%02H" +-# time-stamp-end: "$" ++# time-stamp-time-zone: "UTC" ++# time-stamp-end: "; # UTC" + # End: +diff -r c0e311e010fc Modules/_ctypes/libffi/missing +--- a/Modules/_ctypes/libffi/missing ++++ b/Modules/_ctypes/libffi/missing +@@ -1,11 +1,10 @@ + #! /bin/sh +-# Common stub for a few missing GNU programs while installing. ++# Common wrapper for a few potentially missing GNU programs. + +-scriptversion=2009-04-28.21; # UTC ++scriptversion=2012-06-26.16; # UTC + +-# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006, +-# 2008, 2009 Free Software Foundation, Inc. +-# Originally by Fran,cois Pinard , 1996. ++# Copyright (C) 1996-2013 Free Software Foundation, Inc. ++# Originally written by Fran,cois Pinard , 1996. + + # This program is free software; you can redistribute it and/or modify + # it under the terms of the GNU General Public License as published by +@@ -26,69 +25,40 @@ + # the same distribution terms that you use for the rest of that program. + + if test $# -eq 0; then +- echo 1>&2 "Try \`$0 --help' for more information" ++ echo 1>&2 "Try '$0 --help' for more information" + exit 1 + fi + +-run=: +-sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p' +-sed_minuso='s/.* -o \([^ ]*\).*/\1/p' ++case $1 in + +-# In the cases where this matters, `missing' is being run in the +-# srcdir already. +-if test -f configure.ac; then +- configure_ac=configure.ac +-else +- configure_ac=configure.in +-fi ++ --is-lightweight) ++ # Used by our autoconf macros to check whether the available missing ++ # script is modern enough. ++ exit 0 ++ ;; + +-msg="missing on your system" +- +-case $1 in +---run) +- # Try to run requested program, and just exit if it succeeds. +- run= +- shift +- "$@" && exit 0 +- # Exit code 63 means version mismatch. This often happens +- # when the user try to use an ancient version of a tool on +- # a file that requires a minimum version. In this case we +- # we should proceed has if the program had been absent, or +- # if --run hadn't been passed. +- if test $? = 63; then +- run=: +- msg="probably too old" +- fi +- ;; ++ --run) ++ # Back-compat with the calling convention used by older automake. ++ shift ++ ;; + + -h|--h|--he|--hel|--help) + echo "\ + $0 [OPTION]... PROGRAM [ARGUMENT]... + +-Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an +-error status if there is no known handling for PROGRAM. ++Run 'PROGRAM [ARGUMENT]...', returning a proper advice when this fails due ++to PROGRAM being missing or too old. + + Options: + -h, --help display this help and exit + -v, --version output version information and exit +- --run try to run the given command, and emulate it if it fails + + Supported PROGRAM values: +- aclocal touch file \`aclocal.m4' +- autoconf touch file \`configure' +- autoheader touch file \`config.h.in' +- autom4te touch the output file, or create a stub one +- automake touch all \`Makefile.in' files +- bison create \`y.tab.[ch]', if possible, from existing .[ch] +- flex create \`lex.yy.c', if possible, from existing .c +- help2man touch the output file +- lex create \`lex.yy.c', if possible, from existing .c +- makeinfo touch the output file +- tar try tar, gnutar, gtar, then tar without non-portable flags +- yacc create \`y.tab.[ch]', if possible, from existing .[ch] ++ aclocal autoconf autoheader autom4te automake makeinfo ++ bison yacc flex lex help2man + +-Version suffixes to PROGRAM as well as the prefixes \`gnu-', \`gnu', and +-\`g' are ignored when checking the name. ++Version suffixes to PROGRAM as well as the prefixes 'gnu-', 'gnu', and ++'g' are ignored when checking the name. + + Send bug reports to ." + exit $? +@@ -100,272 +70,141 @@ + ;; + + -*) +- echo 1>&2 "$0: Unknown \`$1' option" +- echo 1>&2 "Try \`$0 --help' for more information" ++ echo 1>&2 "$0: unknown '$1' option" ++ echo 1>&2 "Try '$0 --help' for more information" + exit 1 + ;; + + esac + +-# normalize program name to check for. +-program=`echo "$1" | sed ' +- s/^gnu-//; t +- s/^gnu//; t +- s/^g//; t'` ++# Run the given program, remember its exit status. ++"$@"; st=$? + +-# Now exit if we have it, but it failed. Also exit now if we +-# don't have it and --version was passed (most likely to detect +-# the program). This is about non-GNU programs, so use $1 not +-# $program. +-case $1 in +- lex*|yacc*) +- # Not GNU programs, they don't have --version. ++# If it succeeded, we are done. ++test $st -eq 0 && exit 0 ++ ++# Also exit now if we it failed (or wasn't found), and '--version' was ++# passed; such an option is passed most likely to detect whether the ++# program is present and works. ++case $2 in --version|--help) exit $st;; esac ++ ++# Exit code 63 means version mismatch. This often happens when the user ++# tries to use an ancient version of a tool on a file that requires a ++# minimum version. ++if test $st -eq 63; then ++ msg="probably too old" ++elif test $st -eq 127; then ++ # Program was missing. ++ msg="missing on your system" ++else ++ # Program was found and executed, but failed. Give up. ++ exit $st ++fi ++ ++perl_URL=http://www.perl.org/ ++flex_URL=http://flex.sourceforge.net/ ++gnu_software_URL=http://www.gnu.org/software ++ ++program_details () ++{ ++ case $1 in ++ aclocal|automake) ++ echo "The '$1' program is part of the GNU Automake package:" ++ echo "<$gnu_software_URL/automake>" ++ echo "It also requires GNU Autoconf, GNU m4 and Perl in order to run:" ++ echo "<$gnu_software_URL/autoconf>" ++ echo "<$gnu_software_URL/m4/>" ++ echo "<$perl_URL>" ++ ;; ++ autoconf|autom4te|autoheader) ++ echo "The '$1' program is part of the GNU Autoconf package:" ++ echo "<$gnu_software_URL/autoconf/>" ++ echo "It also requires GNU m4 and Perl in order to run:" ++ echo "<$gnu_software_URL/m4/>" ++ echo "<$perl_URL>" ++ ;; ++ esac ++} ++ ++give_advice () ++{ ++ # Normalize program name to check for. ++ normalized_program=`echo "$1" | sed ' ++ s/^gnu-//; t ++ s/^gnu//; t ++ s/^g//; t'` ++ ++ printf '%s\n' "'$1' is $msg." ++ ++ configure_deps="'configure.ac' or m4 files included by 'configure.ac'" ++ case $normalized_program in ++ autoconf*) ++ echo "You should only need it if you modified 'configure.ac'," ++ echo "or m4 files included by it." ++ program_details 'autoconf' ++ ;; ++ autoheader*) ++ echo "You should only need it if you modified 'acconfig.h' or" ++ echo "$configure_deps." ++ program_details 'autoheader' ++ ;; ++ automake*) ++ echo "You should only need it if you modified 'Makefile.am' or" ++ echo "$configure_deps." ++ program_details 'automake' ++ ;; ++ aclocal*) ++ echo "You should only need it if you modified 'acinclude.m4' or" ++ echo "$configure_deps." ++ program_details 'aclocal' ++ ;; ++ autom4te*) ++ echo "You might have modified some maintainer files that require" ++ echo "the 'automa4te' program to be rebuilt." ++ program_details 'autom4te' ++ ;; ++ bison*|yacc*) ++ echo "You should only need it if you modified a '.y' file." ++ echo "You may want to install the GNU Bison package:" ++ echo "<$gnu_software_URL/bison/>" ++ ;; ++ lex*|flex*) ++ echo "You should only need it if you modified a '.l' file." ++ echo "You may want to install the Fast Lexical Analyzer package:" ++ echo "<$flex_URL>" ++ ;; ++ help2man*) ++ echo "You should only need it if you modified a dependency" \ ++ "of a man page." ++ echo "You may want to install the GNU Help2man package:" ++ echo "<$gnu_software_URL/help2man/>" + ;; ++ makeinfo*) ++ echo "You should only need it if you modified a '.texi' file, or" ++ echo "any other file indirectly affecting the aspect of the manual." ++ echo "You might want to install the Texinfo package:" ++ echo "<$gnu_software_URL/texinfo/>" ++ echo "The spurious makeinfo call might also be the consequence of" ++ echo "using a buggy 'make' (AIX, DU, IRIX), in which case you might" ++ echo "want to install GNU make:" ++ echo "<$gnu_software_URL/make/>" ++ ;; ++ *) ++ echo "You might have modified some files without having the proper" ++ echo "tools for further handling them. Check the 'README' file, it" ++ echo "often tells you about the needed prerequisites for installing" ++ echo "this package. You may also peek at any GNU archive site, in" ++ echo "case some other package contains this missing '$1' program." ++ ;; ++ esac ++} + +- tar*) +- if test -n "$run"; then +- echo 1>&2 "ERROR: \`tar' requires --run" +- exit 1 +- elif test "x$2" = "x--version" || test "x$2" = "x--help"; then +- exit 1 +- fi +- ;; ++give_advice "$1" | sed -e '1s/^/WARNING: /' \ ++ -e '2,$s/^/ /' >&2 + +- *) +- if test -z "$run" && ($1 --version) > /dev/null 2>&1; then +- # We have it, but it failed. +- exit 1 +- elif test "x$2" = "x--version" || test "x$2" = "x--help"; then +- # Could not run --version or --help. This is probably someone +- # running `$TOOL --version' or `$TOOL --help' to check whether +- # $TOOL exists and not knowing $TOOL uses missing. +- exit 1 +- fi +- ;; +-esac +- +-# If it does not exist, or fails to run (possibly an outdated version), +-# try to emulate it. +-case $program in +- aclocal*) +- echo 1>&2 "\ +-WARNING: \`$1' is $msg. You should only need it if +- you modified \`acinclude.m4' or \`${configure_ac}'. You might want +- to install the \`Automake' and \`Perl' packages. Grab them from +- any GNU archive site." +- touch aclocal.m4 +- ;; +- +- autoconf*) +- echo 1>&2 "\ +-WARNING: \`$1' is $msg. You should only need it if +- you modified \`${configure_ac}'. You might want to install the +- \`Autoconf' and \`GNU m4' packages. Grab them from any GNU +- archive site." +- touch configure +- ;; +- +- autoheader*) +- echo 1>&2 "\ +-WARNING: \`$1' is $msg. You should only need it if +- you modified \`acconfig.h' or \`${configure_ac}'. You might want +- to install the \`Autoconf' and \`GNU m4' packages. Grab them +- from any GNU archive site." +- files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}` +- test -z "$files" && files="config.h" +- touch_files= +- for f in $files; do +- case $f in +- *:*) touch_files="$touch_files "`echo "$f" | +- sed -e 's/^[^:]*://' -e 's/:.*//'`;; +- *) touch_files="$touch_files $f.in";; +- esac +- done +- touch $touch_files +- ;; +- +- automake*) +- echo 1>&2 "\ +-WARNING: \`$1' is $msg. You should only need it if +- you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'. +- You might want to install the \`Automake' and \`Perl' packages. +- Grab them from any GNU archive site." +- find . -type f -name Makefile.am -print | +- sed 's/\.am$/.in/' | +- while read f; do touch "$f"; done +- ;; +- +- autom4te*) +- echo 1>&2 "\ +-WARNING: \`$1' is needed, but is $msg. +- You might have modified some files without having the +- proper tools for further handling them. +- You can get \`$1' as part of \`Autoconf' from any GNU +- archive site." +- +- file=`echo "$*" | sed -n "$sed_output"` +- test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` +- if test -f "$file"; then +- touch $file +- else +- test -z "$file" || exec >$file +- echo "#! /bin/sh" +- echo "# Created by GNU Automake missing as a replacement of" +- echo "# $ $@" +- echo "exit 0" +- chmod +x $file +- exit 1 +- fi +- ;; +- +- bison*|yacc*) +- echo 1>&2 "\ +-WARNING: \`$1' $msg. You should only need it if +- you modified a \`.y' file. You may need the \`Bison' package +- in order for those modifications to take effect. You can get +- \`Bison' from any GNU archive site." +- rm -f y.tab.c y.tab.h +- if test $# -ne 1; then +- eval LASTARG="\${$#}" +- case $LASTARG in +- *.y) +- SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` +- if test -f "$SRCFILE"; then +- cp "$SRCFILE" y.tab.c +- fi +- SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` +- if test -f "$SRCFILE"; then +- cp "$SRCFILE" y.tab.h +- fi +- ;; +- esac +- fi +- if test ! -f y.tab.h; then +- echo >y.tab.h +- fi +- if test ! -f y.tab.c; then +- echo 'main() { return 0; }' >y.tab.c +- fi +- ;; +- +- lex*|flex*) +- echo 1>&2 "\ +-WARNING: \`$1' is $msg. You should only need it if +- you modified a \`.l' file. You may need the \`Flex' package +- in order for those modifications to take effect. You can get +- \`Flex' from any GNU archive site." +- rm -f lex.yy.c +- if test $# -ne 1; then +- eval LASTARG="\${$#}" +- case $LASTARG in +- *.l) +- SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` +- if test -f "$SRCFILE"; then +- cp "$SRCFILE" lex.yy.c +- fi +- ;; +- esac +- fi +- if test ! -f lex.yy.c; then +- echo 'main() { return 0; }' >lex.yy.c +- fi +- ;; +- +- help2man*) +- echo 1>&2 "\ +-WARNING: \`$1' is $msg. You should only need it if +- you modified a dependency of a manual page. You may need the +- \`Help2man' package in order for those modifications to take +- effect. You can get \`Help2man' from any GNU archive site." +- +- file=`echo "$*" | sed -n "$sed_output"` +- test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` +- if test -f "$file"; then +- touch $file +- else +- test -z "$file" || exec >$file +- echo ".ab help2man is required to generate this page" +- exit $? +- fi +- ;; +- +- makeinfo*) +- echo 1>&2 "\ +-WARNING: \`$1' is $msg. You should only need it if +- you modified a \`.texi' or \`.texinfo' file, or any other file +- indirectly affecting the aspect of the manual. The spurious +- call might also be the consequence of using a buggy \`make' (AIX, +- DU, IRIX). You might want to install the \`Texinfo' package or +- the \`GNU make' package. Grab either from any GNU archive site." +- # The file to touch is that specified with -o ... +- file=`echo "$*" | sed -n "$sed_output"` +- test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` +- if test -z "$file"; then +- # ... or it is the one specified with @setfilename ... +- infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'` +- file=`sed -n ' +- /^@setfilename/{ +- s/.* \([^ ]*\) *$/\1/ +- p +- q +- }' $infile` +- # ... or it is derived from the source name (dir/f.texi becomes f.info) +- test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info +- fi +- # If the file does not exist, the user really needs makeinfo; +- # let's fail without touching anything. +- test -f $file || exit 1 +- touch $file +- ;; +- +- tar*) +- shift +- +- # We have already tried tar in the generic part. +- # Look for gnutar/gtar before invocation to avoid ugly error +- # messages. +- if (gnutar --version > /dev/null 2>&1); then +- gnutar "$@" && exit 0 +- fi +- if (gtar --version > /dev/null 2>&1); then +- gtar "$@" && exit 0 +- fi +- firstarg="$1" +- if shift; then +- case $firstarg in +- *o*) +- firstarg=`echo "$firstarg" | sed s/o//` +- tar "$firstarg" "$@" && exit 0 +- ;; +- esac +- case $firstarg in +- *h*) +- firstarg=`echo "$firstarg" | sed s/h//` +- tar "$firstarg" "$@" && exit 0 +- ;; +- esac +- fi +- +- echo 1>&2 "\ +-WARNING: I can't seem to be able to run \`tar' with the given arguments. +- You may want to install GNU tar or Free paxutils, or check the +- command line arguments." +- exit 1 +- ;; +- +- *) +- echo 1>&2 "\ +-WARNING: \`$1' is needed, and is $msg. +- You might have modified some files without having the +- proper tools for further handling them. Check the \`README' file, +- it often tells you about the needed prerequisites for installing +- this package. You may also peek at any GNU archive site, in case +- some other package would contain this missing \`$1' program." +- exit 1 +- ;; +-esac +- +-exit 0 ++# Propagate the correct exit status (expected to be 127 for a program ++# not found, 63 for a program that failed due to version mismatch). ++exit $st + + # Local variables: + # eval: (add-hook 'write-file-hooks 'time-stamp) +diff -r c0e311e010fc Modules/_ctypes/libffi/msvcc.sh +--- a/Modules/_ctypes/libffi/msvcc.sh ++++ b/Modules/_ctypes/libffi/msvcc.sh +@@ -42,6 +42,7 @@ + # format and translated into something sensible for cl or ml. + # + ++args_orig=$@ + args="-nologo -W3" + md=-MD + cl="cl" +@@ -72,14 +73,35 @@ + shift 1 + ;; + -O*) +- # If we're optimizing, make sure we explicitly turn on some optimizations +- # that are implicitly disabled by debug symbols (-Zi). +- args="$args $1 -OPT:REF -OPT:ICF -INCREMENTAL:NO" ++ # Runtime error checks (enabled by setting -RTC1 in the -DFFI_DEBUG ++ # case below) are not compatible with optimization flags and will ++ # cause the build to fail. Therefore, drop the optimization flag if ++ # -DFFI_DEBUG is also set. ++ case $args_orig in ++ *-DFFI_DEBUG*) ++ args="$args" ++ ;; ++ *) ++ # The ax_cc_maxopt.m4 macro from the upstream autoconf-archive ++ # project doesn't support MSVC and therefore ends up trying to ++ # use -O3. Use the equivalent "max optimization" flag for MSVC ++ # instead of erroring out. ++ case $1 in ++ -O3) ++ args="$args -O2" ++ ;; ++ *) ++ args="$args $1" ++ ;; ++ esac ++ opt="true" ++ ;; ++ esac + shift 1 + ;; + -g) + # Enable debug symbol generation. +- args="$args -Zi -DEBUG" ++ args="$args -Zi" + shift 1 + ;; + -DFFI_DEBUG) +@@ -126,6 +148,10 @@ + # to do here. + shift 1 + ;; ++ -pedantic) ++ # libffi tests -pedantic with -Wall, so drop it also. ++ shift 1 ++ ;; + -Werror) + args="$args -WX" + shift 1 +@@ -170,6 +196,13 @@ + esac + done + ++# If -Zi is specified, certain optimizations are implicitly disabled ++# by MSVC. Add back those optimizations if this is an optimized build. ++# NOTE: These arguments must come after all others. ++if [ -n "$opt" ]; then ++ args="$args -link -OPT:REF -OPT:ICF -INCREMENTAL:NO" ++fi ++ + if [ -n "$assembly" ]; then + if [ -z "$outdir" ]; then + outdir="." +@@ -189,7 +222,10 @@ + else + args="$md $args" + echo "$cl $args" +- eval "\"$cl\" $args" ++ # Return an error code of 1 if an invalid command line parameter is passed ++ # instead of just ignoring it. ++ eval "(\"$cl\" $args 2>&1 1>&3 | \ ++ awk '{print \$0} /D9002/ {error=1} END{exit error}' >&2) 3>&1" + result=$? + fi + +diff -r c0e311e010fc Modules/_ctypes/libffi/src/aarch64/ffi.c +--- a/Modules/_ctypes/libffi/src/aarch64/ffi.c ++++ b/Modules/_ctypes/libffi/src/aarch64/ffi.c +@@ -27,7 +27,11 @@ + #include + + /* Stack alignment requirement in bytes */ ++#if defined (__APPLE__) ++#define AARCH64_STACK_ALIGN 1 ++#else + #define AARCH64_STACK_ALIGN 16 ++#endif + + #define N_X_ARG_REG 8 + #define N_V_ARG_REG 8 +@@ -49,6 +53,23 @@ + } v [AARCH64_N_VREG]; + }; + ++#if defined (__clang__) && defined (__APPLE__) ++extern void ++sys_icache_invalidate (void *start, size_t len); ++#endif ++ ++static inline void ++ffi_clear_cache (void *start, void *end) ++{ ++#if defined (__clang__) && defined (__APPLE__) ++ sys_icache_invalidate (start, (char *)end - (char *)start); ++#elif defined (__GNUC__) ++ __builtin___clear_cache (start, end); ++#else ++#error "Missing builtin to flush instruction cache" ++#endif ++} ++ + static void * + get_x_addr (struct call_context *context, unsigned n) + { +@@ -94,8 +115,10 @@ + return get_s_addr (context, n); + case FFI_TYPE_DOUBLE: + return get_d_addr (context, n); ++#if FFI_TYPE_DOUBLE != FFI_TYPE_LONGDOUBLE + case FFI_TYPE_LONGDOUBLE: + return get_v_addr (context, n); ++#endif + case FFI_TYPE_UINT8: + case FFI_TYPE_SINT8: + case FFI_TYPE_UINT16: +@@ -107,6 +130,8 @@ + case FFI_TYPE_UINT64: + case FFI_TYPE_SINT64: + return get_x_addr (context, n); ++ case FFI_TYPE_VOID: ++ return NULL; + default: + FFI_ASSERT (0); + return NULL; +@@ -123,15 +148,26 @@ + case FFI_TYPE_FLOAT: + case FFI_TYPE_DOUBLE: + return sizeof (UINT64); ++#if FFI_TYPE_DOUBLE != FFI_TYPE_LONGDOUBLE + case FFI_TYPE_LONGDOUBLE: + return sizeof (long double); ++#endif + case FFI_TYPE_UINT8: + case FFI_TYPE_SINT8: ++#if defined (__APPLE__) ++ return sizeof (UINT8); ++#endif + case FFI_TYPE_UINT16: + case FFI_TYPE_SINT16: ++#if defined (__APPLE__) ++ return sizeof (UINT16); ++#endif + case FFI_TYPE_UINT32: + case FFI_TYPE_INT: + case FFI_TYPE_SINT32: ++#if defined (__APPLE__) ++ return sizeof (UINT32); ++#endif + case FFI_TYPE_POINTER: + case FFI_TYPE_UINT64: + case FFI_TYPE_SINT64: +@@ -154,8 +190,10 @@ + return sizeof (UINT32); + case FFI_TYPE_DOUBLE: + return sizeof (UINT64); ++#if FFI_TYPE_DOUBLE != FFI_TYPE_LONGDOUBLE + case FFI_TYPE_LONGDOUBLE: + return sizeof (long double); ++#endif + case FFI_TYPE_UINT8: + return sizeof (UINT8); + case FFI_TYPE_SINT8: +@@ -186,7 +224,7 @@ + extended_cif *), + struct call_context *context, + extended_cif *, +- unsigned, ++ size_t, + void (*fn)(void)); + + extern void +@@ -305,7 +343,9 @@ + case FFI_TYPE_VOID: + case FFI_TYPE_FLOAT: + case FFI_TYPE_DOUBLE: ++#if FFI_TYPE_DOUBLE != FFI_TYPE_LONGDOUBLE + case FFI_TYPE_LONGDOUBLE: ++#endif + case FFI_TYPE_UINT8: + case FFI_TYPE_UINT16: + case FFI_TYPE_UINT32: +@@ -367,16 +407,24 @@ + { + unsigned ngrn; /* Next general-purpose register number. */ + unsigned nsrn; /* Next vector register number. */ +- unsigned nsaa; /* Next stack offset. */ ++ size_t nsaa; /* Next stack offset. */ ++ ++#if defined (__APPLE__) ++ unsigned allocating_variadic; ++#endif + }; + + /* Initialize a procedure call argument marshalling state. */ + static void +-arg_init (struct arg_state *state, unsigned call_frame_size) ++arg_init (struct arg_state *state, size_t call_frame_size) + { + state->ngrn = 0; + state->nsrn = 0; + state->nsaa = 0; ++ ++#if defined (__APPLE__) ++ state->allocating_variadic = 0; ++#endif + } + + /* Return the number of available consecutive core argument +@@ -400,35 +448,35 @@ + static void * + allocate_to_x (struct call_context *context, struct arg_state *state) + { +- FFI_ASSERT (state->ngrn < N_X_ARG_REG) ++ FFI_ASSERT (state->ngrn < N_X_ARG_REG); + return get_x_addr (context, (state->ngrn)++); + } + + static void * + allocate_to_s (struct call_context *context, struct arg_state *state) + { +- FFI_ASSERT (state->nsrn < N_V_ARG_REG) ++ FFI_ASSERT (state->nsrn < N_V_ARG_REG); + return get_s_addr (context, (state->nsrn)++); + } + + static void * + allocate_to_d (struct call_context *context, struct arg_state *state) + { +- FFI_ASSERT (state->nsrn < N_V_ARG_REG) ++ FFI_ASSERT (state->nsrn < N_V_ARG_REG); + return get_d_addr (context, (state->nsrn)++); + } + + static void * + allocate_to_v (struct call_context *context, struct arg_state *state) + { +- FFI_ASSERT (state->nsrn < N_V_ARG_REG) ++ FFI_ASSERT (state->nsrn < N_V_ARG_REG); + return get_v_addr (context, (state->nsrn)++); + } + + /* Allocate an aligned slot on the stack and return a pointer to it. */ + static void * +-allocate_to_stack (struct arg_state *state, void *stack, unsigned alignment, +- unsigned size) ++allocate_to_stack (struct arg_state *state, void *stack, size_t alignment, ++ size_t size) + { + void *allocation; + +@@ -436,7 +484,12 @@ + alignment of the argument's type. */ + state->nsaa = ALIGN (state->nsaa, alignment); + state->nsaa = ALIGN (state->nsaa, alignment); ++#if defined (__APPLE__) ++ if (state->allocating_variadic) ++ state->nsaa = ALIGN (state->nsaa, 8); ++#else + state->nsaa = ALIGN (state->nsaa, 8); ++#endif + + allocation = stack + state->nsaa; + +@@ -447,7 +500,7 @@ + static void + copy_basic_type (void *dest, void *source, unsigned short type) + { +- /* This is neccessary to ensure that basic types are copied ++ /* This is necessary to ensure that basic types are copied + sign extended to 64-bits as libffi expects. */ + switch (type) + { +@@ -457,9 +510,11 @@ + case FFI_TYPE_DOUBLE: + *(double *) dest = *(double *) source; + break; ++#if FFI_TYPE_DOUBLE != FFI_TYPE_LONGDOUBLE + case FFI_TYPE_LONGDOUBLE: + *(long double *) dest = *(long double *) source; + break; ++#endif + case FFI_TYPE_UINT8: + *(ffi_arg *) dest = *(UINT8 *) source; + break; +@@ -486,6 +541,8 @@ + case FFI_TYPE_SINT64: + *(ffi_sarg *) dest = *(SINT64 *) source; + break; ++ case FFI_TYPE_VOID: ++ break; + + default: + FFI_ASSERT (0); +@@ -514,7 +571,6 @@ + { + int i; + unsigned short type = get_homogeneous_type (ty); +- unsigned elems = element_count (ty); + for (i = 0; i < elems; i++) + { + void *reg = allocate_to_v (context, state); +@@ -548,11 +604,13 @@ + return allocate_to_d (context, state); + state->nsrn = N_V_ARG_REG; + break; ++#if FFI_TYPE_DOUBLE != FFI_TYPE_LONGDOUBLE + case FFI_TYPE_LONGDOUBLE: + if (state->nsrn < N_V_ARG_REG) + return allocate_to_v (context, state); + state->nsrn = N_V_ARG_REG; + break; ++#endif + case FFI_TYPE_UINT8: + case FFI_TYPE_SINT8: + case FFI_TYPE_UINT16: +@@ -615,7 +673,9 @@ + appropriate register, or if none are available, to the stack. */ + case FFI_TYPE_FLOAT: + case FFI_TYPE_DOUBLE: ++#if FFI_TYPE_DOUBLE != FFI_TYPE_LONGDOUBLE + case FFI_TYPE_LONGDOUBLE: ++#endif + case FFI_TYPE_UINT8: + case FFI_TYPE_SINT8: + case FFI_TYPE_UINT16: +@@ -676,6 +736,16 @@ + FFI_ASSERT (0); + break; + } ++ ++#if defined (__APPLE__) ++ if (i + 1 == ecif->cif->aarch64_nfixedargs) ++ { ++ state.ngrn = N_X_ARG_REG; ++ state.nsrn = N_V_ARG_REG; ++ ++ state.allocating_variadic = 1; ++ } ++#endif + } + + return ecif->cif->aarch64_flags; +@@ -712,6 +782,20 @@ + return FFI_OK; + } + ++#if defined (__APPLE__) ++ ++/* Perform Apple-specific cif processing for variadic calls */ ++ffi_status ffi_prep_cif_machdep_var(ffi_cif *cif, ++ unsigned int nfixedargs, ++ unsigned int ntotalargs) ++{ ++ cif->aarch64_nfixedargs = nfixedargs; ++ ++ return ffi_prep_cif_machdep(cif); ++} ++ ++#endif ++ + /* Call a function with the provided arguments and capture the return + value. */ + void +@@ -728,7 +812,7 @@ + case FFI_SYSV: + { + struct call_context context; +- unsigned stack_bytes; ++ size_t stack_bytes; + + /* Figure out the total amount of stack space we need, the + above call frame space needs to be 16 bytes aligned to +@@ -745,7 +829,9 @@ + case FFI_TYPE_VOID: + case FFI_TYPE_FLOAT: + case FFI_TYPE_DOUBLE: ++#if FFI_TYPE_DOUBLE != FFI_TYPE_LONGDOUBLE + case FFI_TYPE_LONGDOUBLE: ++#endif + case FFI_TYPE_UINT8: + case FFI_TYPE_SINT8: + case FFI_TYPE_UINT16: +@@ -778,7 +864,7 @@ + } + else if ((cif->rtype->size + 7) / 8 < N_X_ARG_REG) + { +- unsigned size = ALIGN (cif->rtype->size, sizeof (UINT64)); ++ size_t size = ALIGN (cif->rtype->size, sizeof (UINT64)); + memcpy (rvalue, get_x_addr (&context, 0), size); + } + else +@@ -824,7 +910,7 @@ + memcpy (__tramp + 12, &__fun, sizeof (__fun)); \ + memcpy (__tramp + 20, &__ctx, sizeof (__ctx)); \ + memcpy (__tramp + 28, &__flags, sizeof (__flags)); \ +- __clear_cache(__tramp, __tramp + FFI_TRAMPOLINE_SIZE); \ ++ ffi_clear_cache(__tramp, __tramp + FFI_TRAMPOLINE_SIZE); \ + }) + + ffi_status +@@ -857,13 +943,13 @@ + the stack at the point ffi_closure_SYSV() was invoked. + + On the return path the assembler wrapper will reload call context +- regsiters. ++ registers. + + ffi_closure_SYSV_inner() marshalls the call context into ffi value +- desriptors, invokes the wrapped function, then marshalls the return ++ descriptors, invokes the wrapped function, then marshalls the return + value back into the call context. */ + +-void ++void FFI_HIDDEN + ffi_closure_SYSV_inner (ffi_closure *closure, struct call_context *context, + void *stack) + { +@@ -897,10 +983,12 @@ + case FFI_TYPE_SINT64: + case FFI_TYPE_FLOAT: + case FFI_TYPE_DOUBLE: ++#if FFI_TYPE_DOUBLE != FFI_TYPE_LONGDOUBLE + case FFI_TYPE_LONGDOUBLE: + avalue[i] = allocate_to_register_or_stack (context, stack, + &state, ty->type); + break; ++#endif + + case FFI_TYPE_STRUCT: + if (is_hfa (ty)) +@@ -924,7 +1012,7 @@ + therefore the structure is not represented as + a contiguous sequence of bytes in our saved + register context. We need to fake up a copy +- of the structure layed out in memory ++ of the structure laid out in memory + correctly. The fake can be tossed once the + closure function has returned hence alloca() + is sufficient. */ +@@ -945,7 +1033,7 @@ + therefore the structure is not represented as + a contiguous sequence of bytes in our saved + register context. We need to fake up a copy +- of the structure layed out in memory ++ of the structure laid out in memory + correctly. The fake can be tossed once the + closure function has returned hence alloca() + is sufficient. */ +@@ -958,11 +1046,13 @@ + break; + } + ++#if FFI_TYPE_DOUBLE != FFI_TYPE_LONGDOUBLE + case FFI_TYPE_LONGDOUBLE: + memcpy (&avalue[i], + allocate_to_v (context, &state), + sizeof (*avalue)); + break; ++#endif + + default: + FFI_ASSERT (0); +@@ -1033,7 +1123,9 @@ + case FFI_TYPE_SINT64: + case FFI_TYPE_FLOAT: + case FFI_TYPE_DOUBLE: ++#if FFI_TYPE_DOUBLE != FFI_TYPE_LONGDOUBLE + case FFI_TYPE_LONGDOUBLE: ++#endif + { + void *addr = get_basic_type_addr (cif->rtype->type, context, 0); + copy_basic_type (addr, rvalue, cif->rtype->type); +@@ -1042,19 +1134,19 @@ + case FFI_TYPE_STRUCT: + if (is_hfa (cif->rtype)) + { +- int i; ++ int j; + unsigned short type = get_homogeneous_type (cif->rtype); + unsigned elems = element_count (cif->rtype); +- for (i = 0; i < elems; i++) ++ for (j = 0; j < elems; j++) + { +- void *reg = get_basic_type_addr (type, context, i); ++ void *reg = get_basic_type_addr (type, context, j); + copy_basic_type (reg, rvalue, type); + rvalue += get_basic_type_size (type); + } + } + else if ((cif->rtype->size + 7) / 8 < N_X_ARG_REG) + { +- unsigned size = ALIGN (cif->rtype->size, sizeof (UINT64)) ; ++ size_t size = ALIGN (cif->rtype->size, sizeof (UINT64)) ; + memcpy (get_x_addr (context, 0), rvalue, size); + } + else +diff -r c0e311e010fc Modules/_ctypes/libffi/src/aarch64/ffitarget.h +--- a/Modules/_ctypes/libffi/src/aarch64/ffitarget.h ++++ b/Modules/_ctypes/libffi/src/aarch64/ffitarget.h +@@ -47,8 +47,12 @@ + + /* ---- Internal ---- */ + +- ++#if defined (__APPLE__) ++#define FFI_TARGET_SPECIFIC_VARIADIC ++#define FFI_EXTRA_CIF_FIELDS unsigned aarch64_flags; unsigned aarch64_nfixedargs ++#else + #define FFI_EXTRA_CIF_FIELDS unsigned aarch64_flags ++#endif + + #define AARCH64_FFI_WITH_V_BIT 0 + +diff -r c0e311e010fc Modules/_ctypes/libffi/src/aarch64/sysv.S +--- a/Modules/_ctypes/libffi/src/aarch64/sysv.S ++++ b/Modules/_ctypes/libffi/src/aarch64/sysv.S +@@ -23,14 +23,33 @@ + #include + #include + ++#ifdef HAVE_MACHINE_ASM_H ++#include ++#else ++#ifdef __USER_LABEL_PREFIX__ ++#define CONCAT1(a, b) CONCAT2(a, b) ++#define CONCAT2(a, b) a ## b ++ ++/* Use the right prefix for global labels. */ ++#define CNAME(x) CONCAT1 (__USER_LABEL_PREFIX__, x) ++#else ++#define CNAME(x) x ++#endif ++#endif ++ + #define cfi_adjust_cfa_offset(off) .cfi_adjust_cfa_offset off + #define cfi_rel_offset(reg, off) .cfi_rel_offset reg, off + #define cfi_restore(reg) .cfi_restore reg + #define cfi_def_cfa_register(reg) .cfi_def_cfa_register reg + + .text +- .globl ffi_call_SYSV +- .type ffi_call_SYSV, #function ++ .globl CNAME(ffi_call_SYSV) ++#ifdef __ELF__ ++ .type CNAME(ffi_call_SYSV), #function ++#endif ++#ifdef __APPLE__ ++ .align 2 ++#endif + + /* ffi_call_SYSV() + +@@ -53,7 +72,7 @@ + extended_cif *), + struct call_context *context, + extended_cif *, +- unsigned required_stack_size, ++ size_t required_stack_size, + void (*fn)(void)); + + Therefore on entry we have: +@@ -82,7 +101,7 @@ + #define ffi_call_SYSV_FS (8 * 4) + + .cfi_startproc +-ffi_call_SYSV: ++CNAME(ffi_call_SYSV): + stp x29, x30, [sp, #-16]! + cfi_adjust_cfa_offset (16) + cfi_rel_offset (x29, 0) +@@ -92,11 +111,11 @@ + cfi_def_cfa_register (x29) + sub sp, sp, #ffi_call_SYSV_FS + +- stp x21, x22, [sp, 0] ++ stp x21, x22, [sp, #0] + cfi_rel_offset (x21, 0 - ffi_call_SYSV_FS) + cfi_rel_offset (x22, 8 - ffi_call_SYSV_FS) + +- stp x23, x24, [sp, 16] ++ stp x23, x24, [sp, #16] + cfi_rel_offset (x23, 16 - ffi_call_SYSV_FS) + cfi_rel_offset (x24, 24 - ffi_call_SYSV_FS) + +@@ -180,7 +199,9 @@ + ret + + .cfi_endproc +- .size ffi_call_SYSV, .-ffi_call_SYSV ++#ifdef __ELF__ ++ .size CNAME(ffi_call_SYSV), .-CNAME(ffi_call_SYSV) ++#endif + + #define ffi_closure_SYSV_FS (8 * 2 + AARCH64_CALL_CONTEXT_SIZE) + +@@ -222,22 +243,25 @@ + Voila! */ + + .text +- .globl ffi_closure_SYSV ++ .globl CNAME(ffi_closure_SYSV) ++#ifdef __APPLE__ ++ .align 2 ++#endif + .cfi_startproc +-ffi_closure_SYSV: ++CNAME(ffi_closure_SYSV): + stp x29, x30, [sp, #-16]! + cfi_adjust_cfa_offset (16) + cfi_rel_offset (x29, 0) + cfi_rel_offset (x30, 8) + + mov x29, sp ++ cfi_def_cfa_register (x29) + + sub sp, sp, #ffi_closure_SYSV_FS +- cfi_adjust_cfa_offset (ffi_closure_SYSV_FS) + + stp x21, x22, [x29, #-16] +- cfi_rel_offset (x21, 0) +- cfi_rel_offset (x22, 8) ++ cfi_rel_offset (x21, -16) ++ cfi_rel_offset (x22, -8) + + /* Load x21 with &call_context. */ + mov x21, sp +@@ -270,7 +294,7 @@ + trampoline was called. */ + add x2, x29, #16 + +- bl ffi_closure_SYSV_inner ++ bl CNAME(ffi_closure_SYSV_inner) + + /* Figure out if we should touch the vector registers. */ + ldr x0, [x22, #8] +@@ -287,7 +311,7 @@ + ldp x2, x3, [x21, #16] + ldp x4, x5, [x21, #32] + ldp x6, x7, [x21, #48] +- /* Note nothing usefull is returned in x8. */ ++ /* Note nothing useful is returned in x8. */ + + /* We are done, unwind our frame. */ + ldp x21, x22, [x29, #-16] +@@ -295,7 +319,7 @@ + cfi_restore (x22) + + mov sp, x29 +- cfi_adjust_cfa_offset (-ffi_closure_SYSV_FS) ++ cfi_def_cfa_register (sp) + + ldp x29, x30, [sp], #16 + cfi_adjust_cfa_offset (-16) +@@ -304,4 +328,6 @@ + + ret + .cfi_endproc +- .size ffi_closure_SYSV, .-ffi_closure_SYSV ++#ifdef __ELF__ ++ .size CNAME(ffi_closure_SYSV), .-CNAME(ffi_closure_SYSV) ++#endif +diff -r c0e311e010fc Modules/_ctypes/libffi/src/arc/arcompact.S +--- /dev/null ++++ b/Modules/_ctypes/libffi/src/arc/arcompact.S +@@ -0,0 +1,135 @@ ++/* ----------------------------------------------------------------------- ++ arcompact.S - Copyright (c) 2013 Synposys, Inc. (www.synopsys.com) ++ ++ ARCompact Foreign Function Interface ++ ++ Permission is hereby granted, free of charge, to any person obtaining ++ a copy of this software and associated documentation files (the ++ ``Software''), to deal in the Software without restriction, including ++ without limitation the rights to use, copy, modify, merge, publish, ++ distribute, sublicense, and/or sell copies of the Software, and to ++ permit persons to whom the Software is furnished to do so, subject to ++ the following conditions: ++ ++ The above copyright notice and this permission notice shall be included ++ in all copies or substantial portions of the Software. ++ ++ THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS ++ OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF ++ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. ++ IN NO EVENT SHALL RENESAS TECHNOLOGY BE LIABLE FOR ANY CLAIM, DAMAGES OR ++ OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ++ ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR ++ OTHER DEALINGS IN THE SOFTWARE. ++ ----------------------------------------------------------------------- */ ++ ++#define LIBFFI_ASM ++#include ++#include ++#ifdef HAVE_MACHINE_ASM_H ++#include ++#else ++#define CNAME(x) x ++#define ENTRY(x) .globl CNAME(x)` .type CNAME(x),%function` CNAME(x): ++#endif ++ ++.text ++ ++ /* R0: ffi_prep_args */ ++ /* R1: &ecif */ ++ /* R2: cif->bytes */ ++ /* R3: fig->flags */ ++ /* R4: ecif.rvalue */ ++ /* R5: fn */ ++ENTRY(ffi_call_ARCompact) ++ /* Save registers. */ ++ st.a fp, [sp, -4] /* fp + 20, fp */ ++ push_s blink /* fp + 16, blink */ ++ st.a r4, [sp, -4] /* fp + 12, ecif.rvalue */ ++ push_s r3 /* fp + 8, fig->flags */ ++ st.a r5, [sp, -4] /* fp + 4, fn */ ++ push_s r2 /* fp + 0, cif->bytes */ ++ mov fp, sp ++ ++ /* Make room for all of the new args. */ ++ sub sp, sp, r2 ++ ++ /* Place all of the ffi_prep_args in position. */ ++ /* ffi_prep_args(char *stack, extended_cif *ecif) */ ++ /* R1 already set. */ ++ ++ /* And call. */ ++ jl_s.d [r0] ++ mov_s r0, sp ++ ++ ld.ab r12, [fp, 4] /* cif->bytes */ ++ ld.ab r11, [fp, 4] /* fn */ ++ ++ /* Move first 8 parameters in registers... */ ++ ld_s r0, [sp] ++ ld_s r1, [sp, 4] ++ ld_s r2, [sp, 8] ++ ld_s r3, [sp, 12] ++ ld r4, [sp, 16] ++ ld r5, [sp, 20] ++ ld r6, [sp, 24] ++ ld r7, [sp, 28] ++ ++ /* ...and adjust the stack. */ ++ min r12, r12, 32 ++ ++ /* Call the function. */ ++ jl.d [r11] ++ add sp, sp, r12 ++ ++ mov sp, fp ++ pop_s r3 /* fig->flags, return type */ ++ pop_s r2 /* ecif.rvalue, pointer for return value */ ++ ++ /* If the return value pointer is NULL, assume no return value. */ ++ breq.d r2, 0, epilogue ++ pop_s blink ++ ++ /* Return INT. */ ++ brne r3, FFI_TYPE_INT, return_double ++ b.d epilogue ++ st_s r0, [r2] ++ ++return_double: ++ brne r3, FFI_TYPE_DOUBLE, epilogue ++ st_s r0, [r2] ++ st_s r1, [r2,4] ++ ++epilogue: ++ j_s.d [blink] ++ ld.ab fp, [sp, 4] ++ ++ENTRY(ffi_closure_ARCompact) ++ st.a r0, [sp, -32] ++ st_s r1, [sp, 4] ++ st_s r2, [sp, 8] ++ st_s r3, [sp, 12] ++ st r4, [sp, 16] ++ st r5, [sp, 20] ++ st r6, [sp, 24] ++ st r7, [sp, 28] ++ ++ /* pointer to arguments */ ++ mov_s r2, sp ++ ++ /* return value goes here */ ++ sub sp, sp, 8 ++ mov_s r1, sp ++ ++ push_s blink ++ ++ bl.d ffi_closure_inner_ARCompact ++ mov_s r0, r8 /* codeloc, set by trampoline */ ++ ++ pop_s blink ++ ++ /* set return value to r1:r0 */ ++ pop_s r0 ++ pop_s r1 ++ j_s.d [blink] ++ add_s sp, sp, 32 +diff -r c0e311e010fc Modules/_ctypes/libffi/src/arc/ffi.c +--- /dev/null ++++ b/Modules/_ctypes/libffi/src/arc/ffi.c +@@ -0,0 +1,268 @@ ++/* ----------------------------------------------------------------------- ++ ffi.c - Copyright (c) 2013 Synopsys, Inc. (www.synopsys.com) ++ ++ ARC Foreign Function Interface ++ ++ Permission is hereby granted, free of charge, to any person obtaining ++ a copy of this software and associated documentation files (the ++ ``Software''), to deal in the Software without restriction, including ++ without limitation the rights to use, copy, modify, merge, publish, ++ distribute, sublicense, and/or sell copies of the Software, and to ++ permit persons to whom the Software is furnished to do so, subject to ++ the following conditions: ++ ++ The above copyright notice and this permission notice shall be included ++ in all copies or substantial portions of the Software. ++ ++ THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS ++ OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF ++ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. ++ IN NO EVENT SHALL RENESAS TECHNOLOGY BE LIABLE FOR ANY CLAIM, DAMAGES OR ++ OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ++ ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR ++ OTHER DEALINGS IN THE SOFTWARE. ++ ----------------------------------------------------------------------- */ ++ ++#include ++#include ++ ++#include ++#include ++ ++#include ++ ++/* for little endian ARC, the code is in fact stored as mixed endian for ++ performance reasons */ ++#if __BIG_ENDIAN__ ++#define CODE_ENDIAN(x) (x) ++#else ++#define CODE_ENDIAN(x) ( (((uint32_t) (x)) << 16) | (((uint32_t) (x)) >> 16)) ++#endif ++ ++/* ffi_prep_args is called by the assembly routine once stack ++ space has been allocated for the function's arguments. */ ++ ++void ++ffi_prep_args (char *stack, extended_cif * ecif) ++{ ++ unsigned int i; ++ int tmp; ++ void **p_argv; ++ char *argp; ++ ffi_type **p_arg; ++ ++ tmp = 0; ++ argp = stack; ++ ++ if (ecif->cif->rtype->type == FFI_TYPE_STRUCT) ++ { ++ *(void **) argp = ecif->rvalue; ++ argp += 4; ++ } ++ ++ p_argv = ecif->avalue; ++ ++ for (i = ecif->cif->nargs, p_arg = ecif->cif->arg_types; ++ (i != 0); i--, p_arg++) ++ { ++ size_t z; ++ int alignment; ++ ++ /* align alignment to 4 */ ++ alignment = (((*p_arg)->alignment - 1) | 3) + 1; ++ ++ /* Align if necessary. */ ++ if ((alignment - 1) & (unsigned) argp) ++ argp = (char *) ALIGN (argp, alignment); ++ ++ z = (*p_arg)->size; ++ if (z < sizeof (int)) ++ { ++ z = sizeof (int); ++ ++ switch ((*p_arg)->type) ++ { ++ case FFI_TYPE_SINT8: ++ *(signed int *) argp = (signed int) *(SINT8 *) (*p_argv); ++ break; ++ ++ case FFI_TYPE_UINT8: ++ *(unsigned int *) argp = (unsigned int) *(UINT8 *) (*p_argv); ++ break; ++ ++ case FFI_TYPE_SINT16: ++ *(signed int *) argp = (signed int) *(SINT16 *) (*p_argv); ++ break; ++ ++ case FFI_TYPE_UINT16: ++ *(unsigned int *) argp = (unsigned int) *(UINT16 *) (*p_argv); ++ break; ++ ++ case FFI_TYPE_STRUCT: ++ memcpy (argp, *p_argv, (*p_arg)->size); ++ break; ++ ++ default: ++ FFI_ASSERT (0); ++ } ++ } ++ else if (z == sizeof (int)) ++ { ++ *(unsigned int *) argp = (unsigned int) *(UINT32 *) (*p_argv); ++ } ++ else ++ { ++ if ((*p_arg)->type == FFI_TYPE_STRUCT) ++ { ++ memcpy (argp, *p_argv, z); ++ } ++ else ++ { ++ /* Double or long long 64bit. */ ++ memcpy (argp, *p_argv, z); ++ } ++ } ++ p_argv++; ++ argp += z; ++ } ++ ++ return; ++} ++ ++/* Perform machine dependent cif processing. */ ++ffi_status ++ffi_prep_cif_machdep (ffi_cif * cif) ++{ ++ /* Set the return type flag. */ ++ switch (cif->rtype->type) ++ { ++ case FFI_TYPE_VOID: ++ cif->flags = (unsigned) cif->rtype->type; ++ break; ++ ++ case FFI_TYPE_STRUCT: ++ cif->flags = (unsigned) cif->rtype->type; ++ break; ++ ++ case FFI_TYPE_SINT64: ++ case FFI_TYPE_UINT64: ++ case FFI_TYPE_DOUBLE: ++ cif->flags = FFI_TYPE_DOUBLE; ++ break; ++ ++ case FFI_TYPE_FLOAT: ++ default: ++ cif->flags = FFI_TYPE_INT; ++ break; ++ } ++ ++ return FFI_OK; ++} ++ ++extern void ffi_call_ARCompact (void (*)(char *, extended_cif *), ++ extended_cif *, unsigned, unsigned, ++ unsigned *, void (*fn) (void)); ++ ++void ++ffi_call (ffi_cif * cif, void (*fn) (void), void *rvalue, void **avalue) ++{ ++ extended_cif ecif; ++ ++ ecif.cif = cif; ++ ecif.avalue = avalue; ++ ++ /* If the return value is a struct and we don't have ++ a return value address then we need to make one. */ ++ if ((rvalue == NULL) && (cif->rtype->type == FFI_TYPE_STRUCT)) ++ { ++ ecif.rvalue = alloca (cif->rtype->size); ++ } ++ else ++ ecif.rvalue = rvalue; ++ ++ switch (cif->abi) ++ { ++ case FFI_ARCOMPACT: ++ ffi_call_ARCompact (ffi_prep_args, &ecif, cif->bytes, ++ cif->flags, ecif.rvalue, fn); ++ break; ++ ++ default: ++ FFI_ASSERT (0); ++ break; ++ } ++} ++ ++int ++ffi_closure_inner_ARCompact (ffi_closure * closure, void *rvalue, ++ ffi_arg * args) ++{ ++ void **arg_area, **p_argv; ++ ffi_cif *cif = closure->cif; ++ char *argp = (char *) args; ++ ffi_type **p_argt; ++ int i; ++ ++ arg_area = (void **) alloca (cif->nargs * sizeof (void *)); ++ ++ /* handle hidden argument */ ++ if (cif->flags == FFI_TYPE_STRUCT) ++ { ++ rvalue = *(void **) argp; ++ argp += 4; ++ } ++ ++ p_argv = arg_area; ++ ++ for (i = 0, p_argt = cif->arg_types; i < cif->nargs; ++ i++, p_argt++, p_argv++) ++ { ++ size_t z; ++ int alignment; ++ ++ /* align alignment to 4 */ ++ alignment = (((*p_argt)->alignment - 1) | 3) + 1; ++ ++ /* Align if necessary. */ ++ if ((alignment - 1) & (unsigned) argp) ++ argp = (char *) ALIGN (argp, alignment); ++ ++ z = (*p_argt)->size; ++ *p_argv = (void *) argp; ++ argp += z; ++ } ++ ++ (closure->fun) (cif, rvalue, arg_area, closure->user_data); ++ ++ return cif->flags; ++} ++ ++extern void ffi_closure_ARCompact (void); ++ ++ffi_status ++ffi_prep_closure_loc (ffi_closure * closure, ffi_cif * cif, ++ void (*fun) (ffi_cif *, void *, void **, void *), ++ void *user_data, void *codeloc) ++{ ++ uint32_t *tramp = (uint32_t *) & (closure->tramp[0]); ++ ++ switch (cif->abi) ++ { ++ case FFI_ARCOMPACT: ++ FFI_ASSERT (tramp == codeloc); ++ tramp[0] = CODE_ENDIAN (0x200a1fc0); /* mov r8, pcl */ ++ tramp[1] = CODE_ENDIAN (0x20200f80); /* j [long imm] */ ++ tramp[2] = CODE_ENDIAN (ffi_closure_ARCompact); ++ break; ++ ++ default: ++ return FFI_BAD_ABI; ++ } ++ ++ closure->cif = cif; ++ closure->fun = fun; ++ closure->user_data = user_data; ++ cacheflush (codeloc, FFI_TRAMPOLINE_SIZE, BCACHE); ++ ++ return FFI_OK; ++} +diff -r c0e311e010fc Modules/_ctypes/libffi/src/arc/ffitarget.h +--- /dev/null ++++ b/Modules/_ctypes/libffi/src/arc/ffitarget.h +@@ -0,0 +1,53 @@ ++/* ----------------------------------------------------------------------- ++ ffitarget.h - Copyright (c) 2012 Anthony Green ++ Copyright (c) 2013 Synopsys, Inc. (www.synopsys.com) ++ Target configuration macros for ARC. ++ ++ Permission is hereby granted, free of charge, to any person obtaining ++ a copy of this software and associated documentation files (the ++ ``Software''), to deal in the Software without restriction, including ++ without limitation the rights to use, copy, modify, merge, publish, ++ distribute, sublicense, and/or sell copies of the Software, and to ++ permit persons to whom the Software is furnished to do so, subject to ++ the following conditions: ++ ++ The above copyright notice and this permission notice shall be included ++ in all copies or substantial portions of the Software. ++ ++ THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS ++ OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF ++ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. ++ IN NO EVENT SHALL RENESAS TECHNOLOGY BE LIABLE FOR ANY CLAIM, DAMAGES OR ++ OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ++ ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR ++ OTHER DEALINGS IN THE SOFTWARE. ++ ++ ----------------------------------------------------------------------- */ ++ ++#ifndef LIBFFI_TARGET_H ++#define LIBFFI_TARGET_H ++ ++#ifndef LIBFFI_H ++#error "Please do not include ffitarget.h directly into your source. Use ffi.h instead." ++#endif ++ ++/* ---- Generic type definitions ----------------------------------------- */ ++ ++#ifndef LIBFFI_ASM ++typedef unsigned long ffi_arg; ++typedef signed long ffi_sarg; ++ ++typedef enum ffi_abi ++{ ++ FFI_FIRST_ABI = 0, ++ FFI_ARCOMPACT, ++ FFI_LAST_ABI, ++ FFI_DEFAULT_ABI = FFI_ARCOMPACT ++} ffi_abi; ++#endif ++ ++#define FFI_CLOSURES 1 ++#define FFI_TRAMPOLINE_SIZE 12 ++#define FFI_NATIVE_RAW_API 0 ++ ++#endif +diff -r c0e311e010fc Modules/_ctypes/libffi/src/arm/ffi.c +--- a/Modules/_ctypes/libffi/src/arm/ffi.c ++++ b/Modules/_ctypes/libffi/src/arm/ffi.c +@@ -4,8 +4,8 @@ + Copyright (c) 2011 Anthony Green + Copyright (c) 2011 Free Software Foundation + Copyright (c) 1998, 2008, 2011 Red Hat, Inc. +- +- ARM Foreign Function Interface ++ ++ ARM Foreign Function Interface + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the +@@ -37,6 +37,87 @@ + static int vfp_type_p (ffi_type *); + static void layout_vfp_args (ffi_cif *); + ++int ffi_prep_args_SYSV(char *stack, extended_cif *ecif, float *vfp_space); ++int ffi_prep_args_VFP(char *stack, extended_cif *ecif, float *vfp_space); ++ ++static char* ffi_align(ffi_type **p_arg, char *argp) ++{ ++ /* Align if necessary */ ++ register size_t alignment = (*p_arg)->alignment; ++ if (alignment < 4) ++ { ++ alignment = 4; ++ } ++#ifdef _WIN32_WCE ++ if (alignment > 4) ++ { ++ alignment = 4; ++ } ++#endif ++ if ((alignment - 1) & (unsigned) argp) ++ { ++ argp = (char *) ALIGN(argp, alignment); ++ } ++ ++ if ((*p_arg)->type == FFI_TYPE_STRUCT) ++ { ++ argp = (char *) ALIGN(argp, 4); ++ } ++ return argp; ++} ++ ++static size_t ffi_put_arg(ffi_type **arg_type, void **arg, char *stack) ++{ ++ register char* argp = stack; ++ register ffi_type **p_arg = arg_type; ++ register void **p_argv = arg; ++ register size_t z = (*p_arg)->size; ++ if (z < sizeof(int)) ++ { ++ z = sizeof(int); ++ switch ((*p_arg)->type) ++ { ++ case FFI_TYPE_SINT8: ++ *(signed int *) argp = (signed int)*(SINT8 *)(* p_argv); ++ break; ++ ++ case FFI_TYPE_UINT8: ++ *(unsigned int *) argp = (unsigned int)*(UINT8 *)(* p_argv); ++ break; ++ ++ case FFI_TYPE_SINT16: ++ *(signed int *) argp = (signed int)*(SINT16 *)(* p_argv); ++ break; ++ ++ case FFI_TYPE_UINT16: ++ *(unsigned int *) argp = (unsigned int)*(UINT16 *)(* p_argv); ++ break; ++ ++ case FFI_TYPE_STRUCT: ++ memcpy(argp, *p_argv, (*p_arg)->size); ++ break; ++ ++ default: ++ FFI_ASSERT(0); ++ } ++ } ++ else if (z == sizeof(int)) ++ { ++ if ((*p_arg)->type == FFI_TYPE_FLOAT) ++ *(float *) argp = *(float *)(* p_argv); ++ else ++ *(unsigned int *) argp = (unsigned int)*(UINT32 *)(* p_argv); ++ } ++ else if (z == sizeof(double) && (*p_arg)->type == FFI_TYPE_DOUBLE) ++ { ++ *(double *) argp = *(double *)(* p_argv); ++ } ++ else ++ { ++ memcpy(argp, *p_argv, z); ++ } ++ return z; ++} + /* ffi_prep_args is called by the assembly routine once stack space + has been allocated for the function's arguments + +@@ -44,14 +125,14 @@ + value is cif->vfp_used (word bitset of VFP regs used for passing + arguments). These are only used for the VFP hard-float ABI. + */ +-int ffi_prep_args(char *stack, extended_cif *ecif, float *vfp_space) ++int ffi_prep_args_SYSV(char *stack, extended_cif *ecif, float *vfp_space) + { +- register unsigned int i, vi = 0; ++ register unsigned int i; + register void **p_argv; + register char *argp; + register ffi_type **p_arg; +- + argp = stack; ++ + + if ( ecif->cif->flags == FFI_TYPE_STRUCT ) { + *(void **) argp = ecif->rvalue; +@@ -62,81 +143,89 @@ + + for (i = ecif->cif->nargs, p_arg = ecif->cif->arg_types; + (i != 0); +- i--, p_arg++) ++ i--, p_arg++, p_argv++) + { +- size_t z; +- size_t alignment; ++ argp = ffi_align(p_arg, argp); ++ argp += ffi_put_arg(p_arg, p_argv, argp); ++ } ++ ++ return 0; ++} ++ ++int ffi_prep_args_VFP(char *stack, extended_cif *ecif, float *vfp_space) ++{ ++ register unsigned int i, vi = 0; ++ register void **p_argv; ++ register char *argp, *regp, *eo_regp; ++ register ffi_type **p_arg; ++ char stack_used = 0; ++ char done_with_regs = 0; ++ char is_vfp_type; ++ ++ // make sure we are using FFI_VFP ++ FFI_ASSERT(ecif->cif->abi == FFI_VFP); ++ ++ /* the first 4 words on the stack are used for values passed in core ++ * registers. */ ++ regp = stack; ++ eo_regp = argp = regp + 16; ++ ++ ++ /* if the function returns an FFI_TYPE_STRUCT in memory, that address is ++ * passed in r0 to the function */ ++ if ( ecif->cif->flags == FFI_TYPE_STRUCT ) { ++ *(void **) regp = ecif->rvalue; ++ regp += 4; ++ } ++ ++ p_argv = ecif->avalue; ++ ++ for (i = ecif->cif->nargs, p_arg = ecif->cif->arg_types; ++ (i != 0); ++ i--, p_arg++, p_argv++) ++ { ++ is_vfp_type = vfp_type_p (*p_arg); + + /* Allocated in VFP registers. */ +- if (ecif->cif->abi == FFI_VFP +- && vi < ecif->cif->vfp_nargs && vfp_type_p (*p_arg)) +- { +- float* vfp_slot = vfp_space + ecif->cif->vfp_args[vi++]; +- if ((*p_arg)->type == FFI_TYPE_FLOAT) +- *((float*)vfp_slot) = *((float*)*p_argv); +- else if ((*p_arg)->type == FFI_TYPE_DOUBLE) +- *((double*)vfp_slot) = *((double*)*p_argv); +- else +- memcpy(vfp_slot, *p_argv, (*p_arg)->size); +- p_argv++; +- continue; +- } +- +- /* Align if necessary */ +- alignment = (*p_arg)->alignment; +-#ifdef _WIN32_WCE +- if (alignment > 4) +- alignment = 4; +-#endif +- if ((alignment - 1) & (unsigned) argp) { +- argp = (char *) ALIGN(argp, alignment); +- } +- +- if ((*p_arg)->type == FFI_TYPE_STRUCT) +- argp = (char *) ALIGN(argp, 4); +- +- z = (*p_arg)->size; +- if (z < sizeof(int)) +- { +- z = sizeof(int); +- switch ((*p_arg)->type) +- { +- case FFI_TYPE_SINT8: +- *(signed int *) argp = (signed int)*(SINT8 *)(* p_argv); +- break; +- +- case FFI_TYPE_UINT8: +- *(unsigned int *) argp = (unsigned int)*(UINT8 *)(* p_argv); +- break; +- +- case FFI_TYPE_SINT16: +- *(signed int *) argp = (signed int)*(SINT16 *)(* p_argv); +- break; +- +- case FFI_TYPE_UINT16: +- *(unsigned int *) argp = (unsigned int)*(UINT16 *)(* p_argv); +- break; +- +- case FFI_TYPE_STRUCT: +- memcpy(argp, *p_argv, (*p_arg)->size); +- break; +- +- default: +- FFI_ASSERT(0); +- } +- } +- else if (z == sizeof(int)) +- { +- *(unsigned int *) argp = (unsigned int)*(UINT32 *)(* p_argv); +- } +- else +- { +- memcpy(argp, *p_argv, z); +- } +- p_argv++; +- argp += z; ++ if(vi < ecif->cif->vfp_nargs && is_vfp_type) ++ { ++ char *vfp_slot = (char *)(vfp_space + ecif->cif->vfp_args[vi++]); ++ ffi_put_arg(p_arg, p_argv, vfp_slot); ++ continue; ++ } ++ /* Try allocating in core registers. */ ++ else if (!done_with_regs && !is_vfp_type) ++ { ++ char *tregp = ffi_align(p_arg, regp); ++ size_t size = (*p_arg)->size; ++ size = (size < 4)? 4 : size; // pad ++ /* Check if there is space left in the aligned register area to place ++ * the argument */ ++ if(tregp + size <= eo_regp) ++ { ++ regp = tregp + ffi_put_arg(p_arg, p_argv, tregp); ++ done_with_regs = (regp == argp); ++ // ensure we did not write into the stack area ++ FFI_ASSERT(regp <= argp); ++ continue; ++ } ++ /* In case there are no arguments in the stack area yet, ++ the argument is passed in the remaining core registers and on the ++ stack. */ ++ else if (!stack_used) ++ { ++ stack_used = 1; ++ done_with_regs = 1; ++ argp = tregp + ffi_put_arg(p_arg, p_argv, tregp); ++ FFI_ASSERT(eo_regp < argp); ++ continue; ++ } ++ } ++ /* Base case, arguments are passed on the stack */ ++ stack_used = 1; ++ argp = ffi_align(p_arg, argp); ++ argp += ffi_put_arg(p_arg, p_argv, argp); + } +- + /* Indicate the VFP registers used. */ + return ecif->cif->vfp_used; + } +@@ -227,7 +316,7 @@ + ecif.avalue = avalue; + + /* If the return value is a struct and we don't have a return */ +- /* value address then we need to make one */ ++ /* value address then we need to make one */ + + if ((rvalue == NULL) && + (cif->flags == FFI_TYPE_STRUCT)) +@@ -261,9 +350,17 @@ + break; + } + if (small_struct) +- memcpy (rvalue, &temp, cif->rtype->size); ++ { ++ FFI_ASSERT(rvalue != NULL); ++ memcpy (rvalue, &temp, cif->rtype->size); ++ } ++ + else if (vfp_struct) +- memcpy (rvalue, ecif.rvalue, cif->rtype->size); ++ { ++ FFI_ASSERT(rvalue != NULL); ++ memcpy (rvalue, ecif.rvalue, cif->rtype->size); ++ } ++ + } + + /** private members **/ +@@ -271,18 +368,18 @@ + static void ffi_prep_incoming_args_SYSV (char *stack, void **ret, + void** args, ffi_cif* cif, float *vfp_stack); + ++static void ffi_prep_incoming_args_VFP (char *stack, void **ret, ++ void** args, ffi_cif* cif, float *vfp_stack); ++ + void ffi_closure_SYSV (ffi_closure *); + + void ffi_closure_VFP (ffi_closure *); + + /* This function is jumped to by the trampoline */ + +-unsigned int +-ffi_closure_SYSV_inner( +- ffi_closure *closure, +- void **respp, +- void *args, +- void *vfp_args) ++unsigned int FFI_HIDDEN ++ffi_closure_inner (ffi_closure *closure, ++ void **respp, void *args, void *vfp_args) + { + // our various things... + ffi_cif *cif; +@@ -296,8 +393,10 @@ + * value on the stack; and if the function returns + * a structure, it will re-set RESP to point to the + * structure return address. */ +- +- ffi_prep_incoming_args_SYSV(args, respp, arg_area, cif, vfp_args); ++ if (cif->abi == FFI_VFP) ++ ffi_prep_incoming_args_VFP(args, respp, arg_area, cif, vfp_args); ++ else ++ ffi_prep_incoming_args_SYSV(args, respp, arg_area, cif, vfp_args); + + (closure->fun) (cif, *respp, arg_area, closure->user_data); + +@@ -312,7 +411,7 @@ + float *vfp_stack) + /*@=exportheader@*/ + { +- register unsigned int i, vi = 0; ++ register unsigned int i; + register void **p_argv; + register char *argp; + register ffi_type **p_arg; +@@ -329,27 +428,8 @@ + for (i = cif->nargs, p_arg = cif->arg_types; (i != 0); i--, p_arg++) + { + size_t z; +- size_t alignment; +- +- if (cif->abi == FFI_VFP +- && vi < cif->vfp_nargs && vfp_type_p (*p_arg)) +- { +- *p_argv++ = (void*)(vfp_stack + cif->vfp_args[vi++]); +- continue; +- } + +- alignment = (*p_arg)->alignment; +- if (alignment < 4) +- alignment = 4; +-#ifdef _WIN32_WCE +- else +- if (alignment > 4) +- alignment = 4; +-#endif +- /* Align if necessary */ +- if ((alignment - 1) & (unsigned) argp) { +- argp = (char *) ALIGN(argp, alignment); +- } ++ argp = ffi_align(p_arg, argp); + + z = (*p_arg)->size; + +@@ -364,6 +444,95 @@ + return; + } + ++/*@-exportheader@*/ ++static void ++ffi_prep_incoming_args_VFP(char *stack, void **rvalue, ++ void **avalue, ffi_cif *cif, ++ /* Used only under VFP hard-float ABI. */ ++ float *vfp_stack) ++/*@=exportheader@*/ ++{ ++ register unsigned int i, vi = 0; ++ register void **p_argv; ++ register char *argp, *regp, *eo_regp; ++ register ffi_type **p_arg; ++ char done_with_regs = 0; ++ char stack_used = 0; ++ char is_vfp_type; ++ ++ FFI_ASSERT(cif->abi == FFI_VFP); ++ regp = stack; ++ eo_regp = argp = regp + 16; ++ ++ if ( cif->flags == FFI_TYPE_STRUCT ) { ++ *rvalue = *(void **) regp; ++ regp += 4; ++ } ++ ++ p_argv = avalue; ++ ++ for (i = cif->nargs, p_arg = cif->arg_types; (i != 0); i--, p_arg++) ++ { ++ size_t z; ++ is_vfp_type = vfp_type_p (*p_arg); ++ ++ if(vi < cif->vfp_nargs && is_vfp_type) ++ { ++ *p_argv++ = (void*)(vfp_stack + cif->vfp_args[vi++]); ++ continue; ++ } ++ else if (!done_with_regs && !is_vfp_type) ++ { ++ char* tregp = ffi_align(p_arg, regp); ++ ++ z = (*p_arg)->size; ++ z = (z < 4)? 4 : z; // pad ++ ++ /* if the arguments either fits into the registers or uses registers ++ * and stack, while we haven't read other things from the stack */ ++ if(tregp + z <= eo_regp || !stack_used) ++ { ++ /* because we're little endian, this is what it turns into. */ ++ *p_argv = (void*) tregp; ++ ++ p_argv++; ++ regp = tregp + z; ++ // if we read past the last core register, make sure we have not read ++ // from the stack before and continue reading after regp ++ if(regp > eo_regp) ++ { ++ if(stack_used) ++ { ++ abort(); // we should never read past the end of the register ++ // are if the stack is already in use ++ } ++ argp = regp; ++ } ++ if(regp >= eo_regp) ++ { ++ done_with_regs = 1; ++ stack_used = 1; ++ } ++ continue; ++ } ++ } ++ stack_used = 1; ++ ++ argp = ffi_align(p_arg, argp); ++ ++ z = (*p_arg)->size; ++ ++ /* because we're little endian, this is what it turns into. */ ++ ++ *p_argv = (void*) argp; ++ ++ p_argv++; ++ argp += z; ++ } ++ ++ return; ++} ++ + /* How to make a trampoline. */ + + extern unsigned int ffi_arm_trampoline[3]; +@@ -381,7 +550,7 @@ + typedef struct ffi_trampoline_table_entry ffi_trampoline_table_entry; + + struct ffi_trampoline_table { +- /* contigious writable and executable pages */ ++ /* contiguous writable and executable pages */ + vm_address_t config_page; + vm_address_t trampoline_page; + +@@ -421,7 +590,7 @@ + { + ffi_trampoline_table *table = NULL; + +- /* Loop until we can allocate two contigious pages */ ++ /* Loop until we can allocate two contiguous pages */ + while (table == NULL) { + vm_address_t config_page = 0x0; + kern_return_t kt; +@@ -617,7 +786,7 @@ + #endif + else + return FFI_BAD_ABI; +- ++ + #if FFI_EXEC_TRAMPOLINE_TABLE + void **config = FFI_TRAMPOLINE_CODELOC_CONFIG(codeloc); + config[0] = closure; +@@ -700,9 +869,9 @@ + return 0; + } + +-static void place_vfp_arg (ffi_cif *cif, ffi_type *t) ++static int place_vfp_arg (ffi_cif *cif, ffi_type *t) + { +- int reg = cif->vfp_reg_free; ++ short reg = cif->vfp_reg_free; + int nregs = t->size / sizeof (float); + int align = ((t->type == FFI_TYPE_STRUCT_VFP_FLOAT + || t->type == FFI_TYPE_FLOAT) ? 1 : 2); +@@ -733,9 +902,13 @@ + reg += 1; + cif->vfp_reg_free = reg; + } +- return; ++ return 0; + next_reg: ; + } ++ // done, mark all regs as used ++ cif->vfp_reg_free = 16; ++ cif->vfp_used = 0xFFFF; ++ return 1; + } + + static void layout_vfp_args (ffi_cif *cif) +@@ -750,7 +923,9 @@ + for (i = 0; i < cif->nargs; i++) + { + ffi_type *t = cif->arg_types[i]; +- if (vfp_type_p (t)) +- place_vfp_arg (cif, t); ++ if (vfp_type_p (t) && place_vfp_arg (cif, t) == 1) ++ { ++ break; ++ } + } + } +diff -r c0e311e010fc Modules/_ctypes/libffi/src/arm/gentramp.sh +--- a/Modules/_ctypes/libffi/src/arm/gentramp.sh ++++ b/Modules/_ctypes/libffi/src/arm/gentramp.sh +@@ -84,7 +84,7 @@ + } + + +-# WARNING - Don't modify the trampoline code size without also updating the relevent libffi code ++# WARNING - Don't modify the trampoline code size without also updating the relevant libffi code + trampoline () { + cat << END + +diff -r c0e311e010fc Modules/_ctypes/libffi/src/arm/sysv.S +--- a/Modules/_ctypes/libffi/src/arm/sysv.S ++++ b/Modules/_ctypes/libffi/src/arm/sysv.S +@@ -109,42 +109,27 @@ + #define UNWIND @ + #endif + +- ++.syntax unified ++ + #if defined(__thumb__) && !defined(__THUMB_INTERWORK__) +-.macro ARM_FUNC_START name +- .text +- .align 0 +- .thumb +- .thumb_func +-#ifdef __APPLE__ +- ENTRY($0) ++#define ARM_FUNC_START(name) \ ++ .text; \ ++ .align 2; \ ++ .thumb; \ ++ .thumb_func; \ ++ ENTRY(name); \ ++ bx pc; \ ++ nop; \ ++ .arm; \ ++ UNWIND .fnstart; \ ++_L__##name: + #else +- ENTRY(\name) +-#endif +- bx pc +- nop +- .arm ++#define ARM_FUNC_START(name) \ ++ .text; \ ++ .align 2; \ ++ .arm; \ ++ ENTRY(name); \ + UNWIND .fnstart +-/* A hook to tell gdb that we've switched to ARM mode. Also used to call +- directly from other local arm routines. */ +-#ifdef __APPLE__ +-_L__$0: +-#else +-_L__\name: +-#endif +-.endm +-#else +-.macro ARM_FUNC_START name +- .text +- .align 0 +- .arm +-#ifdef __APPLE__ +- ENTRY($0) +-#else +- ENTRY(\name) +-#endif +- UNWIND .fnstart +-.endm + #endif + + .macro RETLDM regs=, cond=, dirn=ia +@@ -171,7 +156,7 @@ + @ sp+0: ecif.rvalue + + @ This assumes we are using gas. +-ARM_FUNC_START ffi_call_SYSV ++ARM_FUNC_START(ffi_call_SYSV) + @ Save registers + stmfd sp!, {r0-r3, fp, lr} + UNWIND .save {r0-r3, fp, lr} +@@ -187,7 +172,7 @@ + @ r1 already set + + @ Call ffi_prep_args(stack, &ecif) +- bl CNAME(ffi_prep_args) ++ bl CNAME(ffi_prep_args_SYSV) + + @ move first 4 parameters in registers + ldmia sp, {r0-r3} +@@ -228,7 +213,7 @@ + #if defined(__SOFTFP__) || defined(__ARM_EABI__) + cmpne r3, #FFI_TYPE_DOUBLE + #endif +- stmeqia r2, {r0, r1} ++ stmiaeq r2, {r0, r1} + + #if !defined(__SOFTFP__) && !defined(__ARM_EABI__) + beq LSYM(Lepilogue) +@@ -260,13 +245,13 @@ + + /* + unsigned int FFI_HIDDEN +- ffi_closure_SYSV_inner (closure, respp, args) ++ ffi_closure_inner (closure, respp, args) + ffi_closure *closure; + void **respp; + void *args; + */ + +-ARM_FUNC_START ffi_closure_SYSV ++ARM_FUNC_START(ffi_closure_SYSV) + UNWIND .pad #16 + add ip, sp, #16 + stmfd sp!, {ip, lr} +@@ -276,7 +261,7 @@ + sub sp, sp, #16 + str sp, [sp, #8] + add r1, sp, #8 +- bl CNAME(ffi_closure_SYSV_inner) ++ bl CNAME(ffi_closure_inner) + cmp r0, #FFI_TYPE_INT + beq .Lretint + +@@ -345,7 +330,7 @@ + @ r3: fig->flags + @ sp+0: ecif.rvalue + +-ARM_FUNC_START ffi_call_VFP ++ARM_FUNC_START(ffi_call_VFP) + @ Save registers + stmfd sp!, {r0-r3, fp, lr} + UNWIND .save {r0-r3, fp, lr} +@@ -364,10 +349,11 @@ + sub r2, fp, #64 @ VFP scratch space + + @ Call ffi_prep_args(stack, &ecif, vfp_space) +- bl CNAME(ffi_prep_args) ++ bl CNAME(ffi_prep_args_VFP) + + @ Load VFP register args if needed + cmp r0, #0 ++ mov ip, fp + beq LSYM(Lbase_args) + + @ Load only d0 if possible +@@ -433,7 +419,7 @@ + .size CNAME(ffi_call_VFP),.ffi_call_VFP_end-CNAME(ffi_call_VFP) + + +-ARM_FUNC_START ffi_closure_VFP ++ARM_FUNC_START(ffi_closure_VFP) + fstmfdd sp!, {d0-d7} + @ r0-r3, then d0-d7 + UNWIND .pad #80 +@@ -446,7 +432,7 @@ + sub sp, sp, #72 + str sp, [sp, #64] + add r1, sp, #64 +- bl CNAME(ffi_closure_SYSV_inner) ++ bl CNAME(ffi_closure_inner) + + cmp r0, #FFI_TYPE_INT + beq .Lretint_vfp +diff -r c0e311e010fc Modules/_ctypes/libffi/src/bfin/ffi.c +--- a/Modules/_ctypes/libffi/src/bfin/ffi.c ++++ b/Modules/_ctypes/libffi/src/bfin/ffi.c +@@ -1,5 +1,6 @@ + /* ----------------------------------------------------------------------- +- ffi.c - Copyright (c) 2012 Alexandre K. I. de Mendonca ++ ffi.c - Copyright (c) 2012 Alexandre K. I. de Mendonca , ++ Paulo Pizarro + + Blackfin Foreign Function Interface + +diff -r c0e311e010fc Modules/_ctypes/libffi/src/bfin/sysv.S +--- a/Modules/_ctypes/libffi/src/bfin/sysv.S ++++ b/Modules/_ctypes/libffi/src/bfin/sysv.S +@@ -1,5 +1,6 @@ + /* ----------------------------------------------------------------------- +- sysv.S - Copyright (c) 2012 Alexandre K. I. de Mendonca ++ sysv.S - Copyright (c) 2012 Alexandre K. I. de Mendonca , ++ Paulo Pizarro + + Blackfin Foreign Function Interface + +@@ -32,7 +33,7 @@ + .align 4 + + /* +- There is a "feature" in the bfin toolchain that it puts a _ before funcion names ++ There is a "feature" in the bfin toolchain that it puts a _ before function names + that's why the function here it's called _ffi_call_SYSV and not ffi_call_SYSV + */ + .global _ffi_call_SYSV; +@@ -40,25 +41,26 @@ + .func ffi_call_SYSV + + /* +- cif->bytes = R0 (fp+8) +- &ecif = R1 (fp+12) +- ffi_prep_args = R2 (fp+16) +- ret_type = stack (fp+20) +- ecif.rvalue = stack (fp+24) +- fn = stack (fp+28) +- got (fp+32) +- There is room for improvement here (we can use temporary registers ++ cif->bytes = R0 (fp+8) ++ &ecif = R1 (fp+12) ++ ffi_prep_args = R2 (fp+16) ++ ret_type = stack (fp+20) ++ ecif.rvalue = stack (fp+24) ++ fn = stack (fp+28) ++ got (fp+32) ++ ++ There is room for improvement here (we can use temporary registers + instead of saving the values in the memory) +- REGS: +- P5 => Stack pointer (function arguments) +- R5 => cif->bytes +- R4 => ret->type ++ REGS: ++ P5 => Stack pointer (function arguments) ++ R5 => cif->bytes ++ R4 => ret->type + +- FP-20 = P3 +- FP-16 = SP (parameters area) +- FP-12 = SP (temp) +- FP-08 = function return part 1 [R0] +- FP-04 = function return part 2 [R1] ++ FP-20 = P3 ++ FP-16 = SP (parameters area) ++ FP-12 = SP (temp) ++ FP-08 = function return part 1 [R0] ++ FP-04 = function return part 2 [R1] + */ + + _ffi_call_SYSV: +diff -r c0e311e010fc Modules/_ctypes/libffi/src/closures.c +--- a/Modules/_ctypes/libffi/src/closures.c ++++ b/Modules/_ctypes/libffi/src/closures.c +@@ -34,7 +34,7 @@ + #include + + #if !FFI_MMAP_EXEC_WRIT && !FFI_EXEC_TRAMPOLINE_TABLE +-# if __gnu_linux__ ++# if __gnu_linux__ && !defined(__ANDROID__) + /* This macro indicates it may be forbidden to map anonymous memory + with both write and execute permission. Code compiled when this + option is defined will attempt to map such pages once, but if it +@@ -181,10 +181,26 @@ + static int + emutramp_enabled_check (void) + { +- if (getenv ("FFI_DISABLE_EMUTRAMP") == NULL) +- return 1; +- else ++ char *buf = NULL; ++ size_t len = 0; ++ FILE *f; ++ int ret; ++ f = fopen ("/proc/self/status", "r"); ++ if (f == NULL) + return 0; ++ ret = 0; ++ ++ while (getline (&buf, &len, f) != -1) ++ if (!strncmp (buf, "PaX:", 4)) ++ { ++ char emutramp; ++ if (sscanf (buf, "%*s %*c%c", &emutramp) == 1) ++ ret = (emutramp == 'E'); ++ break; ++ } ++ free (buf); ++ fclose (f); ++ return ret; + } + + #define is_emutramp_enabled() (emutramp_enabled >= 0 ? emutramp_enabled \ +@@ -264,7 +280,7 @@ + open_temp_exec_file_dir (const char *dir) + { + static const char suffix[] = "/ffiXXXXXX"; +- int lendir = strlen (dir); ++ size_t lendir = strlen (dir); + char *tempname = __builtin_alloca (lendir + sizeof (suffix)); + + if (!tempname) +@@ -382,7 +398,7 @@ + } + + /* Return a file descriptor of a temporary zero-sized file in a +- writable and exexutable filesystem. */ ++ writable and executable filesystem. */ + static int + open_temp_exec_file (void) + { +diff -r c0e311e010fc Modules/_ctypes/libffi/src/dlmalloc.c +--- a/Modules/_ctypes/libffi/src/dlmalloc.c ++++ b/Modules/_ctypes/libffi/src/dlmalloc.c +@@ -1260,7 +1260,7 @@ + #define SIZE_T_BITSIZE (sizeof(size_t) << 3) + + /* Some constants coerced to size_t */ +-/* Annoying but necessary to avoid errors on some plaftorms */ ++/* Annoying but necessary to avoid errors on some platforms */ + #define SIZE_T_ZERO ((size_t)0) + #define SIZE_T_ONE ((size_t)1) + #define SIZE_T_TWO ((size_t)2) +@@ -1414,7 +1414,7 @@ + #define CALL_MORECORE(S) MFAIL + #endif /* HAVE_MORECORE */ + +-/* mstate bit set if continguous morecore disabled or failed */ ++/* mstate bit set if contiguous morecore disabled or failed */ + #define USE_NONCONTIGUOUS_BIT (4U) + + /* segment bit set in create_mspace_with_base */ +@@ -1666,7 +1666,7 @@ + typedef struct malloc_chunk mchunk; + typedef struct malloc_chunk* mchunkptr; + typedef struct malloc_chunk* sbinptr; /* The type of bins of chunks */ +-typedef unsigned int bindex_t; /* Described below */ ++typedef size_t bindex_t; /* Described below */ + typedef unsigned int binmap_t; /* Described below */ + typedef unsigned int flag_t; /* The type of various bit flag sets */ + +@@ -3095,8 +3095,8 @@ + and choose its bk node as its replacement. + 2. If x was the last node of its size, but not a leaf node, it must + be replaced with a leaf node (not merely one with an open left or +- right), to make sure that lefts and rights of descendents +- correspond properly to bit masks. We use the rightmost descendent ++ right), to make sure that lefts and rights of descendants ++ correspond properly to bit masks. We use the rightmost descendant + of x. We could use any other leaf, but this is easy to locate and + tends to counteract removal of leftmosts elsewhere, and so keeps + paths shorter than minimally guaranteed. This doesn't loop much +@@ -5096,10 +5096,10 @@ + Wolfram Gloger (Gloger@lrz.uni-muenchen.de). + * Use last_remainder in more cases. + * Pack bins using idea from colin@nyx10.cs.du.edu +- * Use ordered bins instead of best-fit threshhold ++ * Use ordered bins instead of best-fit threshold + * Eliminate block-local decls to simplify tracing and debugging. + * Support another case of realloc via move into top +- * Fix error occuring when initial sbrk_base not word-aligned. ++ * Fix error occurring when initial sbrk_base not word-aligned. + * Rely on page size for units instead of SBRK_UNIT to + avoid surprises about sbrk alignment conventions. + * Add mallinfo, mallopt. Thanks to Raymond Nijssen +diff -r c0e311e010fc Modules/_ctypes/libffi/src/ia64/ffi.c +--- a/Modules/_ctypes/libffi/src/ia64/ffi.c ++++ b/Modules/_ctypes/libffi/src/ia64/ffi.c +@@ -401,7 +401,7 @@ + the closure (in the "trampoline" area), but we replace the gp + pointer with a pointer to the closure itself. We also add the real + gp pointer to the closure. This allows the function entry code to +- both retrieve the user data, and to restire the correct gp pointer. */ ++ both retrieve the user data, and to restore the correct gp pointer. */ + + extern void ffi_closure_unix (); + +diff -r c0e311e010fc Modules/_ctypes/libffi/src/m88k/ffi.c +--- /dev/null ++++ b/Modules/_ctypes/libffi/src/m88k/ffi.c +@@ -0,0 +1,400 @@ ++/* ++ * Copyright (c) 2013 Miodrag Vallat. ++ * ++ * Permission is hereby granted, free of charge, to any person obtaining ++ * a copy of this software and associated documentation files (the ++ * ``Software''), to deal in the Software without restriction, including ++ * without limitation the rights to use, copy, modify, merge, publish, ++ * distribute, sublicense, and/or sell copies of the Software, and to ++ * permit persons to whom the Software is furnished to do so, subject to ++ * the following conditions: ++ * ++ * The above copyright notice and this permission notice shall be included ++ * in all copies or substantial portions of the Software. ++ * ++ * THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, ++ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF ++ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. ++ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY ++ * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, ++ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE ++ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ++ */ ++ ++/* ++ * m88k Foreign Function Interface ++ * ++ * This file attempts to provide all the FFI entry points which can reliably ++ * be implemented in C. ++ * ++ * Only OpenBSD/m88k is currently supported; other platforms (such as ++ * Motorola's SysV/m88k) could be supported with the following tweaks: ++ * ++ * - non-OpenBSD systems use an `outgoing parameter area' as part of the ++ * 88BCS calling convention, which is not supported under OpenBSD from ++ * release 3.6 onwards. Supporting it should be as easy as taking it ++ * into account when adjusting the stack, in the assembly code. ++ * ++ * - the logic deciding whether a function argument gets passed through ++ * registers, or on the stack, has changed several times in OpenBSD in ++ * edge cases (especially for structs larger than 32 bytes being passed ++ * by value). The code below attemps to match the logic used by the ++ * system compiler of OpenBSD 5.3, i.e. gcc 3.3.6 with many m88k backend ++ * fixes. ++ */ ++ ++#include ++#include ++ ++#include ++#include ++ ++void ffi_call_OBSD (unsigned int, extended_cif *, unsigned int, void *, ++ void (*fn) ()); ++void *ffi_prep_args (void *, extended_cif *); ++void ffi_closure_OBSD (ffi_closure *); ++void ffi_closure_struct_OBSD (ffi_closure *); ++unsigned int ffi_closure_OBSD_inner (ffi_closure *, void *, unsigned int *, ++ char *); ++void ffi_cacheflush_OBSD (unsigned int, unsigned int); ++ ++#define CIF_FLAGS_INT (1 << 0) ++#define CIF_FLAGS_DINT (1 << 1) ++ ++/* ++ * Foreign Function Interface API ++ */ ++ ++/* ffi_prep_args is called by the assembly routine once stack space has ++ been allocated for the function's arguments. */ ++ ++void * ++ffi_prep_args (void *stack, extended_cif *ecif) ++{ ++ unsigned int i; ++ void **p_argv; ++ char *argp, *stackp; ++ unsigned int *regp; ++ unsigned int regused; ++ ffi_type **p_arg; ++ void *struct_value_ptr; ++ ++ regp = (unsigned int *)stack; ++ stackp = (char *)(regp + 8); ++ regused = 0; ++ ++ if (ecif->cif->rtype->type == FFI_TYPE_STRUCT ++ && !ecif->cif->flags) ++ struct_value_ptr = ecif->rvalue; ++ else ++ struct_value_ptr = NULL; ++ ++ p_argv = ecif->avalue; ++ ++ for (i = ecif->cif->nargs, p_arg = ecif->cif->arg_types; i != 0; i--, p_arg++) ++ { ++ size_t z; ++ unsigned short t, a; ++ ++ z = (*p_arg)->size; ++ t = (*p_arg)->type; ++ a = (*p_arg)->alignment; ++ ++ /* ++ * Figure out whether the argument can be passed through registers ++ * or on the stack. ++ * The rule is that registers can only receive simple types not larger ++ * than 64 bits, or structs the exact size of a register and aligned to ++ * the size of a register. ++ */ ++ if (t == FFI_TYPE_STRUCT) ++ { ++ if (z == sizeof (int) && a == sizeof (int) && regused < 8) ++ argp = (char *)regp; ++ else ++ argp = stackp; ++ } ++ else ++ { ++ if (z > sizeof (int) && regused < 8 - 1) ++ { ++ /* align to an even register pair */ ++ if (regused & 1) ++ { ++ regp++; ++ regused++; ++ } ++ } ++ if (regused < 8) ++ argp = (char *)regp; ++ else ++ argp = stackp; ++ } ++ ++ /* Enforce proper stack alignment of 64-bit types */ ++ if (argp == stackp && a > sizeof (int)) ++ { ++ stackp = (char *) ALIGN(stackp, a); ++ argp = stackp; ++ } ++ ++ switch (t) ++ { ++ case FFI_TYPE_SINT8: ++ *(signed int *) argp = (signed int) *(SINT8 *) *p_argv; ++ break; ++ ++ case FFI_TYPE_UINT8: ++ *(unsigned int *) argp = (unsigned int) *(UINT8 *) *p_argv; ++ break; ++ ++ case FFI_TYPE_SINT16: ++ *(signed int *) argp = (signed int) *(SINT16 *) *p_argv; ++ break; ++ ++ case FFI_TYPE_UINT16: ++ *(unsigned int *) argp = (unsigned int) *(UINT16 *) *p_argv; ++ break; ++ ++ case FFI_TYPE_INT: ++ case FFI_TYPE_FLOAT: ++ case FFI_TYPE_UINT32: ++ case FFI_TYPE_SINT32: ++ case FFI_TYPE_POINTER: ++ *(unsigned int *) argp = *(unsigned int *) *p_argv; ++ break; ++ ++ case FFI_TYPE_DOUBLE: ++ case FFI_TYPE_UINT64: ++ case FFI_TYPE_SINT64: ++ case FFI_TYPE_STRUCT: ++ memcpy (argp, *p_argv, z); ++ break; ++ ++ default: ++ FFI_ASSERT (0); ++ } ++ ++ /* Align if necessary. */ ++ if ((sizeof (int) - 1) & z) ++ z = ALIGN(z, sizeof (int)); ++ ++ p_argv++; ++ ++ /* Be careful, once all registers are filled, and about to continue ++ on stack, regp == stackp. Therefore the check for regused as well. */ ++ if (argp == (char *)regp && regused < 8) ++ { ++ regp += z / sizeof (int); ++ regused += z / sizeof (int); ++ } ++ else ++ stackp += z; ++ } ++ ++ return struct_value_ptr; ++} ++ ++/* Perform machine dependent cif processing */ ++ffi_status ++ffi_prep_cif_machdep (ffi_cif *cif) ++{ ++ /* Set the return type flag */ ++ switch (cif->rtype->type) ++ { ++ case FFI_TYPE_VOID: ++ cif->flags = 0; ++ break; ++ ++ case FFI_TYPE_STRUCT: ++ if (cif->rtype->size == sizeof (int) && ++ cif->rtype->alignment == sizeof (int)) ++ cif->flags = CIF_FLAGS_INT; ++ else ++ cif->flags = 0; ++ break; ++ ++ case FFI_TYPE_DOUBLE: ++ case FFI_TYPE_SINT64: ++ case FFI_TYPE_UINT64: ++ cif->flags = CIF_FLAGS_DINT; ++ break; ++ ++ default: ++ cif->flags = CIF_FLAGS_INT; ++ break; ++ } ++ ++ return FFI_OK; ++} ++ ++void ++ffi_call (ffi_cif *cif, void (*fn) (), void *rvalue, void **avalue) ++{ ++ extended_cif ecif; ++ ++ ecif.cif = cif; ++ ecif.avalue = avalue; ++ ++ /* If the return value is a struct and we don't have a return value ++ address then we need to make one. */ ++ ++ if (rvalue == NULL ++ && cif->rtype->type == FFI_TYPE_STRUCT ++ && (cif->rtype->size != sizeof (int) ++ || cif->rtype->alignment != sizeof (int))) ++ ecif.rvalue = alloca (cif->rtype->size); ++ else ++ ecif.rvalue = rvalue; ++ ++ switch (cif->abi) ++ { ++ case FFI_OBSD: ++ ffi_call_OBSD (cif->bytes, &ecif, cif->flags, ecif.rvalue, fn); ++ break; ++ ++ default: ++ FFI_ASSERT (0); ++ break; ++ } ++} ++ ++/* ++ * Closure API ++ */ ++ ++static void ++ffi_prep_closure_args_OBSD (ffi_cif *cif, void **avalue, unsigned int *regp, ++ char *stackp) ++{ ++ unsigned int i; ++ void **p_argv; ++ char *argp; ++ unsigned int regused; ++ ffi_type **p_arg; ++ ++ regused = 0; ++ ++ p_argv = avalue; ++ ++ for (i = cif->nargs, p_arg = cif->arg_types; i != 0; i--, p_arg++) ++ { ++ size_t z; ++ unsigned short t, a; ++ ++ z = (*p_arg)->size; ++ t = (*p_arg)->type; ++ a = (*p_arg)->alignment; ++ ++ /* ++ * Figure out whether the argument has been passed through registers ++ * or on the stack. ++ * The rule is that registers can only receive simple types not larger ++ * than 64 bits, or structs the exact size of a register and aligned to ++ * the size of a register. ++ */ ++ if (t == FFI_TYPE_STRUCT) ++ { ++ if (z == sizeof (int) && a == sizeof (int) && regused < 8) ++ argp = (char *)regp; ++ else ++ argp = stackp; ++ } ++ else ++ { ++ if (z > sizeof (int) && regused < 8 - 1) ++ { ++ /* align to an even register pair */ ++ if (regused & 1) ++ { ++ regp++; ++ regused++; ++ } ++ } ++ if (regused < 8) ++ argp = (char *)regp; ++ else ++ argp = stackp; ++ } ++ ++ /* Enforce proper stack alignment of 64-bit types */ ++ if (argp == stackp && a > sizeof (int)) ++ { ++ stackp = (char *) ALIGN(stackp, a); ++ argp = stackp; ++ } ++ ++ if (z < sizeof (int) && t != FFI_TYPE_STRUCT) ++ *p_argv = (void *) (argp + sizeof (int) - z); ++ else ++ *p_argv = (void *) argp; ++ ++ /* Align if necessary */ ++ if ((sizeof (int) - 1) & z) ++ z = ALIGN(z, sizeof (int)); ++ ++ p_argv++; ++ ++ /* Be careful, once all registers are exhausted, and about to fetch from ++ stack, regp == stackp. Therefore the check for regused as well. */ ++ if (argp == (char *)regp && regused < 8) ++ { ++ regp += z / sizeof (int); ++ regused += z / sizeof (int); ++ } ++ else ++ stackp += z; ++ } ++} ++ ++unsigned int ++ffi_closure_OBSD_inner (ffi_closure *closure, void *resp, unsigned int *regp, ++ char *stackp) ++{ ++ ffi_cif *cif; ++ void **arg_area; ++ ++ cif = closure->cif; ++ arg_area = (void**) alloca (cif->nargs * sizeof (void *)); ++ ++ ffi_prep_closure_args_OBSD(cif, arg_area, regp, stackp); ++ ++ (closure->fun) (cif, resp, arg_area, closure->user_data); ++ ++ return cif->flags; ++} ++ ++ffi_status ++ffi_prep_closure_loc (ffi_closure* closure, ffi_cif* cif, ++ void (*fun)(ffi_cif*,void*,void**,void*), ++ void *user_data, void *codeloc) ++{ ++ unsigned int *tramp = (unsigned int *) codeloc; ++ void *fn; ++ ++ FFI_ASSERT (cif->abi == FFI_OBSD); ++ ++ if (cif->rtype->type == FFI_TYPE_STRUCT && !cif->flags) ++ fn = &ffi_closure_struct_OBSD; ++ else ++ fn = &ffi_closure_OBSD; ++ ++ /* or.u %r10, %r0, %hi16(fn) */ ++ tramp[0] = 0x5d400000 | (((unsigned int)fn) >> 16); ++ /* or.u %r13, %r0, %hi16(closure) */ ++ tramp[1] = 0x5da00000 | ((unsigned int)closure >> 16); ++ /* or %r10, %r10, %lo16(fn) */ ++ tramp[2] = 0x594a0000 | (((unsigned int)fn) & 0xffff); ++ /* jmp.n %r10 */ ++ tramp[3] = 0xf400c40a; ++ /* or %r13, %r13, %lo16(closure) */ ++ tramp[4] = 0x59ad0000 | ((unsigned int)closure & 0xffff); ++ ++ ffi_cacheflush_OBSD((unsigned int)codeloc, FFI_TRAMPOLINE_SIZE); ++ ++ closure->cif = cif; ++ closure->user_data = user_data; ++ closure->fun = fun; ++ ++ return FFI_OK; ++} +diff -r c0e311e010fc Modules/_ctypes/libffi/src/m88k/ffitarget.h +--- /dev/null ++++ b/Modules/_ctypes/libffi/src/m88k/ffitarget.h +@@ -0,0 +1,49 @@ ++/* ++ * Copyright (c) 2013 Miodrag Vallat. ++ * ++ * Permission is hereby granted, free of charge, to any person obtaining ++ * a copy of this software and associated documentation files (the ++ * ``Software''), to deal in the Software without restriction, including ++ * without limitation the rights to use, copy, modify, merge, publish, ++ * distribute, sublicense, and/or sell copies of the Software, and to ++ * permit persons to whom the Software is furnished to do so, subject to ++ * the following conditions: ++ * ++ * The above copyright notice and this permission notice shall be included ++ * in all copies or substantial portions of the Software. ++ * ++ * THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, ++ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF ++ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. ++ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY ++ * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, ++ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE ++ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ++ */ ++ ++/* ++ * m88k Foreign Function Interface ++ */ ++ ++#ifndef LIBFFI_TARGET_H ++#define LIBFFI_TARGET_H ++ ++#ifndef LIBFFI_ASM ++typedef unsigned long ffi_arg; ++typedef signed long ffi_sarg; ++ ++typedef enum ffi_abi { ++ FFI_FIRST_ABI = 0, ++ FFI_OBSD, ++ FFI_DEFAULT_ABI = FFI_OBSD, ++ FFI_LAST_ABI = FFI_DEFAULT_ABI + 1 ++} ffi_abi; ++#endif ++ ++/* ---- Definitions for closures ----------------------------------------- */ ++ ++#define FFI_CLOSURES 1 ++#define FFI_TRAMPOLINE_SIZE 0x14 ++#define FFI_NATIVE_RAW_API 0 ++ ++#endif +diff -r c0e311e010fc Modules/_ctypes/libffi/src/m88k/obsd.S +--- /dev/null ++++ b/Modules/_ctypes/libffi/src/m88k/obsd.S +@@ -0,0 +1,209 @@ ++/* ++ * Copyright (c) 2013 Miodrag Vallat. ++ * ++ * Permission is hereby granted, free of charge, to any person obtaining ++ * a copy of this software and associated documentation files (the ++ * ``Software''), to deal in the Software without restriction, including ++ * without limitation the rights to use, copy, modify, merge, publish, ++ * distribute, sublicense, and/or sell copies of the Software, and to ++ * permit persons to whom the Software is furnished to do so, subject to ++ * the following conditions: ++ * ++ * The above copyright notice and this permission notice shall be included ++ * in all copies or substantial portions of the Software. ++ * ++ * THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, ++ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF ++ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. ++ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY ++ * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, ++ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE ++ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ++ */ ++ ++/* ++ * m88k Foreign Function Interface ++ */ ++ ++#define LIBFFI_ASM ++#include ++#include ++ ++ .text ++ ++/* ++ * ffi_cacheflush_OBSD(unsigned int addr, %r2 ++ * unsigned int size); %r3 ++ */ ++ .align 4 ++ .globl ffi_cacheflush_OBSD ++ .type ffi_cacheflush_OBSD,@function ++ffi_cacheflush_OBSD: ++ tb0 0, %r0, 451 ++ or %r0, %r0, %r0 ++ jmp %r1 ++ .size ffi_cacheflush_OBSD, . - ffi_cacheflush_OBSD ++ ++/* ++ * ffi_call_OBSD(unsigned bytes, %r2 ++ * extended_cif *ecif, %r3 ++ * unsigned flags, %r4 ++ * void *rvalue, %r5 ++ * void (*fn)()); %r6 ++ */ ++ .align 4 ++ .globl ffi_call_OBSD ++ .type ffi_call_OBSD,@function ++ffi_call_OBSD: ++ subu %r31, %r31, 32 ++ st %r30, %r31, 4 ++ st %r1, %r31, 0 ++ addu %r30, %r31, 32 ++ ++ | Save the few arguments we'll need after ffi_prep_args() ++ st.d %r4, %r31, 8 ++ st %r6, %r31, 16 ++ ++ | Allocate room for the image of r2-r9, and the stack space for ++ | the args (rounded to a 16-byte boundary) ++ addu %r2, %r2, (8 * 4) + 15 ++ clr %r2, %r2, 4<0> ++ subu %r31, %r31, %r2 ++ ++ | Fill register and stack image ++ or %r2, %r31, %r0 ++#ifdef PIC ++ bsr ffi_prep_args#plt ++#else ++ bsr ffi_prep_args ++#endif ++ ++ | Save pointer to return struct address, if any ++ or %r12, %r2, %r0 ++ ++ | Get function pointer ++ subu %r4, %r30, 32 ++ ld %r1, %r4, 16 ++ ++ | Fetch the register arguments ++ ld.d %r2, %r31, (0 * 4) ++ ld.d %r4, %r31, (2 * 4) ++ ld.d %r6, %r31, (4 * 4) ++ ld.d %r8, %r31, (6 * 4) ++ addu %r31, %r31, (8 * 4) ++ ++ | Invoke the function ++ jsr %r1 ++ ++ | Restore stack now that we don't need the args anymore ++ subu %r31, %r30, 32 ++ ++ | Figure out what to return as the function's return value ++ ld %r5, %r31, 12 | rvalue ++ ld %r4, %r31, 8 | flags ++ ++ bcnd eq0, %r5, 9f ++ ++ bb0 0, %r4, 1f | CIF_FLAGS_INT ++ st %r2, %r5, 0 ++ br 9f ++ ++1: ++ bb0 1, %r4, 1f | CIF_FLAGS_DINT ++ st.d %r2, %r5, 0 ++ br 9f ++ ++1: ++9: ++ ld %r1, %r31, 0 ++ ld %r30, %r31, 4 ++ jmp.n %r1 ++ addu %r31, %r31, 32 ++ .size ffi_call_OBSD, . - ffi_call_OBSD ++ ++/* ++ * ffi_closure_OBSD(ffi_closure *closure); %r13 ++ */ ++ .align 4 ++ .globl ffi_closure_OBSD ++ .type ffi_closure_OBSD, @function ++ffi_closure_OBSD: ++ subu %r31, %r31, 16 ++ st %r30, %r31, 4 ++ st %r1, %r31, 0 ++ addu %r30, %r31, 16 ++ ++ | Make room on the stack for saved register arguments and return ++ | value ++ subu %r31, %r31, (8 * 4) + (2 * 4) ++ st.d %r2, %r31, (0 * 4) ++ st.d %r4, %r31, (2 * 4) ++ st.d %r6, %r31, (4 * 4) ++ st.d %r8, %r31, (6 * 4) ++ ++ | Invoke the closure function ++ or %r5, %r30, 0 | calling stack ++ addu %r4, %r31, 0 | saved registers ++ addu %r3, %r31, (8 * 4) | return value ++ or %r2, %r13, %r0 | closure ++#ifdef PIC ++ bsr ffi_closure_OBSD_inner#plt ++#else ++ bsr ffi_closure_OBSD_inner ++#endif ++ ++ | Figure out what to return as the function's return value ++ bb0 0, %r2, 1f | CIF_FLAGS_INT ++ ld %r2, %r31, (8 * 4) ++ br 9f ++ ++1: ++ bb0 1, %r2, 1f | CIF_FLAGS_DINT ++ ld.d %r2, %r31, (8 * 4) ++ br 9f ++ ++1: ++9: ++ subu %r31, %r30, 16 ++ ld %r1, %r31, 0 ++ ld %r30, %r31, 4 ++ jmp.n %r1 ++ addu %r31, %r31, 16 ++ .size ffi_closure_OBSD,.-ffi_closure_OBSD ++ ++/* ++ * ffi_closure_struct_OBSD(ffi_closure *closure); %r13 ++ */ ++ .align 4 ++ .globl ffi_closure_struct_OBSD ++ .type ffi_closure_struct_OBSD, @function ++ffi_closure_struct_OBSD: ++ subu %r31, %r31, 16 ++ st %r30, %r31, 4 ++ st %r1, %r31, 0 ++ addu %r30, %r31, 16 ++ ++ | Make room on the stack for saved register arguments ++ subu %r31, %r31, (8 * 4) ++ st.d %r2, %r31, (0 * 4) ++ st.d %r4, %r31, (2 * 4) ++ st.d %r6, %r31, (4 * 4) ++ st.d %r8, %r31, (6 * 4) ++ ++ | Invoke the closure function ++ or %r5, %r30, 0 | calling stack ++ addu %r4, %r31, 0 | saved registers ++ or %r3, %r12, 0 | return value ++ or %r2, %r13, %r0 | closure ++#ifdef PIC ++ bsr ffi_closure_OBSD_inner#plt ++#else ++ bsr ffi_closure_OBSD_inner ++#endif ++ ++ subu %r31, %r30, 16 ++ ld %r1, %r31, 0 ++ ld %r30, %r31, 4 ++ jmp.n %r1 ++ addu %r31, %r31, 16 ++ .size ffi_closure_struct_OBSD,.-ffi_closure_struct_OBSD +diff -r c0e311e010fc Modules/_ctypes/libffi/src/microblaze/ffi.c +--- a/Modules/_ctypes/libffi/src/microblaze/ffi.c ++++ b/Modules/_ctypes/libffi/src/microblaze/ffi.c +@@ -183,7 +183,7 @@ + ffi_type** arg_types = cif->arg_types; + + /* re-allocate data for the args. This needs to be done in order to keep +- * multi-word objects (e.g. structs) in contigious memory. Callers are not ++ * multi-word objects (e.g. structs) in contiguous memory. Callers are not + * required to store the value of args in the lower 6 words in the stack + * (although they are allocated in the stack). + */ +diff -r c0e311e010fc Modules/_ctypes/libffi/src/microblaze/sysv.S +--- a/Modules/_ctypes/libffi/src/microblaze/sysv.S ++++ b/Modules/_ctypes/libffi/src/microblaze/sysv.S +@@ -134,7 +134,7 @@ + rsubi r11, r23, 8 + beqi r11, ffi_call_SYSV_store64 + +- /* Didnt match anything */ ++ /* Didn't match anything */ + bri ffi_call_SYSV_end + + ffi_call_SYSV_store64: +@@ -210,7 +210,7 @@ + addik r7, r12, 0 /* closure object */ + addik r1, r1, -8 /* allocate return value */ + addik r8, r1, 0 /* void* rvalue */ +- addik r1, r1, -8 /* allocate for reutrn type/size values */ ++ addik r1, r1, -8 /* allocate for return type/size values */ + addik r9, r1, 0 /* void* rtype */ + addik r10, r1, 4 /* void* rsize */ + +@@ -247,7 +247,7 @@ + rsubi r11, r10, 8 + beqi r11, ffi_closure_SYSV_store64 + +- /* Didnt match anything */ ++ /* Didn't match anything */ + bri ffi_closure_SYSV_end + + ffi_closure_SYSV_store64: +diff -r c0e311e010fc Modules/_ctypes/libffi/src/mips/ffi.c +--- a/Modules/_ctypes/libffi/src/mips/ffi.c ++++ b/Modules/_ctypes/libffi/src/mips/ffi.c +@@ -170,7 +170,14 @@ + break; + + case FFI_TYPE_UINT32: ++#ifdef FFI_MIPS_N32 ++ /* The N32 ABI requires that 32-bit integers ++ be sign-extended to 64-bits, regardless of ++ whether they are signed or unsigned. */ ++ *(ffi_arg *)argp = *(SINT32 *)(* p_argv); ++#else + *(ffi_arg *)argp = *(UINT32 *)(* p_argv); ++#endif + break; + + /* This can only happen with 64bit slots. */ +diff -r c0e311e010fc Modules/_ctypes/libffi/src/mips/n32.S +--- a/Modules/_ctypes/libffi/src/mips/n32.S ++++ b/Modules/_ctypes/libffi/src/mips/n32.S +@@ -108,10 +108,8 @@ + REG_L t6, 3*FFI_SIZEOF_ARG($fp) # load the flags word into t6. + + and t4, t6, ((1< ++#include ++ ++#include ++ ++/* The Nios II Processor Reference Handbook defines the procedure call ++ ABI as follows. ++ ++ Arguments are passed as if a structure containing the types of ++ the arguments were constructed. The first 16 bytes are passed in r4 ++ through r7, the remainder on the stack. The first 16 bytes of a function ++ taking variable arguments are passed in r4-r7 in the same way. ++ ++ Return values of types up to 8 bytes are returned in r2 and r3. For ++ return values greater than 8 bytes, the caller must allocate memory for ++ the result and pass the address as if it were argument 0. ++ ++ While this isn't specified explicitly in the ABI documentation, GCC ++ promotes integral arguments smaller than int size to 32 bits. ++ ++ Also of note, the ABI specifies that all structure objects are ++ aligned to 32 bits even if all their fields have a smaller natural ++ alignment. See FFI_AGGREGATE_ALIGNMENT. */ ++ ++ ++/* Declare the assembly language hooks. */ ++ ++extern UINT64 ffi_call_sysv (void (*) (char *, extended_cif *), ++ extended_cif *, ++ unsigned, ++ void (*fn) (void)); ++extern void ffi_closure_sysv (void); ++ ++/* Perform machine-dependent cif processing. */ ++ ++ffi_status ffi_prep_cif_machdep (ffi_cif *cif) ++{ ++ /* We always want at least 16 bytes in the parameter block since it ++ simplifies the low-level call function. Also round the parameter ++ block size up to a multiple of 4 bytes to preserve ++ 32-bit alignment of the stack pointer. */ ++ if (cif->bytes < 16) ++ cif->bytes = 16; ++ else ++ cif->bytes = (cif->bytes + 3) & ~3; ++ ++ return FFI_OK; ++} ++ ++ ++/* ffi_prep_args is called by the assembly routine to transfer arguments ++ to the stack using the pointers in the ecif array. ++ Note that the stack buffer is big enough to fit all the arguments, ++ but the first 16 bytes will be copied to registers for the actual ++ call. */ ++ ++void ffi_prep_args (char *stack, extended_cif *ecif) ++{ ++ char *argp = stack; ++ unsigned int i; ++ ++ /* The implicit return value pointer is passed as if it were a hidden ++ first argument. */ ++ if (ecif->cif->rtype->type == FFI_TYPE_STRUCT ++ && ecif->cif->rtype->size > 8) ++ { ++ (*(void **) argp) = ecif->rvalue; ++ argp += 4; ++ } ++ ++ for (i = 0; i < ecif->cif->nargs; i++) ++ { ++ void *avalue = ecif->avalue[i]; ++ ffi_type *atype = ecif->cif->arg_types[i]; ++ size_t size = atype->size; ++ size_t alignment = atype->alignment; ++ ++ /* Align argp as appropriate for the argument type. */ ++ if ((alignment - 1) & (unsigned) argp) ++ argp = (char *) ALIGN (argp, alignment); ++ ++ /* Copy the argument, promoting integral types smaller than a ++ word to word size. */ ++ if (size < sizeof (int)) ++ { ++ size = sizeof (int); ++ switch (atype->type) ++ { ++ case FFI_TYPE_SINT8: ++ *(signed int *) argp = (signed int) *(SINT8 *) avalue; ++ break; ++ ++ case FFI_TYPE_UINT8: ++ *(unsigned int *) argp = (unsigned int) *(UINT8 *) avalue; ++ break; ++ ++ case FFI_TYPE_SINT16: ++ *(signed int *) argp = (signed int) *(SINT16 *) avalue; ++ break; ++ ++ case FFI_TYPE_UINT16: ++ *(unsigned int *) argp = (unsigned int) *(UINT16 *) avalue; ++ break; ++ ++ case FFI_TYPE_STRUCT: ++ memcpy (argp, avalue, atype->size); ++ break; ++ ++ default: ++ FFI_ASSERT(0); ++ } ++ } ++ else if (size == sizeof (int)) ++ *(unsigned int *) argp = (unsigned int) *(UINT32 *) avalue; ++ else ++ memcpy (argp, avalue, size); ++ argp += size; ++ } ++} ++ ++ ++/* Call FN using the prepared CIF. RVALUE points to space allocated by ++ the caller for the return value, and AVALUE is an array of argument ++ pointers. */ ++ ++void ffi_call (ffi_cif *cif, void (*fn) (void), void *rvalue, void **avalue) ++{ ++ ++ extended_cif ecif; ++ UINT64 result; ++ ++ /* If bigret is true, this is the case where a return value of larger ++ than 8 bytes is handled by being passed by reference as an implicit ++ argument. */ ++ int bigret = (cif->rtype->type == FFI_TYPE_STRUCT ++ && cif->rtype->size > 8); ++ ++ ecif.cif = cif; ++ ecif.avalue = avalue; ++ ++ /* Allocate space for return value if this is the pass-by-reference case ++ and the caller did not provide a buffer. */ ++ if (rvalue == NULL && bigret) ++ ecif.rvalue = alloca (cif->rtype->size); ++ else ++ ecif.rvalue = rvalue; ++ ++ result = ffi_call_sysv (ffi_prep_args, &ecif, cif->bytes, fn); ++ ++ /* Now result contains the 64 bit contents returned from fn in ++ r2 and r3. Copy the value of the appropriate size to the user-provided ++ rvalue buffer. */ ++ if (rvalue && !bigret) ++ switch (cif->rtype->size) ++ { ++ case 1: ++ *(UINT8 *)rvalue = (UINT8) result; ++ break; ++ case 2: ++ *(UINT16 *)rvalue = (UINT16) result; ++ break; ++ case 4: ++ *(UINT32 *)rvalue = (UINT32) result; ++ break; ++ case 8: ++ *(UINT64 *)rvalue = (UINT64) result; ++ break; ++ default: ++ memcpy (rvalue, (void *)&result, cif->rtype->size); ++ break; ++ } ++} ++ ++/* This function is invoked from the closure trampoline to invoke ++ CLOSURE with argument block ARGS. Parse ARGS according to ++ CLOSURE->cfi and invoke CLOSURE->fun. */ ++ ++static UINT64 ++ffi_closure_helper (unsigned char *args, ++ ffi_closure *closure) ++{ ++ ffi_cif *cif = closure->cif; ++ unsigned char *argp = args; ++ void **parsed_args = alloca (cif->nargs * sizeof (void *)); ++ UINT64 result; ++ void *retptr; ++ unsigned int i; ++ ++ /* First figure out what to do about the return type. If this is the ++ big-structure-return case, the first arg is the hidden return buffer ++ allocated by the caller. */ ++ if (cif->rtype->type == FFI_TYPE_STRUCT ++ && cif->rtype->size > 8) ++ { ++ retptr = *((void **) argp); ++ argp += 4; ++ } ++ else ++ retptr = (void *) &result; ++ ++ /* Fill in the array of argument pointers. */ ++ for (i = 0; i < cif->nargs; i++) ++ { ++ size_t size = cif->arg_types[i]->size; ++ size_t alignment = cif->arg_types[i]->alignment; ++ ++ /* Align argp as appropriate for the argument type. */ ++ if ((alignment - 1) & (unsigned) argp) ++ argp = (char *) ALIGN (argp, alignment); ++ ++ /* Arguments smaller than an int are promoted to int. */ ++ if (size < sizeof (int)) ++ size = sizeof (int); ++ ++ /* Store the pointer. */ ++ parsed_args[i] = argp; ++ argp += size; ++ } ++ ++ /* Call the user-supplied function. */ ++ (closure->fun) (cif, retptr, parsed_args, closure->user_data); ++ return result; ++} ++ ++ ++/* Initialize CLOSURE with a trampoline to call FUN with ++ CIF and USER_DATA. */ ++ffi_status ++ffi_prep_closure_loc (ffi_closure* closure, ++ ffi_cif* cif, ++ void (*fun) (ffi_cif*, void*, void**, void*), ++ void *user_data, ++ void *codeloc) ++{ ++ unsigned int *tramp = (unsigned int *) &closure->tramp[0]; ++ int i; ++ ++ if (cif->abi != FFI_SYSV) ++ return FFI_BAD_ABI; ++ ++ /* The trampoline looks like: ++ movhi r8, %hi(ffi_closure_sysv) ++ ori r8, r8, %lo(ffi_closure_sysv) ++ movhi r9, %hi(ffi_closure_helper) ++ ori r0, r9, %lo(ffi_closure_helper) ++ movhi r10, %hi(closure) ++ ori r10, r10, %lo(closure) ++ jmp r8 ++ and then ffi_closure_sysv retrieves the closure pointer out of r10 ++ in addition to the arguments passed in the normal way for the call, ++ and invokes ffi_closure_helper. We encode the pointer to ++ ffi_closure_helper in the trampoline because making a PIC call ++ to it in ffi_closure_sysv would be messy (it would have to indirect ++ through the GOT). */ ++ ++#define HI(x) ((((unsigned int) (x)) >> 16) & 0xffff) ++#define LO(x) (((unsigned int) (x)) & 0xffff) ++ tramp[0] = (0 << 27) | (8 << 22) | (HI (ffi_closure_sysv) << 6) | 0x34; ++ tramp[1] = (8 << 27) | (8 << 22) | (LO (ffi_closure_sysv) << 6) | 0x14; ++ tramp[2] = (0 << 27) | (9 << 22) | (HI (ffi_closure_helper) << 6) | 0x34; ++ tramp[3] = (9 << 27) | (9 << 22) | (LO (ffi_closure_helper) << 6) | 0x14; ++ tramp[4] = (0 << 27) | (10 << 22) | (HI (closure) << 6) | 0x34; ++ tramp[5] = (10 << 27) | (10 << 22) | (LO (closure) << 6) | 0x14; ++ tramp[6] = (8 << 27) | (0x0d << 11) | 0x3a; ++#undef HI ++#undef LO ++ ++ /* Flush the caches. ++ See Example 9-4 in the Nios II Software Developer's Handbook. */ ++ for (i = 0; i < 7; i++) ++ asm volatile ("flushd 0(%0); flushi %0" :: "r"(tramp + i) : "memory"); ++ asm volatile ("flushp" ::: "memory"); ++ ++ closure->cif = cif; ++ closure->fun = fun; ++ closure->user_data = user_data; ++ ++ return FFI_OK; ++} ++ +diff -r c0e311e010fc Modules/_ctypes/libffi/src/nios2/ffitarget.h +--- /dev/null ++++ b/Modules/_ctypes/libffi/src/nios2/ffitarget.h +@@ -0,0 +1,52 @@ ++/* libffi target includes for Altera Nios II. ++ ++ Copyright (c) 2013 Mentor Graphics. ++ ++ Permission is hereby granted, free of charge, to any person obtaining ++ a copy of this software and associated documentation files (the ++ ``Software''), to deal in the Software without restriction, including ++ without limitation the rights to use, copy, modify, merge, publish, ++ distribute, sublicense, and/or sell copies of the Software, and to ++ permit persons to whom the Software is furnished to do so, subject to ++ the following conditions: ++ ++ The above copyright notice and this permission notice shall be ++ included in all copies or substantial portions of the Software. ++ ++ THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, ++ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF ++ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. ++ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY ++ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, ++ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE ++ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ ++ ++ ++#ifndef LIBFFI_TARGET_H ++#define LIBFFI_TARGET_H ++ ++#ifndef LIBFFI_H ++#error "Please do not include ffitarget.h directly into your source. Use ffi.h instead." ++#endif ++ ++#ifndef LIBFFI_ASM ++typedef unsigned long ffi_arg; ++typedef signed long ffi_sarg; ++ ++typedef enum ffi_abi { ++ FFI_FIRST_ABI = 0, ++ FFI_SYSV, ++ FFI_LAST_ABI, ++ FFI_DEFAULT_ABI = FFI_SYSV ++} ffi_abi; ++#endif ++ ++/* Structures have a 4-byte alignment even if all the fields have lesser ++ alignment requirements. */ ++#define FFI_AGGREGATE_ALIGNMENT 4 ++ ++#define FFI_CLOSURES 1 ++#define FFI_TRAMPOLINE_SIZE 28 /* 7 instructions */ ++#define FFI_NATIVE_RAW_API 0 ++ ++#endif +diff -r c0e311e010fc Modules/_ctypes/libffi/src/nios2/sysv.S +--- /dev/null ++++ b/Modules/_ctypes/libffi/src/nios2/sysv.S +@@ -0,0 +1,136 @@ ++/* Low-level libffi support for Altera Nios II. ++ ++ Copyright (c) 2013 Mentor Graphics. ++ ++ Permission is hereby granted, free of charge, to any person obtaining ++ a copy of this software and associated documentation files (the ++ ``Software''), to deal in the Software without restriction, including ++ without limitation the rights to use, copy, modify, merge, publish, ++ distribute, sublicense, and/or sell copies of the Software, and to ++ permit persons to whom the Software is furnished to do so, subject to ++ the following conditions: ++ ++ The above copyright notice and this permission notice shall be ++ included in all copies or substantial portions of the Software. ++ ++ THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, ++ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF ++ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. ++ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY ++ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, ++ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE ++ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ ++ ++/* This function is declared on the C side as ++ ++ extern UINT64 ffi_call_sysv (void (*arghook) (char *, extended_cif *), ++ extended_cif *ecif, ++ unsigned nbytes, ++ void (*fn) (void)); ++ ++ On input, the arguments appear as ++ r4 = arghook ++ r5 = ecif ++ r6 = nbytes ++ r7 = fn ++*/ ++ ++ .section .text ++ .align 2 ++ .global ffi_call_sysv ++ .type ffi_call_sysv, @function ++ ++ffi_call_sysv: ++ .cfi_startproc ++ ++ /* Create the stack frame, saving r16 so we can use it locally. */ ++ addi sp, sp, -12 ++ .cfi_def_cfa_offset 12 ++ stw ra, 8(sp) ++ stw fp, 4(sp) ++ stw r16, 0(sp) ++ .cfi_offset 31, -4 ++ .cfi_offset 28, -8 ++ .cfi_offset 16, -12 ++ mov fp, sp ++ .cfi_def_cfa_register 28 ++ mov r16, r7 ++ ++ /* Adjust the stack pointer to create the argument buffer ++ nbytes long. */ ++ sub sp, sp, r6 ++ ++ /* Call the arghook function. */ ++ mov r2, r4 /* fn */ ++ mov r4, sp /* argbuffer */ ++ callr r2 /* r5 already contains ecif */ ++ ++ /* Pop off the first 16 bytes of the argument buffer on the stack, ++ transferring the contents to the argument registers. */ ++ ldw r4, 0(sp) ++ ldw r5, 4(sp) ++ ldw r6, 8(sp) ++ ldw r7, 12(sp) ++ addi sp, sp, 16 ++ ++ /* Call the user function, which leaves its result in r2 and r3. */ ++ callr r16 ++ ++ /* Pop off the stack frame. */ ++ mov sp, fp ++ ldw ra, 8(sp) ++ ldw fp, 4(sp) ++ ldw r16, 0(sp) ++ addi sp, sp, 12 ++ ret ++ .cfi_endproc ++ .size ffi_call_sysv, .-ffi_call_sysv ++ ++ ++/* Closure trampolines jump here after putting the C helper address ++ in r9 and the closure pointer in r10. The user-supplied arguments ++ to the closure are in the normal places, in r4-r7 and on the ++ stack. Push the register arguments on the stack too and then call the ++ C helper function to deal with them. */ ++ ++ .section .text ++ .align 2 ++ .global ffi_closure_sysv ++ .type ffi_closure_sysv, @function ++ ++ffi_closure_sysv: ++ .cfi_startproc ++ ++ /* Create the stack frame, pushing the register args on the stack ++ just below the stack args. This is the same trick illustrated ++ in Figure 7-3 in the Nios II Processor Reference Handbook, used ++ for variable arguments and structures passed by value. */ ++ addi sp, sp, -20 ++ .cfi_def_cfa_offset 20 ++ stw ra, 0(sp) ++ .cfi_offset 31, -20 ++ stw r4, 4(sp) ++ .cfi_offset 4, -16 ++ stw r5, 8(sp) ++ .cfi_offset 5, -12 ++ stw r6, 12(sp) ++ .cfi_offset 6, -8 ++ stw r7, 16(sp) ++ .cfi_offset 7, -4 ++ ++ /* Call the helper. ++ r4 = pointer to arguments on stack ++ r5 = closure pointer (loaded in r10 by the trampoline) ++ r9 = address of helper function (loaded by trampoline) */ ++ addi r4, sp, 4 ++ mov r5, r10 ++ callr r9 ++ ++ /* Pop the stack and return. */ ++ ldw ra, 0(sp) ++ addi sp, sp, 20 ++ .cfi_def_cfa_offset -20 ++ ret ++ .cfi_endproc ++ .size ffi_closure_sysv, .-ffi_closure_sysv ++ +diff -r c0e311e010fc Modules/_ctypes/libffi/src/powerpc/darwin.S +--- a/Modules/_ctypes/libffi/src/powerpc/darwin.S ++++ b/Modules/_ctypes/libffi/src/powerpc/darwin.S +@@ -318,11 +318,6 @@ + + #define EH_DATA_ALIGN_FACT MODE_CHOICE(0x7c,0x78) + +- .static_data +- .align LOG2_GPR_BYTES +-LLFB0$non_lazy_ptr: +- .g_long Lstartcode +- + .section __TEXT,__eh_frame,coalesced,no_toc+strip_static_syms+live_support + EH_frame1: + .set L$set$0,LECIE1-LSCIE1 +@@ -335,7 +330,7 @@ + .byte EH_DATA_ALIGN_FACT ; sleb128 -4; CIE Data Alignment Factor + .byte 0x41 ; CIE RA Column + .byte 0x1 ; uleb128 0x1; Augmentation size +- .byte 0x10 ; FDE Encoding (indirect pcrel) ++ .byte 0x10 ; FDE Encoding (pcrel) + .byte 0xc ; DW_CFA_def_cfa + .byte 0x1 ; uleb128 0x1 + .byte 0x0 ; uleb128 0x0 +@@ -349,7 +344,7 @@ + .long L$set$1 ; FDE Length + LASFDE1: + .long LASFDE1-EH_frame1 ; FDE CIE offset +- .g_long LLFB0$non_lazy_ptr-. ; FDE initial location ++ .g_long Lstartcode-. ; FDE initial location + .set L$set$3,LFE1-Lstartcode + .g_long L$set$3 ; FDE address range + .byte 0x0 ; uleb128 0x0; Augmentation size +diff -r c0e311e010fc Modules/_ctypes/libffi/src/powerpc/darwin_closure.S +--- a/Modules/_ctypes/libffi/src/powerpc/darwin_closure.S ++++ b/Modules/_ctypes/libffi/src/powerpc/darwin_closure.S +@@ -192,7 +192,7 @@ + lg r0,0(r3) ; size => r0 + lhz r3,FFI_TYPE_TYPE(r3) ; type => r3 + +- /* The helper will have intercepted struture returns and inserted ++ /* The helper will have intercepted structure returns and inserted + the caller`s destination address for structs returned by ref. */ + + /* r3 contains the return type so use it to look up in a table +@@ -467,11 +467,6 @@ + #define EH_FRAME_OFFSETA MODE_CHOICE(176,0x90) + #define EH_FRAME_OFFSETB MODE_CHOICE(1,3) + +- .static_data +- .align LOG2_GPR_BYTES +-LLFB1$non_lazy_ptr: +- .g_long Lstartcode +- + .section __TEXT,__eh_frame,coalesced,no_toc+strip_static_syms+live_support + EH_frame1: + .set L$set$0,LECIE1-LSCIE1 +@@ -484,7 +479,7 @@ + .byte EH_DATA_ALIGN_FACT ; sleb128 -4; CIE Data Alignment Factor + .byte 0x41 ; CIE RA Column + .byte 0x1 ; uleb128 0x1; Augmentation size +- .byte 0x10 ; FDE Encoding (indirect pcrel) ++ .byte 0x10 ; FDE Encoding (pcrel) + .byte 0xc ; DW_CFA_def_cfa + .byte 0x1 ; uleb128 0x1 + .byte 0x0 ; uleb128 0x0 +@@ -498,7 +493,7 @@ + + LASFDE1: + .long LASFDE1-EH_frame1 ; FDE CIE offset +- .g_long LLFB1$non_lazy_ptr-. ; FDE initial location ++ .g_long Lstartcode-. ; FDE initial location + .set L$set$3,LFE1-Lstartcode + .g_long L$set$3 ; FDE address range + .byte 0x0 ; uleb128 0x0; Augmentation size +@@ -523,12 +518,12 @@ + L_ffi_closure_helper_DARWIN$stub: + .indirect_symbol _ffi_closure_helper_DARWIN + mflr r0 +- bcl 20,31,"L00000000001$spb" +-"L00000000001$spb": ++ bcl 20,31,"L1$spb" ++"L1$spb": + mflr r11 +- addis r11,r11,ha16(L_ffi_closure_helper_DARWIN$lazy_ptr-"L00000000001$spb") ++ addis r11,r11,ha16(L_ffi_closure_helper_DARWIN$lazy_ptr-"L1$spb") + mtlr r0 +- lwzu r12,lo16(L_ffi_closure_helper_DARWIN$lazy_ptr-"L00000000001$spb")(r11) ++ lwzu r12,lo16(L_ffi_closure_helper_DARWIN$lazy_ptr-"L1$spb")(r11) + mtctr r12 + bctr + .lazy_symbol_pointer +@@ -542,12 +537,12 @@ + L_darwin64_struct_ret_by_value_p$stub: + .indirect_symbol _darwin64_struct_ret_by_value_p + mflr r0 +- bcl 20,31,"L00000000002$spb" +-"L00000000002$spb": ++ bcl 20,31,"L2$spb" ++"L2$spb": + mflr r11 +- addis r11,r11,ha16(L_darwin64_struct_ret_by_value_p$lazy_ptr-"L00000000002$spb") ++ addis r11,r11,ha16(L_darwin64_struct_ret_by_value_p$lazy_ptr-"L2$spb") + mtlr r0 +- lwzu r12,lo16(L_darwin64_struct_ret_by_value_p$lazy_ptr-"L00000000002$spb")(r11) ++ lwzu r12,lo16(L_darwin64_struct_ret_by_value_p$lazy_ptr-"L2$spb")(r11) + mtctr r12 + bctr + .lazy_symbol_pointer +@@ -560,12 +555,12 @@ + L_darwin64_pass_struct_floats$stub: + .indirect_symbol _darwin64_pass_struct_floats + mflr r0 +- bcl 20,31,"L00000000003$spb" +-"L00000000003$spb": ++ bcl 20,31,"L3$spb" ++"L3$spb": + mflr r11 +- addis r11,r11,ha16(L_darwin64_pass_struct_floats$lazy_ptr-"L00000000003$spb") ++ addis r11,r11,ha16(L_darwin64_pass_struct_floats$lazy_ptr-"L3$spb") + mtlr r0 +- lwzu r12,lo16(L_darwin64_pass_struct_floats$lazy_ptr-"L00000000003$spb")(r11) ++ lwzu r12,lo16(L_darwin64_pass_struct_floats$lazy_ptr-"L3$spb")(r11) + mtctr r12 + bctr + .lazy_symbol_pointer +diff -r c0e311e010fc Modules/_ctypes/libffi/src/powerpc/ffi.c +--- a/Modules/_ctypes/libffi/src/powerpc/ffi.c ++++ b/Modules/_ctypes/libffi/src/powerpc/ffi.c +@@ -1,5 +1,6 @@ + /* ----------------------------------------------------------------------- +- ffi.c - Copyright (C) 2011 Anthony Green ++ ffi.c - Copyright (C) 2013 IBM ++ Copyright (C) 2011 Anthony Green + Copyright (C) 2011 Kyle Moffett + Copyright (C) 2008 Red Hat, Inc + Copyright (C) 2007, 2008 Free Software Foundation, Inc +@@ -27,993 +28,104 @@ + OTHER DEALINGS IN THE SOFTWARE. + ----------------------------------------------------------------------- */ + +-#include +-#include ++#include "ffi.h" ++#include "ffi_common.h" ++#include "ffi_powerpc.h" + +-#include +-#include +- +- +-extern void ffi_closure_SYSV (void); +-extern void FFI_HIDDEN ffi_closure_LINUX64 (void); +- +-enum { +- /* The assembly depends on these exact flags. */ +- FLAG_RETURNS_SMST = 1 << (31-31), /* Used for FFI_SYSV small structs. */ +- FLAG_RETURNS_NOTHING = 1 << (31-30), /* These go in cr7 */ +-#ifndef __NO_FPRS__ +- FLAG_RETURNS_FP = 1 << (31-29), +-#endif +- FLAG_RETURNS_64BITS = 1 << (31-28), +- +- FLAG_RETURNS_128BITS = 1 << (31-27), /* cr6 */ +- +- FLAG_SYSV_SMST_R4 = 1 << (31-26), /* use r4 for FFI_SYSV 8 byte +- structs. */ +- FLAG_SYSV_SMST_R3 = 1 << (31-25), /* use r3 for FFI_SYSV 4 byte +- structs. */ +- +- FLAG_ARG_NEEDS_COPY = 1 << (31- 7), +-#ifndef __NO_FPRS__ +- FLAG_FP_ARGUMENTS = 1 << (31- 6), /* cr1.eq; specified by ABI */ +-#endif +- FLAG_4_GPR_ARGUMENTS = 1 << (31- 5), +- FLAG_RETVAL_REFERENCE = 1 << (31- 4) +-}; +- +-/* About the SYSV ABI. */ +-#define ASM_NEEDS_REGISTERS 4 +-#define NUM_GPR_ARG_REGISTERS 8 +-#ifndef __NO_FPRS__ +-# define NUM_FPR_ARG_REGISTERS 8 ++#if HAVE_LONG_DOUBLE_VARIANT ++/* Adjust ffi_type_longdouble. */ ++void FFI_HIDDEN ++ffi_prep_types (ffi_abi abi) ++{ ++# if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE ++# ifdef POWERPC64 ++ ffi_prep_types_linux64 (abi); ++# else ++ ffi_prep_types_sysv (abi); ++# endif ++# endif ++} + #endif + +-/* ffi_prep_args_SYSV is called by the assembly routine once stack space +- has been allocated for the function's arguments. +- +- The stack layout we want looks like this: +- +- | Return address from ffi_call_SYSV 4bytes | higher addresses +- |--------------------------------------------| +- | Previous backchain pointer 4 | stack pointer here +- |--------------------------------------------|<+ <<< on entry to +- | Saved r28-r31 4*4 | | ffi_call_SYSV +- |--------------------------------------------| | +- | GPR registers r3-r10 8*4 | | ffi_call_SYSV +- |--------------------------------------------| | +- | FPR registers f1-f8 (optional) 8*8 | | +- |--------------------------------------------| | stack | +- | Space for copied structures | | grows | +- |--------------------------------------------| | down V +- | Parameters that didn't fit in registers | | +- |--------------------------------------------| | lower addresses +- | Space for callee's LR 4 | | +- |--------------------------------------------| | stack pointer here +- | Current backchain pointer 4 |-/ during +- |--------------------------------------------| <<< ffi_call_SYSV +- +-*/ +- +-void +-ffi_prep_args_SYSV (extended_cif *ecif, unsigned *const stack) ++/* Perform machine dependent cif processing */ ++ffi_status FFI_HIDDEN ++ffi_prep_cif_machdep (ffi_cif *cif) + { +- const unsigned bytes = ecif->cif->bytes; +- const unsigned flags = ecif->cif->flags; +- +- typedef union { +- char *c; +- unsigned *u; +- long long *ll; +- float *f; +- double *d; +- } valp; +- +- /* 'stacktop' points at the previous backchain pointer. */ +- valp stacktop; +- +- /* 'gpr_base' points at the space for gpr3, and grows upwards as +- we use GPR registers. */ +- valp gpr_base; +- int intarg_count; +- +-#ifndef __NO_FPRS__ +- /* 'fpr_base' points at the space for fpr1, and grows upwards as +- we use FPR registers. */ +- valp fpr_base; +- int fparg_count; ++#ifdef POWERPC64 ++ return ffi_prep_cif_linux64 (cif); ++#else ++ return ffi_prep_cif_sysv (cif); + #endif +- +- /* 'copy_space' grows down as we put structures in it. It should +- stay 16-byte aligned. */ +- valp copy_space; +- +- /* 'next_arg' grows up as we put parameters in it. */ +- valp next_arg; +- +- int i; +- ffi_type **ptr; +- union { +- void **v; +- char **c; +- signed char **sc; +- unsigned char **uc; +- signed short **ss; +- unsigned short **us; +- unsigned int **ui; +- long long **ll; +- float **f; +- double **d; +- } p_argv; +- size_t struct_copy_size; +- unsigned gprvalue; +-#ifndef __NO_FPRS__ +- double double_tmp; +-#endif +- +- stacktop.c = (char *) stack + bytes; +- gpr_base.u = stacktop.u - ASM_NEEDS_REGISTERS - NUM_GPR_ARG_REGISTERS; +- intarg_count = 0; +-#ifndef __NO_FPRS__ +- fpr_base.d = gpr_base.d - NUM_FPR_ARG_REGISTERS; +- fparg_count = 0; +- copy_space.c = ((flags & FLAG_FP_ARGUMENTS) ? fpr_base.c : gpr_base.c); +-#else +- copy_space.c = gpr_base.c; +-#endif +- next_arg.u = stack + 2; +- +- /* Check that everything starts aligned properly. */ +- FFI_ASSERT (((unsigned long) (char *) stack & 0xF) == 0); +- FFI_ASSERT (((unsigned long) copy_space.c & 0xF) == 0); +- FFI_ASSERT (((unsigned long) stacktop.c & 0xF) == 0); +- FFI_ASSERT ((bytes & 0xF) == 0); +- FFI_ASSERT (copy_space.c >= next_arg.c); +- +- /* Deal with return values that are actually pass-by-reference. */ +- if (flags & FLAG_RETVAL_REFERENCE) +- { +- *gpr_base.u++ = (unsigned long) (char *) ecif->rvalue; +- intarg_count++; +- } +- +- /* Now for the arguments. */ +- p_argv.v = ecif->avalue; +- for (ptr = ecif->cif->arg_types, i = ecif->cif->nargs; +- i > 0; +- i--, ptr++, p_argv.v++) +- { +- unsigned short typenum = (*ptr)->type; +- +- /* We may need to handle some values depending on ABI */ +- if (ecif->cif->abi == FFI_LINUX_SOFT_FLOAT) { +- if (typenum == FFI_TYPE_FLOAT) +- typenum = FFI_TYPE_UINT32; +- if (typenum == FFI_TYPE_DOUBLE) +- typenum = FFI_TYPE_UINT64; +- if (typenum == FFI_TYPE_LONGDOUBLE) +- typenum = FFI_TYPE_UINT128; +- } else if (ecif->cif->abi != FFI_LINUX) { +-#if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE +- if (typenum == FFI_TYPE_LONGDOUBLE) +- typenum = FFI_TYPE_STRUCT; +-#endif +- } +- +- /* Now test the translated value */ +- switch (typenum) { +-#ifndef __NO_FPRS__ +- case FFI_TYPE_FLOAT: +- /* With FFI_LINUX_SOFT_FLOAT floats are handled like UINT32. */ +- double_tmp = **p_argv.f; +- if (fparg_count >= NUM_FPR_ARG_REGISTERS) +- { +- *next_arg.f = (float) double_tmp; +- next_arg.u += 1; +- intarg_count++; +- } +- else +- *fpr_base.d++ = double_tmp; +- fparg_count++; +- FFI_ASSERT (flags & FLAG_FP_ARGUMENTS); +- break; +- +- case FFI_TYPE_DOUBLE: +- /* With FFI_LINUX_SOFT_FLOAT doubles are handled like UINT64. */ +- double_tmp = **p_argv.d; +- +- if (fparg_count >= NUM_FPR_ARG_REGISTERS) +- { +- if (intarg_count >= NUM_GPR_ARG_REGISTERS +- && intarg_count % 2 != 0) +- { +- intarg_count++; +- next_arg.u++; +- } +- *next_arg.d = double_tmp; +- next_arg.u += 2; +- } +- else +- *fpr_base.d++ = double_tmp; +- fparg_count++; +- FFI_ASSERT (flags & FLAG_FP_ARGUMENTS); +- break; +- +-#if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE +- case FFI_TYPE_LONGDOUBLE: +- double_tmp = (*p_argv.d)[0]; +- +- if (fparg_count >= NUM_FPR_ARG_REGISTERS - 1) +- { +- if (intarg_count >= NUM_GPR_ARG_REGISTERS +- && intarg_count % 2 != 0) +- { +- intarg_count++; +- next_arg.u++; +- } +- *next_arg.d = double_tmp; +- next_arg.u += 2; +- double_tmp = (*p_argv.d)[1]; +- *next_arg.d = double_tmp; +- next_arg.u += 2; +- } +- else +- { +- *fpr_base.d++ = double_tmp; +- double_tmp = (*p_argv.d)[1]; +- *fpr_base.d++ = double_tmp; +- } +- +- fparg_count += 2; +- FFI_ASSERT (flags & FLAG_FP_ARGUMENTS); +- break; +-#endif +-#endif /* have FPRs */ +- +- /* +- * The soft float ABI for long doubles works like this, a long double +- * is passed in four consecutive GPRs if available. A maximum of 2 +- * long doubles can be passed in gprs. If we do not have 4 GPRs +- * left, the long double is passed on the stack, 4-byte aligned. +- */ +- case FFI_TYPE_UINT128: { +- unsigned int int_tmp = (*p_argv.ui)[0]; +- unsigned int ii; +- if (intarg_count >= NUM_GPR_ARG_REGISTERS - 3) { +- if (intarg_count < NUM_GPR_ARG_REGISTERS) +- intarg_count += NUM_GPR_ARG_REGISTERS - intarg_count; +- *(next_arg.u++) = int_tmp; +- for (ii = 1; ii < 4; ii++) { +- int_tmp = (*p_argv.ui)[ii]; +- *(next_arg.u++) = int_tmp; +- } +- } else { +- *(gpr_base.u++) = int_tmp; +- for (ii = 1; ii < 4; ii++) { +- int_tmp = (*p_argv.ui)[ii]; +- *(gpr_base.u++) = int_tmp; +- } +- } +- intarg_count += 4; +- break; +- } +- +- case FFI_TYPE_UINT64: +- case FFI_TYPE_SINT64: +- if (intarg_count == NUM_GPR_ARG_REGISTERS-1) +- intarg_count++; +- if (intarg_count >= NUM_GPR_ARG_REGISTERS) +- { +- if (intarg_count % 2 != 0) +- { +- intarg_count++; +- next_arg.u++; +- } +- *next_arg.ll = **p_argv.ll; +- next_arg.u += 2; +- } +- else +- { +- /* whoops: abi states only certain register pairs +- * can be used for passing long long int +- * specifically (r3,r4), (r5,r6), (r7,r8), +- * (r9,r10) and if next arg is long long but +- * not correct starting register of pair then skip +- * until the proper starting register +- */ +- if (intarg_count % 2 != 0) +- { +- intarg_count ++; +- gpr_base.u++; +- } +- *gpr_base.ll++ = **p_argv.ll; +- } +- intarg_count += 2; +- break; +- +- case FFI_TYPE_STRUCT: +- struct_copy_size = ((*ptr)->size + 15) & ~0xF; +- copy_space.c -= struct_copy_size; +- memcpy (copy_space.c, *p_argv.c, (*ptr)->size); +- +- gprvalue = (unsigned long) copy_space.c; +- +- FFI_ASSERT (copy_space.c > next_arg.c); +- FFI_ASSERT (flags & FLAG_ARG_NEEDS_COPY); +- goto putgpr; +- +- case FFI_TYPE_UINT8: +- gprvalue = **p_argv.uc; +- goto putgpr; +- case FFI_TYPE_SINT8: +- gprvalue = **p_argv.sc; +- goto putgpr; +- case FFI_TYPE_UINT16: +- gprvalue = **p_argv.us; +- goto putgpr; +- case FFI_TYPE_SINT16: +- gprvalue = **p_argv.ss; +- goto putgpr; +- +- case FFI_TYPE_INT: +- case FFI_TYPE_UINT32: +- case FFI_TYPE_SINT32: +- case FFI_TYPE_POINTER: +- +- gprvalue = **p_argv.ui; +- +- putgpr: +- if (intarg_count >= NUM_GPR_ARG_REGISTERS) +- *next_arg.u++ = gprvalue; +- else +- *gpr_base.u++ = gprvalue; +- intarg_count++; +- break; +- } +- } +- +- /* Check that we didn't overrun the stack... */ +- FFI_ASSERT (copy_space.c >= next_arg.c); +- FFI_ASSERT (gpr_base.u <= stacktop.u - ASM_NEEDS_REGISTERS); +- /* The assert below is testing that the number of integer arguments agrees +- with the number found in ffi_prep_cif_machdep(). However, intarg_count +- is incremeneted whenever we place an FP arg on the stack, so account for +- that before our assert test. */ +-#ifndef __NO_FPRS__ +- if (fparg_count > NUM_FPR_ARG_REGISTERS) +- intarg_count -= fparg_count - NUM_FPR_ARG_REGISTERS; +- FFI_ASSERT (fpr_base.u +- <= stacktop.u - ASM_NEEDS_REGISTERS - NUM_GPR_ARG_REGISTERS); +-#endif +- FFI_ASSERT (flags & FLAG_4_GPR_ARGUMENTS || intarg_count <= 4); + } + +-/* About the LINUX64 ABI. */ +-enum { +- NUM_GPR_ARG_REGISTERS64 = 8, +- NUM_FPR_ARG_REGISTERS64 = 13 +-}; +-enum { ASM_NEEDS_REGISTERS64 = 4 }; +- +-/* ffi_prep_args64 is called by the assembly routine once stack space +- has been allocated for the function's arguments. +- +- The stack layout we want looks like this: +- +- | Ret addr from ffi_call_LINUX64 8bytes | higher addresses +- |--------------------------------------------| +- | CR save area 8bytes | +- |--------------------------------------------| +- | Previous backchain pointer 8 | stack pointer here +- |--------------------------------------------|<+ <<< on entry to +- | Saved r28-r31 4*8 | | ffi_call_LINUX64 +- |--------------------------------------------| | +- | GPR registers r3-r10 8*8 | | +- |--------------------------------------------| | +- | FPR registers f1-f13 (optional) 13*8 | | +- |--------------------------------------------| | +- | Parameter save area | | +- |--------------------------------------------| | +- | TOC save area 8 | | +- |--------------------------------------------| | stack | +- | Linker doubleword 8 | | grows | +- |--------------------------------------------| | down V +- | Compiler doubleword 8 | | +- |--------------------------------------------| | lower addresses +- | Space for callee's LR 8 | | +- |--------------------------------------------| | +- | CR save area 8 | | +- |--------------------------------------------| | stack pointer here +- | Current backchain pointer 8 |-/ during +- |--------------------------------------------| <<< ffi_call_LINUX64 +- +-*/ +- +-void FFI_HIDDEN +-ffi_prep_args64 (extended_cif *ecif, unsigned long *const stack) ++ffi_status FFI_HIDDEN ++ffi_prep_cif_machdep_var (ffi_cif *cif, ++ unsigned int nfixedargs MAYBE_UNUSED, ++ unsigned int ntotalargs MAYBE_UNUSED) + { +- const unsigned long bytes = ecif->cif->bytes; +- const unsigned long flags = ecif->cif->flags; +- +- typedef union { +- char *c; +- unsigned long *ul; +- float *f; +- double *d; +- } valp; +- +- /* 'stacktop' points at the previous backchain pointer. */ +- valp stacktop; +- +- /* 'next_arg' points at the space for gpr3, and grows upwards as +- we use GPR registers, then continues at rest. */ +- valp gpr_base; +- valp gpr_end; +- valp rest; +- valp next_arg; +- +- /* 'fpr_base' points at the space for fpr3, and grows upwards as +- we use FPR registers. */ +- valp fpr_base; +- int fparg_count; +- +- int i, words; +- ffi_type **ptr; +- double double_tmp; +- union { +- void **v; +- char **c; +- signed char **sc; +- unsigned char **uc; +- signed short **ss; +- unsigned short **us; +- signed int **si; +- unsigned int **ui; +- unsigned long **ul; +- float **f; +- double **d; +- } p_argv; +- unsigned long gprvalue; +- +- stacktop.c = (char *) stack + bytes; +- gpr_base.ul = stacktop.ul - ASM_NEEDS_REGISTERS64 - NUM_GPR_ARG_REGISTERS64; +- gpr_end.ul = gpr_base.ul + NUM_GPR_ARG_REGISTERS64; +- rest.ul = stack + 6 + NUM_GPR_ARG_REGISTERS64; +- fpr_base.d = gpr_base.d - NUM_FPR_ARG_REGISTERS64; +- fparg_count = 0; +- next_arg.ul = gpr_base.ul; +- +- /* Check that everything starts aligned properly. */ +- FFI_ASSERT (((unsigned long) (char *) stack & 0xF) == 0); +- FFI_ASSERT (((unsigned long) stacktop.c & 0xF) == 0); +- FFI_ASSERT ((bytes & 0xF) == 0); +- +- /* Deal with return values that are actually pass-by-reference. */ +- if (flags & FLAG_RETVAL_REFERENCE) +- *next_arg.ul++ = (unsigned long) (char *) ecif->rvalue; +- +- /* Now for the arguments. */ +- p_argv.v = ecif->avalue; +- for (ptr = ecif->cif->arg_types, i = ecif->cif->nargs; +- i > 0; +- i--, ptr++, p_argv.v++) +- { +- switch ((*ptr)->type) +- { +- case FFI_TYPE_FLOAT: +- double_tmp = **p_argv.f; +- *next_arg.f = (float) double_tmp; +- if (++next_arg.ul == gpr_end.ul) +- next_arg.ul = rest.ul; +- if (fparg_count < NUM_FPR_ARG_REGISTERS64) +- *fpr_base.d++ = double_tmp; +- fparg_count++; +- FFI_ASSERT (flags & FLAG_FP_ARGUMENTS); +- break; +- +- case FFI_TYPE_DOUBLE: +- double_tmp = **p_argv.d; +- *next_arg.d = double_tmp; +- if (++next_arg.ul == gpr_end.ul) +- next_arg.ul = rest.ul; +- if (fparg_count < NUM_FPR_ARG_REGISTERS64) +- *fpr_base.d++ = double_tmp; +- fparg_count++; +- FFI_ASSERT (flags & FLAG_FP_ARGUMENTS); +- break; +- +-#if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE +- case FFI_TYPE_LONGDOUBLE: +- double_tmp = (*p_argv.d)[0]; +- *next_arg.d = double_tmp; +- if (++next_arg.ul == gpr_end.ul) +- next_arg.ul = rest.ul; +- if (fparg_count < NUM_FPR_ARG_REGISTERS64) +- *fpr_base.d++ = double_tmp; +- fparg_count++; +- double_tmp = (*p_argv.d)[1]; +- *next_arg.d = double_tmp; +- if (++next_arg.ul == gpr_end.ul) +- next_arg.ul = rest.ul; +- if (fparg_count < NUM_FPR_ARG_REGISTERS64) +- *fpr_base.d++ = double_tmp; +- fparg_count++; +- FFI_ASSERT (__LDBL_MANT_DIG__ == 106); +- FFI_ASSERT (flags & FLAG_FP_ARGUMENTS); +- break; ++#ifdef POWERPC64 ++ return ffi_prep_cif_linux64_var (cif, nfixedargs, ntotalargs); ++#else ++ return ffi_prep_cif_sysv (cif); + #endif +- +- case FFI_TYPE_STRUCT: +- words = ((*ptr)->size + 7) / 8; +- if (next_arg.ul >= gpr_base.ul && next_arg.ul + words > gpr_end.ul) +- { +- size_t first = gpr_end.c - next_arg.c; +- memcpy (next_arg.c, *p_argv.c, first); +- memcpy (rest.c, *p_argv.c + first, (*ptr)->size - first); +- next_arg.c = rest.c + words * 8 - first; +- } +- else +- { +- char *where = next_arg.c; +- +- /* Structures with size less than eight bytes are passed +- left-padded. */ +- if ((*ptr)->size < 8) +- where += 8 - (*ptr)->size; +- +- memcpy (where, *p_argv.c, (*ptr)->size); +- next_arg.ul += words; +- if (next_arg.ul == gpr_end.ul) +- next_arg.ul = rest.ul; +- } +- break; +- +- case FFI_TYPE_UINT8: +- gprvalue = **p_argv.uc; +- goto putgpr; +- case FFI_TYPE_SINT8: +- gprvalue = **p_argv.sc; +- goto putgpr; +- case FFI_TYPE_UINT16: +- gprvalue = **p_argv.us; +- goto putgpr; +- case FFI_TYPE_SINT16: +- gprvalue = **p_argv.ss; +- goto putgpr; +- case FFI_TYPE_UINT32: +- gprvalue = **p_argv.ui; +- goto putgpr; +- case FFI_TYPE_INT: +- case FFI_TYPE_SINT32: +- gprvalue = **p_argv.si; +- goto putgpr; +- +- case FFI_TYPE_UINT64: +- case FFI_TYPE_SINT64: +- case FFI_TYPE_POINTER: +- gprvalue = **p_argv.ul; +- putgpr: +- *next_arg.ul++ = gprvalue; +- if (next_arg.ul == gpr_end.ul) +- next_arg.ul = rest.ul; +- break; +- } +- } +- +- FFI_ASSERT (flags & FLAG_4_GPR_ARGUMENTS +- || (next_arg.ul >= gpr_base.ul +- && next_arg.ul <= gpr_base.ul + 4)); + } + +- +- +-/* Perform machine dependent cif processing */ +-ffi_status +-ffi_prep_cif_machdep (ffi_cif *cif) +-{ +- /* All this is for the SYSV and LINUX64 ABI. */ +- int i; +- ffi_type **ptr; +- unsigned bytes; +- int fparg_count = 0, intarg_count = 0; +- unsigned flags = 0; +- unsigned struct_copy_size = 0; +- unsigned type = cif->rtype->type; +- unsigned size = cif->rtype->size; +- +- if (cif->abi != FFI_LINUX64) +- { +- /* All the machine-independent calculation of cif->bytes will be wrong. +- Redo the calculation for SYSV. */ +- +- /* Space for the frame pointer, callee's LR, and the asm's temp regs. */ +- bytes = (2 + ASM_NEEDS_REGISTERS) * sizeof (int); +- +- /* Space for the GPR registers. */ +- bytes += NUM_GPR_ARG_REGISTERS * sizeof (int); +- } +- else +- { +- /* 64-bit ABI. */ +- +- /* Space for backchain, CR, LR, cc/ld doubleword, TOC and the asm's temp +- regs. */ +- bytes = (6 + ASM_NEEDS_REGISTERS64) * sizeof (long); +- +- /* Space for the mandatory parm save area and general registers. */ +- bytes += 2 * NUM_GPR_ARG_REGISTERS64 * sizeof (long); +- } +- +- /* Return value handling. The rules for SYSV are as follows: +- - 32-bit (or less) integer values are returned in gpr3; +- - Structures of size <= 4 bytes also returned in gpr3; +- - 64-bit integer values and structures between 5 and 8 bytes are returned +- in gpr3 and gpr4; +- - Single/double FP values are returned in fpr1; +- - Larger structures are allocated space and a pointer is passed as +- the first argument. +- - long doubles (if not equivalent to double) are returned in +- fpr1,fpr2 for Linux and as for large structs for SysV. +- For LINUX64: +- - integer values in gpr3; +- - Structures/Unions by reference; +- - Single/double FP values in fpr1, long double in fpr1,fpr2. +- - soft-float float/doubles are treated as UINT32/UINT64 respectivley. +- - soft-float long doubles are returned in gpr3-gpr6. */ +- /* First translate for softfloat/nonlinux */ +- if (cif->abi == FFI_LINUX_SOFT_FLOAT) { +- if (type == FFI_TYPE_FLOAT) +- type = FFI_TYPE_UINT32; +- if (type == FFI_TYPE_DOUBLE) +- type = FFI_TYPE_UINT64; +- if (type == FFI_TYPE_LONGDOUBLE) +- type = FFI_TYPE_UINT128; +- } else if (cif->abi != FFI_LINUX && cif->abi != FFI_LINUX64) { +-#if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE +- if (type == FFI_TYPE_LONGDOUBLE) +- type = FFI_TYPE_STRUCT; +-#endif +- } +- +- switch (type) +- { +-#ifndef __NO_FPRS__ +-#if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE +- case FFI_TYPE_LONGDOUBLE: +- flags |= FLAG_RETURNS_128BITS; +- /* Fall through. */ +-#endif +- case FFI_TYPE_DOUBLE: +- flags |= FLAG_RETURNS_64BITS; +- /* Fall through. */ +- case FFI_TYPE_FLOAT: +- flags |= FLAG_RETURNS_FP; +- break; +-#endif +- +- case FFI_TYPE_UINT128: +- flags |= FLAG_RETURNS_128BITS; +- /* Fall through. */ +- case FFI_TYPE_UINT64: +- case FFI_TYPE_SINT64: +- flags |= FLAG_RETURNS_64BITS; +- break; +- +- case FFI_TYPE_STRUCT: +- if (cif->abi == FFI_SYSV) +- { +- /* The final SYSV ABI says that structures smaller or equal 8 bytes +- are returned in r3/r4. The FFI_GCC_SYSV ABI instead returns them +- in memory. */ +- +- /* Treat structs with size <= 8 bytes. */ +- if (size <= 8) +- { +- flags |= FLAG_RETURNS_SMST; +- /* These structs are returned in r3. We pack the type and the +- precalculated shift value (needed in the sysv.S) into flags. +- The same applies for the structs returned in r3/r4. */ +- if (size <= 4) +- { +- flags |= FLAG_SYSV_SMST_R3; +- flags |= 8 * (4 - size) << 8; +- break; +- } +- /* These structs are returned in r3 and r4. See above. */ +- if (size <= 8) +- { +- flags |= FLAG_SYSV_SMST_R3 | FLAG_SYSV_SMST_R4; +- flags |= 8 * (8 - size) << 8; +- break; +- } +- } +- } +- +- intarg_count++; +- flags |= FLAG_RETVAL_REFERENCE; +- /* Fall through. */ +- case FFI_TYPE_VOID: +- flags |= FLAG_RETURNS_NOTHING; +- break; +- +- default: +- /* Returns 32-bit integer, or similar. Nothing to do here. */ +- break; +- } +- +- if (cif->abi != FFI_LINUX64) +- /* The first NUM_GPR_ARG_REGISTERS words of integer arguments, and the +- first NUM_FPR_ARG_REGISTERS fp arguments, go in registers; the rest +- goes on the stack. Structures and long doubles (if not equivalent +- to double) are passed as a pointer to a copy of the structure. +- Stuff on the stack needs to keep proper alignment. */ +- for (ptr = cif->arg_types, i = cif->nargs; i > 0; i--, ptr++) +- { +- unsigned short typenum = (*ptr)->type; +- +- /* We may need to handle some values depending on ABI */ +- if (cif->abi == FFI_LINUX_SOFT_FLOAT) { +- if (typenum == FFI_TYPE_FLOAT) +- typenum = FFI_TYPE_UINT32; +- if (typenum == FFI_TYPE_DOUBLE) +- typenum = FFI_TYPE_UINT64; +- if (typenum == FFI_TYPE_LONGDOUBLE) +- typenum = FFI_TYPE_UINT128; +- } else if (cif->abi != FFI_LINUX && cif->abi != FFI_LINUX64) { +-#if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE +- if (typenum == FFI_TYPE_LONGDOUBLE) +- typenum = FFI_TYPE_STRUCT; +-#endif +- } +- +- switch (typenum) { +-#ifndef __NO_FPRS__ +- case FFI_TYPE_FLOAT: +- fparg_count++; +- /* floating singles are not 8-aligned on stack */ +- break; +- +-#if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE +- case FFI_TYPE_LONGDOUBLE: +- fparg_count++; +- /* Fall thru */ +-#endif +- case FFI_TYPE_DOUBLE: +- fparg_count++; +- /* If this FP arg is going on the stack, it must be +- 8-byte-aligned. */ +- if (fparg_count > NUM_FPR_ARG_REGISTERS +- && intarg_count >= NUM_GPR_ARG_REGISTERS +- && intarg_count % 2 != 0) +- intarg_count++; +- break; +-#endif +- case FFI_TYPE_UINT128: +- /* +- * A long double in FFI_LINUX_SOFT_FLOAT can use only a set +- * of four consecutive gprs. If we do not have enough, we +- * have to adjust the intarg_count value. +- */ +- if (intarg_count >= NUM_GPR_ARG_REGISTERS - 3 +- && intarg_count < NUM_GPR_ARG_REGISTERS) +- intarg_count = NUM_GPR_ARG_REGISTERS; +- intarg_count += 4; +- break; +- +- case FFI_TYPE_UINT64: +- case FFI_TYPE_SINT64: +- /* 'long long' arguments are passed as two words, but +- either both words must fit in registers or both go +- on the stack. If they go on the stack, they must +- be 8-byte-aligned. +- +- Also, only certain register pairs can be used for +- passing long long int -- specifically (r3,r4), (r5,r6), +- (r7,r8), (r9,r10). +- */ +- if (intarg_count == NUM_GPR_ARG_REGISTERS-1 +- || intarg_count % 2 != 0) +- intarg_count++; +- intarg_count += 2; +- break; +- +- case FFI_TYPE_STRUCT: +- /* We must allocate space for a copy of these to enforce +- pass-by-value. Pad the space up to a multiple of 16 +- bytes (the maximum alignment required for anything under +- the SYSV ABI). */ +- struct_copy_size += ((*ptr)->size + 15) & ~0xF; +- /* Fall through (allocate space for the pointer). */ +- +- case FFI_TYPE_POINTER: +- case FFI_TYPE_INT: +- case FFI_TYPE_UINT32: +- case FFI_TYPE_SINT32: +- case FFI_TYPE_UINT16: +- case FFI_TYPE_SINT16: +- case FFI_TYPE_UINT8: +- case FFI_TYPE_SINT8: +- /* Everything else is passed as a 4-byte word in a GPR, either +- the object itself or a pointer to it. */ +- intarg_count++; +- break; +- default: +- FFI_ASSERT (0); +- } +- } +- else +- for (ptr = cif->arg_types, i = cif->nargs; i > 0; i--, ptr++) +- { +- switch ((*ptr)->type) +- { +-#if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE +- case FFI_TYPE_LONGDOUBLE: +- if (cif->abi == FFI_LINUX_SOFT_FLOAT) +- intarg_count += 4; +- else +- { +- fparg_count += 2; +- intarg_count += 2; +- } +- break; +-#endif +- case FFI_TYPE_FLOAT: +- case FFI_TYPE_DOUBLE: +- fparg_count++; +- intarg_count++; +- break; +- +- case FFI_TYPE_STRUCT: +- intarg_count += ((*ptr)->size + 7) / 8; +- break; +- +- case FFI_TYPE_POINTER: +- case FFI_TYPE_UINT64: +- case FFI_TYPE_SINT64: +- case FFI_TYPE_INT: +- case FFI_TYPE_UINT32: +- case FFI_TYPE_SINT32: +- case FFI_TYPE_UINT16: +- case FFI_TYPE_SINT16: +- case FFI_TYPE_UINT8: +- case FFI_TYPE_SINT8: +- /* Everything else is passed as a 8-byte word in a GPR, either +- the object itself or a pointer to it. */ +- intarg_count++; +- break; +- default: +- FFI_ASSERT (0); +- } +- } +- +-#ifndef __NO_FPRS__ +- if (fparg_count != 0) +- flags |= FLAG_FP_ARGUMENTS; +-#endif +- if (intarg_count > 4) +- flags |= FLAG_4_GPR_ARGUMENTS; +- if (struct_copy_size != 0) +- flags |= FLAG_ARG_NEEDS_COPY; +- +- if (cif->abi != FFI_LINUX64) +- { +-#ifndef __NO_FPRS__ +- /* Space for the FPR registers, if needed. */ +- if (fparg_count != 0) +- bytes += NUM_FPR_ARG_REGISTERS * sizeof (double); +-#endif +- +- /* Stack space. */ +- if (intarg_count > NUM_GPR_ARG_REGISTERS) +- bytes += (intarg_count - NUM_GPR_ARG_REGISTERS) * sizeof (int); +-#ifndef __NO_FPRS__ +- if (fparg_count > NUM_FPR_ARG_REGISTERS) +- bytes += (fparg_count - NUM_FPR_ARG_REGISTERS) * sizeof (double); +-#endif +- } +- else +- { +-#ifndef __NO_FPRS__ +- /* Space for the FPR registers, if needed. */ +- if (fparg_count != 0) +- bytes += NUM_FPR_ARG_REGISTERS64 * sizeof (double); +-#endif +- +- /* Stack space. */ +- if (intarg_count > NUM_GPR_ARG_REGISTERS64) +- bytes += (intarg_count - NUM_GPR_ARG_REGISTERS64) * sizeof (long); +- } +- +- /* The stack space allocated needs to be a multiple of 16 bytes. */ +- bytes = (bytes + 15) & ~0xF; +- +- /* Add in the space for the copied structures. */ +- bytes += struct_copy_size; +- +- cif->flags = flags; +- cif->bytes = bytes; +- +- return FFI_OK; +-} +- +-extern void ffi_call_SYSV(extended_cif *, unsigned, unsigned, unsigned *, +- void (*fn)(void)); +-extern void FFI_HIDDEN ffi_call_LINUX64(extended_cif *, unsigned long, +- unsigned long, unsigned long *, +- void (*fn)(void)); +- + void + ffi_call(ffi_cif *cif, void (*fn)(void), void *rvalue, void **avalue) + { +- /* +- * The final SYSV ABI says that structures smaller or equal 8 bytes +- * are returned in r3/r4. The FFI_GCC_SYSV ABI instead returns them +- * in memory. +- * +- * Just to keep things simple for the assembly code, we will always +- * bounce-buffer struct return values less than or equal to 8 bytes. +- * This allows the ASM to handle SYSV small structures by directly +- * writing r3 and r4 to memory without worrying about struct size. +- */ +- unsigned int smst_buffer[2]; ++ /* The final SYSV ABI says that structures smaller or equal 8 bytes ++ are returned in r3/r4. A draft ABI used by linux instead returns ++ them in memory. ++ ++ We bounce-buffer SYSV small struct return values so that sysv.S ++ can write r3 and r4 to memory without worrying about struct size. ++ ++ For ELFv2 ABI, use a bounce buffer for homogeneous structs too, ++ for similar reasons. */ ++ unsigned long smst_buffer[8]; + extended_cif ecif; +- unsigned int rsize = 0; + + ecif.cif = cif; + ecif.avalue = avalue; + +- /* Ensure that we have a valid struct return value */ + ecif.rvalue = rvalue; +- if (cif->rtype->type == FFI_TYPE_STRUCT) { +- rsize = cif->rtype->size; +- if (rsize <= 8) +- ecif.rvalue = smst_buffer; +- else if (!rvalue) +- ecif.rvalue = alloca(rsize); +- } ++ if ((cif->flags & FLAG_RETURNS_SMST) != 0) ++ ecif.rvalue = smst_buffer; ++ /* Ensure that we have a valid struct return value. ++ FIXME: Isn't this just papering over a user problem? */ ++ else if (!rvalue && cif->rtype->type == FFI_TYPE_STRUCT) ++ ecif.rvalue = alloca (cif->rtype->size); + +- switch (cif->abi) +- { +-#ifndef POWERPC64 +-# ifndef __NO_FPRS__ +- case FFI_SYSV: +- case FFI_GCC_SYSV: +- case FFI_LINUX: +-# endif +- case FFI_LINUX_SOFT_FLOAT: +- ffi_call_SYSV (&ecif, -cif->bytes, cif->flags, ecif.rvalue, fn); +- break; ++#ifdef POWERPC64 ++ ffi_call_LINUX64 (&ecif, -(long) cif->bytes, cif->flags, ecif.rvalue, fn); + #else +- case FFI_LINUX64: +- ffi_call_LINUX64 (&ecif, -(long) cif->bytes, cif->flags, ecif.rvalue, fn); +- break; ++ ffi_call_SYSV (&ecif, -cif->bytes, cif->flags, ecif.rvalue, fn); + #endif +- default: +- FFI_ASSERT (0); +- break; +- } + + /* Check for a bounce-buffered return value */ + if (rvalue && ecif.rvalue == smst_buffer) +- memcpy(rvalue, smst_buffer, rsize); ++ { ++ unsigned int rsize = cif->rtype->size; ++#ifndef __LITTLE_ENDIAN__ ++ /* The SYSV ABI returns a structure of up to 4 bytes in size ++ left-padded in r3. */ ++# ifndef POWERPC64 ++ if (rsize <= 4) ++ memcpy (rvalue, (char *) smst_buffer + 4 - rsize, rsize); ++ else ++# endif ++ /* The SYSV ABI returns a structure of up to 8 bytes in size ++ left-padded in r3/r4, and the ELFv2 ABI similarly returns a ++ structure of up to 8 bytes in size left-padded in r3. */ ++ if (rsize <= 8) ++ memcpy (rvalue, (char *) smst_buffer + 8 - rsize, rsize); ++ else ++#endif ++ memcpy (rvalue, smst_buffer, rsize); ++ } + } + + +-#ifndef POWERPC64 +-#define MIN_CACHE_LINE_SIZE 8 +- +-static void +-flush_icache (char *wraddr, char *xaddr, int size) +-{ +- int i; +- for (i = 0; i < size; i += MIN_CACHE_LINE_SIZE) +- __asm__ volatile ("icbi 0,%0;" "dcbf 0,%1;" +- : : "r" (xaddr + i), "r" (wraddr + i) : "memory"); +- __asm__ volatile ("icbi 0,%0;" "dcbf 0,%1;" "sync;" "isync;" +- : : "r"(xaddr + size - 1), "r"(wraddr + size - 1) +- : "memory"); +-} +-#endif +- + ffi_status + ffi_prep_closure_loc (ffi_closure *closure, + ffi_cif *cif, +@@ -1022,480 +134,8 @@ + void *codeloc) + { + #ifdef POWERPC64 +- void **tramp = (void **) &closure->tramp[0]; +- +- if (cif->abi != FFI_LINUX64) +- return FFI_BAD_ABI; +- /* Copy function address and TOC from ffi_closure_LINUX64. */ +- memcpy (tramp, (char *) ffi_closure_LINUX64, 16); +- tramp[2] = codeloc; ++ return ffi_prep_closure_loc_linux64 (closure, cif, fun, user_data, codeloc); + #else +- unsigned int *tramp; +- +- if (! (cif->abi == FFI_GCC_SYSV +- || cif->abi == FFI_SYSV +- || cif->abi == FFI_LINUX +- || cif->abi == FFI_LINUX_SOFT_FLOAT)) +- return FFI_BAD_ABI; +- +- tramp = (unsigned int *) &closure->tramp[0]; +- tramp[0] = 0x7c0802a6; /* mflr r0 */ +- tramp[1] = 0x4800000d; /* bl 10 */ +- tramp[4] = 0x7d6802a6; /* mflr r11 */ +- tramp[5] = 0x7c0803a6; /* mtlr r0 */ +- tramp[6] = 0x800b0000; /* lwz r0,0(r11) */ +- tramp[7] = 0x816b0004; /* lwz r11,4(r11) */ +- tramp[8] = 0x7c0903a6; /* mtctr r0 */ +- tramp[9] = 0x4e800420; /* bctr */ +- *(void **) &tramp[2] = (void *) ffi_closure_SYSV; /* function */ +- *(void **) &tramp[3] = codeloc; /* context */ +- +- /* Flush the icache. */ +- flush_icache ((char *)tramp, (char *)codeloc, FFI_TRAMPOLINE_SIZE); ++ return ffi_prep_closure_loc_sysv (closure, cif, fun, user_data, codeloc); + #endif +- +- closure->cif = cif; +- closure->fun = fun; +- closure->user_data = user_data; +- +- return FFI_OK; + } +- +-typedef union +-{ +- float f; +- double d; +-} ffi_dblfl; +- +-int ffi_closure_helper_SYSV (ffi_closure *, void *, unsigned long *, +- ffi_dblfl *, unsigned long *); +- +-/* Basically the trampoline invokes ffi_closure_SYSV, and on +- * entry, r11 holds the address of the closure. +- * After storing the registers that could possibly contain +- * parameters to be passed into the stack frame and setting +- * up space for a return value, ffi_closure_SYSV invokes the +- * following helper function to do most of the work +- */ +- +-int +-ffi_closure_helper_SYSV (ffi_closure *closure, void *rvalue, +- unsigned long *pgr, ffi_dblfl *pfr, +- unsigned long *pst) +-{ +- /* rvalue is the pointer to space for return value in closure assembly */ +- /* pgr is the pointer to where r3-r10 are stored in ffi_closure_SYSV */ +- /* pfr is the pointer to where f1-f8 are stored in ffi_closure_SYSV */ +- /* pst is the pointer to outgoing parameter stack in original caller */ +- +- void ** avalue; +- ffi_type ** arg_types; +- long i, avn; +-#ifndef __NO_FPRS__ +- long nf = 0; /* number of floating registers already used */ +-#endif +- long ng = 0; /* number of general registers already used */ +- +- ffi_cif *cif = closure->cif; +- unsigned size = cif->rtype->size; +- unsigned short rtypenum = cif->rtype->type; +- +- avalue = alloca (cif->nargs * sizeof (void *)); +- +- /* First translate for softfloat/nonlinux */ +- if (cif->abi == FFI_LINUX_SOFT_FLOAT) { +- if (rtypenum == FFI_TYPE_FLOAT) +- rtypenum = FFI_TYPE_UINT32; +- if (rtypenum == FFI_TYPE_DOUBLE) +- rtypenum = FFI_TYPE_UINT64; +- if (rtypenum == FFI_TYPE_LONGDOUBLE) +- rtypenum = FFI_TYPE_UINT128; +- } else if (cif->abi != FFI_LINUX && cif->abi != FFI_LINUX64) { +-#if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE +- if (rtypenum == FFI_TYPE_LONGDOUBLE) +- rtypenum = FFI_TYPE_STRUCT; +-#endif +- } +- +- +- /* Copy the caller's structure return value address so that the closure +- returns the data directly to the caller. +- For FFI_SYSV the result is passed in r3/r4 if the struct size is less +- or equal 8 bytes. */ +- if (rtypenum == FFI_TYPE_STRUCT && ((cif->abi != FFI_SYSV) || (size > 8))) { +- rvalue = (void *) *pgr; +- ng++; +- pgr++; +- } +- +- i = 0; +- avn = cif->nargs; +- arg_types = cif->arg_types; +- +- /* Grab the addresses of the arguments from the stack frame. */ +- while (i < avn) { +- unsigned short typenum = arg_types[i]->type; +- +- /* We may need to handle some values depending on ABI */ +- if (cif->abi == FFI_LINUX_SOFT_FLOAT) { +- if (typenum == FFI_TYPE_FLOAT) +- typenum = FFI_TYPE_UINT32; +- if (typenum == FFI_TYPE_DOUBLE) +- typenum = FFI_TYPE_UINT64; +- if (typenum == FFI_TYPE_LONGDOUBLE) +- typenum = FFI_TYPE_UINT128; +- } else if (cif->abi != FFI_LINUX && cif->abi != FFI_LINUX64) { +-#if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE +- if (typenum == FFI_TYPE_LONGDOUBLE) +- typenum = FFI_TYPE_STRUCT; +-#endif +- } +- +- switch (typenum) { +-#ifndef __NO_FPRS__ +- case FFI_TYPE_FLOAT: +- /* unfortunately float values are stored as doubles +- * in the ffi_closure_SYSV code (since we don't check +- * the type in that routine). +- */ +- +- /* there are 8 64bit floating point registers */ +- +- if (nf < 8) +- { +- double temp = pfr->d; +- pfr->f = (float) temp; +- avalue[i] = pfr; +- nf++; +- pfr++; +- } +- else +- { +- /* FIXME? here we are really changing the values +- * stored in the original calling routines outgoing +- * parameter stack. This is probably a really +- * naughty thing to do but... +- */ +- avalue[i] = pst; +- pst += 1; +- } +- break; +- +- case FFI_TYPE_DOUBLE: +- /* On the outgoing stack all values are aligned to 8 */ +- /* there are 8 64bit floating point registers */ +- +- if (nf < 8) +- { +- avalue[i] = pfr; +- nf++; +- pfr++; +- } +- else +- { +- if (((long) pst) & 4) +- pst++; +- avalue[i] = pst; +- pst += 2; +- } +- break; +- +-#if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE +- case FFI_TYPE_LONGDOUBLE: +- if (nf < 7) +- { +- avalue[i] = pfr; +- pfr += 2; +- nf += 2; +- } +- else +- { +- if (((long) pst) & 4) +- pst++; +- avalue[i] = pst; +- pst += 4; +- nf = 8; +- } +- break; +-#endif +-#endif /* have FPRS */ +- +- case FFI_TYPE_UINT128: +- /* +- * Test if for the whole long double, 4 gprs are available. +- * otherwise the stuff ends up on the stack. +- */ +- if (ng < 5) { +- avalue[i] = pgr; +- pgr += 4; +- ng += 4; +- } else { +- avalue[i] = pst; +- pst += 4; +- ng = 8+4; +- } +- break; +- +- case FFI_TYPE_SINT8: +- case FFI_TYPE_UINT8: +- /* there are 8 gpr registers used to pass values */ +- if (ng < 8) +- { +- avalue[i] = (char *) pgr + 3; +- ng++; +- pgr++; +- } +- else +- { +- avalue[i] = (char *) pst + 3; +- pst++; +- } +- break; +- +- case FFI_TYPE_SINT16: +- case FFI_TYPE_UINT16: +- /* there are 8 gpr registers used to pass values */ +- if (ng < 8) +- { +- avalue[i] = (char *) pgr + 2; +- ng++; +- pgr++; +- } +- else +- { +- avalue[i] = (char *) pst + 2; +- pst++; +- } +- break; +- +- case FFI_TYPE_SINT32: +- case FFI_TYPE_UINT32: +- case FFI_TYPE_POINTER: +- /* there are 8 gpr registers used to pass values */ +- if (ng < 8) +- { +- avalue[i] = pgr; +- ng++; +- pgr++; +- } +- else +- { +- avalue[i] = pst; +- pst++; +- } +- break; +- +- case FFI_TYPE_STRUCT: +- /* Structs are passed by reference. The address will appear in a +- gpr if it is one of the first 8 arguments. */ +- if (ng < 8) +- { +- avalue[i] = (void *) *pgr; +- ng++; +- pgr++; +- } +- else +- { +- avalue[i] = (void *) *pst; +- pst++; +- } +- break; +- +- case FFI_TYPE_SINT64: +- case FFI_TYPE_UINT64: +- /* passing long long ints are complex, they must +- * be passed in suitable register pairs such as +- * (r3,r4) or (r5,r6) or (r6,r7), or (r7,r8) or (r9,r10) +- * and if the entire pair aren't available then the outgoing +- * parameter stack is used for both but an alignment of 8 +- * must will be kept. So we must either look in pgr +- * or pst to find the correct address for this type +- * of parameter. +- */ +- if (ng < 7) +- { +- if (ng & 0x01) +- { +- /* skip r4, r6, r8 as starting points */ +- ng++; +- pgr++; +- } +- avalue[i] = pgr; +- ng += 2; +- pgr += 2; +- } +- else +- { +- if (((long) pst) & 4) +- pst++; +- avalue[i] = pst; +- pst += 2; +- ng = 8; +- } +- break; +- +- default: +- FFI_ASSERT (0); +- } +- +- i++; +- } +- +- +- (closure->fun) (cif, rvalue, avalue, closure->user_data); +- +- /* Tell ffi_closure_SYSV how to perform return type promotions. +- Because the FFI_SYSV ABI returns the structures <= 8 bytes in r3/r4 +- we have to tell ffi_closure_SYSV how to treat them. We combine the base +- type FFI_SYSV_TYPE_SMALL_STRUCT - 1 with the size of the struct. +- So a one byte struct gets the return type 16. Return type 1 to 15 are +- already used and we never have a struct with size zero. That is the reason +- for the subtraction of 1. See the comment in ffitarget.h about ordering. +- */ +- if (cif->abi == FFI_SYSV && rtypenum == FFI_TYPE_STRUCT && size <= 8) +- return (FFI_SYSV_TYPE_SMALL_STRUCT - 1) + size; +- return rtypenum; +-} +- +-int FFI_HIDDEN ffi_closure_helper_LINUX64 (ffi_closure *, void *, +- unsigned long *, ffi_dblfl *); +- +-int FFI_HIDDEN +-ffi_closure_helper_LINUX64 (ffi_closure *closure, void *rvalue, +- unsigned long *pst, ffi_dblfl *pfr) +-{ +- /* rvalue is the pointer to space for return value in closure assembly */ +- /* pst is the pointer to parameter save area +- (r3-r10 are stored into its first 8 slots by ffi_closure_LINUX64) */ +- /* pfr is the pointer to where f1-f13 are stored in ffi_closure_LINUX64 */ +- +- void **avalue; +- ffi_type **arg_types; +- long i, avn; +- ffi_cif *cif; +- ffi_dblfl *end_pfr = pfr + NUM_FPR_ARG_REGISTERS64; +- +- cif = closure->cif; +- avalue = alloca (cif->nargs * sizeof (void *)); +- +- /* Copy the caller's structure return value address so that the closure +- returns the data directly to the caller. */ +- if (cif->rtype->type == FFI_TYPE_STRUCT) +- { +- rvalue = (void *) *pst; +- pst++; +- } +- +- i = 0; +- avn = cif->nargs; +- arg_types = cif->arg_types; +- +- /* Grab the addresses of the arguments from the stack frame. */ +- while (i < avn) +- { +- switch (arg_types[i]->type) +- { +- case FFI_TYPE_SINT8: +- case FFI_TYPE_UINT8: +- avalue[i] = (char *) pst + 7; +- pst++; +- break; +- +- case FFI_TYPE_SINT16: +- case FFI_TYPE_UINT16: +- avalue[i] = (char *) pst + 6; +- pst++; +- break; +- +- case FFI_TYPE_SINT32: +- case FFI_TYPE_UINT32: +- avalue[i] = (char *) pst + 4; +- pst++; +- break; +- +- case FFI_TYPE_SINT64: +- case FFI_TYPE_UINT64: +- case FFI_TYPE_POINTER: +- avalue[i] = pst; +- pst++; +- break; +- +- case FFI_TYPE_STRUCT: +- /* Structures with size less than eight bytes are passed +- left-padded. */ +- if (arg_types[i]->size < 8) +- avalue[i] = (char *) pst + 8 - arg_types[i]->size; +- else +- avalue[i] = pst; +- pst += (arg_types[i]->size + 7) / 8; +- break; +- +- case FFI_TYPE_FLOAT: +- /* unfortunately float values are stored as doubles +- * in the ffi_closure_LINUX64 code (since we don't check +- * the type in that routine). +- */ +- +- /* there are 13 64bit floating point registers */ +- +- if (pfr < end_pfr) +- { +- double temp = pfr->d; +- pfr->f = (float) temp; +- avalue[i] = pfr; +- pfr++; +- } +- else +- avalue[i] = pst; +- pst++; +- break; +- +- case FFI_TYPE_DOUBLE: +- /* On the outgoing stack all values are aligned to 8 */ +- /* there are 13 64bit floating point registers */ +- +- if (pfr < end_pfr) +- { +- avalue[i] = pfr; +- pfr++; +- } +- else +- avalue[i] = pst; +- pst++; +- break; +- +-#if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE +- case FFI_TYPE_LONGDOUBLE: +- if (pfr + 1 < end_pfr) +- { +- avalue[i] = pfr; +- pfr += 2; +- } +- else +- { +- if (pfr < end_pfr) +- { +- /* Passed partly in f13 and partly on the stack. +- Move it all to the stack. */ +- *pst = *(unsigned long *) pfr; +- pfr++; +- } +- avalue[i] = pst; +- } +- pst += 2; +- break; +-#endif +- +- default: +- FFI_ASSERT (0); +- } +- +- i++; +- } +- +- +- (closure->fun) (cif, rvalue, avalue, closure->user_data); +- +- /* Tell ffi_closure_LINUX64 how to perform return type promotions. */ +- return cif->rtype->type; +-} +diff -r c0e311e010fc Modules/_ctypes/libffi/src/powerpc/ffi_darwin.c +--- a/Modules/_ctypes/libffi/src/powerpc/ffi_darwin.c ++++ b/Modules/_ctypes/libffi/src/powerpc/ffi_darwin.c +@@ -593,7 +593,7 @@ + /* Natural alignment for all items. */ + align = p->alignment; + #else +- /* Natrual alignment for the first item... */ ++ /* Natural alignment for the first item... */ + if (i == 0) + align = p->alignment; + else if (p->alignment == 16 || p->alignment < 4) +diff -r c0e311e010fc Modules/_ctypes/libffi/src/powerpc/ffi_linux64.c +--- /dev/null ++++ b/Modules/_ctypes/libffi/src/powerpc/ffi_linux64.c +@@ -0,0 +1,943 @@ ++/* ----------------------------------------------------------------------- ++ ffi_linux64.c - Copyright (C) 2013 IBM ++ Copyright (C) 2011 Anthony Green ++ Copyright (C) 2011 Kyle Moffett ++ Copyright (C) 2008 Red Hat, Inc ++ Copyright (C) 2007, 2008 Free Software Foundation, Inc ++ Copyright (c) 1998 Geoffrey Keating ++ ++ PowerPC Foreign Function Interface ++ ++ Permission is hereby granted, free of charge, to any person obtaining ++ a copy of this software and associated documentation files (the ++ ``Software''), to deal in the Software without restriction, including ++ without limitation the rights to use, copy, modify, merge, publish, ++ distribute, sublicense, and/or sell copies of the Software, and to ++ permit persons to whom the Software is furnished to do so, subject to ++ the following conditions: ++ ++ The above copyright notice and this permission notice shall be included ++ in all copies or substantial portions of the Software. ++ ++ THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS ++ OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF ++ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. ++ IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR ++ OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ++ ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR ++ OTHER DEALINGS IN THE SOFTWARE. ++ ----------------------------------------------------------------------- */ ++ ++#include "ffi.h" ++ ++#ifdef POWERPC64 ++#include "ffi_common.h" ++#include "ffi_powerpc.h" ++ ++ ++/* About the LINUX64 ABI. */ ++enum { ++ NUM_GPR_ARG_REGISTERS64 = 8, ++ NUM_FPR_ARG_REGISTERS64 = 13 ++}; ++enum { ASM_NEEDS_REGISTERS64 = 4 }; ++ ++ ++#if HAVE_LONG_DOUBLE_VARIANT && FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE ++/* Adjust size of ffi_type_longdouble. */ ++void FFI_HIDDEN ++ffi_prep_types_linux64 (ffi_abi abi) ++{ ++ if ((abi & (FFI_LINUX | FFI_LINUX_LONG_DOUBLE_128)) == FFI_LINUX) ++ { ++ ffi_type_longdouble.size = 8; ++ ffi_type_longdouble.alignment = 8; ++ } ++ else ++ { ++ ffi_type_longdouble.size = 16; ++ ffi_type_longdouble.alignment = 16; ++ } ++} ++#endif ++ ++ ++#if _CALL_ELF == 2 ++static unsigned int ++discover_homogeneous_aggregate (const ffi_type *t, unsigned int *elnum) ++{ ++ switch (t->type) ++ { ++ case FFI_TYPE_FLOAT: ++ case FFI_TYPE_DOUBLE: ++ *elnum = 1; ++ return (int) t->type; ++ ++ case FFI_TYPE_STRUCT:; ++ { ++ unsigned int base_elt = 0, total_elnum = 0; ++ ffi_type **el = t->elements; ++ while (*el) ++ { ++ unsigned int el_elt, el_elnum = 0; ++ el_elt = discover_homogeneous_aggregate (*el, &el_elnum); ++ if (el_elt == 0 ++ || (base_elt && base_elt != el_elt)) ++ return 0; ++ base_elt = el_elt; ++ total_elnum += el_elnum; ++ if (total_elnum > 8) ++ return 0; ++ el++; ++ } ++ *elnum = total_elnum; ++ return base_elt; ++ } ++ ++ default: ++ return 0; ++ } ++} ++#endif ++ ++ ++/* Perform machine dependent cif processing */ ++static ffi_status ++ffi_prep_cif_linux64_core (ffi_cif *cif) ++{ ++ ffi_type **ptr; ++ unsigned bytes; ++ unsigned i, fparg_count = 0, intarg_count = 0; ++ unsigned flags = cif->flags; ++#if _CALL_ELF == 2 ++ unsigned int elt, elnum; ++#endif ++ ++#if FFI_TYPE_LONGDOUBLE == FFI_TYPE_DOUBLE ++ /* If compiled without long double support.. */ ++ if ((cif->abi & FFI_LINUX_LONG_DOUBLE_128) != 0) ++ return FFI_BAD_ABI; ++#endif ++ ++ /* The machine-independent calculation of cif->bytes doesn't work ++ for us. Redo the calculation. */ ++#if _CALL_ELF == 2 ++ /* Space for backchain, CR, LR, TOC and the asm's temp regs. */ ++ bytes = (4 + ASM_NEEDS_REGISTERS64) * sizeof (long); ++ ++ /* Space for the general registers. */ ++ bytes += NUM_GPR_ARG_REGISTERS64 * sizeof (long); ++#else ++ /* Space for backchain, CR, LR, cc/ld doubleword, TOC and the asm's temp ++ regs. */ ++ bytes = (6 + ASM_NEEDS_REGISTERS64) * sizeof (long); ++ ++ /* Space for the mandatory parm save area and general registers. */ ++ bytes += 2 * NUM_GPR_ARG_REGISTERS64 * sizeof (long); ++#endif ++ ++ /* Return value handling. */ ++ switch (cif->rtype->type) ++ { ++#if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE ++ case FFI_TYPE_LONGDOUBLE: ++ if ((cif->abi & FFI_LINUX_LONG_DOUBLE_128) != 0) ++ flags |= FLAG_RETURNS_128BITS; ++ /* Fall through. */ ++#endif ++ case FFI_TYPE_DOUBLE: ++ flags |= FLAG_RETURNS_64BITS; ++ /* Fall through. */ ++ case FFI_TYPE_FLOAT: ++ flags |= FLAG_RETURNS_FP; ++ break; ++ ++ case FFI_TYPE_UINT128: ++ flags |= FLAG_RETURNS_128BITS; ++ /* Fall through. */ ++ case FFI_TYPE_UINT64: ++ case FFI_TYPE_SINT64: ++ flags |= FLAG_RETURNS_64BITS; ++ break; ++ ++ case FFI_TYPE_STRUCT: ++#if _CALL_ELF == 2 ++ elt = discover_homogeneous_aggregate (cif->rtype, &elnum); ++ if (elt) ++ { ++ if (elt == FFI_TYPE_DOUBLE) ++ flags |= FLAG_RETURNS_64BITS; ++ flags |= FLAG_RETURNS_FP | FLAG_RETURNS_SMST; ++ break; ++ } ++ if (cif->rtype->size <= 16) ++ { ++ flags |= FLAG_RETURNS_SMST; ++ break; ++ } ++#endif ++ intarg_count++; ++ flags |= FLAG_RETVAL_REFERENCE; ++ /* Fall through. */ ++ case FFI_TYPE_VOID: ++ flags |= FLAG_RETURNS_NOTHING; ++ break; ++ ++ default: ++ /* Returns 32-bit integer, or similar. Nothing to do here. */ ++ break; ++ } ++ ++ for (ptr = cif->arg_types, i = cif->nargs; i > 0; i--, ptr++) ++ { ++ unsigned int align; ++ ++ switch ((*ptr)->type) ++ { ++#if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE ++ case FFI_TYPE_LONGDOUBLE: ++ if ((cif->abi & FFI_LINUX_LONG_DOUBLE_128) != 0) ++ { ++ fparg_count++; ++ intarg_count++; ++ } ++ /* Fall through. */ ++#endif ++ case FFI_TYPE_DOUBLE: ++ case FFI_TYPE_FLOAT: ++ fparg_count++; ++ intarg_count++; ++ if (fparg_count > NUM_FPR_ARG_REGISTERS64) ++ flags |= FLAG_ARG_NEEDS_PSAVE; ++ break; ++ ++ case FFI_TYPE_STRUCT: ++ if ((cif->abi & FFI_LINUX_STRUCT_ALIGN) != 0) ++ { ++ align = (*ptr)->alignment; ++ if (align > 16) ++ align = 16; ++ align = align / 8; ++ if (align > 1) ++ intarg_count = ALIGN (intarg_count, align); ++ } ++ intarg_count += ((*ptr)->size + 7) / 8; ++#if _CALL_ELF == 2 ++ elt = discover_homogeneous_aggregate (*ptr, &elnum); ++ if (elt) ++ { ++ fparg_count += elnum; ++ if (fparg_count > NUM_FPR_ARG_REGISTERS64) ++ flags |= FLAG_ARG_NEEDS_PSAVE; ++ } ++ else ++#endif ++ { ++ if (intarg_count > NUM_GPR_ARG_REGISTERS64) ++ flags |= FLAG_ARG_NEEDS_PSAVE; ++ } ++ break; ++ ++ case FFI_TYPE_POINTER: ++ case FFI_TYPE_UINT64: ++ case FFI_TYPE_SINT64: ++ case FFI_TYPE_INT: ++ case FFI_TYPE_UINT32: ++ case FFI_TYPE_SINT32: ++ case FFI_TYPE_UINT16: ++ case FFI_TYPE_SINT16: ++ case FFI_TYPE_UINT8: ++ case FFI_TYPE_SINT8: ++ /* Everything else is passed as a 8-byte word in a GPR, either ++ the object itself or a pointer to it. */ ++ intarg_count++; ++ if (intarg_count > NUM_GPR_ARG_REGISTERS64) ++ flags |= FLAG_ARG_NEEDS_PSAVE; ++ break; ++ default: ++ FFI_ASSERT (0); ++ } ++ } ++ ++ if (fparg_count != 0) ++ flags |= FLAG_FP_ARGUMENTS; ++ if (intarg_count > 4) ++ flags |= FLAG_4_GPR_ARGUMENTS; ++ ++ /* Space for the FPR registers, if needed. */ ++ if (fparg_count != 0) ++ bytes += NUM_FPR_ARG_REGISTERS64 * sizeof (double); ++ ++ /* Stack space. */ ++#if _CALL_ELF == 2 ++ if ((flags & FLAG_ARG_NEEDS_PSAVE) != 0) ++ bytes += intarg_count * sizeof (long); ++#else ++ if (intarg_count > NUM_GPR_ARG_REGISTERS64) ++ bytes += (intarg_count - NUM_GPR_ARG_REGISTERS64) * sizeof (long); ++#endif ++ ++ /* The stack space allocated needs to be a multiple of 16 bytes. */ ++ bytes = (bytes + 15) & ~0xF; ++ ++ cif->flags = flags; ++ cif->bytes = bytes; ++ ++ return FFI_OK; ++} ++ ++ffi_status FFI_HIDDEN ++ffi_prep_cif_linux64 (ffi_cif *cif) ++{ ++ if ((cif->abi & FFI_LINUX) != 0) ++ cif->nfixedargs = cif->nargs; ++#if _CALL_ELF != 2 ++ else if (cif->abi == FFI_COMPAT_LINUX64) ++ { ++ /* This call is from old code. Don't touch cif->nfixedargs ++ since old code will be using a smaller cif. */ ++ cif->flags |= FLAG_COMPAT; ++ /* Translate to new abi value. */ ++ cif->abi = FFI_LINUX | FFI_LINUX_LONG_DOUBLE_128; ++ } ++#endif ++ else ++ return FFI_BAD_ABI; ++ return ffi_prep_cif_linux64_core (cif); ++} ++ ++ffi_status FFI_HIDDEN ++ffi_prep_cif_linux64_var (ffi_cif *cif, ++ unsigned int nfixedargs, ++ unsigned int ntotalargs MAYBE_UNUSED) ++{ ++ if ((cif->abi & FFI_LINUX) != 0) ++ cif->nfixedargs = nfixedargs; ++#if _CALL_ELF != 2 ++ else if (cif->abi == FFI_COMPAT_LINUX64) ++ { ++ /* This call is from old code. Don't touch cif->nfixedargs ++ since old code will be using a smaller cif. */ ++ cif->flags |= FLAG_COMPAT; ++ /* Translate to new abi value. */ ++ cif->abi = FFI_LINUX | FFI_LINUX_LONG_DOUBLE_128; ++ } ++#endif ++ else ++ return FFI_BAD_ABI; ++#if _CALL_ELF == 2 ++ cif->flags |= FLAG_ARG_NEEDS_PSAVE; ++#endif ++ return ffi_prep_cif_linux64_core (cif); ++} ++ ++ ++/* ffi_prep_args64 is called by the assembly routine once stack space ++ has been allocated for the function's arguments. ++ ++ The stack layout we want looks like this: ++ ++ | Ret addr from ffi_call_LINUX64 8bytes | higher addresses ++ |--------------------------------------------| ++ | CR save area 8bytes | ++ |--------------------------------------------| ++ | Previous backchain pointer 8 | stack pointer here ++ |--------------------------------------------|<+ <<< on entry to ++ | Saved r28-r31 4*8 | | ffi_call_LINUX64 ++ |--------------------------------------------| | ++ | GPR registers r3-r10 8*8 | | ++ |--------------------------------------------| | ++ | FPR registers f1-f13 (optional) 13*8 | | ++ |--------------------------------------------| | ++ | Parameter save area | | ++ |--------------------------------------------| | ++ | TOC save area 8 | | ++ |--------------------------------------------| | stack | ++ | Linker doubleword 8 | | grows | ++ |--------------------------------------------| | down V ++ | Compiler doubleword 8 | | ++ |--------------------------------------------| | lower addresses ++ | Space for callee's LR 8 | | ++ |--------------------------------------------| | ++ | CR save area 8 | | ++ |--------------------------------------------| | stack pointer here ++ | Current backchain pointer 8 |-/ during ++ |--------------------------------------------| <<< ffi_call_LINUX64 ++ ++*/ ++ ++void FFI_HIDDEN ++ffi_prep_args64 (extended_cif *ecif, unsigned long *const stack) ++{ ++ const unsigned long bytes = ecif->cif->bytes; ++ const unsigned long flags = ecif->cif->flags; ++ ++ typedef union ++ { ++ char *c; ++ unsigned long *ul; ++ float *f; ++ double *d; ++ size_t p; ++ } valp; ++ ++ /* 'stacktop' points at the previous backchain pointer. */ ++ valp stacktop; ++ ++ /* 'next_arg' points at the space for gpr3, and grows upwards as ++ we use GPR registers, then continues at rest. */ ++ valp gpr_base; ++ valp gpr_end; ++ valp rest; ++ valp next_arg; ++ ++ /* 'fpr_base' points at the space for fpr3, and grows upwards as ++ we use FPR registers. */ ++ valp fpr_base; ++ unsigned int fparg_count; ++ ++ unsigned int i, words, nargs, nfixedargs; ++ ffi_type **ptr; ++ double double_tmp; ++ union ++ { ++ void **v; ++ char **c; ++ signed char **sc; ++ unsigned char **uc; ++ signed short **ss; ++ unsigned short **us; ++ signed int **si; ++ unsigned int **ui; ++ unsigned long **ul; ++ float **f; ++ double **d; ++ } p_argv; ++ unsigned long gprvalue; ++ unsigned long align; ++ ++ stacktop.c = (char *) stack + bytes; ++ gpr_base.ul = stacktop.ul - ASM_NEEDS_REGISTERS64 - NUM_GPR_ARG_REGISTERS64; ++ gpr_end.ul = gpr_base.ul + NUM_GPR_ARG_REGISTERS64; ++#if _CALL_ELF == 2 ++ rest.ul = stack + 4 + NUM_GPR_ARG_REGISTERS64; ++#else ++ rest.ul = stack + 6 + NUM_GPR_ARG_REGISTERS64; ++#endif ++ fpr_base.d = gpr_base.d - NUM_FPR_ARG_REGISTERS64; ++ fparg_count = 0; ++ next_arg.ul = gpr_base.ul; ++ ++ /* Check that everything starts aligned properly. */ ++ FFI_ASSERT (((unsigned long) (char *) stack & 0xF) == 0); ++ FFI_ASSERT (((unsigned long) stacktop.c & 0xF) == 0); ++ FFI_ASSERT ((bytes & 0xF) == 0); ++ ++ /* Deal with return values that are actually pass-by-reference. */ ++ if (flags & FLAG_RETVAL_REFERENCE) ++ *next_arg.ul++ = (unsigned long) (char *) ecif->rvalue; ++ ++ /* Now for the arguments. */ ++ p_argv.v = ecif->avalue; ++ nargs = ecif->cif->nargs; ++#if _CALL_ELF != 2 ++ nfixedargs = (unsigned) -1; ++ if ((flags & FLAG_COMPAT) == 0) ++#endif ++ nfixedargs = ecif->cif->nfixedargs; ++ for (ptr = ecif->cif->arg_types, i = 0; ++ i < nargs; ++ i++, ptr++, p_argv.v++) ++ { ++#if _CALL_ELF == 2 ++ unsigned int elt, elnum; ++#endif ++ ++ switch ((*ptr)->type) ++ { ++#if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE ++ case FFI_TYPE_LONGDOUBLE: ++ if ((ecif->cif->abi & FFI_LINUX_LONG_DOUBLE_128) != 0) ++ { ++ double_tmp = (*p_argv.d)[0]; ++ if (fparg_count < NUM_FPR_ARG_REGISTERS64 && i < nfixedargs) ++ { ++ *fpr_base.d++ = double_tmp; ++# if _CALL_ELF != 2 ++ if ((flags & FLAG_COMPAT) != 0) ++ *next_arg.d = double_tmp; ++# endif ++ } ++ else ++ *next_arg.d = double_tmp; ++ if (++next_arg.ul == gpr_end.ul) ++ next_arg.ul = rest.ul; ++ fparg_count++; ++ double_tmp = (*p_argv.d)[1]; ++ if (fparg_count < NUM_FPR_ARG_REGISTERS64 && i < nfixedargs) ++ { ++ *fpr_base.d++ = double_tmp; ++# if _CALL_ELF != 2 ++ if ((flags & FLAG_COMPAT) != 0) ++ *next_arg.d = double_tmp; ++# endif ++ } ++ else ++ *next_arg.d = double_tmp; ++ if (++next_arg.ul == gpr_end.ul) ++ next_arg.ul = rest.ul; ++ fparg_count++; ++ FFI_ASSERT (__LDBL_MANT_DIG__ == 106); ++ FFI_ASSERT (flags & FLAG_FP_ARGUMENTS); ++ break; ++ } ++ /* Fall through. */ ++#endif ++ case FFI_TYPE_DOUBLE: ++ double_tmp = **p_argv.d; ++ if (fparg_count < NUM_FPR_ARG_REGISTERS64 && i < nfixedargs) ++ { ++ *fpr_base.d++ = double_tmp; ++#if _CALL_ELF != 2 ++ if ((flags & FLAG_COMPAT) != 0) ++ *next_arg.d = double_tmp; ++#endif ++ } ++ else ++ *next_arg.d = double_tmp; ++ if (++next_arg.ul == gpr_end.ul) ++ next_arg.ul = rest.ul; ++ fparg_count++; ++ FFI_ASSERT (flags & FLAG_FP_ARGUMENTS); ++ break; ++ ++ case FFI_TYPE_FLOAT: ++ double_tmp = **p_argv.f; ++ if (fparg_count < NUM_FPR_ARG_REGISTERS64 && i < nfixedargs) ++ { ++ *fpr_base.d++ = double_tmp; ++#if _CALL_ELF != 2 ++ if ((flags & FLAG_COMPAT) != 0) ++ *next_arg.f = (float) double_tmp; ++#endif ++ } ++ else ++ *next_arg.f = (float) double_tmp; ++ if (++next_arg.ul == gpr_end.ul) ++ next_arg.ul = rest.ul; ++ fparg_count++; ++ FFI_ASSERT (flags & FLAG_FP_ARGUMENTS); ++ break; ++ ++ case FFI_TYPE_STRUCT: ++ if ((ecif->cif->abi & FFI_LINUX_STRUCT_ALIGN) != 0) ++ { ++ align = (*ptr)->alignment; ++ if (align > 16) ++ align = 16; ++ if (align > 1) ++ next_arg.p = ALIGN (next_arg.p, align); ++ } ++#if _CALL_ELF == 2 ++ elt = discover_homogeneous_aggregate (*ptr, &elnum); ++ if (elt) ++ { ++ union { ++ void *v; ++ float *f; ++ double *d; ++ } arg; ++ ++ arg.v = *p_argv.v; ++ if (elt == FFI_TYPE_FLOAT) ++ { ++ do ++ { ++ double_tmp = *arg.f++; ++ if (fparg_count < NUM_FPR_ARG_REGISTERS64 ++ && i < nfixedargs) ++ *fpr_base.d++ = double_tmp; ++ else ++ *next_arg.f = (float) double_tmp; ++ if (++next_arg.f == gpr_end.f) ++ next_arg.f = rest.f; ++ fparg_count++; ++ } ++ while (--elnum != 0); ++ if ((next_arg.p & 3) != 0) ++ { ++ if (++next_arg.f == gpr_end.f) ++ next_arg.f = rest.f; ++ } ++ } ++ else ++ do ++ { ++ double_tmp = *arg.d++; ++ if (fparg_count < NUM_FPR_ARG_REGISTERS64 && i < nfixedargs) ++ *fpr_base.d++ = double_tmp; ++ else ++ *next_arg.d = double_tmp; ++ if (++next_arg.d == gpr_end.d) ++ next_arg.d = rest.d; ++ fparg_count++; ++ } ++ while (--elnum != 0); ++ } ++ else ++#endif ++ { ++ words = ((*ptr)->size + 7) / 8; ++ if (next_arg.ul >= gpr_base.ul && next_arg.ul + words > gpr_end.ul) ++ { ++ size_t first = gpr_end.c - next_arg.c; ++ memcpy (next_arg.c, *p_argv.c, first); ++ memcpy (rest.c, *p_argv.c + first, (*ptr)->size - first); ++ next_arg.c = rest.c + words * 8 - first; ++ } ++ else ++ { ++ char *where = next_arg.c; ++ ++#ifndef __LITTLE_ENDIAN__ ++ /* Structures with size less than eight bytes are passed ++ left-padded. */ ++ if ((*ptr)->size < 8) ++ where += 8 - (*ptr)->size; ++#endif ++ memcpy (where, *p_argv.c, (*ptr)->size); ++ next_arg.ul += words; ++ if (next_arg.ul == gpr_end.ul) ++ next_arg.ul = rest.ul; ++ } ++ } ++ break; ++ ++ case FFI_TYPE_UINT8: ++ gprvalue = **p_argv.uc; ++ goto putgpr; ++ case FFI_TYPE_SINT8: ++ gprvalue = **p_argv.sc; ++ goto putgpr; ++ case FFI_TYPE_UINT16: ++ gprvalue = **p_argv.us; ++ goto putgpr; ++ case FFI_TYPE_SINT16: ++ gprvalue = **p_argv.ss; ++ goto putgpr; ++ case FFI_TYPE_UINT32: ++ gprvalue = **p_argv.ui; ++ goto putgpr; ++ case FFI_TYPE_INT: ++ case FFI_TYPE_SINT32: ++ gprvalue = **p_argv.si; ++ goto putgpr; ++ ++ case FFI_TYPE_UINT64: ++ case FFI_TYPE_SINT64: ++ case FFI_TYPE_POINTER: ++ gprvalue = **p_argv.ul; ++ putgpr: ++ *next_arg.ul++ = gprvalue; ++ if (next_arg.ul == gpr_end.ul) ++ next_arg.ul = rest.ul; ++ break; ++ } ++ } ++ ++ FFI_ASSERT (flags & FLAG_4_GPR_ARGUMENTS ++ || (next_arg.ul >= gpr_base.ul ++ && next_arg.ul <= gpr_base.ul + 4)); ++} ++ ++ ++#if _CALL_ELF == 2 ++#define MIN_CACHE_LINE_SIZE 8 ++ ++static void ++flush_icache (char *wraddr, char *xaddr, int size) ++{ ++ int i; ++ for (i = 0; i < size; i += MIN_CACHE_LINE_SIZE) ++ __asm__ volatile ("icbi 0,%0;" "dcbf 0,%1;" ++ : : "r" (xaddr + i), "r" (wraddr + i) : "memory"); ++ __asm__ volatile ("icbi 0,%0;" "dcbf 0,%1;" "sync;" "isync;" ++ : : "r"(xaddr + size - 1), "r"(wraddr + size - 1) ++ : "memory"); ++} ++#endif ++ ++ffi_status ++ffi_prep_closure_loc_linux64 (ffi_closure *closure, ++ ffi_cif *cif, ++ void (*fun) (ffi_cif *, void *, void **, void *), ++ void *user_data, ++ void *codeloc) ++{ ++#if _CALL_ELF == 2 ++ unsigned int *tramp = (unsigned int *) &closure->tramp[0]; ++ ++ if (cif->abi < FFI_LINUX || cif->abi >= FFI_LAST_ABI) ++ return FFI_BAD_ABI; ++ ++ tramp[0] = 0xe96c0018; /* 0: ld 11,2f-0b(12) */ ++ tramp[1] = 0xe98c0010; /* ld 12,1f-0b(12) */ ++ tramp[2] = 0x7d8903a6; /* mtctr 12 */ ++ tramp[3] = 0x4e800420; /* bctr */ ++ /* 1: .quad function_addr */ ++ /* 2: .quad context */ ++ *(void **) &tramp[4] = (void *) ffi_closure_LINUX64; ++ *(void **) &tramp[6] = codeloc; ++ flush_icache ((char *)tramp, (char *)codeloc, FFI_TRAMPOLINE_SIZE); ++#else ++ void **tramp = (void **) &closure->tramp[0]; ++ ++ if (cif->abi < FFI_LINUX || cif->abi >= FFI_LAST_ABI) ++ return FFI_BAD_ABI; ++ ++ /* Copy function address and TOC from ffi_closure_LINUX64. */ ++ memcpy (tramp, (char *) ffi_closure_LINUX64, 16); ++ tramp[2] = tramp[1]; ++ tramp[1] = codeloc; ++#endif ++ ++ closure->cif = cif; ++ closure->fun = fun; ++ closure->user_data = user_data; ++ ++ return FFI_OK; ++} ++ ++ ++int FFI_HIDDEN ++ffi_closure_helper_LINUX64 (ffi_closure *closure, void *rvalue, ++ unsigned long *pst, ffi_dblfl *pfr) ++{ ++ /* rvalue is the pointer to space for return value in closure assembly */ ++ /* pst is the pointer to parameter save area ++ (r3-r10 are stored into its first 8 slots by ffi_closure_LINUX64) */ ++ /* pfr is the pointer to where f1-f13 are stored in ffi_closure_LINUX64 */ ++ ++ void **avalue; ++ ffi_type **arg_types; ++ unsigned long i, avn, nfixedargs; ++ ffi_cif *cif; ++ ffi_dblfl *end_pfr = pfr + NUM_FPR_ARG_REGISTERS64; ++ unsigned long align; ++ ++ cif = closure->cif; ++ avalue = alloca (cif->nargs * sizeof (void *)); ++ ++ /* Copy the caller's structure return value address so that the ++ closure returns the data directly to the caller. */ ++ if (cif->rtype->type == FFI_TYPE_STRUCT ++ && (cif->flags & FLAG_RETURNS_SMST) == 0) ++ { ++ rvalue = (void *) *pst; ++ pst++; ++ } ++ ++ i = 0; ++ avn = cif->nargs; ++#if _CALL_ELF != 2 ++ nfixedargs = (unsigned) -1; ++ if ((cif->flags & FLAG_COMPAT) == 0) ++#endif ++ nfixedargs = cif->nfixedargs; ++ arg_types = cif->arg_types; ++ ++ /* Grab the addresses of the arguments from the stack frame. */ ++ while (i < avn) ++ { ++ unsigned int elt, elnum; ++ ++ switch (arg_types[i]->type) ++ { ++ case FFI_TYPE_SINT8: ++ case FFI_TYPE_UINT8: ++#ifndef __LITTLE_ENDIAN__ ++ avalue[i] = (char *) pst + 7; ++ pst++; ++ break; ++#endif ++ ++ case FFI_TYPE_SINT16: ++ case FFI_TYPE_UINT16: ++#ifndef __LITTLE_ENDIAN__ ++ avalue[i] = (char *) pst + 6; ++ pst++; ++ break; ++#endif ++ ++ case FFI_TYPE_SINT32: ++ case FFI_TYPE_UINT32: ++#ifndef __LITTLE_ENDIAN__ ++ avalue[i] = (char *) pst + 4; ++ pst++; ++ break; ++#endif ++ ++ case FFI_TYPE_SINT64: ++ case FFI_TYPE_UINT64: ++ case FFI_TYPE_POINTER: ++ avalue[i] = pst; ++ pst++; ++ break; ++ ++ case FFI_TYPE_STRUCT: ++ if ((cif->abi & FFI_LINUX_STRUCT_ALIGN) != 0) ++ { ++ align = arg_types[i]->alignment; ++ if (align > 16) ++ align = 16; ++ if (align > 1) ++ pst = (unsigned long *) ALIGN ((size_t) pst, align); ++ } ++ elt = 0; ++#if _CALL_ELF == 2 ++ elt = discover_homogeneous_aggregate (arg_types[i], &elnum); ++#endif ++ if (elt) ++ { ++ union { ++ void *v; ++ unsigned long *ul; ++ float *f; ++ double *d; ++ size_t p; ++ } to, from; ++ ++ /* Repackage the aggregate from its parts. The ++ aggregate size is not greater than the space taken by ++ the registers so store back to the register/parameter ++ save arrays. */ ++ if (pfr + elnum <= end_pfr) ++ to.v = pfr; ++ else ++ to.v = pst; ++ ++ avalue[i] = to.v; ++ from.ul = pst; ++ if (elt == FFI_TYPE_FLOAT) ++ { ++ do ++ { ++ if (pfr < end_pfr && i < nfixedargs) ++ { ++ *to.f = (float) pfr->d; ++ pfr++; ++ } ++ else ++ *to.f = *from.f; ++ to.f++; ++ from.f++; ++ } ++ while (--elnum != 0); ++ } ++ else ++ { ++ do ++ { ++ if (pfr < end_pfr && i < nfixedargs) ++ { ++ *to.d = pfr->d; ++ pfr++; ++ } ++ else ++ *to.d = *from.d; ++ to.d++; ++ from.d++; ++ } ++ while (--elnum != 0); ++ } ++ } ++ else ++ { ++#ifndef __LITTLE_ENDIAN__ ++ /* Structures with size less than eight bytes are passed ++ left-padded. */ ++ if (arg_types[i]->size < 8) ++ avalue[i] = (char *) pst + 8 - arg_types[i]->size; ++ else ++#endif ++ avalue[i] = pst; ++ } ++ pst += (arg_types[i]->size + 7) / 8; ++ break; ++ ++#if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE ++ case FFI_TYPE_LONGDOUBLE: ++ if ((cif->abi & FFI_LINUX_LONG_DOUBLE_128) != 0) ++ { ++ if (pfr + 1 < end_pfr && i + 1 < nfixedargs) ++ { ++ avalue[i] = pfr; ++ pfr += 2; ++ } ++ else ++ { ++ if (pfr < end_pfr && i < nfixedargs) ++ { ++ /* Passed partly in f13 and partly on the stack. ++ Move it all to the stack. */ ++ *pst = *(unsigned long *) pfr; ++ pfr++; ++ } ++ avalue[i] = pst; ++ } ++ pst += 2; ++ break; ++ } ++ /* Fall through. */ ++#endif ++ case FFI_TYPE_DOUBLE: ++ /* On the outgoing stack all values are aligned to 8 */ ++ /* there are 13 64bit floating point registers */ ++ ++ if (pfr < end_pfr && i < nfixedargs) ++ { ++ avalue[i] = pfr; ++ pfr++; ++ } ++ else ++ avalue[i] = pst; ++ pst++; ++ break; ++ ++ case FFI_TYPE_FLOAT: ++ if (pfr < end_pfr && i < nfixedargs) ++ { ++ /* Float values are stored as doubles in the ++ ffi_closure_LINUX64 code. Fix them here. */ ++ pfr->f = (float) pfr->d; ++ avalue[i] = pfr; ++ pfr++; ++ } ++ else ++ avalue[i] = pst; ++ pst++; ++ break; ++ ++ default: ++ FFI_ASSERT (0); ++ } ++ ++ i++; ++ } ++ ++ ++ (closure->fun) (cif, rvalue, avalue, closure->user_data); ++ ++ /* Tell ffi_closure_LINUX64 how to perform return type promotions. */ ++ if ((cif->flags & FLAG_RETURNS_SMST) != 0) ++ { ++ if ((cif->flags & FLAG_RETURNS_FP) == 0) ++ return FFI_V2_TYPE_SMALL_STRUCT + cif->rtype->size - 1; ++ else if ((cif->flags & FLAG_RETURNS_64BITS) != 0) ++ return FFI_V2_TYPE_DOUBLE_HOMOG; ++ else ++ return FFI_V2_TYPE_FLOAT_HOMOG; ++ } ++ return cif->rtype->type; ++} ++#endif +diff -r c0e311e010fc Modules/_ctypes/libffi/src/powerpc/ffi_powerpc.h +--- /dev/null ++++ b/Modules/_ctypes/libffi/src/powerpc/ffi_powerpc.h +@@ -0,0 +1,77 @@ ++/* ----------------------------------------------------------------------- ++ ffi_powerpc.h - Copyright (C) 2013 IBM ++ Copyright (C) 2011 Anthony Green ++ Copyright (C) 2011 Kyle Moffett ++ Copyright (C) 2008 Red Hat, Inc ++ Copyright (C) 2007, 2008 Free Software Foundation, Inc ++ Copyright (c) 1998 Geoffrey Keating ++ ++ PowerPC Foreign Function Interface ++ ++ Permission is hereby granted, free of charge, to any person obtaining ++ a copy of this software and associated documentation files (the ++ ``Software''), to deal in the Software without restriction, including ++ without limitation the rights to use, copy, modify, merge, publish, ++ distribute, sublicense, and/or sell copies of the Software, and to ++ permit persons to whom the Software is furnished to do so, subject to ++ the following conditions: ++ ++ The above copyright notice and this permission notice shall be included ++ in all copies or substantial portions of the Software. ++ ++ THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS ++ OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF ++ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. ++ IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR ++ OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ++ ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR ++ OTHER DEALINGS IN THE SOFTWARE. ++ ----------------------------------------------------------------------- */ ++ ++enum { ++ /* The assembly depends on these exact flags. */ ++ /* These go in cr7 */ ++ FLAG_RETURNS_SMST = 1 << (31-31), /* Used for FFI_SYSV small structs. */ ++ FLAG_RETURNS_NOTHING = 1 << (31-30), ++ FLAG_RETURNS_FP = 1 << (31-29), ++ FLAG_RETURNS_64BITS = 1 << (31-28), ++ ++ /* This goes in cr6 */ ++ FLAG_RETURNS_128BITS = 1 << (31-27), ++ ++ FLAG_COMPAT = 1 << (31- 8), /* Not used by assembly */ ++ ++ /* These go in cr1 */ ++ FLAG_ARG_NEEDS_COPY = 1 << (31- 7), /* Used by sysv code */ ++ FLAG_ARG_NEEDS_PSAVE = FLAG_ARG_NEEDS_COPY, /* Used by linux64 code */ ++ FLAG_FP_ARGUMENTS = 1 << (31- 6), /* cr1.eq; specified by ABI */ ++ FLAG_4_GPR_ARGUMENTS = 1 << (31- 5), ++ FLAG_RETVAL_REFERENCE = 1 << (31- 4) ++}; ++ ++typedef union ++{ ++ float f; ++ double d; ++} ffi_dblfl; ++ ++void FFI_HIDDEN ffi_closure_SYSV (void); ++void FFI_HIDDEN ffi_call_SYSV(extended_cif *, unsigned, unsigned, unsigned *, ++ void (*)(void)); ++ ++void FFI_HIDDEN ffi_prep_types_sysv (ffi_abi); ++ffi_status FFI_HIDDEN ffi_prep_cif_sysv (ffi_cif *); ++int FFI_HIDDEN ffi_closure_helper_SYSV (ffi_closure *, void *, unsigned long *, ++ ffi_dblfl *, unsigned long *); ++ ++void FFI_HIDDEN ffi_call_LINUX64(extended_cif *, unsigned long, unsigned long, ++ unsigned long *, void (*)(void)); ++void FFI_HIDDEN ffi_closure_LINUX64 (void); ++ ++void FFI_HIDDEN ffi_prep_types_linux64 (ffi_abi); ++ffi_status FFI_HIDDEN ffi_prep_cif_linux64 (ffi_cif *); ++ffi_status FFI_HIDDEN ffi_prep_cif_linux64_var (ffi_cif *, unsigned int, ++ unsigned int); ++void FFI_HIDDEN ffi_prep_args64 (extended_cif *, unsigned long *const); ++int FFI_HIDDEN ffi_closure_helper_LINUX64 (ffi_closure *, void *, ++ unsigned long *, ffi_dblfl *); +diff -r c0e311e010fc Modules/_ctypes/libffi/src/powerpc/ffi_sysv.c +--- /dev/null ++++ b/Modules/_ctypes/libffi/src/powerpc/ffi_sysv.c +@@ -0,0 +1,931 @@ ++/* ----------------------------------------------------------------------- ++ ffi_sysv.c - Copyright (C) 2013 IBM ++ Copyright (C) 2011 Anthony Green ++ Copyright (C) 2011 Kyle Moffett ++ Copyright (C) 2008 Red Hat, Inc ++ Copyright (C) 2007, 2008 Free Software Foundation, Inc ++ Copyright (c) 1998 Geoffrey Keating ++ ++ PowerPC Foreign Function Interface ++ ++ Permission is hereby granted, free of charge, to any person obtaining ++ a copy of this software and associated documentation files (the ++ ``Software''), to deal in the Software without restriction, including ++ without limitation the rights to use, copy, modify, merge, publish, ++ distribute, sublicense, and/or sell copies of the Software, and to ++ permit persons to whom the Software is furnished to do so, subject to ++ the following conditions: ++ ++ The above copyright notice and this permission notice shall be included ++ in all copies or substantial portions of the Software. ++ ++ THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS ++ OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF ++ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. ++ IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR ++ OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ++ ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR ++ OTHER DEALINGS IN THE SOFTWARE. ++ ----------------------------------------------------------------------- */ ++ ++#include "ffi.h" ++ ++#ifndef POWERPC64 ++#include "ffi_common.h" ++#include "ffi_powerpc.h" ++ ++ ++/* About the SYSV ABI. */ ++#define ASM_NEEDS_REGISTERS 4 ++#define NUM_GPR_ARG_REGISTERS 8 ++#define NUM_FPR_ARG_REGISTERS 8 ++ ++ ++#if HAVE_LONG_DOUBLE_VARIANT && FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE ++/* Adjust size of ffi_type_longdouble. */ ++void FFI_HIDDEN ++ffi_prep_types_sysv (ffi_abi abi) ++{ ++ if ((abi & (FFI_SYSV | FFI_SYSV_LONG_DOUBLE_128)) == FFI_SYSV) ++ { ++ ffi_type_longdouble.size = 8; ++ ffi_type_longdouble.alignment = 8; ++ } ++ else ++ { ++ ffi_type_longdouble.size = 16; ++ ffi_type_longdouble.alignment = 16; ++ } ++} ++#endif ++ ++/* Transform long double, double and float to other types as per abi. */ ++static int ++translate_float (int abi, int type) ++{ ++#if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE ++ if (type == FFI_TYPE_LONGDOUBLE ++ && (abi & FFI_SYSV_LONG_DOUBLE_128) == 0) ++ type = FFI_TYPE_DOUBLE; ++#endif ++ if ((abi & FFI_SYSV_SOFT_FLOAT) != 0) ++ { ++ if (type == FFI_TYPE_FLOAT) ++ type = FFI_TYPE_UINT32; ++ else if (type == FFI_TYPE_DOUBLE) ++ type = FFI_TYPE_UINT64; ++#if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE ++ else if (type == FFI_TYPE_LONGDOUBLE) ++ type = FFI_TYPE_UINT128; ++ } ++ else if ((abi & FFI_SYSV_IBM_LONG_DOUBLE) == 0) ++ { ++ if (type == FFI_TYPE_LONGDOUBLE) ++ type = FFI_TYPE_STRUCT; ++#endif ++ } ++ return type; ++} ++ ++/* Perform machine dependent cif processing */ ++static ffi_status ++ffi_prep_cif_sysv_core (ffi_cif *cif) ++{ ++ ffi_type **ptr; ++ unsigned bytes; ++ unsigned i, fparg_count = 0, intarg_count = 0; ++ unsigned flags = cif->flags; ++ unsigned struct_copy_size = 0; ++ unsigned type = cif->rtype->type; ++ unsigned size = cif->rtype->size; ++ ++ /* The machine-independent calculation of cif->bytes doesn't work ++ for us. Redo the calculation. */ ++ ++ /* Space for the frame pointer, callee's LR, and the asm's temp regs. */ ++ bytes = (2 + ASM_NEEDS_REGISTERS) * sizeof (int); ++ ++ /* Space for the GPR registers. */ ++ bytes += NUM_GPR_ARG_REGISTERS * sizeof (int); ++ ++ /* Return value handling. The rules for SYSV are as follows: ++ - 32-bit (or less) integer values are returned in gpr3; ++ - Structures of size <= 4 bytes also returned in gpr3; ++ - 64-bit integer values and structures between 5 and 8 bytes are returned ++ in gpr3 and gpr4; ++ - Larger structures are allocated space and a pointer is passed as ++ the first argument. ++ - Single/double FP values are returned in fpr1; ++ - long doubles (if not equivalent to double) are returned in ++ fpr1,fpr2 for Linux and as for large structs for SysV. */ ++ ++ type = translate_float (cif->abi, type); ++ ++ switch (type) ++ { ++#if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE ++ case FFI_TYPE_LONGDOUBLE: ++ flags |= FLAG_RETURNS_128BITS; ++ /* Fall through. */ ++#endif ++ case FFI_TYPE_DOUBLE: ++ flags |= FLAG_RETURNS_64BITS; ++ /* Fall through. */ ++ case FFI_TYPE_FLOAT: ++ flags |= FLAG_RETURNS_FP; ++#ifdef __NO_FPRS__ ++ return FFI_BAD_ABI; ++#endif ++ break; ++ ++ case FFI_TYPE_UINT128: ++ flags |= FLAG_RETURNS_128BITS; ++ /* Fall through. */ ++ case FFI_TYPE_UINT64: ++ case FFI_TYPE_SINT64: ++ flags |= FLAG_RETURNS_64BITS; ++ break; ++ ++ case FFI_TYPE_STRUCT: ++ /* The final SYSV ABI says that structures smaller or equal 8 bytes ++ are returned in r3/r4. A draft ABI used by linux instead ++ returns them in memory. */ ++ if ((cif->abi & FFI_SYSV_STRUCT_RET) != 0 && size <= 8) ++ { ++ flags |= FLAG_RETURNS_SMST; ++ break; ++ } ++ intarg_count++; ++ flags |= FLAG_RETVAL_REFERENCE; ++ /* Fall through. */ ++ case FFI_TYPE_VOID: ++ flags |= FLAG_RETURNS_NOTHING; ++ break; ++ ++ default: ++ /* Returns 32-bit integer, or similar. Nothing to do here. */ ++ break; ++ } ++ ++ /* The first NUM_GPR_ARG_REGISTERS words of integer arguments, and the ++ first NUM_FPR_ARG_REGISTERS fp arguments, go in registers; the rest ++ goes on the stack. Structures and long doubles (if not equivalent ++ to double) are passed as a pointer to a copy of the structure. ++ Stuff on the stack needs to keep proper alignment. */ ++ for (ptr = cif->arg_types, i = cif->nargs; i > 0; i--, ptr++) ++ { ++ unsigned short typenum = (*ptr)->type; ++ ++ typenum = translate_float (cif->abi, typenum); ++ ++ switch (typenum) ++ { ++#if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE ++ case FFI_TYPE_LONGDOUBLE: ++ fparg_count++; ++ /* Fall thru */ ++#endif ++ case FFI_TYPE_DOUBLE: ++ fparg_count++; ++ /* If this FP arg is going on the stack, it must be ++ 8-byte-aligned. */ ++ if (fparg_count > NUM_FPR_ARG_REGISTERS ++ && intarg_count >= NUM_GPR_ARG_REGISTERS ++ && intarg_count % 2 != 0) ++ intarg_count++; ++#ifdef __NO_FPRS__ ++ return FFI_BAD_ABI; ++#endif ++ break; ++ ++ case FFI_TYPE_FLOAT: ++ fparg_count++; ++#ifdef __NO_FPRS__ ++ return FFI_BAD_ABI; ++#endif ++ break; ++ ++ case FFI_TYPE_UINT128: ++ /* A long double in FFI_LINUX_SOFT_FLOAT can use only a set ++ of four consecutive gprs. If we do not have enough, we ++ have to adjust the intarg_count value. */ ++ if (intarg_count >= NUM_GPR_ARG_REGISTERS - 3 ++ && intarg_count < NUM_GPR_ARG_REGISTERS) ++ intarg_count = NUM_GPR_ARG_REGISTERS; ++ intarg_count += 4; ++ break; ++ ++ case FFI_TYPE_UINT64: ++ case FFI_TYPE_SINT64: ++ /* 'long long' arguments are passed as two words, but ++ either both words must fit in registers or both go ++ on the stack. If they go on the stack, they must ++ be 8-byte-aligned. ++ ++ Also, only certain register pairs can be used for ++ passing long long int -- specifically (r3,r4), (r5,r6), ++ (r7,r8), (r9,r10). */ ++ if (intarg_count == NUM_GPR_ARG_REGISTERS-1 ++ || intarg_count % 2 != 0) ++ intarg_count++; ++ intarg_count += 2; ++ break; ++ ++ case FFI_TYPE_STRUCT: ++ /* We must allocate space for a copy of these to enforce ++ pass-by-value. Pad the space up to a multiple of 16 ++ bytes (the maximum alignment required for anything under ++ the SYSV ABI). */ ++ struct_copy_size += ((*ptr)->size + 15) & ~0xF; ++ /* Fall through (allocate space for the pointer). */ ++ ++ case FFI_TYPE_POINTER: ++ case FFI_TYPE_INT: ++ case FFI_TYPE_UINT32: ++ case FFI_TYPE_SINT32: ++ case FFI_TYPE_UINT16: ++ case FFI_TYPE_SINT16: ++ case FFI_TYPE_UINT8: ++ case FFI_TYPE_SINT8: ++ /* Everything else is passed as a 4-byte word in a GPR, either ++ the object itself or a pointer to it. */ ++ intarg_count++; ++ break; ++ ++ default: ++ FFI_ASSERT (0); ++ } ++ } ++ ++ if (fparg_count != 0) ++ flags |= FLAG_FP_ARGUMENTS; ++ if (intarg_count > 4) ++ flags |= FLAG_4_GPR_ARGUMENTS; ++ if (struct_copy_size != 0) ++ flags |= FLAG_ARG_NEEDS_COPY; ++ ++ /* Space for the FPR registers, if needed. */ ++ if (fparg_count != 0) ++ bytes += NUM_FPR_ARG_REGISTERS * sizeof (double); ++ ++ /* Stack space. */ ++ if (intarg_count > NUM_GPR_ARG_REGISTERS) ++ bytes += (intarg_count - NUM_GPR_ARG_REGISTERS) * sizeof (int); ++ if (fparg_count > NUM_FPR_ARG_REGISTERS) ++ bytes += (fparg_count - NUM_FPR_ARG_REGISTERS) * sizeof (double); ++ ++ /* The stack space allocated needs to be a multiple of 16 bytes. */ ++ bytes = (bytes + 15) & ~0xF; ++ ++ /* Add in the space for the copied structures. */ ++ bytes += struct_copy_size; ++ ++ cif->flags = flags; ++ cif->bytes = bytes; ++ ++ return FFI_OK; ++} ++ ++ffi_status FFI_HIDDEN ++ffi_prep_cif_sysv (ffi_cif *cif) ++{ ++ if ((cif->abi & FFI_SYSV) == 0) ++ { ++ /* This call is from old code. Translate to new ABI values. */ ++ cif->flags |= FLAG_COMPAT; ++ switch (cif->abi) ++ { ++ default: ++ return FFI_BAD_ABI; ++ ++ case FFI_COMPAT_SYSV: ++ cif->abi = FFI_SYSV | FFI_SYSV_STRUCT_RET | FFI_SYSV_LONG_DOUBLE_128; ++ break; ++ ++ case FFI_COMPAT_GCC_SYSV: ++ cif->abi = FFI_SYSV | FFI_SYSV_LONG_DOUBLE_128; ++ break; ++ ++ case FFI_COMPAT_LINUX: ++ cif->abi = (FFI_SYSV | FFI_SYSV_IBM_LONG_DOUBLE ++ | FFI_SYSV_LONG_DOUBLE_128); ++ break; ++ ++ case FFI_COMPAT_LINUX_SOFT_FLOAT: ++ cif->abi = (FFI_SYSV | FFI_SYSV_SOFT_FLOAT | FFI_SYSV_IBM_LONG_DOUBLE ++ | FFI_SYSV_LONG_DOUBLE_128); ++ break; ++ } ++ } ++ return ffi_prep_cif_sysv_core (cif); ++} ++ ++/* ffi_prep_args_SYSV is called by the assembly routine once stack space ++ has been allocated for the function's arguments. ++ ++ The stack layout we want looks like this: ++ ++ | Return address from ffi_call_SYSV 4bytes | higher addresses ++ |--------------------------------------------| ++ | Previous backchain pointer 4 | stack pointer here ++ |--------------------------------------------|<+ <<< on entry to ++ | Saved r28-r31 4*4 | | ffi_call_SYSV ++ |--------------------------------------------| | ++ | GPR registers r3-r10 8*4 | | ffi_call_SYSV ++ |--------------------------------------------| | ++ | FPR registers f1-f8 (optional) 8*8 | | ++ |--------------------------------------------| | stack | ++ | Space for copied structures | | grows | ++ |--------------------------------------------| | down V ++ | Parameters that didn't fit in registers | | ++ |--------------------------------------------| | lower addresses ++ | Space for callee's LR 4 | | ++ |--------------------------------------------| | stack pointer here ++ | Current backchain pointer 4 |-/ during ++ |--------------------------------------------| <<< ffi_call_SYSV ++ ++*/ ++ ++void FFI_HIDDEN ++ffi_prep_args_SYSV (extended_cif *ecif, unsigned *const stack) ++{ ++ const unsigned bytes = ecif->cif->bytes; ++ const unsigned flags = ecif->cif->flags; ++ ++ typedef union ++ { ++ char *c; ++ unsigned *u; ++ long long *ll; ++ float *f; ++ double *d; ++ } valp; ++ ++ /* 'stacktop' points at the previous backchain pointer. */ ++ valp stacktop; ++ ++ /* 'gpr_base' points at the space for gpr3, and grows upwards as ++ we use GPR registers. */ ++ valp gpr_base; ++ int intarg_count; ++ ++#ifndef __NO_FPRS__ ++ /* 'fpr_base' points at the space for fpr1, and grows upwards as ++ we use FPR registers. */ ++ valp fpr_base; ++ int fparg_count; ++#endif ++ ++ /* 'copy_space' grows down as we put structures in it. It should ++ stay 16-byte aligned. */ ++ valp copy_space; ++ ++ /* 'next_arg' grows up as we put parameters in it. */ ++ valp next_arg; ++ ++ int i; ++ ffi_type **ptr; ++#ifndef __NO_FPRS__ ++ double double_tmp; ++#endif ++ union ++ { ++ void **v; ++ char **c; ++ signed char **sc; ++ unsigned char **uc; ++ signed short **ss; ++ unsigned short **us; ++ unsigned int **ui; ++ long long **ll; ++ float **f; ++ double **d; ++ } p_argv; ++ size_t struct_copy_size; ++ unsigned gprvalue; ++ ++ stacktop.c = (char *) stack + bytes; ++ gpr_base.u = stacktop.u - ASM_NEEDS_REGISTERS - NUM_GPR_ARG_REGISTERS; ++ intarg_count = 0; ++#ifndef __NO_FPRS__ ++ fpr_base.d = gpr_base.d - NUM_FPR_ARG_REGISTERS; ++ fparg_count = 0; ++ copy_space.c = ((flags & FLAG_FP_ARGUMENTS) ? fpr_base.c : gpr_base.c); ++#else ++ copy_space.c = gpr_base.c; ++#endif ++ next_arg.u = stack + 2; ++ ++ /* Check that everything starts aligned properly. */ ++ FFI_ASSERT (((unsigned long) (char *) stack & 0xF) == 0); ++ FFI_ASSERT (((unsigned long) copy_space.c & 0xF) == 0); ++ FFI_ASSERT (((unsigned long) stacktop.c & 0xF) == 0); ++ FFI_ASSERT ((bytes & 0xF) == 0); ++ FFI_ASSERT (copy_space.c >= next_arg.c); ++ ++ /* Deal with return values that are actually pass-by-reference. */ ++ if (flags & FLAG_RETVAL_REFERENCE) ++ { ++ *gpr_base.u++ = (unsigned long) (char *) ecif->rvalue; ++ intarg_count++; ++ } ++ ++ /* Now for the arguments. */ ++ p_argv.v = ecif->avalue; ++ for (ptr = ecif->cif->arg_types, i = ecif->cif->nargs; ++ i > 0; ++ i--, ptr++, p_argv.v++) ++ { ++ unsigned int typenum = (*ptr)->type; ++ ++ typenum = translate_float (ecif->cif->abi, typenum); ++ ++ /* Now test the translated value */ ++ switch (typenum) ++ { ++#ifndef __NO_FPRS__ ++# if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE ++ case FFI_TYPE_LONGDOUBLE: ++ double_tmp = (*p_argv.d)[0]; ++ ++ if (fparg_count >= NUM_FPR_ARG_REGISTERS - 1) ++ { ++ if (intarg_count >= NUM_GPR_ARG_REGISTERS ++ && intarg_count % 2 != 0) ++ { ++ intarg_count++; ++ next_arg.u++; ++ } ++ *next_arg.d = double_tmp; ++ next_arg.u += 2; ++ double_tmp = (*p_argv.d)[1]; ++ *next_arg.d = double_tmp; ++ next_arg.u += 2; ++ } ++ else ++ { ++ *fpr_base.d++ = double_tmp; ++ double_tmp = (*p_argv.d)[1]; ++ *fpr_base.d++ = double_tmp; ++ } ++ ++ fparg_count += 2; ++ FFI_ASSERT (flags & FLAG_FP_ARGUMENTS); ++ break; ++# endif ++ case FFI_TYPE_DOUBLE: ++ double_tmp = **p_argv.d; ++ ++ if (fparg_count >= NUM_FPR_ARG_REGISTERS) ++ { ++ if (intarg_count >= NUM_GPR_ARG_REGISTERS ++ && intarg_count % 2 != 0) ++ { ++ intarg_count++; ++ next_arg.u++; ++ } ++ *next_arg.d = double_tmp; ++ next_arg.u += 2; ++ } ++ else ++ *fpr_base.d++ = double_tmp; ++ fparg_count++; ++ FFI_ASSERT (flags & FLAG_FP_ARGUMENTS); ++ break; ++ ++ case FFI_TYPE_FLOAT: ++ double_tmp = **p_argv.f; ++ if (fparg_count >= NUM_FPR_ARG_REGISTERS) ++ { ++ *next_arg.f = (float) double_tmp; ++ next_arg.u += 1; ++ intarg_count++; ++ } ++ else ++ *fpr_base.d++ = double_tmp; ++ fparg_count++; ++ FFI_ASSERT (flags & FLAG_FP_ARGUMENTS); ++ break; ++#endif /* have FPRs */ ++ ++ case FFI_TYPE_UINT128: ++ /* The soft float ABI for long doubles works like this, a long double ++ is passed in four consecutive GPRs if available. A maximum of 2 ++ long doubles can be passed in gprs. If we do not have 4 GPRs ++ left, the long double is passed on the stack, 4-byte aligned. */ ++ { ++ unsigned int int_tmp; ++ unsigned int ii; ++ if (intarg_count >= NUM_GPR_ARG_REGISTERS - 3) ++ { ++ if (intarg_count < NUM_GPR_ARG_REGISTERS) ++ intarg_count = NUM_GPR_ARG_REGISTERS; ++ for (ii = 0; ii < 4; ii++) ++ { ++ int_tmp = (*p_argv.ui)[ii]; ++ *next_arg.u++ = int_tmp; ++ } ++ } ++ else ++ { ++ for (ii = 0; ii < 4; ii++) ++ { ++ int_tmp = (*p_argv.ui)[ii]; ++ *gpr_base.u++ = int_tmp; ++ } ++ } ++ intarg_count += 4; ++ break; ++ } ++ ++ case FFI_TYPE_UINT64: ++ case FFI_TYPE_SINT64: ++ if (intarg_count == NUM_GPR_ARG_REGISTERS-1) ++ intarg_count++; ++ if (intarg_count >= NUM_GPR_ARG_REGISTERS) ++ { ++ if (intarg_count % 2 != 0) ++ { ++ intarg_count++; ++ next_arg.u++; ++ } ++ *next_arg.ll = **p_argv.ll; ++ next_arg.u += 2; ++ } ++ else ++ { ++ /* The abi states only certain register pairs can be ++ used for passing long long int specifically (r3,r4), ++ (r5,r6), (r7,r8), (r9,r10). If next arg is long long ++ but not correct starting register of pair then skip ++ until the proper starting register. */ ++ if (intarg_count % 2 != 0) ++ { ++ intarg_count ++; ++ gpr_base.u++; ++ } ++ *gpr_base.ll++ = **p_argv.ll; ++ } ++ intarg_count += 2; ++ break; ++ ++ case FFI_TYPE_STRUCT: ++ struct_copy_size = ((*ptr)->size + 15) & ~0xF; ++ copy_space.c -= struct_copy_size; ++ memcpy (copy_space.c, *p_argv.c, (*ptr)->size); ++ ++ gprvalue = (unsigned long) copy_space.c; ++ ++ FFI_ASSERT (copy_space.c > next_arg.c); ++ FFI_ASSERT (flags & FLAG_ARG_NEEDS_COPY); ++ goto putgpr; ++ ++ case FFI_TYPE_UINT8: ++ gprvalue = **p_argv.uc; ++ goto putgpr; ++ case FFI_TYPE_SINT8: ++ gprvalue = **p_argv.sc; ++ goto putgpr; ++ case FFI_TYPE_UINT16: ++ gprvalue = **p_argv.us; ++ goto putgpr; ++ case FFI_TYPE_SINT16: ++ gprvalue = **p_argv.ss; ++ goto putgpr; ++ ++ case FFI_TYPE_INT: ++ case FFI_TYPE_UINT32: ++ case FFI_TYPE_SINT32: ++ case FFI_TYPE_POINTER: ++ ++ gprvalue = **p_argv.ui; ++ ++ putgpr: ++ if (intarg_count >= NUM_GPR_ARG_REGISTERS) ++ *next_arg.u++ = gprvalue; ++ else ++ *gpr_base.u++ = gprvalue; ++ intarg_count++; ++ break; ++ } ++ } ++ ++ /* Check that we didn't overrun the stack... */ ++ FFI_ASSERT (copy_space.c >= next_arg.c); ++ FFI_ASSERT (gpr_base.u <= stacktop.u - ASM_NEEDS_REGISTERS); ++ /* The assert below is testing that the number of integer arguments agrees ++ with the number found in ffi_prep_cif_machdep(). However, intarg_count ++ is incremented whenever we place an FP arg on the stack, so account for ++ that before our assert test. */ ++#ifndef __NO_FPRS__ ++ if (fparg_count > NUM_FPR_ARG_REGISTERS) ++ intarg_count -= fparg_count - NUM_FPR_ARG_REGISTERS; ++ FFI_ASSERT (fpr_base.u ++ <= stacktop.u - ASM_NEEDS_REGISTERS - NUM_GPR_ARG_REGISTERS); ++#endif ++ FFI_ASSERT (flags & FLAG_4_GPR_ARGUMENTS || intarg_count <= 4); ++} ++ ++#define MIN_CACHE_LINE_SIZE 8 ++ ++static void ++flush_icache (char *wraddr, char *xaddr, int size) ++{ ++ int i; ++ for (i = 0; i < size; i += MIN_CACHE_LINE_SIZE) ++ __asm__ volatile ("icbi 0,%0;" "dcbf 0,%1;" ++ : : "r" (xaddr + i), "r" (wraddr + i) : "memory"); ++ __asm__ volatile ("icbi 0,%0;" "dcbf 0,%1;" "sync;" "isync;" ++ : : "r"(xaddr + size - 1), "r"(wraddr + size - 1) ++ : "memory"); ++} ++ ++ffi_status FFI_HIDDEN ++ffi_prep_closure_loc_sysv (ffi_closure *closure, ++ ffi_cif *cif, ++ void (*fun) (ffi_cif *, void *, void **, void *), ++ void *user_data, ++ void *codeloc) ++{ ++ unsigned int *tramp; ++ ++ if (cif->abi < FFI_SYSV || cif->abi >= FFI_LAST_ABI) ++ return FFI_BAD_ABI; ++ ++ tramp = (unsigned int *) &closure->tramp[0]; ++ tramp[0] = 0x7c0802a6; /* mflr r0 */ ++ tramp[1] = 0x4800000d; /* bl 10 */ ++ tramp[4] = 0x7d6802a6; /* mflr r11 */ ++ tramp[5] = 0x7c0803a6; /* mtlr r0 */ ++ tramp[6] = 0x800b0000; /* lwz r0,0(r11) */ ++ tramp[7] = 0x816b0004; /* lwz r11,4(r11) */ ++ tramp[8] = 0x7c0903a6; /* mtctr r0 */ ++ tramp[9] = 0x4e800420; /* bctr */ ++ *(void **) &tramp[2] = (void *) ffi_closure_SYSV; /* function */ ++ *(void **) &tramp[3] = codeloc; /* context */ ++ ++ /* Flush the icache. */ ++ flush_icache ((char *)tramp, (char *)codeloc, FFI_TRAMPOLINE_SIZE); ++ ++ closure->cif = cif; ++ closure->fun = fun; ++ closure->user_data = user_data; ++ ++ return FFI_OK; ++} ++ ++/* Basically the trampoline invokes ffi_closure_SYSV, and on ++ entry, r11 holds the address of the closure. ++ After storing the registers that could possibly contain ++ parameters to be passed into the stack frame and setting ++ up space for a return value, ffi_closure_SYSV invokes the ++ following helper function to do most of the work. */ ++ ++int ++ffi_closure_helper_SYSV (ffi_closure *closure, void *rvalue, ++ unsigned long *pgr, ffi_dblfl *pfr, ++ unsigned long *pst) ++{ ++ /* rvalue is the pointer to space for return value in closure assembly */ ++ /* pgr is the pointer to where r3-r10 are stored in ffi_closure_SYSV */ ++ /* pfr is the pointer to where f1-f8 are stored in ffi_closure_SYSV */ ++ /* pst is the pointer to outgoing parameter stack in original caller */ ++ ++ void ** avalue; ++ ffi_type ** arg_types; ++ long i, avn; ++#ifndef __NO_FPRS__ ++ long nf = 0; /* number of floating registers already used */ ++#endif ++ long ng = 0; /* number of general registers already used */ ++ ++ ffi_cif *cif = closure->cif; ++ unsigned size = cif->rtype->size; ++ unsigned short rtypenum = cif->rtype->type; ++ ++ avalue = alloca (cif->nargs * sizeof (void *)); ++ ++ /* First translate for softfloat/nonlinux */ ++ rtypenum = translate_float (cif->abi, rtypenum); ++ ++ /* Copy the caller's structure return value address so that the closure ++ returns the data directly to the caller. ++ For FFI_SYSV the result is passed in r3/r4 if the struct size is less ++ or equal 8 bytes. */ ++ if (rtypenum == FFI_TYPE_STRUCT ++ && !((cif->abi & FFI_SYSV_STRUCT_RET) != 0 && size <= 8)) ++ { ++ rvalue = (void *) *pgr; ++ ng++; ++ pgr++; ++ } ++ ++ i = 0; ++ avn = cif->nargs; ++ arg_types = cif->arg_types; ++ ++ /* Grab the addresses of the arguments from the stack frame. */ ++ while (i < avn) { ++ unsigned short typenum = arg_types[i]->type; ++ ++ /* We may need to handle some values depending on ABI. */ ++ typenum = translate_float (cif->abi, typenum); ++ ++ switch (typenum) ++ { ++#ifndef __NO_FPRS__ ++ case FFI_TYPE_FLOAT: ++ /* Unfortunately float values are stored as doubles ++ in the ffi_closure_SYSV code (since we don't check ++ the type in that routine). */ ++ if (nf < NUM_FPR_ARG_REGISTERS) ++ { ++ /* FIXME? here we are really changing the values ++ stored in the original calling routines outgoing ++ parameter stack. This is probably a really ++ naughty thing to do but... */ ++ double temp = pfr->d; ++ pfr->f = (float) temp; ++ avalue[i] = pfr; ++ nf++; ++ pfr++; ++ } ++ else ++ { ++ avalue[i] = pst; ++ pst += 1; ++ } ++ break; ++ ++ case FFI_TYPE_DOUBLE: ++ if (nf < NUM_FPR_ARG_REGISTERS) ++ { ++ avalue[i] = pfr; ++ nf++; ++ pfr++; ++ } ++ else ++ { ++ if (((long) pst) & 4) ++ pst++; ++ avalue[i] = pst; ++ pst += 2; ++ } ++ break; ++ ++# if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE ++ case FFI_TYPE_LONGDOUBLE: ++ if (nf < NUM_FPR_ARG_REGISTERS - 1) ++ { ++ avalue[i] = pfr; ++ pfr += 2; ++ nf += 2; ++ } ++ else ++ { ++ if (((long) pst) & 4) ++ pst++; ++ avalue[i] = pst; ++ pst += 4; ++ nf = 8; ++ } ++ break; ++# endif ++#endif ++ ++ case FFI_TYPE_UINT128: ++ /* Test if for the whole long double, 4 gprs are available. ++ otherwise the stuff ends up on the stack. */ ++ if (ng < NUM_GPR_ARG_REGISTERS - 3) ++ { ++ avalue[i] = pgr; ++ pgr += 4; ++ ng += 4; ++ } ++ else ++ { ++ avalue[i] = pst; ++ pst += 4; ++ ng = 8+4; ++ } ++ break; ++ ++ case FFI_TYPE_SINT8: ++ case FFI_TYPE_UINT8: ++#ifndef __LITTLE_ENDIAN__ ++ if (ng < NUM_GPR_ARG_REGISTERS) ++ { ++ avalue[i] = (char *) pgr + 3; ++ ng++; ++ pgr++; ++ } ++ else ++ { ++ avalue[i] = (char *) pst + 3; ++ pst++; ++ } ++ break; ++#endif ++ ++ case FFI_TYPE_SINT16: ++ case FFI_TYPE_UINT16: ++#ifndef __LITTLE_ENDIAN__ ++ if (ng < NUM_GPR_ARG_REGISTERS) ++ { ++ avalue[i] = (char *) pgr + 2; ++ ng++; ++ pgr++; ++ } ++ else ++ { ++ avalue[i] = (char *) pst + 2; ++ pst++; ++ } ++ break; ++#endif ++ ++ case FFI_TYPE_SINT32: ++ case FFI_TYPE_UINT32: ++ case FFI_TYPE_POINTER: ++ if (ng < NUM_GPR_ARG_REGISTERS) ++ { ++ avalue[i] = pgr; ++ ng++; ++ pgr++; ++ } ++ else ++ { ++ avalue[i] = pst; ++ pst++; ++ } ++ break; ++ ++ case FFI_TYPE_STRUCT: ++ /* Structs are passed by reference. The address will appear in a ++ gpr if it is one of the first 8 arguments. */ ++ if (ng < NUM_GPR_ARG_REGISTERS) ++ { ++ avalue[i] = (void *) *pgr; ++ ng++; ++ pgr++; ++ } ++ else ++ { ++ avalue[i] = (void *) *pst; ++ pst++; ++ } ++ break; ++ ++ case FFI_TYPE_SINT64: ++ case FFI_TYPE_UINT64: ++ /* Passing long long ints are complex, they must ++ be passed in suitable register pairs such as ++ (r3,r4) or (r5,r6) or (r6,r7), or (r7,r8) or (r9,r10) ++ and if the entire pair aren't available then the outgoing ++ parameter stack is used for both but an alignment of 8 ++ must will be kept. So we must either look in pgr ++ or pst to find the correct address for this type ++ of parameter. */ ++ if (ng < NUM_GPR_ARG_REGISTERS - 1) ++ { ++ if (ng & 1) ++ { ++ /* skip r4, r6, r8 as starting points */ ++ ng++; ++ pgr++; ++ } ++ avalue[i] = pgr; ++ ng += 2; ++ pgr += 2; ++ } ++ else ++ { ++ if (((long) pst) & 4) ++ pst++; ++ avalue[i] = pst; ++ pst += 2; ++ ng = NUM_GPR_ARG_REGISTERS; ++ } ++ break; ++ ++ default: ++ FFI_ASSERT (0); ++ } ++ ++ i++; ++ } ++ ++ (closure->fun) (cif, rvalue, avalue, closure->user_data); ++ ++ /* Tell ffi_closure_SYSV how to perform return type promotions. ++ Because the FFI_SYSV ABI returns the structures <= 8 bytes in ++ r3/r4 we have to tell ffi_closure_SYSV how to treat them. We ++ combine the base type FFI_SYSV_TYPE_SMALL_STRUCT with the size of ++ the struct less one. We never have a struct with size zero. ++ See the comment in ffitarget.h about ordering. */ ++ if (rtypenum == FFI_TYPE_STRUCT ++ && (cif->abi & FFI_SYSV_STRUCT_RET) != 0 && size <= 8) ++ return FFI_SYSV_TYPE_SMALL_STRUCT - 1 + size; ++ return rtypenum; ++} ++#endif +diff -r c0e311e010fc Modules/_ctypes/libffi/src/powerpc/ffitarget.h +--- a/Modules/_ctypes/libffi/src/powerpc/ffitarget.h ++++ b/Modules/_ctypes/libffi/src/powerpc/ffitarget.h +@@ -60,45 +60,76 @@ + typedef enum ffi_abi { + FFI_FIRST_ABI = 0, + +-#ifdef POWERPC +- FFI_SYSV, +- FFI_GCC_SYSV, +- FFI_LINUX64, +- FFI_LINUX, +- FFI_LINUX_SOFT_FLOAT, +-# if defined(POWERPC64) +- FFI_DEFAULT_ABI = FFI_LINUX64, +-# elif defined(__NO_FPRS__) +- FFI_DEFAULT_ABI = FFI_LINUX_SOFT_FLOAT, +-# elif (__LDBL_MANT_DIG__ == 106) +- FFI_DEFAULT_ABI = FFI_LINUX, ++#if defined (POWERPC_AIX) ++ FFI_AIX, ++ FFI_DARWIN, ++ FFI_DEFAULT_ABI = FFI_AIX, ++ FFI_LAST_ABI ++ ++#elif defined (POWERPC_DARWIN) ++ FFI_AIX, ++ FFI_DARWIN, ++ FFI_DEFAULT_ABI = FFI_DARWIN, ++ FFI_LAST_ABI ++ ++#else ++ /* The FFI_COMPAT values are used by old code. Since libffi may be ++ a shared library we have to support old values for backwards ++ compatibility. */ ++ FFI_COMPAT_SYSV, ++ FFI_COMPAT_GCC_SYSV, ++ FFI_COMPAT_LINUX64, ++ FFI_COMPAT_LINUX, ++ FFI_COMPAT_LINUX_SOFT_FLOAT, ++ ++# if defined (POWERPC64) ++ /* This bit, always set in new code, must not be set in any of the ++ old FFI_COMPAT values that might be used for 64-bit linux. We ++ only need worry about FFI_COMPAT_LINUX64, but to be safe avoid ++ all old values. */ ++ FFI_LINUX = 8, ++ /* This and following bits can reuse FFI_COMPAT values. */ ++ FFI_LINUX_STRUCT_ALIGN = 1, ++ FFI_LINUX_LONG_DOUBLE_128 = 2, ++ FFI_DEFAULT_ABI = (FFI_LINUX ++# ifdef __STRUCT_PARM_ALIGN__ ++ | FFI_LINUX_STRUCT_ALIGN ++# endif ++# ifdef __LONG_DOUBLE_128__ ++ | FFI_LINUX_LONG_DOUBLE_128 ++# endif ++ ), ++ FFI_LAST_ABI = 12 ++ + # else +- FFI_DEFAULT_ABI = FFI_GCC_SYSV, ++ /* This bit, always set in new code, must not be set in any of the ++ old FFI_COMPAT values that might be used for 32-bit linux/sysv/bsd. */ ++ FFI_SYSV = 8, ++ /* This and following bits can reuse FFI_COMPAT values. */ ++ FFI_SYSV_SOFT_FLOAT = 1, ++ FFI_SYSV_STRUCT_RET = 2, ++ FFI_SYSV_IBM_LONG_DOUBLE = 4, ++ FFI_SYSV_LONG_DOUBLE_128 = 16, ++ ++ FFI_DEFAULT_ABI = (FFI_SYSV ++# ifdef __NO_FPRS__ ++ | FFI_SYSV_SOFT_FLOAT ++# endif ++# if (defined (__SVR4_STRUCT_RETURN) \ ++ || defined (POWERPC_FREEBSD) && !defined (__AIX_STRUCT_RETURN)) ++ | FFI_SYSV_STRUCT_RET ++# endif ++# if __LDBL_MANT_DIG__ == 106 ++ | FFI_SYSV_IBM_LONG_DOUBLE ++# endif ++# ifdef __LONG_DOUBLE_128__ ++ | FFI_SYSV_LONG_DOUBLE_128 ++# endif ++ ), ++ FFI_LAST_ABI = 32 + # endif + #endif + +-#ifdef POWERPC_AIX +- FFI_AIX, +- FFI_DARWIN, +- FFI_DEFAULT_ABI = FFI_AIX, +-#endif +- +-#ifdef POWERPC_DARWIN +- FFI_AIX, +- FFI_DARWIN, +- FFI_DEFAULT_ABI = FFI_DARWIN, +-#endif +- +-#ifdef POWERPC_FREEBSD +- FFI_SYSV, +- FFI_GCC_SYSV, +- FFI_LINUX64, +- FFI_LINUX, +- FFI_LINUX_SOFT_FLOAT, +- FFI_DEFAULT_ABI = FFI_SYSV, +-#endif +- +- FFI_LAST_ABI + } ffi_abi; + #endif + +@@ -106,6 +137,10 @@ + + #define FFI_CLOSURES 1 + #define FFI_NATIVE_RAW_API 0 ++#if defined (POWERPC) || defined (POWERPC_FREEBSD) ++# define FFI_TARGET_SPECIFIC_VARIADIC 1 ++# define FFI_EXTRA_CIF_FIELDS unsigned nfixedargs ++#endif + + /* For additional types like the below, take care about the order in + ppc_closures.S. They must follow after the FFI_TYPE_LAST. */ +@@ -113,19 +148,26 @@ + /* Needed for soft-float long-double-128 support. */ + #define FFI_TYPE_UINT128 (FFI_TYPE_LAST + 1) + +-/* Needed for FFI_SYSV small structure returns. +- We use two flag bits, (FLAG_SYSV_SMST_R3, FLAG_SYSV_SMST_R4) which are +- defined in ffi.c, to determine the exact return type and its size. */ ++/* Needed for FFI_SYSV small structure returns. */ + #define FFI_SYSV_TYPE_SMALL_STRUCT (FFI_TYPE_LAST + 2) + +-#if defined(POWERPC64) || defined(POWERPC_AIX) ++/* Used by ELFv2 for homogenous structure returns. */ ++#define FFI_V2_TYPE_FLOAT_HOMOG (FFI_TYPE_LAST + 1) ++#define FFI_V2_TYPE_DOUBLE_HOMOG (FFI_TYPE_LAST + 2) ++#define FFI_V2_TYPE_SMALL_STRUCT (FFI_TYPE_LAST + 3) ++ ++#if _CALL_ELF == 2 ++# define FFI_TRAMPOLINE_SIZE 32 ++#else ++# if defined(POWERPC64) || defined(POWERPC_AIX) + # if defined(POWERPC_DARWIN64) + # define FFI_TRAMPOLINE_SIZE 48 + # else + # define FFI_TRAMPOLINE_SIZE 24 + # endif +-#else /* POWERPC || POWERPC_AIX */ ++# else /* POWERPC || POWERPC_AIX */ + # define FFI_TRAMPOLINE_SIZE 40 ++# endif + #endif + + #ifndef LIBFFI_ASM +diff -r c0e311e010fc Modules/_ctypes/libffi/src/powerpc/linux64.S +--- a/Modules/_ctypes/libffi/src/powerpc/linux64.S ++++ b/Modules/_ctypes/libffi/src/powerpc/linux64.S +@@ -29,18 +29,25 @@ + #include + #include + +-#ifdef __powerpc64__ ++#ifdef POWERPC64 + .hidden ffi_call_LINUX64 + .globl ffi_call_LINUX64 ++# if _CALL_ELF == 2 ++ .text ++ffi_call_LINUX64: ++ addis %r2, %r12, .TOC.-ffi_call_LINUX64@ha ++ addi %r2, %r2, .TOC.-ffi_call_LINUX64@l ++ .localentry ffi_call_LINUX64, . - ffi_call_LINUX64 ++# else + .section ".opd","aw" + .align 3 + ffi_call_LINUX64: +-#ifdef _CALL_LINUX ++# ifdef _CALL_LINUX + .quad .L.ffi_call_LINUX64,.TOC.@tocbase,0 + .type ffi_call_LINUX64,@function + .text + .L.ffi_call_LINUX64: +-#else ++# else + .hidden .ffi_call_LINUX64 + .globl .ffi_call_LINUX64 + .quad .ffi_call_LINUX64,.TOC.@tocbase,0 +@@ -48,7 +55,8 @@ + .type .ffi_call_LINUX64,@function + .text + .ffi_call_LINUX64: +-#endif ++# endif ++# endif + .LFB1: + mflr %r0 + std %r28, -32(%r1) +@@ -63,26 +71,35 @@ + mr %r31, %r5 /* flags, */ + mr %r30, %r6 /* rvalue, */ + mr %r29, %r7 /* function address. */ ++/* Save toc pointer, not for the ffi_prep_args64 call, but for the later ++ bctrl function call. */ ++# if _CALL_ELF == 2 ++ std %r2, 24(%r1) ++# else + std %r2, 40(%r1) ++# endif + + /* Call ffi_prep_args64. */ + mr %r4, %r1 +-#ifdef _CALL_LINUX ++# if defined _CALL_LINUX || _CALL_ELF == 2 + bl ffi_prep_args64 +-#else ++# else + bl .ffi_prep_args64 +-#endif ++# endif + +- ld %r0, 0(%r29) ++# if _CALL_ELF == 2 ++ mr %r12, %r29 ++# else ++ ld %r12, 0(%r29) + ld %r2, 8(%r29) + ld %r11, 16(%r29) +- ++# endif + /* Now do the call. */ + /* Set up cr1 with bits 4-7 of the flags. */ + mtcrf 0x40, %r31 + + /* Get the address to call into CTR. */ +- mtctr %r0 ++ mtctr %r12 + /* Load all those argument registers. */ + ld %r3, -32-(8*8)(%r28) + ld %r4, -32-(7*8)(%r28) +@@ -117,12 +134,17 @@ + + /* This must follow the call immediately, the unwinder + uses this to find out if r2 has been saved or not. */ ++# if _CALL_ELF == 2 ++ ld %r2, 24(%r1) ++# else + ld %r2, 40(%r1) ++# endif + + /* Now, deal with the return value. */ + mtcrf 0x01, %r31 +- bt- 30, .Ldone_return_value +- bt- 29, .Lfp_return_value ++ bt 31, .Lstruct_return_value ++ bt 30, .Ldone_return_value ++ bt 29, .Lfp_return_value + std %r3, 0(%r30) + /* Fall through... */ + +@@ -130,7 +152,7 @@ + /* Restore the registers we used and return. */ + mr %r1, %r28 + ld %r0, 16(%r28) +- ld %r28, -32(%r1) ++ ld %r28, -32(%r28) + mtlr %r0 + ld %r29, -24(%r1) + ld %r30, -16(%r1) +@@ -147,14 +169,48 @@ + .Lfloat_return_value: + stfs %f1, 0(%r30) + b .Ldone_return_value ++ ++.Lstruct_return_value: ++ bf 29, .Lsmall_struct ++ bf 28, .Lfloat_homog_return_value ++ stfd %f1, 0(%r30) ++ stfd %f2, 8(%r30) ++ stfd %f3, 16(%r30) ++ stfd %f4, 24(%r30) ++ stfd %f5, 32(%r30) ++ stfd %f6, 40(%r30) ++ stfd %f7, 48(%r30) ++ stfd %f8, 56(%r30) ++ b .Ldone_return_value ++ ++.Lfloat_homog_return_value: ++ stfs %f1, 0(%r30) ++ stfs %f2, 4(%r30) ++ stfs %f3, 8(%r30) ++ stfs %f4, 12(%r30) ++ stfs %f5, 16(%r30) ++ stfs %f6, 20(%r30) ++ stfs %f7, 24(%r30) ++ stfs %f8, 28(%r30) ++ b .Ldone_return_value ++ ++.Lsmall_struct: ++ std %r3, 0(%r30) ++ std %r4, 8(%r30) ++ b .Ldone_return_value ++ + .LFE1: + .long 0 + .byte 0,12,0,1,128,4,0,0 +-#ifdef _CALL_LINUX ++# if _CALL_ELF == 2 ++ .size ffi_call_LINUX64,.-ffi_call_LINUX64 ++# else ++# ifdef _CALL_LINUX + .size ffi_call_LINUX64,.-.L.ffi_call_LINUX64 +-#else ++# else + .size .ffi_call_LINUX64,.-.ffi_call_LINUX64 +-#endif ++# endif ++# endif + + .section .eh_frame,EH_FRAME_FLAGS,@progbits + .Lframe1: +@@ -197,8 +253,8 @@ + .uleb128 0x4 + .align 3 + .LEFDE1: ++ ++# if (defined __ELF__ && defined __linux__) || _CALL_ELF == 2 ++ .section .note.GNU-stack,"",@progbits ++# endif + #endif +- +-#if defined __ELF__ && defined __linux__ +- .section .note.GNU-stack,"",@progbits +-#endif +diff -r c0e311e010fc Modules/_ctypes/libffi/src/powerpc/linux64_closure.S +--- a/Modules/_ctypes/libffi/src/powerpc/linux64_closure.S ++++ b/Modules/_ctypes/libffi/src/powerpc/linux64_closure.S +@@ -30,18 +30,25 @@ + + .file "linux64_closure.S" + +-#ifdef __powerpc64__ ++#ifdef POWERPC64 + FFI_HIDDEN (ffi_closure_LINUX64) + .globl ffi_closure_LINUX64 ++# if _CALL_ELF == 2 ++ .text ++ffi_closure_LINUX64: ++ addis %r2, %r12, .TOC.-ffi_closure_LINUX64@ha ++ addi %r2, %r2, .TOC.-ffi_closure_LINUX64@l ++ .localentry ffi_closure_LINUX64, . - ffi_closure_LINUX64 ++# else + .section ".opd","aw" + .align 3 + ffi_closure_LINUX64: +-#ifdef _CALL_LINUX ++# ifdef _CALL_LINUX + .quad .L.ffi_closure_LINUX64,.TOC.@tocbase,0 + .type ffi_closure_LINUX64,@function + .text + .L.ffi_closure_LINUX64: +-#else ++# else + FFI_HIDDEN (.ffi_closure_LINUX64) + .globl .ffi_closure_LINUX64 + .quad .ffi_closure_LINUX64,.TOC.@tocbase,0 +@@ -49,61 +56,105 @@ + .type .ffi_closure_LINUX64,@function + .text + .ffi_closure_LINUX64: +-#endif ++# endif ++# endif ++ ++# if _CALL_ELF == 2 ++# 32 byte special reg save area + 64 byte parm save area ++# + 64 byte retval area + 13*8 fpr save area + round to 16 ++# define STACKFRAME 272 ++# define PARMSAVE 32 ++# define RETVAL PARMSAVE+64 ++# else ++# 48 bytes special reg save area + 64 bytes parm save area ++# + 16 bytes retval area + 13*8 bytes fpr save area + round to 16 ++# define STACKFRAME 240 ++# define PARMSAVE 48 ++# define RETVAL PARMSAVE+64 ++# endif ++ + .LFB1: +- # save general regs into parm save area +- std %r3, 48(%r1) +- std %r4, 56(%r1) +- std %r5, 64(%r1) +- std %r6, 72(%r1) ++# if _CALL_ELF == 2 ++ ld %r12, FFI_TRAMPOLINE_SIZE(%r11) # closure->cif + mflr %r0 ++ lwz %r12, 28(%r12) # cif->flags ++ mtcrf 0x40, %r12 ++ addi %r12, %r1, PARMSAVE ++ bt 7, .Lparmsave ++ # Our caller has not allocated a parameter save area. ++ # We need to allocate one here and use it to pass gprs to ++ # ffi_closure_helper_LINUX64. ++ addi %r12, %r1, -STACKFRAME+PARMSAVE ++.Lparmsave: ++ std %r0, 16(%r1) ++ # Save general regs into parm save area ++ std %r3, 0(%r12) ++ std %r4, 8(%r12) ++ std %r5, 16(%r12) ++ std %r6, 24(%r12) ++ std %r7, 32(%r12) ++ std %r8, 40(%r12) ++ std %r9, 48(%r12) ++ std %r10, 56(%r12) + +- std %r7, 80(%r1) +- std %r8, 88(%r1) +- std %r9, 96(%r1) +- std %r10, 104(%r1) ++ # load up the pointer to the parm save area ++ mr %r5, %r12 ++# else ++ # copy r2 to r11 and load TOC into r2 ++ mr %r11, %r2 ++ ld %r2, 16(%r11) ++ ++ mflr %r0 ++ # Save general regs into parm save area ++ # This is the parameter save area set up by our caller. ++ std %r3, PARMSAVE+0(%r1) ++ std %r4, PARMSAVE+8(%r1) ++ std %r5, PARMSAVE+16(%r1) ++ std %r6, PARMSAVE+24(%r1) ++ std %r7, PARMSAVE+32(%r1) ++ std %r8, PARMSAVE+40(%r1) ++ std %r9, PARMSAVE+48(%r1) ++ std %r10, PARMSAVE+56(%r1) ++ + std %r0, 16(%r1) + +- # mandatory 48 bytes special reg save area + 64 bytes parm save area +- # + 16 bytes retval area + 13*8 bytes fpr save area + round to 16 +- stdu %r1, -240(%r1) ++ # load up the pointer to the parm save area ++ addi %r5, %r1, PARMSAVE ++# endif ++ ++ # next save fpr 1 to fpr 13 ++ stfd %f1, -104+(0*8)(%r1) ++ stfd %f2, -104+(1*8)(%r1) ++ stfd %f3, -104+(2*8)(%r1) ++ stfd %f4, -104+(3*8)(%r1) ++ stfd %f5, -104+(4*8)(%r1) ++ stfd %f6, -104+(5*8)(%r1) ++ stfd %f7, -104+(6*8)(%r1) ++ stfd %f8, -104+(7*8)(%r1) ++ stfd %f9, -104+(8*8)(%r1) ++ stfd %f10, -104+(9*8)(%r1) ++ stfd %f11, -104+(10*8)(%r1) ++ stfd %f12, -104+(11*8)(%r1) ++ stfd %f13, -104+(12*8)(%r1) ++ ++ # load up the pointer to the saved fpr registers */ ++ addi %r6, %r1, -104 ++ ++ # load up the pointer to the result storage ++ addi %r4, %r1, -STACKFRAME+RETVAL ++ ++ stdu %r1, -STACKFRAME(%r1) + .LCFI0: + +- # next save fpr 1 to fpr 13 +- stfd %f1, 128+(0*8)(%r1) +- stfd %f2, 128+(1*8)(%r1) +- stfd %f3, 128+(2*8)(%r1) +- stfd %f4, 128+(3*8)(%r1) +- stfd %f5, 128+(4*8)(%r1) +- stfd %f6, 128+(5*8)(%r1) +- stfd %f7, 128+(6*8)(%r1) +- stfd %f8, 128+(7*8)(%r1) +- stfd %f9, 128+(8*8)(%r1) +- stfd %f10, 128+(9*8)(%r1) +- stfd %f11, 128+(10*8)(%r1) +- stfd %f12, 128+(11*8)(%r1) +- stfd %f13, 128+(12*8)(%r1) +- +- # set up registers for the routine that actually does the work + # get the context pointer from the trampoline +- mr %r3, %r11 +- +- # now load up the pointer to the result storage +- addi %r4, %r1, 112 +- +- # now load up the pointer to the parameter save area +- # in the previous frame +- addi %r5, %r1, 240 + 48 +- +- # now load up the pointer to the saved fpr registers */ +- addi %r6, %r1, 128 ++ mr %r3, %r11 + + # make the call +-#ifdef _CALL_LINUX ++# if defined _CALL_LINUX || _CALL_ELF == 2 + bl ffi_closure_helper_LINUX64 +-#else ++# else + bl .ffi_closure_helper_LINUX64 +-#endif ++# endif + .Lret: + + # now r3 contains the return type +@@ -112,10 +163,12 @@ + + # look up the proper starting point in table + # by using return type as offset ++ ld %r0, STACKFRAME+16(%r1) ++ cmpldi %r3, FFI_V2_TYPE_SMALL_STRUCT ++ bge .Lsmall + mflr %r4 # move address of .Lret to r4 + sldi %r3, %r3, 4 # now multiply return type by 16 + addi %r4, %r4, .Lret_type0 - .Lret +- ld %r0, 240+16(%r1) + add %r3, %r3, %r4 # add contents of table to table address + mtctr %r3 + bctr # jump to it +@@ -128,89 +181,175 @@ + .Lret_type0: + # case FFI_TYPE_VOID + mtlr %r0 +- addi %r1, %r1, 240 ++ addi %r1, %r1, STACKFRAME + blr + nop + # case FFI_TYPE_INT +- lwa %r3, 112+4(%r1) ++# ifdef __LITTLE_ENDIAN__ ++ lwa %r3, RETVAL+0(%r1) ++# else ++ lwa %r3, RETVAL+4(%r1) ++# endif + mtlr %r0 +- addi %r1, %r1, 240 ++ addi %r1, %r1, STACKFRAME + blr + # case FFI_TYPE_FLOAT +- lfs %f1, 112+0(%r1) ++ lfs %f1, RETVAL+0(%r1) + mtlr %r0 +- addi %r1, %r1, 240 ++ addi %r1, %r1, STACKFRAME + blr + # case FFI_TYPE_DOUBLE +- lfd %f1, 112+0(%r1) ++ lfd %f1, RETVAL+0(%r1) + mtlr %r0 +- addi %r1, %r1, 240 ++ addi %r1, %r1, STACKFRAME + blr + # case FFI_TYPE_LONGDOUBLE +- lfd %f1, 112+0(%r1) ++ lfd %f1, RETVAL+0(%r1) + mtlr %r0 +- lfd %f2, 112+8(%r1) ++ lfd %f2, RETVAL+8(%r1) + b .Lfinish + # case FFI_TYPE_UINT8 +- lbz %r3, 112+7(%r1) ++# ifdef __LITTLE_ENDIAN__ ++ lbz %r3, RETVAL+0(%r1) ++# else ++ lbz %r3, RETVAL+7(%r1) ++# endif + mtlr %r0 +- addi %r1, %r1, 240 ++ addi %r1, %r1, STACKFRAME + blr + # case FFI_TYPE_SINT8 +- lbz %r3, 112+7(%r1) ++# ifdef __LITTLE_ENDIAN__ ++ lbz %r3, RETVAL+0(%r1) ++# else ++ lbz %r3, RETVAL+7(%r1) ++# endif + extsb %r3,%r3 + mtlr %r0 + b .Lfinish + # case FFI_TYPE_UINT16 +- lhz %r3, 112+6(%r1) ++# ifdef __LITTLE_ENDIAN__ ++ lhz %r3, RETVAL+0(%r1) ++# else ++ lhz %r3, RETVAL+6(%r1) ++# endif + mtlr %r0 + .Lfinish: +- addi %r1, %r1, 240 ++ addi %r1, %r1, STACKFRAME + blr + # case FFI_TYPE_SINT16 +- lha %r3, 112+6(%r1) ++# ifdef __LITTLE_ENDIAN__ ++ lha %r3, RETVAL+0(%r1) ++# else ++ lha %r3, RETVAL+6(%r1) ++# endif + mtlr %r0 +- addi %r1, %r1, 240 ++ addi %r1, %r1, STACKFRAME + blr + # case FFI_TYPE_UINT32 +- lwz %r3, 112+4(%r1) ++# ifdef __LITTLE_ENDIAN__ ++ lwz %r3, RETVAL+0(%r1) ++# else ++ lwz %r3, RETVAL+4(%r1) ++# endif + mtlr %r0 +- addi %r1, %r1, 240 ++ addi %r1, %r1, STACKFRAME + blr + # case FFI_TYPE_SINT32 +- lwa %r3, 112+4(%r1) ++# ifdef __LITTLE_ENDIAN__ ++ lwa %r3, RETVAL+0(%r1) ++# else ++ lwa %r3, RETVAL+4(%r1) ++# endif + mtlr %r0 +- addi %r1, %r1, 240 ++ addi %r1, %r1, STACKFRAME + blr + # case FFI_TYPE_UINT64 +- ld %r3, 112+0(%r1) ++ ld %r3, RETVAL+0(%r1) + mtlr %r0 +- addi %r1, %r1, 240 ++ addi %r1, %r1, STACKFRAME + blr + # case FFI_TYPE_SINT64 +- ld %r3, 112+0(%r1) ++ ld %r3, RETVAL+0(%r1) + mtlr %r0 +- addi %r1, %r1, 240 ++ addi %r1, %r1, STACKFRAME + blr + # case FFI_TYPE_STRUCT + mtlr %r0 +- addi %r1, %r1, 240 ++ addi %r1, %r1, STACKFRAME + blr + nop + # case FFI_TYPE_POINTER +- ld %r3, 112+0(%r1) ++ ld %r3, RETVAL+0(%r1) + mtlr %r0 +- addi %r1, %r1, 240 ++ addi %r1, %r1, STACKFRAME + blr +-# esac ++# case FFI_V2_TYPE_FLOAT_HOMOG ++ lfs %f1, RETVAL+0(%r1) ++ lfs %f2, RETVAL+4(%r1) ++ lfs %f3, RETVAL+8(%r1) ++ b .Lmorefloat ++# case FFI_V2_TYPE_DOUBLE_HOMOG ++ lfd %f1, RETVAL+0(%r1) ++ lfd %f2, RETVAL+8(%r1) ++ lfd %f3, RETVAL+16(%r1) ++ lfd %f4, RETVAL+24(%r1) ++ mtlr %r0 ++ lfd %f5, RETVAL+32(%r1) ++ lfd %f6, RETVAL+40(%r1) ++ lfd %f7, RETVAL+48(%r1) ++ lfd %f8, RETVAL+56(%r1) ++ addi %r1, %r1, STACKFRAME ++ blr ++.Lmorefloat: ++ lfs %f4, RETVAL+12(%r1) ++ mtlr %r0 ++ lfs %f5, RETVAL+16(%r1) ++ lfs %f6, RETVAL+20(%r1) ++ lfs %f7, RETVAL+24(%r1) ++ lfs %f8, RETVAL+28(%r1) ++ addi %r1, %r1, STACKFRAME ++ blr ++.Lsmall: ++# ifdef __LITTLE_ENDIAN__ ++ ld %r3,RETVAL+0(%r1) ++ mtlr %r0 ++ ld %r4,RETVAL+8(%r1) ++ addi %r1, %r1, STACKFRAME ++ blr ++# else ++ # A struct smaller than a dword is returned in the low bits of r3 ++ # ie. right justified. Larger structs are passed left justified ++ # in r3 and r4. The return value area on the stack will have ++ # the structs as they are usually stored in memory. ++ cmpldi %r3, FFI_V2_TYPE_SMALL_STRUCT + 7 # size 8 bytes? ++ neg %r5, %r3 ++ ld %r3,RETVAL+0(%r1) ++ blt .Lsmalldown ++ mtlr %r0 ++ ld %r4,RETVAL+8(%r1) ++ addi %r1, %r1, STACKFRAME ++ blr ++.Lsmalldown: ++ addi %r5, %r5, FFI_V2_TYPE_SMALL_STRUCT + 7 ++ mtlr %r0 ++ sldi %r5, %r5, 3 ++ addi %r1, %r1, STACKFRAME ++ srd %r3, %r3, %r5 ++ blr ++# endif ++ + .LFE1: + .long 0 + .byte 0,12,0,1,128,0,0,0 +-#ifdef _CALL_LINUX ++# if _CALL_ELF == 2 ++ .size ffi_closure_LINUX64,.-ffi_closure_LINUX64 ++# else ++# ifdef _CALL_LINUX + .size ffi_closure_LINUX64,.-.L.ffi_closure_LINUX64 +-#else ++# else + .size .ffi_closure_LINUX64,.-.ffi_closure_LINUX64 +-#endif ++# endif ++# endif + + .section .eh_frame,EH_FRAME_FLAGS,@progbits + .Lframe1: +@@ -239,14 +378,14 @@ + .byte 0x2 # DW_CFA_advance_loc1 + .byte .LCFI0-.LFB1 + .byte 0xe # DW_CFA_def_cfa_offset +- .uleb128 240 ++ .uleb128 STACKFRAME + .byte 0x11 # DW_CFA_offset_extended_sf + .uleb128 0x41 + .sleb128 -2 + .align 3 + .LEFDE1: ++ ++# if defined __ELF__ && defined __linux__ ++ .section .note.GNU-stack,"",@progbits ++# endif + #endif +- +-#if defined __ELF__ && defined __linux__ +- .section .note.GNU-stack,"",@progbits +-#endif +diff -r c0e311e010fc Modules/_ctypes/libffi/src/powerpc/ppc_closure.S +--- a/Modules/_ctypes/libffi/src/powerpc/ppc_closure.S ++++ b/Modules/_ctypes/libffi/src/powerpc/ppc_closure.S +@@ -31,7 +31,7 @@ + + .file "ppc_closure.S" + +-#ifndef __powerpc64__ ++#ifndef POWERPC64 + + ENTRY(ffi_closure_SYSV) + .LFB1: +@@ -159,25 +159,41 @@ + #endif + + # case FFI_TYPE_UINT8 ++#ifdef __LITTLE_ENDIAN__ ++ lbz %r3,112+0(%r1) ++#else + lbz %r3,112+3(%r1) ++#endif + mtlr %r0 + addi %r1,%r1,144 + blr + + # case FFI_TYPE_SINT8 ++#ifdef __LITTLE_ENDIAN__ ++ lbz %r3,112+0(%r1) ++#else + lbz %r3,112+3(%r1) ++#endif + extsb %r3,%r3 + mtlr %r0 + b .Lfinish + + # case FFI_TYPE_UINT16 ++#ifdef __LITTLE_ENDIAN__ ++ lhz %r3,112+0(%r1) ++#else + lhz %r3,112+2(%r1) ++#endif + mtlr %r0 + addi %r1,%r1,144 + blr + + # case FFI_TYPE_SINT16 ++#ifdef __LITTLE_ENDIAN__ ++ lha %r3,112+0(%r1) ++#else + lha %r3,112+2(%r1) ++#endif + mtlr %r0 + addi %r1,%r1,144 + blr +@@ -222,7 +238,7 @@ + lwz %r3,112+0(%r1) + lwz %r4,112+4(%r1) + lwz %r5,112+8(%r1) +- bl .Luint128 ++ b .Luint128 + + # The return types below are only used when the ABI type is FFI_SYSV. + # case FFI_SYSV_TYPE_SMALL_STRUCT + 1. One byte struct. +@@ -239,9 +255,15 @@ + + # case FFI_SYSV_TYPE_SMALL_STRUCT + 3. Three byte struct. + lwz %r3,112+0(%r1) ++#ifdef __LITTLE_ENDIAN__ ++ mtlr %r0 ++ addi %r1,%r1,144 ++ blr ++#else + srwi %r3,%r3,8 + mtlr %r0 + b .Lfinish ++#endif + + # case FFI_SYSV_TYPE_SMALL_STRUCT + 4. Four byte struct. + lwz %r3,112+0(%r1) +@@ -252,20 +274,35 @@ + # case FFI_SYSV_TYPE_SMALL_STRUCT + 5. Five byte struct. + lwz %r3,112+0(%r1) + lwz %r4,112+4(%r1) ++#ifdef __LITTLE_ENDIAN__ ++ mtlr %r0 ++ b .Lfinish ++#else + li %r5,24 + b .Lstruct567 ++#endif + + # case FFI_SYSV_TYPE_SMALL_STRUCT + 6. Six byte struct. + lwz %r3,112+0(%r1) + lwz %r4,112+4(%r1) ++#ifdef __LITTLE_ENDIAN__ ++ mtlr %r0 ++ b .Lfinish ++#else + li %r5,16 + b .Lstruct567 ++#endif + + # case FFI_SYSV_TYPE_SMALL_STRUCT + 7. Seven byte struct. + lwz %r3,112+0(%r1) + lwz %r4,112+4(%r1) ++#ifdef __LITTLE_ENDIAN__ ++ mtlr %r0 ++ b .Lfinish ++#else + li %r5,8 + b .Lstruct567 ++#endif + + # case FFI_SYSV_TYPE_SMALL_STRUCT + 8. Eight byte struct. + lwz %r3,112+0(%r1) +@@ -273,6 +310,7 @@ + mtlr %r0 + b .Lfinish + ++#ifndef __LITTLE_ENDIAN__ + .Lstruct567: + subfic %r6,%r5,32 + srw %r4,%r4,%r5 +@@ -282,13 +320,14 @@ + mtlr %r0 + addi %r1,%r1,144 + blr ++#endif + + .Luint128: + lwz %r6,112+12(%r1) + mtlr %r0 + addi %r1,%r1,144 + blr +- ++ + END(ffi_closure_SYSV) + + .section ".eh_frame",EH_FRAME_FLAGS,@progbits +@@ -339,8 +378,7 @@ + .align 2 + .LEFDE1: + +-#endif +- + #if defined __ELF__ && defined __linux__ + .section .note.GNU-stack,"",@progbits + #endif ++#endif +diff -r c0e311e010fc Modules/_ctypes/libffi/src/powerpc/sysv.S +--- a/Modules/_ctypes/libffi/src/powerpc/sysv.S ++++ b/Modules/_ctypes/libffi/src/powerpc/sysv.S +@@ -30,7 +30,7 @@ + #include + #include + +-#ifndef __powerpc64__ ++#ifndef POWERPC64 + .globl ffi_prep_args_SYSV + ENTRY(ffi_call_SYSV) + .LFB1: +@@ -142,19 +142,14 @@ + #endif + + L(small_struct_return_value): +- extrwi %r6,%r31,2,19 /* number of bytes padding = shift/8 */ +- mtcrf 0x02,%r31 /* copy flags to cr[24:27] (cr6) */ +- extrwi %r5,%r31,5,19 /* r5 <- number of bits of padding */ +- subfic %r6,%r6,4 /* r6 <- number of useful bytes in r3 */ +- bf- 25,L(done_return_value) /* struct in r3 ? if not, done. */ +-/* smst_one_register: */ +- slw %r3,%r3,%r5 /* Left-justify value in r3 */ +- mtxer %r6 /* move byte count to XER ... */ +- stswx %r3,0,%r30 /* ... and store that many bytes */ +- bf+ 26,L(done_return_value) /* struct in r3:r4 ? */ +- add %r6,%r6,%r30 /* adjust pointer */ +- stswi %r4,%r6,4 /* store last four bytes */ +- b L(done_return_value) ++ /* ++ * The C code always allocates a properly-aligned 8-byte bounce ++ * buffer to make this assembly code very simple. Just write out ++ * r3 and r4 to the buffer to allow the C code to handle the rest. ++ */ ++ stw %r3, 0(%r30) ++ stw %r4, 4(%r30) ++ b L(done_return_value) + + .LFE1: + END(ffi_call_SYSV) +@@ -218,8 +213,8 @@ + .uleb128 0x1c + .align 2 + .LEFDE1: +-#endif + + #if defined __ELF__ && defined __linux__ + .section .note.GNU-stack,"",@progbits + #endif ++#endif +diff -r c0e311e010fc Modules/_ctypes/libffi/src/prep_cif.c +--- a/Modules/_ctypes/libffi/src/prep_cif.c ++++ b/Modules/_ctypes/libffi/src/prep_cif.c +@@ -76,6 +76,13 @@ + total size of 3*sizeof(long). */ + arg->size = ALIGN (arg->size, arg->alignment); + ++ /* On some targets, the ABI defines that structures have an additional ++ alignment beyond the "natural" one based on their elements. */ ++#ifdef FFI_AGGREGATE_ALIGNMENT ++ if (FFI_AGGREGATE_ALIGNMENT > arg->alignment) ++ arg->alignment = FFI_AGGREGATE_ALIGNMENT; ++#endif ++ + if (arg->size == 0) + return FFI_BAD_TYPEDEF; + else +@@ -111,13 +118,8 @@ + FFI_ASSERT((!isvariadic) || (nfixedargs >= 1)); + FFI_ASSERT(nfixedargs <= ntotalargs); + +-#ifndef X86_WIN32 + if (! (abi > FFI_FIRST_ABI && abi < FFI_LAST_ABI)) + return FFI_BAD_ABI; +-#else +- if (! (abi > FFI_FIRST_ABI && abi < FFI_LAST_ABI || abi == FFI_THISCALL)) +- return FFI_BAD_ABI; +-#endif + + cif->abi = abi; + cif->arg_types = atypes; +@@ -126,6 +128,10 @@ + + cif->flags = 0; + ++#if HAVE_LONG_DOUBLE_VARIANT ++ ffi_prep_types (abi); ++#endif ++ + /* Initialize the return type if necessary */ + if ((cif->rtype->size == 0) && (initialize_aggregate(cif->rtype) != FFI_OK)) + return FFI_BAD_TYPEDEF; +@@ -146,7 +152,9 @@ + #ifdef XTENSA + && (cif->rtype->size > 16) + #endif +- ++#ifdef NIOS2 ++ && (cif->rtype->size > 8) ++#endif + ) + bytes = STACK_ARG_SIZE(sizeof(void*)); + #endif +@@ -174,7 +182,7 @@ + { + /* Add any padding if necessary */ + if (((*ptr)->alignment - 1) & bytes) +- bytes = ALIGN(bytes, (*ptr)->alignment); ++ bytes = (unsigned)ALIGN(bytes, (*ptr)->alignment); + + #ifdef TILE + if (bytes < 10 * FFI_SIZEOF_ARG && +diff -r c0e311e010fc Modules/_ctypes/libffi/src/sh/ffi.c +--- a/Modules/_ctypes/libffi/src/sh/ffi.c ++++ b/Modules/_ctypes/libffi/src/sh/ffi.c +@@ -41,7 +41,7 @@ + #define STRUCT_VALUE_ADDRESS_WITH_ARG 0 + #endif + +-/* If the structure has essentialy an unique element, return its type. */ ++/* If the structure has essentially an unique element, return its type. */ + static int + simple_type (ffi_type *arg) + { +diff -r c0e311e010fc Modules/_ctypes/libffi/src/tile/tile.S +--- a/Modules/_ctypes/libffi/src/tile/tile.S ++++ b/Modules/_ctypes/libffi/src/tile/tile.S +@@ -60,7 +60,7 @@ + void (*fnaddr)(void)); + + On entry, REG_ARGS contain the outgoing register values, +- and STACK_ARGS containts STACK_ARG_BYTES of additional values ++ and STACK_ARGS contains STACK_ARG_BYTES of additional values + to be passed on the stack. If STACK_ARG_BYTES is zero, then + STACK_ARGS is ignored. + +diff -r c0e311e010fc Modules/_ctypes/libffi/src/types.c +--- a/Modules/_ctypes/libffi/src/types.c ++++ b/Modules/_ctypes/libffi/src/types.c +@@ -44,6 +44,17 @@ + id, NULL \ + } + ++#define FFI_NONCONST_TYPEDEF(name, type, id) \ ++struct struct_align_##name { \ ++ char c; \ ++ type x; \ ++}; \ ++ffi_type ffi_type_##name = { \ ++ sizeof(type), \ ++ offsetof(struct struct_align_##name, x), \ ++ id, NULL \ ++} ++ + /* Size and alignment are fake here. They must not be 0. */ + const ffi_type ffi_type_void = { + 1, 1, FFI_TYPE_VOID, NULL +@@ -73,5 +84,9 @@ + # endif + const ffi_type ffi_type_longdouble = { 16, 16, 4, NULL }; + #elif FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE ++# if HAVE_LONG_DOUBLE_VARIANT ++FFI_NONCONST_TYPEDEF(longdouble, long double, FFI_TYPE_LONGDOUBLE); ++# else + FFI_TYPEDEF(longdouble, long double, FFI_TYPE_LONGDOUBLE); ++# endif + #endif +diff -r c0e311e010fc Modules/_ctypes/libffi/src/vax/elfbsd.S +--- /dev/null ++++ b/Modules/_ctypes/libffi/src/vax/elfbsd.S +@@ -0,0 +1,195 @@ ++/* ++ * Copyright (c) 2013 Miodrag Vallat. ++ * ++ * Permission is hereby granted, free of charge, to any person obtaining ++ * a copy of this software and associated documentation files (the ++ * ``Software''), to deal in the Software without restriction, including ++ * without limitation the rights to use, copy, modify, merge, publish, ++ * distribute, sublicense, and/or sell copies of the Software, and to ++ * permit persons to whom the Software is furnished to do so, subject to ++ * the following conditions: ++ * ++ * The above copyright notice and this permission notice shall be included ++ * in all copies or substantial portions of the Software. ++ * ++ * THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, ++ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF ++ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. ++ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY ++ * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, ++ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE ++ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ++ */ ++ ++/* ++ * vax Foreign Function Interface ++ */ ++ ++#define LIBFFI_ASM ++#include ++#include ++ ++ .text ++ ++/* ++ * void * %r0 ++ * ffi_call_elfbsd(extended_cif *ecif, 4(%ap) ++ * unsigned bytes, 8(%ap) ++ * unsigned flags, 12(%ap) ++ * void *rvalue, 16(%ap) ++ * void (*fn)()); 20(%ap) ++ */ ++ .globl ffi_call_elfbsd ++ .type ffi_call_elfbsd,@function ++ .align 2 ++ffi_call_elfbsd: ++ .word 0x00c # save R2 and R3 ++ ++ # Allocate stack space for the args ++ subl2 8(%ap), %sp ++ ++ # Call ffi_prep_args ++ pushl %sp ++ pushl 4(%ap) ++ calls $2, ffi_prep_args ++ ++ # Get function pointer ++ movl 20(%ap), %r1 ++ ++ # Build a CALLS frame ++ ashl $-2, 8(%ap), %r0 ++ pushl %r0 # argument stack usage ++ movl %sp, %r0 # future %ap ++ # saved registers ++ bbc $11, 0(%r1), 1f ++ pushl %r11 ++1: bbc $10, 0(%r1), 1f ++ pushl %r10 ++1: bbc $9, 0(%r1), 1f ++ pushl %r9 ++1: bbc $8, 0(%r1), 1f ++ pushl %r8 ++1: bbc $7, 0(%r1), 1f ++ pushl %r7 ++1: bbc $6, 0(%r1), 1f ++ pushl %r6 ++1: bbc $5, 0(%r1), 1f ++ pushl %r5 ++1: bbc $4, 0(%r1), 1f ++ pushl %r4 ++1: bbc $3, 0(%r1), 1f ++ pushl %r3 ++1: bbc $2, 0(%r1), 1f ++ pushl %r2 ++1: ++ pushal 9f ++ pushl %fp ++ pushl %ap ++ movl 16(%ap), %r3 # struct return address, if needed ++ movl %r0, %ap ++ movzwl 4(%fp), %r0 # previous PSW, without the saved registers mask ++ bisl2 $0x20000000, %r0 # calls frame ++ movzwl 0(%r1), %r2 ++ bicw2 $0xf003, %r2 # only keep R11-R2 ++ ashl $16, %r2, %r2 ++ bisl2 %r2, %r0 # saved register mask of the called function ++ pushl %r0 ++ pushl $0 ++ movl %sp, %fp ++ ++ # Invoke the function ++ pushal 2(%r1) # skip procedure entry mask ++ movl %r3, %r1 ++ bicpsw $0x000f ++ rsb ++ ++9: ++ # Copy return value if necessary ++ tstl 16(%ap) ++ jeql 9f ++ movl 16(%ap), %r2 ++ ++ bbc $0, 12(%ap), 1f # CIF_FLAGS_CHAR ++ movb %r0, 0(%r2) ++ brb 9f ++1: ++ bbc $1, 12(%ap), 1f # CIF_FLAGS_SHORT ++ movw %r0, 0(%r2) ++ brb 9f ++1: ++ bbc $2, 12(%ap), 1f # CIF_FLAGS_INT ++ movl %r0, 0(%r2) ++ brb 9f ++1: ++ bbc $3, 12(%ap), 1f # CIF_FLAGS_DINT ++ movq %r0, 0(%r2) ++ brb 9f ++1: ++ movl %r1, %r0 # might have been a struct ++ #brb 9f ++ ++9: ++ ret ++ ++/* ++ * ffi_closure_elfbsd(void); ++ * invoked with %r0: ffi_closure *closure ++ */ ++ .globl ffi_closure_elfbsd ++ .type ffi_closure_elfbsd, @function ++ .align 2 ++ffi_closure_elfbsd: ++ .word 0 ++ ++ # Allocate room on stack for return value ++ subl2 $8, %sp ++ ++ # Invoke the closure function ++ pushal 4(%ap) # calling stack ++ pushal 4(%sp) # return value ++ pushl %r0 # closure ++ calls $3, ffi_closure_elfbsd_inner ++ ++ # Copy return value if necessary ++ bitb $1, %r0 # CIF_FLAGS_CHAR ++ beql 1f ++ movb 0(%sp), %r0 ++ brb 9f ++1: ++ bitb $2, %r0 # CIF_FLAGS_SHORT ++ beql 1f ++ movw 0(%sp), %r0 ++ brb 9f ++1: ++ bitb $4, %r0 # CIF_FLAGS_INT ++ beql 1f ++ movl 0(%sp), %r0 ++ brb 9f ++1: ++ bitb $8, %r0 # CIF_FLAGS_DINT ++ beql 1f ++ movq 0(%sp), %r0 ++ #brb 9f ++1: ++ ++9: ++ ret ++ ++/* ++ * ffi_closure_struct_elfbsd(void); ++ * invoked with %r0: ffi_closure *closure ++ * %r1: struct return address ++ */ ++ .globl ffi_closure_struct_elfbsd ++ .type ffi_closure_struct_elfbsd, @function ++ .align 2 ++ffi_closure_struct_elfbsd: ++ .word 0 ++ ++ # Invoke the closure function ++ pushal 4(%ap) # calling stack ++ pushl %r1 # return value ++ pushl %r0 # closure ++ calls $3, ffi_closure_elfbsd_inner ++ ++ ret +diff -r c0e311e010fc Modules/_ctypes/libffi/src/vax/ffi.c +--- /dev/null ++++ b/Modules/_ctypes/libffi/src/vax/ffi.c +@@ -0,0 +1,276 @@ ++/* ++ * Copyright (c) 2013 Miodrag Vallat. ++ * ++ * Permission is hereby granted, free of charge, to any person obtaining ++ * a copy of this software and associated documentation files (the ++ * ``Software''), to deal in the Software without restriction, including ++ * without limitation the rights to use, copy, modify, merge, publish, ++ * distribute, sublicense, and/or sell copies of the Software, and to ++ * permit persons to whom the Software is furnished to do so, subject to ++ * the following conditions: ++ * ++ * The above copyright notice and this permission notice shall be included ++ * in all copies or substantial portions of the Software. ++ * ++ * THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, ++ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF ++ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. ++ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY ++ * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, ++ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE ++ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ++ */ ++ ++/* ++ * vax Foreign Function Interface ++ * ++ * This file attempts to provide all the FFI entry points which can reliably ++ * be implemented in C. ++ */ ++ ++#include ++#include ++ ++#include ++#include ++ ++#define CIF_FLAGS_CHAR 1 /* for struct only */ ++#define CIF_FLAGS_SHORT 2 /* for struct only */ ++#define CIF_FLAGS_INT 4 ++#define CIF_FLAGS_DINT 8 ++ ++/* ++ * Foreign Function Interface API ++ */ ++ ++void ffi_call_elfbsd (extended_cif *, unsigned, unsigned, void *, ++ void (*) ()); ++void *ffi_prep_args (extended_cif *ecif, void *stack); ++ ++void * ++ffi_prep_args (extended_cif *ecif, void *stack) ++{ ++ unsigned int i; ++ void **p_argv; ++ char *argp; ++ ffi_type **p_arg; ++ void *struct_value_ptr; ++ ++ argp = stack; ++ ++ if (ecif->cif->rtype->type == FFI_TYPE_STRUCT ++ && !ecif->cif->flags) ++ struct_value_ptr = ecif->rvalue; ++ else ++ struct_value_ptr = NULL; ++ ++ p_argv = ecif->avalue; ++ ++ for (i = ecif->cif->nargs, p_arg = ecif->cif->arg_types; ++ i != 0; ++ i--, p_arg++) ++ { ++ size_t z; ++ ++ z = (*p_arg)->size; ++ if (z < sizeof (int)) ++ { ++ switch ((*p_arg)->type) ++ { ++ case FFI_TYPE_SINT8: ++ *(signed int *) argp = (signed int) *(SINT8 *) *p_argv; ++ break; ++ ++ case FFI_TYPE_UINT8: ++ *(unsigned int *) argp = (unsigned int) *(UINT8 *) *p_argv; ++ break; ++ ++ case FFI_TYPE_SINT16: ++ *(signed int *) argp = (signed int) *(SINT16 *) *p_argv; ++ break; ++ ++ case FFI_TYPE_UINT16: ++ *(unsigned int *) argp = (unsigned int) *(UINT16 *) *p_argv; ++ break; ++ ++ case FFI_TYPE_STRUCT: ++ memcpy (argp, *p_argv, z); ++ break; ++ ++ default: ++ FFI_ASSERT (0); ++ } ++ z = sizeof (int); ++ } ++ else ++ { ++ memcpy (argp, *p_argv, z); ++ ++ /* Align if necessary. */ ++ if ((sizeof(int) - 1) & z) ++ z = ALIGN(z, sizeof(int)); ++ } ++ ++ p_argv++; ++ argp += z; ++ } ++ ++ return struct_value_ptr; ++} ++ ++ffi_status ++ffi_prep_cif_machdep (ffi_cif *cif) ++{ ++ /* Set the return type flag */ ++ switch (cif->rtype->type) ++ { ++ case FFI_TYPE_VOID: ++ cif->flags = 0; ++ break; ++ ++ case FFI_TYPE_STRUCT: ++ if (cif->rtype->elements[0]->type == FFI_TYPE_STRUCT && ++ cif->rtype->elements[1]) ++ { ++ cif->flags = 0; ++ break; ++ } ++ ++ if (cif->rtype->size == sizeof (char)) ++ cif->flags = CIF_FLAGS_CHAR; ++ else if (cif->rtype->size == sizeof (short)) ++ cif->flags = CIF_FLAGS_SHORT; ++ else if (cif->rtype->size == sizeof (int)) ++ cif->flags = CIF_FLAGS_INT; ++ else if (cif->rtype->size == 2 * sizeof (int)) ++ cif->flags = CIF_FLAGS_DINT; ++ else ++ cif->flags = 0; ++ break; ++ ++ default: ++ if (cif->rtype->size <= sizeof (int)) ++ cif->flags = CIF_FLAGS_INT; ++ else ++ cif->flags = CIF_FLAGS_DINT; ++ break; ++ } ++ ++ return FFI_OK; ++} ++ ++void ++ffi_call (ffi_cif *cif, void (*fn) (), void *rvalue, void **avalue) ++{ ++ extended_cif ecif; ++ ++ ecif.cif = cif; ++ ecif.avalue = avalue; ++ ++ /* If the return value is a struct and we don't have a return value ++ address then we need to make one. */ ++ ++ if (rvalue == NULL ++ && cif->rtype->type == FFI_TYPE_STRUCT ++ && cif->flags == 0) ++ ecif.rvalue = alloca (cif->rtype->size); ++ else ++ ecif.rvalue = rvalue; ++ ++ switch (cif->abi) ++ { ++ case FFI_ELFBSD: ++ ffi_call_elfbsd (&ecif, cif->bytes, cif->flags, ecif.rvalue, fn); ++ break; ++ ++ default: ++ FFI_ASSERT (0); ++ break; ++ } ++} ++ ++/* ++ * Closure API ++ */ ++ ++void ffi_closure_elfbsd (void); ++void ffi_closure_struct_elfbsd (void); ++unsigned int ffi_closure_elfbsd_inner (ffi_closure *, void *, char *); ++ ++static void ++ffi_prep_closure_elfbsd (ffi_cif *cif, void **avalue, char *stackp) ++{ ++ unsigned int i; ++ void **p_argv; ++ ffi_type **p_arg; ++ ++ p_argv = avalue; ++ ++ for (i = cif->nargs, p_arg = cif->arg_types; i != 0; i--, p_arg++) ++ { ++ size_t z; ++ ++ z = (*p_arg)->size; ++ *p_argv = stackp; ++ ++ /* Align if necessary */ ++ if ((sizeof (int) - 1) & z) ++ z = ALIGN(z, sizeof (int)); ++ ++ p_argv++; ++ stackp += z; ++ } ++} ++ ++unsigned int ++ffi_closure_elfbsd_inner (ffi_closure *closure, void *resp, char *stack) ++{ ++ ffi_cif *cif; ++ void **arg_area; ++ ++ cif = closure->cif; ++ arg_area = (void **) alloca (cif->nargs * sizeof (void *)); ++ ++ ffi_prep_closure_elfbsd (cif, arg_area, stack); ++ ++ (closure->fun) (cif, resp, arg_area, closure->user_data); ++ ++ return cif->flags; ++} ++ ++ffi_status ++ffi_prep_closure_loc (ffi_closure *closure, ffi_cif *cif, ++ void (*fun)(ffi_cif *, void *, void **, void *), ++ void *user_data, void *codeloc) ++{ ++ char *tramp = (char *) codeloc; ++ void *fn; ++ ++ FFI_ASSERT (cif->abi == FFI_ELFBSD); ++ ++ /* entry mask */ ++ *(unsigned short *)(tramp + 0) = 0x0000; ++ /* movl #closure, r0 */ ++ tramp[2] = 0xd0; ++ tramp[3] = 0x8f; ++ *(unsigned int *)(tramp + 4) = (unsigned int) closure; ++ tramp[8] = 0x50; ++ ++ if (cif->rtype->type == FFI_TYPE_STRUCT ++ && !cif->flags) ++ fn = &ffi_closure_struct_elfbsd; ++ else ++ fn = &ffi_closure_elfbsd; ++ ++ /* jmpl #fn */ ++ tramp[9] = 0x17; ++ tramp[10] = 0xef; ++ *(unsigned int *)(tramp + 11) = (unsigned int)fn + 2 - ++ (unsigned int)tramp - 9 - 6; ++ ++ closure->cif = cif; ++ closure->user_data = user_data; ++ closure->fun = fun; ++ ++ return FFI_OK; ++} +diff -r c0e311e010fc Modules/_ctypes/libffi/src/vax/ffitarget.h +--- /dev/null ++++ b/Modules/_ctypes/libffi/src/vax/ffitarget.h +@@ -0,0 +1,49 @@ ++/* ++ * Copyright (c) 2013 Miodrag Vallat. ++ * ++ * Permission is hereby granted, free of charge, to any person obtaining ++ * a copy of this software and associated documentation files (the ++ * ``Software''), to deal in the Software without restriction, including ++ * without limitation the rights to use, copy, modify, merge, publish, ++ * distribute, sublicense, and/or sell copies of the Software, and to ++ * permit persons to whom the Software is furnished to do so, subject to ++ * the following conditions: ++ * ++ * The above copyright notice and this permission notice shall be included ++ * in all copies or substantial portions of the Software. ++ * ++ * THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, ++ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF ++ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. ++ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY ++ * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, ++ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE ++ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ++ */ ++ ++/* ++ * vax Foreign Function Interface ++ */ ++ ++#ifndef LIBFFI_TARGET_H ++#define LIBFFI_TARGET_H ++ ++#ifndef LIBFFI_ASM ++typedef unsigned long ffi_arg; ++typedef signed long ffi_sarg; ++ ++typedef enum ffi_abi { ++ FFI_FIRST_ABI = 0, ++ FFI_ELFBSD, ++ FFI_DEFAULT_ABI = FFI_ELFBSD, ++ FFI_LAST_ABI = FFI_DEFAULT_ABI + 1 ++} ffi_abi; ++#endif ++ ++/* ---- Definitions for closures ----------------------------------------- */ ++ ++#define FFI_CLOSURES 1 ++#define FFI_TRAMPOLINE_SIZE 15 ++#define FFI_NATIVE_RAW_API 0 ++ ++#endif +diff -r c0e311e010fc Modules/_ctypes/libffi/src/x86/ffi.c +--- a/Modules/_ctypes/libffi/src/x86/ffi.c ++++ b/Modules/_ctypes/libffi/src/x86/ffi.c +@@ -39,16 +39,18 @@ + + #include + ++ + /* ffi_prep_args is called by the assembly routine once stack space + has been allocated for the function's arguments */ + ++void ffi_prep_args(char *stack, extended_cif *ecif); + void ffi_prep_args(char *stack, extended_cif *ecif) + { + register unsigned int i; + register void **p_argv; + register char *argp; + register ffi_type **p_arg; +-#ifdef X86_WIN32 ++#ifndef X86_WIN64 + size_t p_stack_args[2]; + void *p_stack_data[2]; + char *argp2 = stack; +@@ -67,7 +69,7 @@ + ) + { + *(void **) argp = ecif->rvalue; +-#ifdef X86_WIN32 ++#ifndef X86_WIN64 + /* For fastcall/thiscall this is first register-passed + argument. */ + if (cabi == FFI_THISCALL || cabi == FFI_FASTCALL) +@@ -153,7 +155,7 @@ + memcpy(argp, *p_argv, z); + } + +-#ifdef X86_WIN32 ++#ifndef X86_WIN64 + /* For thiscall/fastcall convention register-passed arguments + are the first two none-floating-point arguments with a size + smaller or equal to sizeof (void*). */ +@@ -178,7 +180,7 @@ + #endif + } + +-#ifdef X86_WIN32 ++#ifndef X86_WIN64 + /* We need to move the register-passed arguments for thiscall/fastcall + on top of stack, so that those can be moved to registers ecx/edx by + call-handler. */ +@@ -307,7 +309,7 @@ + { + if (((*ptr)->alignment - 1) & cif->bytes) + cif->bytes = ALIGN(cif->bytes, (*ptr)->alignment); +- cif->bytes += ALIGN((*ptr)->size, FFI_SIZEOF_ARG); ++ cif->bytes += (unsigned)ALIGN((*ptr)->size, FFI_SIZEOF_ARG); + } + + #ifdef X86_WIN64 +@@ -315,7 +317,12 @@ + cif->bytes += 4 * sizeof(ffi_arg); + #endif + +- cif->bytes = (cif->bytes + 15) & ~0xF; ++#ifndef X86_WIN32 ++#ifndef X86_WIN64 ++ if (cif->abi != FFI_STDCALL && cif->abi != FFI_THISCALL && cif->abi != FFI_FASTCALL) ++#endif ++ cif->bytes = (cif->bytes + 15) & ~0xF; ++#endif + + return FFI_OK; + } +@@ -324,11 +331,10 @@ + extern int + ffi_call_win64(void (*)(char *, extended_cif *), extended_cif *, + unsigned, unsigned, unsigned *, void (*fn)(void)); +-#elif defined(X86_WIN32) ++#else + extern void + ffi_call_win32(void (*)(char *, extended_cif *), extended_cif *, + unsigned, unsigned, unsigned, unsigned *, void (*fn)(void)); +-#else + extern void ffi_call_SYSV(void (*)(char *, extended_cif *), extended_cif *, + unsigned, unsigned, unsigned *, void (*fn)(void)); + #endif +@@ -370,10 +376,17 @@ + ffi_call_win64(ffi_prep_args, &ecif, cif->bytes, + cif->flags, ecif.rvalue, fn); + break; +-#elif defined(X86_WIN32) ++#else ++#ifndef X86_WIN32 + case FFI_SYSV: ++ ffi_call_SYSV(ffi_prep_args, &ecif, cif->bytes, cif->flags, ecif.rvalue, ++ fn); ++ break; ++#else ++ case FFI_SYSV: ++ case FFI_MS_CDECL: ++#endif + case FFI_STDCALL: +- case FFI_MS_CDECL: + ffi_call_win32(ffi_prep_args, &ecif, cif->abi, cif->bytes, cif->flags, + ecif.rvalue, fn); + break; +@@ -406,11 +419,6 @@ + ecif.rvalue, fn); + } + break; +-#else +- case FFI_SYSV: +- ffi_call_SYSV(ffi_prep_args, &ecif, cif->bytes, cif->flags, ecif.rvalue, +- fn); +- break; + #endif + default: + FFI_ASSERT(0); +@@ -434,12 +442,15 @@ + #ifdef X86_WIN32 + void FFI_HIDDEN ffi_closure_raw_THISCALL (ffi_raw_closure *) + __attribute__ ((regparm(1))); ++#endif ++#ifndef X86_WIN64 + void FFI_HIDDEN ffi_closure_STDCALL (ffi_closure *) + __attribute__ ((regparm(1))); + void FFI_HIDDEN ffi_closure_THISCALL (ffi_closure *) + __attribute__ ((regparm(1))); +-#endif +-#ifdef X86_WIN64 ++void FFI_HIDDEN ffi_closure_FASTCALL (ffi_closure *) ++ __attribute__ ((regparm(1))); ++#else + void FFI_HIDDEN ffi_closure_win64 (ffi_closure *); + #endif + +@@ -598,7 +609,7 @@ + *(unsigned int*) &__tramp[6] = __dis; /* jmp __fun */ \ + } + +-#define FFI_INIT_TRAMPOLINE_THISCALL(TRAMP,FUN,CTX,SIZE) \ ++#define FFI_INIT_TRAMPOLINE_RAW_THISCALL(TRAMP,FUN,CTX,SIZE) \ + { unsigned char *__tramp = (unsigned char*)(TRAMP); \ + unsigned int __fun = (unsigned int)(FUN); \ + unsigned int __ctx = (unsigned int)(CTX); \ +@@ -625,18 +636,15 @@ + *(unsigned short*) &__tramp[50] = (__size + 8); /* ret (__size + 8) */ \ + } + +-#define FFI_INIT_TRAMPOLINE_STDCALL(TRAMP,FUN,CTX,SIZE) \ ++#define FFI_INIT_TRAMPOLINE_STDCALL(TRAMP,FUN,CTX) \ + { unsigned char *__tramp = (unsigned char*)(TRAMP); \ + unsigned int __fun = (unsigned int)(FUN); \ + unsigned int __ctx = (unsigned int)(CTX); \ + unsigned int __dis = __fun - (__ctx + 10); \ +- unsigned short __size = (unsigned short)(SIZE); \ + *(unsigned char*) &__tramp[0] = 0xb8; \ + *(unsigned int*) &__tramp[1] = __ctx; /* movl __ctx, %eax */ \ + *(unsigned char *) &__tramp[5] = 0xe8; \ + *(unsigned int*) &__tramp[6] = __dis; /* call __fun */ \ +- *(unsigned char *) &__tramp[10] = 0xc2; \ +- *(unsigned short*) &__tramp[11] = __size; /* ret __size */ \ + } + + /* the cif must already be prep'ed */ +@@ -666,20 +674,25 @@ + &ffi_closure_SYSV, + (void*)codeloc); + } +-#ifdef X86_WIN32 ++ else if (cif->abi == FFI_FASTCALL) ++ { ++ FFI_INIT_TRAMPOLINE_STDCALL (&closure->tramp[0], ++ &ffi_closure_FASTCALL, ++ (void*)codeloc); ++ } + else if (cif->abi == FFI_THISCALL) + { +- FFI_INIT_TRAMPOLINE_THISCALL (&closure->tramp[0], +- &ffi_closure_THISCALL, +- (void*)codeloc, +- cif->bytes); ++ FFI_INIT_TRAMPOLINE_STDCALL (&closure->tramp[0], ++ &ffi_closure_THISCALL, ++ (void*)codeloc); + } + else if (cif->abi == FFI_STDCALL) + { + FFI_INIT_TRAMPOLINE_STDCALL (&closure->tramp[0], + &ffi_closure_STDCALL, +- (void*)codeloc, cif->bytes); ++ (void*)codeloc); + } ++#ifdef X86_WIN32 + else if (cif->abi == FFI_MS_CDECL) + { + FFI_INIT_TRAMPOLINE (&closure->tramp[0], +@@ -713,12 +726,12 @@ + { + int i; + +- if (cif->abi != FFI_SYSV) { ++ if (cif->abi != FFI_SYSV + #ifdef X86_WIN32 +- if (cif->abi != FFI_THISCALL) ++ && cif->abi != FFI_THISCALL + #endif ++ ) + return FFI_BAD_ABI; +- } + + /* we currently don't support certain kinds of arguments for raw + closures. This should be implemented by a separate assembly +@@ -741,8 +754,7 @@ + } + else if (cif->abi == FFI_THISCALL) + { +- FFI_INIT_TRAMPOLINE_THISCALL (&closure->tramp[0], &ffi_closure_raw_THISCALL, +- codeloc, cif->bytes); ++ FFI_INIT_TRAMPOLINE_RAW_THISCALL (&closure->tramp[0], &ffi_closure_raw_THISCALL, codeloc, cif->bytes); + } + #endif + closure->cif = cif; +@@ -787,10 +799,17 @@ + + switch (cif->abi) + { +-#ifdef X86_WIN32 ++#ifndef X86_WIN32 + case FFI_SYSV: ++ ffi_call_SYSV(ffi_prep_args_raw, &ecif, cif->bytes, cif->flags, ++ ecif.rvalue, fn); ++ break; ++#else ++ case FFI_SYSV: ++ case FFI_MS_CDECL: ++#endif ++#ifndef X86_WIN64 + case FFI_STDCALL: +- case FFI_MS_CDECL: + ffi_call_win32(ffi_prep_args_raw, &ecif, cif->abi, cif->bytes, cif->flags, + ecif.rvalue, fn); + break; +@@ -823,11 +842,6 @@ + ecif.rvalue, fn); + } + break; +-#else +- case FFI_SYSV: +- ffi_call_SYSV(ffi_prep_args_raw, &ecif, cif->bytes, cif->flags, +- ecif.rvalue, fn); +- break; + #endif + default: + FFI_ASSERT(0); +diff -r c0e311e010fc Modules/_ctypes/libffi/src/x86/ffi64.c +--- a/Modules/_ctypes/libffi/src/x86/ffi64.c ++++ b/Modules/_ctypes/libffi/src/x86/ffi64.c +@@ -3,8 +3,8 @@ + Copyright (c) 2011 Anthony Green + Copyright (c) 2008, 2010 Red Hat, Inc. + Copyright (c) 2002, 2007 Bo Thorsen +- +- x86-64 Foreign Function Interface ++ ++ x86-64 Foreign Function Interface + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the +@@ -39,6 +39,7 @@ + #define MAX_SSE_REGS 8 + + #if defined(__INTEL_COMPILER) ++#include "xmmintrin.h" + #define UINT128 __m128 + #else + #if defined(__SUNPRO_C) +@@ -60,7 +61,7 @@ + { + /* Registers for argument passing. */ + UINT64 gpr[MAX_GPR_REGS]; +- union big_int_union sse[MAX_SSE_REGS]; ++ union big_int_union sse[MAX_SSE_REGS]; + }; + + extern void ffi_call_unix64 (void *args, unsigned long bytes, unsigned flags, +@@ -151,7 +152,7 @@ + + See the x86-64 PS ABI for details. + */ +-static int ++static size_t + classify_argument (ffi_type *type, enum x86_64_reg_class classes[], + size_t byte_offset) + { +@@ -167,7 +168,7 @@ + case FFI_TYPE_SINT64: + case FFI_TYPE_POINTER: + { +- int size = byte_offset + type->size; ++ size_t size = byte_offset + type->size; + + if (size <= 4) + { +@@ -202,15 +203,17 @@ + case FFI_TYPE_DOUBLE: + classes[0] = X86_64_SSEDF_CLASS; + return 1; ++#if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE + case FFI_TYPE_LONGDOUBLE: + classes[0] = X86_64_X87_CLASS; + classes[1] = X86_64_X87UP_CLASS; + return 2; ++#endif + case FFI_TYPE_STRUCT: + { +- const int UNITS_PER_WORD = 8; +- int words = (type->size + UNITS_PER_WORD - 1) / UNITS_PER_WORD; +- ffi_type **ptr; ++ const size_t UNITS_PER_WORD = 8; ++ size_t words = (type->size + UNITS_PER_WORD - 1) / UNITS_PER_WORD; ++ ffi_type **ptr; + int i; + enum x86_64_reg_class subclasses[MAX_CLASSES]; + +@@ -232,7 +235,7 @@ + /* Merge the fields of structure. */ + for (ptr = type->elements; *ptr != NULL; ptr++) + { +- int num; ++ size_t num; + + byte_offset = ALIGN (byte_offset, (*ptr)->alignment); + +@@ -241,7 +244,7 @@ + return 0; + for (i = 0; i < num; i++) + { +- int pos = byte_offset / 8; ++ size_t pos = byte_offset / 8; + classes[i + pos] = + merge_classes (subclasses[i], classes[i + pos]); + } +@@ -305,11 +308,12 @@ + class. Return zero iff parameter should be passed in memory, otherwise + the number of registers. */ + +-static int ++static size_t + examine_argument (ffi_type *type, enum x86_64_reg_class classes[MAX_CLASSES], + _Bool in_return, int *pngpr, int *pnsse) + { +- int i, n, ngpr, nsse; ++ size_t n; ++ int i, ngpr, nsse; + + n = classify_argument (type, classes, 0); + if (n == 0) +@@ -350,9 +354,9 @@ + ffi_status + ffi_prep_cif_machdep (ffi_cif *cif) + { +- int gprcount, ssecount, i, avn, n, ngpr, nsse, flags; ++ int gprcount, ssecount, i, avn, ngpr, nsse, flags; + enum x86_64_reg_class classes[MAX_CLASSES]; +- size_t bytes; ++ size_t bytes, n; + + gprcount = ssecount = 0; + +@@ -410,7 +414,7 @@ + if (ssecount) + flags |= 1 << 11; + cif->flags = flags; +- cif->bytes = ALIGN (bytes, 8); ++ cif->bytes = (unsigned)ALIGN (bytes, 8); + + return FFI_OK; + } +@@ -453,8 +457,7 @@ + + for (i = 0; i < avn; ++i) + { +- size_t size = arg_types[i]->size; +- int n; ++ size_t n, size = arg_types[i]->size; + + n = examine_argument (arg_types[i], classes, 0, &ngpr, &nsse); + if (n == 0 +@@ -583,7 +586,7 @@ + if (ret != FFI_TYPE_VOID) + { + enum x86_64_reg_class classes[MAX_CLASSES]; +- int n = examine_argument (cif->rtype, classes, 1, &ngpr, &nsse); ++ size_t n = examine_argument (cif->rtype, classes, 1, &ngpr, &nsse); + if (n == 0) + { + /* The return value goes in memory. Arrange for the closure +@@ -606,11 +609,11 @@ + + avn = cif->nargs; + arg_types = cif->arg_types; +- ++ + for (i = 0; i < avn; ++i) + { + enum x86_64_reg_class classes[MAX_CLASSES]; +- int n; ++ size_t n; + + n = examine_argument (arg_types[i], classes, 0, &ngpr, &nsse); + if (n == 0 +diff -r c0e311e010fc Modules/_ctypes/libffi/src/x86/ffitarget.h +--- a/Modules/_ctypes/libffi/src/x86/ffitarget.h ++++ b/Modules/_ctypes/libffi/src/x86/ffitarget.h +@@ -98,6 +98,9 @@ + /* ---- Intel x86 and AMD x86-64 - */ + FFI_SYSV, + FFI_UNIX64, /* Unix variants all use the same ABI for x86-64 */ ++ FFI_THISCALL, ++ FFI_FASTCALL, ++ FFI_STDCALL, + FFI_LAST_ABI, + #if defined(__i386__) || defined(__i386) + FFI_DEFAULT_ABI = FFI_SYSV +diff -r c0e311e010fc Modules/_ctypes/libffi/src/x86/freebsd.S +--- a/Modules/_ctypes/libffi/src/x86/freebsd.S ++++ b/Modules/_ctypes/libffi/src/x86/freebsd.S +@@ -49,6 +49,9 @@ + movl 16(%ebp),%ecx + subl %ecx,%esp + ++ /* Align the stack pointer to 16-bytes */ ++ andl $0xfffffff0, %esp ++ + movl %esp,%eax + + /* Place all of the ffi_prep_args in position */ +@@ -456,3 +459,5 @@ + #endif + + #endif /* ifndef __x86_64__ */ ++ ++ .section .note.GNU-stack,"",%progbits +diff -r c0e311e010fc Modules/_ctypes/libffi/src/x86/win32.S +--- a/Modules/_ctypes/libffi/src/x86/win32.S ++++ b/Modules/_ctypes/libffi/src/x86/win32.S +@@ -33,8 +33,13 @@ + #include + #include + ++#define CIF_ABI_OFFSET 0 ++#define CIF_BYTES_OFFSET 16 ++ + #ifdef _MSC_VER + ++#define CLOSURE_CIF_OFFSET ((FFI_TRAMPOLINE_SIZE + 3) AND NOT 3) ++ + .386 + .MODEL FLAT, C + +@@ -188,14 +193,23 @@ + ret + ffi_call_win32 ENDP + +-ffi_closure_THISCALL PROC NEAR FORCEFRAME +- sub esp, 40 +- lea edx, [ebp -24] +- mov [ebp - 12], edx /* resp */ +- lea edx, [ebp + 12] /* account for stub return address on stack */ +- jmp stub ++ffi_closure_THISCALL PROC NEAR ++ ;; Insert the register argument on the stack as the first argument ++ xchg DWORD PTR [esp+4], ecx ++ xchg DWORD PTR [esp], ecx ++ push ecx ++ jmp ffi_closure_STDCALL + ffi_closure_THISCALL ENDP + ++ffi_closure_FASTCALL PROC NEAR ++ ;; Insert the register argument on the stack as the first argument ++ xchg DWORD PTR [esp+4], edx ++ xchg DWORD PTR [esp], ecx ++ push edx ++ push ecx ++ jmp ffi_closure_STDCALL ++ffi_closure_FASTCALL ENDP ++ + ffi_closure_SYSV PROC NEAR FORCEFRAME + ;; the ffi_closure ctx is passed in eax by the trampoline. + +@@ -464,8 +478,23 @@ + jmp cd_epilogue + + cd_epilogue: +- ;; Epilogue code is autogenerated. +- ret ++ mov esp, ebp ++ pop ebp ++ pop ecx ++ pop edx ++ mov ecx, DWORD PTR [ecx + (CLOSURE_CIF_OFFSET-10)] ++ add esp, DWORD PTR [ecx + CIF_BYTES_OFFSET] ++ mov ecx, DWORD PTR [ecx + CIF_ABI_OFFSET] ++ cmp ecx, 3 ++ je cd_thiscall ++ cmp ecx, 4 ++ jne cd_not_fastcall ++ ++ add esp, 4 ++cd_thiscall: ++ add esp, 4 ++cd_not_fastcall: ++ jmp edx + ffi_closure_STDCALL ENDP + + _TEXT ENDS +@@ -473,15 +502,23 @@ + + #else + ++#define CLOSURE_CIF_OFFSET ((FFI_TRAMPOLINE_SIZE + 3) & ~3) ++ ++#if defined(SYMBOL_UNDERSCORE) ++#define USCORE_SYMBOL(x) _##x ++#else ++#define USCORE_SYMBOL(x) x ++#endif + .text + + # This assumes we are using gas. + .balign 16 +- .globl _ffi_call_win32 +-#ifndef __OS2__ ++FFI_HIDDEN(ffi_call_win32) ++ .globl USCORE_SYMBOL(ffi_call_win32) ++#if defined(X86_WIN32) && !defined(__OS2__) + .def _ffi_call_win32; .scl 2; .type 32; .endef + #endif +-_ffi_call_win32: ++USCORE_SYMBOL(ffi_call_win32): + .LFB1: + pushl %ebp + .LCFI0: +@@ -542,31 +579,32 @@ + call 1f + # Do not insert anything here between the call and the jump table. + .Lstore_table: +- .long .Lnoretval /* FFI_TYPE_VOID */ +- .long .Lretint /* FFI_TYPE_INT */ +- .long .Lretfloat /* FFI_TYPE_FLOAT */ +- .long .Lretdouble /* FFI_TYPE_DOUBLE */ +- .long .Lretlongdouble /* FFI_TYPE_LONGDOUBLE */ +- .long .Lretuint8 /* FFI_TYPE_UINT8 */ +- .long .Lretsint8 /* FFI_TYPE_SINT8 */ +- .long .Lretuint16 /* FFI_TYPE_UINT16 */ +- .long .Lretsint16 /* FFI_TYPE_SINT16 */ +- .long .Lretint /* FFI_TYPE_UINT32 */ +- .long .Lretint /* FFI_TYPE_SINT32 */ +- .long .Lretint64 /* FFI_TYPE_UINT64 */ +- .long .Lretint64 /* FFI_TYPE_SINT64 */ +- .long .Lretstruct /* FFI_TYPE_STRUCT */ +- .long .Lretint /* FFI_TYPE_POINTER */ +- .long .Lretstruct1b /* FFI_TYPE_SMALL_STRUCT_1B */ +- .long .Lretstruct2b /* FFI_TYPE_SMALL_STRUCT_2B */ +- .long .Lretstruct4b /* FFI_TYPE_SMALL_STRUCT_4B */ +- .long .Lretstruct /* FFI_TYPE_MS_STRUCT */ ++ .long .Lnoretval-.Lstore_table /* FFI_TYPE_VOID */ ++ .long .Lretint-.Lstore_table /* FFI_TYPE_INT */ ++ .long .Lretfloat-.Lstore_table /* FFI_TYPE_FLOAT */ ++ .long .Lretdouble-.Lstore_table /* FFI_TYPE_DOUBLE */ ++ .long .Lretlongdouble-.Lstore_table /* FFI_TYPE_LONGDOUBLE */ ++ .long .Lretuint8-.Lstore_table /* FFI_TYPE_UINT8 */ ++ .long .Lretsint8-.Lstore_table /* FFI_TYPE_SINT8 */ ++ .long .Lretuint16-.Lstore_table /* FFI_TYPE_UINT16 */ ++ .long .Lretsint16-.Lstore_table /* FFI_TYPE_SINT16 */ ++ .long .Lretint-.Lstore_table /* FFI_TYPE_UINT32 */ ++ .long .Lretint-.Lstore_table /* FFI_TYPE_SINT32 */ ++ .long .Lretint64-.Lstore_table /* FFI_TYPE_UINT64 */ ++ .long .Lretint64-.Lstore_table /* FFI_TYPE_SINT64 */ ++ .long .Lretstruct-.Lstore_table /* FFI_TYPE_STRUCT */ ++ .long .Lretint-.Lstore_table /* FFI_TYPE_POINTER */ ++ .long .Lretstruct1b-.Lstore_table /* FFI_TYPE_SMALL_STRUCT_1B */ ++ .long .Lretstruct2b-.Lstore_table /* FFI_TYPE_SMALL_STRUCT_2B */ ++ .long .Lretstruct4b-.Lstore_table /* FFI_TYPE_SMALL_STRUCT_4B */ ++ .long .Lretstruct-.Lstore_table /* FFI_TYPE_MS_STRUCT */ + 1: +- add %ecx, %ecx +- add %ecx, %ecx ++ shl $2, %ecx ++ add (%esp),%ecx ++ mov (%ecx),%ecx + add (%esp),%ecx + add $4, %esp +- jmp *(%ecx) ++ jmp *%ecx + + /* Sign/zero extend as appropriate. */ + .Lretsint8: +@@ -644,27 +682,43 @@ + ret + .ffi_call_win32_end: + .balign 16 +- .globl _ffi_closure_THISCALL +-#ifndef __OS2__ ++FFI_HIDDEN(ffi_closure_THISCALL) ++ .globl USCORE_SYMBOL(ffi_closure_THISCALL) ++#if defined(X86_WIN32) && !defined(__OS2__) + .def _ffi_closure_THISCALL; .scl 2; .type 32; .endef + #endif +-_ffi_closure_THISCALL: +- pushl %ebp +- movl %esp, %ebp +- subl $40, %esp +- leal -24(%ebp), %edx +- movl %edx, -12(%ebp) /* resp */ +- leal 12(%ebp), %edx /* account for stub return address on stack */ +- jmp .stub ++USCORE_SYMBOL(ffi_closure_THISCALL): ++ /* Insert the register argument on the stack as the first argument */ ++ xchg %ecx, 4(%esp) ++ xchg %ecx, (%esp) ++ push %ecx ++ jmp .ffi_closure_STDCALL_internal ++ ++ .balign 16 ++FFI_HIDDEN(ffi_closure_FASTCALL) ++ .globl USCORE_SYMBOL(ffi_closure_FASTCALL) ++#if defined(X86_WIN32) && !defined(__OS2__) ++ .def _ffi_closure_FASTCALL; .scl 2; .type 32; .endef ++#endif ++USCORE_SYMBOL(ffi_closure_FASTCALL): ++ /* Insert the register arguments on the stack as the first two arguments */ ++ xchg %edx, 4(%esp) ++ xchg %ecx, (%esp) ++ push %edx ++ push %ecx ++ jmp .ffi_closure_STDCALL_internal + .LFE1: + + # This assumes we are using gas. + .balign 16 +- .globl _ffi_closure_SYSV +-#ifndef __OS2__ ++FFI_HIDDEN(ffi_closure_SYSV) ++#if defined(X86_WIN32) ++ .globl USCORE_SYMBOL(ffi_closure_SYSV) ++#if defined(X86_WIN32) && !defined(__OS2__) + .def _ffi_closure_SYSV; .scl 2; .type 32; .endef + #endif +-_ffi_closure_SYSV: ++USCORE_SYMBOL(ffi_closure_SYSV): ++#endif + .LFB3: + pushl %ebp + .LCFI4: +@@ -674,43 +728,54 @@ + leal -24(%ebp), %edx + movl %edx, -12(%ebp) /* resp */ + leal 8(%ebp), %edx +-.stub: + movl %edx, 4(%esp) /* args = __builtin_dwarf_cfa () */ + leal -12(%ebp), %edx + movl %edx, (%esp) /* &resp */ +- call _ffi_closure_SYSV_inner ++#if defined(HAVE_HIDDEN_VISIBILITY_ATTRIBUTE) || !defined(__PIC__) ++ call USCORE_SYMBOL(ffi_closure_SYSV_inner) ++#elif defined(X86_DARWIN) ++ calll L_ffi_closure_SYSV_inner$stub ++#else ++ movl %ebx, 8(%esp) ++ call 1f ++1: popl %ebx ++ addl $_GLOBAL_OFFSET_TABLE_+[.-1b], %ebx ++ call ffi_closure_SYSV_inner@PLT ++ movl 8(%esp), %ebx ++#endif + movl -12(%ebp), %ecx + + 0: + call 1f + # Do not insert anything here between the call and the jump table. + .Lcls_store_table: +- .long .Lcls_noretval /* FFI_TYPE_VOID */ +- .long .Lcls_retint /* FFI_TYPE_INT */ +- .long .Lcls_retfloat /* FFI_TYPE_FLOAT */ +- .long .Lcls_retdouble /* FFI_TYPE_DOUBLE */ +- .long .Lcls_retldouble /* FFI_TYPE_LONGDOUBLE */ +- .long .Lcls_retuint8 /* FFI_TYPE_UINT8 */ +- .long .Lcls_retsint8 /* FFI_TYPE_SINT8 */ +- .long .Lcls_retuint16 /* FFI_TYPE_UINT16 */ +- .long .Lcls_retsint16 /* FFI_TYPE_SINT16 */ +- .long .Lcls_retint /* FFI_TYPE_UINT32 */ +- .long .Lcls_retint /* FFI_TYPE_SINT32 */ +- .long .Lcls_retllong /* FFI_TYPE_UINT64 */ +- .long .Lcls_retllong /* FFI_TYPE_SINT64 */ +- .long .Lcls_retstruct /* FFI_TYPE_STRUCT */ +- .long .Lcls_retint /* FFI_TYPE_POINTER */ +- .long .Lcls_retstruct1 /* FFI_TYPE_SMALL_STRUCT_1B */ +- .long .Lcls_retstruct2 /* FFI_TYPE_SMALL_STRUCT_2B */ +- .long .Lcls_retstruct4 /* FFI_TYPE_SMALL_STRUCT_4B */ +- .long .Lcls_retmsstruct /* FFI_TYPE_MS_STRUCT */ ++ .long .Lcls_noretval-.Lcls_store_table /* FFI_TYPE_VOID */ ++ .long .Lcls_retint-.Lcls_store_table /* FFI_TYPE_INT */ ++ .long .Lcls_retfloat-.Lcls_store_table /* FFI_TYPE_FLOAT */ ++ .long .Lcls_retdouble-.Lcls_store_table /* FFI_TYPE_DOUBLE */ ++ .long .Lcls_retldouble-.Lcls_store_table /* FFI_TYPE_LONGDOUBLE */ ++ .long .Lcls_retuint8-.Lcls_store_table /* FFI_TYPE_UINT8 */ ++ .long .Lcls_retsint8-.Lcls_store_table /* FFI_TYPE_SINT8 */ ++ .long .Lcls_retuint16-.Lcls_store_table /* FFI_TYPE_UINT16 */ ++ .long .Lcls_retsint16-.Lcls_store_table /* FFI_TYPE_SINT16 */ ++ .long .Lcls_retint-.Lcls_store_table /* FFI_TYPE_UINT32 */ ++ .long .Lcls_retint-.Lcls_store_table /* FFI_TYPE_SINT32 */ ++ .long .Lcls_retllong-.Lcls_store_table /* FFI_TYPE_UINT64 */ ++ .long .Lcls_retllong-.Lcls_store_table /* FFI_TYPE_SINT64 */ ++ .long .Lcls_retstruct-.Lcls_store_table /* FFI_TYPE_STRUCT */ ++ .long .Lcls_retint-.Lcls_store_table /* FFI_TYPE_POINTER */ ++ .long .Lcls_retstruct1-.Lcls_store_table /* FFI_TYPE_SMALL_STRUCT_1B */ ++ .long .Lcls_retstruct2-.Lcls_store_table /* FFI_TYPE_SMALL_STRUCT_2B */ ++ .long .Lcls_retstruct4-.Lcls_store_table /* FFI_TYPE_SMALL_STRUCT_4B */ ++ .long .Lcls_retmsstruct-.Lcls_store_table /* FFI_TYPE_MS_STRUCT */ + + 1: +- add %eax, %eax +- add %eax, %eax ++ shl $2, %eax ++ add (%esp),%eax ++ mov (%eax),%eax + add (%esp),%eax + add $4, %esp +- jmp *(%eax) ++ jmp *%eax + + /* Sign/zero extend as appropriate. */ + .Lcls_retsint8: +@@ -788,12 +853,15 @@ + #define RAW_CLOSURE_FUN_OFFSET (RAW_CLOSURE_CIF_OFFSET + 4) + #define RAW_CLOSURE_USER_DATA_OFFSET (RAW_CLOSURE_FUN_OFFSET + 4) + #define CIF_FLAGS_OFFSET 20 ++ ++#ifdef X86_WIN32 + .balign 16 +- .globl _ffi_closure_raw_THISCALL +-#ifndef __OS2__ ++FFI_HIDDEN(ffi_closure_raw_THISCALL) ++ .globl USCORE_SYMBOL(ffi_closure_raw_THISCALL) ++#if defined(X86_WIN32) && !defined(__OS2__) + .def _ffi_closure_raw_THISCALL; .scl 2; .type 32; .endef + #endif +-_ffi_closure_raw_THISCALL: ++USCORE_SYMBOL(ffi_closure_raw_THISCALL): + pushl %ebp + movl %esp, %ebp + pushl %esi +@@ -803,13 +871,17 @@ + movl %edx, 12(%esp) /* user_data */ + leal 12(%ebp), %edx /* __builtin_dwarf_cfa () */ + jmp .stubraw ++#endif /* X86_WIN32 */ ++ + # This assumes we are using gas. + .balign 16 +- .globl _ffi_closure_raw_SYSV +-#ifndef __OS2__ ++#if defined(X86_WIN32) ++ .globl USCORE_SYMBOL(ffi_closure_raw_SYSV) ++#if defined(X86_WIN32) && !defined(__OS2__) + .def _ffi_closure_raw_SYSV; .scl 2; .type 32; .endef + #endif +-_ffi_closure_raw_SYSV: ++USCORE_SYMBOL(ffi_closure_raw_SYSV): ++#endif /* defined(X86_WIN32) */ + .LFB4: + pushl %ebp + .LCFI6: +@@ -833,31 +905,32 @@ + call 1f + # Do not insert anything here between the call and the jump table. + .Lrcls_store_table: +- .long .Lrcls_noretval /* FFI_TYPE_VOID */ +- .long .Lrcls_retint /* FFI_TYPE_INT */ +- .long .Lrcls_retfloat /* FFI_TYPE_FLOAT */ +- .long .Lrcls_retdouble /* FFI_TYPE_DOUBLE */ +- .long .Lrcls_retldouble /* FFI_TYPE_LONGDOUBLE */ +- .long .Lrcls_retuint8 /* FFI_TYPE_UINT8 */ +- .long .Lrcls_retsint8 /* FFI_TYPE_SINT8 */ +- .long .Lrcls_retuint16 /* FFI_TYPE_UINT16 */ +- .long .Lrcls_retsint16 /* FFI_TYPE_SINT16 */ +- .long .Lrcls_retint /* FFI_TYPE_UINT32 */ +- .long .Lrcls_retint /* FFI_TYPE_SINT32 */ +- .long .Lrcls_retllong /* FFI_TYPE_UINT64 */ +- .long .Lrcls_retllong /* FFI_TYPE_SINT64 */ +- .long .Lrcls_retstruct /* FFI_TYPE_STRUCT */ +- .long .Lrcls_retint /* FFI_TYPE_POINTER */ +- .long .Lrcls_retstruct1 /* FFI_TYPE_SMALL_STRUCT_1B */ +- .long .Lrcls_retstruct2 /* FFI_TYPE_SMALL_STRUCT_2B */ +- .long .Lrcls_retstruct4 /* FFI_TYPE_SMALL_STRUCT_4B */ +- .long .Lrcls_retstruct /* FFI_TYPE_MS_STRUCT */ ++ .long .Lrcls_noretval-.Lrcls_store_table /* FFI_TYPE_VOID */ ++ .long .Lrcls_retint-.Lrcls_store_table /* FFI_TYPE_INT */ ++ .long .Lrcls_retfloat-.Lrcls_store_table /* FFI_TYPE_FLOAT */ ++ .long .Lrcls_retdouble-.Lrcls_store_table /* FFI_TYPE_DOUBLE */ ++ .long .Lrcls_retldouble-.Lrcls_store_table /* FFI_TYPE_LONGDOUBLE */ ++ .long .Lrcls_retuint8-.Lrcls_store_table /* FFI_TYPE_UINT8 */ ++ .long .Lrcls_retsint8-.Lrcls_store_table /* FFI_TYPE_SINT8 */ ++ .long .Lrcls_retuint16-.Lrcls_store_table /* FFI_TYPE_UINT16 */ ++ .long .Lrcls_retsint16-.Lrcls_store_table /* FFI_TYPE_SINT16 */ ++ .long .Lrcls_retint-.Lrcls_store_table /* FFI_TYPE_UINT32 */ ++ .long .Lrcls_retint-.Lrcls_store_table /* FFI_TYPE_SINT32 */ ++ .long .Lrcls_retllong-.Lrcls_store_table /* FFI_TYPE_UINT64 */ ++ .long .Lrcls_retllong-.Lrcls_store_table /* FFI_TYPE_SINT64 */ ++ .long .Lrcls_retstruct-.Lrcls_store_table /* FFI_TYPE_STRUCT */ ++ .long .Lrcls_retint-.Lrcls_store_table /* FFI_TYPE_POINTER */ ++ .long .Lrcls_retstruct1-.Lrcls_store_table /* FFI_TYPE_SMALL_STRUCT_1B */ ++ .long .Lrcls_retstruct2-.Lrcls_store_table /* FFI_TYPE_SMALL_STRUCT_2B */ ++ .long .Lrcls_retstruct4-.Lrcls_store_table /* FFI_TYPE_SMALL_STRUCT_4B */ ++ .long .Lrcls_retstruct-.Lrcls_store_table /* FFI_TYPE_MS_STRUCT */ + 1: +- add %eax, %eax +- add %eax, %eax ++ shl $2, %eax ++ add (%esp),%eax ++ mov (%eax),%eax + add (%esp),%eax + add $4, %esp +- jmp *(%eax) ++ jmp *%eax + + /* Sign/zero extend as appropriate. */ + .Lrcls_retsint8: +@@ -925,11 +998,13 @@ + + # This assumes we are using gas. + .balign 16 +- .globl _ffi_closure_STDCALL +-#ifndef __OS2__ ++FFI_HIDDEN(ffi_closure_STDCALL) ++ .globl USCORE_SYMBOL(ffi_closure_STDCALL) ++#if defined(X86_WIN32) && !defined(__OS2__) + .def _ffi_closure_STDCALL; .scl 2; .type 32; .endef + #endif +-_ffi_closure_STDCALL: ++USCORE_SYMBOL(ffi_closure_STDCALL): ++.ffi_closure_STDCALL_internal: + .LFB5: + pushl %ebp + .LCFI9: +@@ -942,36 +1017,48 @@ + movl %edx, 4(%esp) /* args */ + leal -12(%ebp), %edx + movl %edx, (%esp) /* &resp */ +- call _ffi_closure_SYSV_inner ++#if defined(HAVE_HIDDEN_VISIBILITY_ATTRIBUTE) || !defined(__PIC__) ++ call USCORE_SYMBOL(ffi_closure_SYSV_inner) ++#elif defined(X86_DARWIN) ++ calll L_ffi_closure_SYSV_inner$stub ++#else ++ movl %ebx, 8(%esp) ++ call 1f ++1: popl %ebx ++ addl $_GLOBAL_OFFSET_TABLE_+[.-1b], %ebx ++ call ffi_closure_SYSV_inner@PLT ++ movl 8(%esp), %ebx ++#endif + movl -12(%ebp), %ecx + 0: + call 1f + # Do not insert anything here between the call and the jump table. + .Lscls_store_table: +- .long .Lscls_noretval /* FFI_TYPE_VOID */ +- .long .Lscls_retint /* FFI_TYPE_INT */ +- .long .Lscls_retfloat /* FFI_TYPE_FLOAT */ +- .long .Lscls_retdouble /* FFI_TYPE_DOUBLE */ +- .long .Lscls_retldouble /* FFI_TYPE_LONGDOUBLE */ +- .long .Lscls_retuint8 /* FFI_TYPE_UINT8 */ +- .long .Lscls_retsint8 /* FFI_TYPE_SINT8 */ +- .long .Lscls_retuint16 /* FFI_TYPE_UINT16 */ +- .long .Lscls_retsint16 /* FFI_TYPE_SINT16 */ +- .long .Lscls_retint /* FFI_TYPE_UINT32 */ +- .long .Lscls_retint /* FFI_TYPE_SINT32 */ +- .long .Lscls_retllong /* FFI_TYPE_UINT64 */ +- .long .Lscls_retllong /* FFI_TYPE_SINT64 */ +- .long .Lscls_retstruct /* FFI_TYPE_STRUCT */ +- .long .Lscls_retint /* FFI_TYPE_POINTER */ +- .long .Lscls_retstruct1 /* FFI_TYPE_SMALL_STRUCT_1B */ +- .long .Lscls_retstruct2 /* FFI_TYPE_SMALL_STRUCT_2B */ +- .long .Lscls_retstruct4 /* FFI_TYPE_SMALL_STRUCT_4B */ ++ .long .Lscls_noretval-.Lscls_store_table /* FFI_TYPE_VOID */ ++ .long .Lscls_retint-.Lscls_store_table /* FFI_TYPE_INT */ ++ .long .Lscls_retfloat-.Lscls_store_table /* FFI_TYPE_FLOAT */ ++ .long .Lscls_retdouble-.Lscls_store_table /* FFI_TYPE_DOUBLE */ ++ .long .Lscls_retldouble-.Lscls_store_table /* FFI_TYPE_LONGDOUBLE */ ++ .long .Lscls_retuint8-.Lscls_store_table /* FFI_TYPE_UINT8 */ ++ .long .Lscls_retsint8-.Lscls_store_table /* FFI_TYPE_SINT8 */ ++ .long .Lscls_retuint16-.Lscls_store_table /* FFI_TYPE_UINT16 */ ++ .long .Lscls_retsint16-.Lscls_store_table /* FFI_TYPE_SINT16 */ ++ .long .Lscls_retint-.Lscls_store_table /* FFI_TYPE_UINT32 */ ++ .long .Lscls_retint-.Lscls_store_table /* FFI_TYPE_SINT32 */ ++ .long .Lscls_retllong-.Lscls_store_table /* FFI_TYPE_UINT64 */ ++ .long .Lscls_retllong-.Lscls_store_table /* FFI_TYPE_SINT64 */ ++ .long .Lscls_retstruct-.Lscls_store_table /* FFI_TYPE_STRUCT */ ++ .long .Lscls_retint-.Lscls_store_table /* FFI_TYPE_POINTER */ ++ .long .Lscls_retstruct1-.Lscls_store_table /* FFI_TYPE_SMALL_STRUCT_1B */ ++ .long .Lscls_retstruct2-.Lscls_store_table /* FFI_TYPE_SMALL_STRUCT_2B */ ++ .long .Lscls_retstruct4-.Lscls_store_table /* FFI_TYPE_SMALL_STRUCT_4B */ + 1: +- add %eax, %eax +- add %eax, %eax ++ shl $2, %eax ++ add (%esp),%eax ++ mov (%eax),%eax + add (%esp),%eax + add $4, %esp +- jmp *(%eax) ++ jmp *%eax + + /* Sign/zero extend as appropriate. */ + .Lscls_retsint8: +@@ -1030,11 +1117,30 @@ + .Lscls_epilogue: + movl %ebp, %esp + popl %ebp +- ret ++ popl %ecx ++ popl %edx ++ movl (CLOSURE_CIF_OFFSET-10)(%ecx), %ecx ++ addl CIF_BYTES_OFFSET(%ecx), %esp ++ movl CIF_ABI_OFFSET(%ecx), %ecx ++ cmpl $3, %ecx /* FFI_THISCALL */ ++ je 1f ++ cmpl $4, %ecx /* FFI_FASTCALL */ ++ jne 2f ++ ++ addl $4, %esp ++1: addl $4, %esp ++2: jmp *%edx + .ffi_closure_STDCALL_end: + .LFE5: + +-#ifndef __OS2__ ++#if defined(X86_DARWIN) ++.section __IMPORT,__jump_table,symbol_stubs,self_modifying_code+pure_instructions,5 ++L_ffi_closure_SYSV_inner$stub: ++ .indirect_symbol _ffi_closure_SYSV_inner ++ hlt ; hlt ; hlt ; hlt ; hlt ++#endif ++ ++#if defined(X86_WIN32) && !defined(__OS2__) + .section .eh_frame,"w" + #endif + .Lframe1: +@@ -1094,7 +1200,6 @@ + .align 4 + .LEFDE1: + +- + .LSFDE3: + .long .LEFDE3-.LASFDE3 /* FDE Length */ + .LASFDE3: +diff -r c0e311e010fc Modules/_ctypes/libffi/stamp-h.in +--- a/Modules/_ctypes/libffi/stamp-h.in ++++ /dev/null +@@ -1 +0,0 @@ +-timestamp +diff -r c0e311e010fc Modules/_ctypes/libffi/testsuite/Makefile.am +--- a/Modules/_ctypes/libffi/testsuite/Makefile.am ++++ b/Modules/_ctypes/libffi/testsuite/Makefile.am +@@ -2,17 +2,6 @@ + + AUTOMAKE_OPTIONS = foreign dejagnu + +-# Setup the testing framework, if you have one +-EXPECT = `if [ -f $(top_builddir)/../expect/expect ] ; then \ +- echo $(top_builddir)/../expect/expect ; \ +- else echo expect ; fi` +- +-RUNTEST = `if [ -f $(top_srcdir)/../dejagnu/runtest ] ; then \ +- echo $(top_srcdir)/../dejagnu/runtest ; \ +- else echo runtest; fi` +- +-AM_RUNTESTFLAGS = +- + EXTRA_DEJAGNU_SITE_CONFIG=../local.exp + + CLEANFILES = *.exe core* *.log *.sum +@@ -20,7 +9,7 @@ + EXTRA_DIST = config/default.exp libffi.call/cls_19byte.c \ + libffi.call/cls_align_longdouble_split.c \ + libffi.call/closure_loc_fn0.c libffi.call/cls_schar.c \ +-libffi.call/closure_fn1.c libffi.call/many2_win32.c \ ++libffi.call/closure_fn1.c \ + libffi.call/return_ul.c libffi.call/cls_align_double.c \ + libffi.call/return_fl2.c libffi.call/cls_1_1byte.c \ + libffi.call/cls_64byte.c libffi.call/nested_struct7.c \ +@@ -30,7 +19,7 @@ + libffi.call/cls_3byte1.c libffi.call/cls_16byte.c \ + libffi.call/struct8.c libffi.call/nested_struct8.c \ + libffi.call/cls_multi_sshort.c libffi.call/cls_3byte2.c \ +-libffi.call/fastthis2_win32.c libffi.call/cls_pointer.c \ ++libffi.call/cls_pointer.c \ + libffi.call/err_bad_typedef.c libffi.call/cls_4_1byte.c \ + libffi.call/cls_9byte2.c libffi.call/cls_multi_schar.c \ + libffi.call/stret_medium2.c libffi.call/cls_5_1_byte.c \ +@@ -46,16 +35,16 @@ + libffi.call/return_fl3.c libffi.call/stret_medium.c \ + libffi.call/nested_struct6.c libffi.call/closure_fn3.c \ + libffi.call/float3.c libffi.call/many2.c \ +-libffi.call/closure_stdcall.c libffi.call/cls_align_uint16.c \ ++libffi.call/closure_simple.c libffi.call/cls_align_uint16.c \ + libffi.call/cls_9byte1.c libffi.call/closure_fn6.c \ + libffi.call/cls_double_va.c libffi.call/cls_align_pointer.c \ + libffi.call/cls_align_longdouble.c libffi.call/closure_fn2.c \ +-libffi.call/cls_sshort.c libffi.call/many_win32.c \ ++libffi.call/cls_sshort.c \ + libffi.call/nested_struct.c libffi.call/cls_20byte.c \ + libffi.call/cls_longdouble.c libffi.call/cls_multi_uchar.c \ +-libffi.call/return_uc.c libffi.call/closure_thiscall.c \ ++libffi.call/return_uc.c \ + libffi.call/cls_18byte.c libffi.call/cls_8byte.c \ +-libffi.call/promotion.c libffi.call/struct1_win32.c \ ++libffi.call/promotion.c \ + libffi.call/return_dbl.c libffi.call/cls_24byte.c \ + libffi.call/struct4.c libffi.call/cls_6byte.c \ + libffi.call/cls_align_uint32.c libffi.call/float.c \ +@@ -63,7 +52,7 @@ + libffi.call/return_dbl1.c libffi.call/cls_3_1byte.c \ + libffi.call/cls_align_float.c libffi.call/return_fl1.c \ + libffi.call/nested_struct10.c libffi.call/nested_struct5.c \ +-libffi.call/fastthis1_win32.c libffi.call/cls_align_sint64.c \ ++libffi.call/cls_align_sint64.c \ + libffi.call/stret_large2.c libffi.call/return_sl.c \ + libffi.call/closure_fn0.c libffi.call/cls_5byte.c \ + libffi.call/cls_2byte.c libffi.call/float2.c \ +@@ -75,20 +64,22 @@ + libffi.call/pyobjc-tc.c libffi.call/cls_multi_ushortchar.c \ + libffi.call/struct1.c libffi.call/nested_struct9.c \ + libffi.call/huge_struct.c libffi.call/problem1.c \ +-libffi.call/float4.c libffi.call/fastthis3_win32.c \ +-libffi.call/return_ldl.c libffi.call/strlen2_win32.c \ +-libffi.call/closure_fn5.c libffi.call/struct2_win32.c \ ++libffi.call/float4.c \ ++libffi.call/return_ldl.c \ ++libffi.call/closure_fn5.c \ + libffi.call/struct6.c libffi.call/return_ll.c libffi.call/struct9.c \ + libffi.call/return_sc.c libffi.call/struct7.c \ + libffi.call/cls_align_uint64.c libffi.call/cls_4byte.c \ +-libffi.call/strlen_win32.c libffi.call/cls_6_1_byte.c \ +-libffi.call/cls_7_1_byte.c libffi.special/unwindtest.cc \ +-libffi.special/special.exp libffi.special/unwindtest_ffi_call.cc \ +-libffi.special/ffitestcxx.h lib/wrapper.exp lib/target-libpath.exp \ ++libffi.call/cls_6_1_byte.c \ ++libffi.call/cls_7_1_byte.c libffi.call/unwindtest.cc \ ++libffi.call/unwindtest_ffi_call.cc \ ++lib/wrapper.exp lib/target-libpath.exp \ + lib/libffi.exp libffi.call/cls_struct_va1.c \ + libffi.call/cls_uchar_va.c libffi.call/cls_uint_va.c \ + libffi.call/cls_ulong_va.c libffi.call/cls_ushort_va.c \ + libffi.call/nested_struct11.c libffi.call/uninitialized.c \ + libffi.call/va_1.c libffi.call/va_struct1.c libffi.call/va_struct2.c \ +-libffi.call/va_struct3.c +- ++libffi.call/va_struct3.c \ ++libffi.call/strlen2.c \ ++libffi.call/strlen3.c \ ++libffi.call/strlen4.c +diff -r c0e311e010fc Modules/_ctypes/libffi/testsuite/Makefile.in +--- a/Modules/_ctypes/libffi/testsuite/Makefile.in ++++ b/Modules/_ctypes/libffi/testsuite/Makefile.in +@@ -1,7 +1,7 @@ +-# Makefile.in generated by automake 1.12.2 from Makefile.am. ++# Makefile.in generated by automake 1.13.4 from Makefile.am. + # @configure_input@ + +-# Copyright (C) 1994-2012 Free Software Foundation, Inc. ++# Copyright (C) 1994-2013 Free Software Foundation, Inc. + + # This Makefile.in is free software; the Free Software Foundation + # gives unlimited permission to copy and/or distribute it, +@@ -14,23 +14,51 @@ + + @SET_MAKE@ + VPATH = @srcdir@ +-am__make_dryrun = \ +- { \ +- am__dry=no; \ ++am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' ++am__make_running_with_option = \ ++ case $${target_option-} in \ ++ ?) ;; \ ++ *) echo "am__make_running_with_option: internal error: invalid" \ ++ "target option '$${target_option-}' specified" >&2; \ ++ exit 1;; \ ++ esac; \ ++ has_opt=no; \ ++ sane_makeflags=$$MAKEFLAGS; \ ++ if $(am__is_gnu_make); then \ ++ sane_makeflags=$$MFLAGS; \ ++ else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ +- echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ +- | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ +- *) \ +- for am__flg in $$MAKEFLAGS; do \ +- case $$am__flg in \ +- *=*|--*) ;; \ +- *n*) am__dry=yes; break;; \ +- esac; \ +- done;; \ ++ bs=\\; \ ++ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ ++ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ +- test $$am__dry = yes; \ +- } ++ fi; \ ++ skip_next=no; \ ++ strip_trailopt () \ ++ { \ ++ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ ++ }; \ ++ for flg in $$sane_makeflags; do \ ++ test $$skip_next = yes && { skip_next=no; continue; }; \ ++ case $$flg in \ ++ *=*|--*) continue;; \ ++ -*I) strip_trailopt 'I'; skip_next=yes;; \ ++ -*I?*) strip_trailopt 'I';; \ ++ -*O) strip_trailopt 'O'; skip_next=yes;; \ ++ -*O?*) strip_trailopt 'O';; \ ++ -*l) strip_trailopt 'l'; skip_next=yes;; \ ++ -*l?*) strip_trailopt 'l';; \ ++ -[dEDm]) skip_next=yes;; \ ++ -[JT]) skip_next=yes;; \ ++ esac; \ ++ case $$flg in \ ++ *$$target_option*) has_opt=yes; break;; \ ++ esac; \ ++ done; \ ++ test $$has_opt = yes ++am__make_dryrun = (target_option=n; $(am__make_running_with_option)) ++am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) + pkgdatadir = $(datadir)/@PACKAGE@ + pkgincludedir = $(includedir)/@PACKAGE@ + pkglibdir = $(libdir)/@PACKAGE@ +@@ -51,7 +79,7 @@ + host_triplet = @host@ + target_triplet = @target@ + subdir = testsuite +-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ++DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am + ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 + am__aclocal_m4_deps = $(top_srcdir)/m4/asmcfi.m4 \ + $(top_srcdir)/m4/ax_append_flag.m4 \ +@@ -73,6 +101,18 @@ + CONFIG_HEADER = $(top_builddir)/fficonfig.h + CONFIG_CLEAN_FILES = + CONFIG_CLEAN_VPATH_FILES = ++AM_V_P = $(am__v_P_@AM_V@) ++am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) ++am__v_P_0 = false ++am__v_P_1 = : ++AM_V_GEN = $(am__v_GEN_@AM_V@) ++am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) ++am__v_GEN_0 = @echo " GEN " $@; ++am__v_GEN_1 = ++AM_V_at = $(am__v_at_@AM_V@) ++am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) ++am__v_at_0 = @ ++am__v_at_1 = + SOURCES = + DIST_SOURCES = + am__can_run_installinfo = \ +@@ -80,14 +120,18 @@ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac ++am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) + DEJATOOL = $(PACKAGE) + RUNTESTDEFAULTFLAGS = --tool $$tool --srcdir $$srcdir ++EXPECT = expect ++RUNTEST = runtest + DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) + ACLOCAL = @ACLOCAL@ + ALLOCA = @ALLOCA@ + AMTAR = @AMTAR@ ++AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ + AM_LTLDFLAGS = @AM_LTLDFLAGS@ +-AM_RUNTESTFLAGS = ++AM_RUNTESTFLAGS = @AM_RUNTESTFLAGS@ + AR = @AR@ + AUTOCONF = @AUTOCONF@ + AUTOHEADER = @AUTOHEADER@ +@@ -101,6 +145,10 @@ + CFLAGS = @CFLAGS@ + CPP = @CPP@ + CPPFLAGS = @CPPFLAGS@ ++CXX = @CXX@ ++CXXCPP = @CXXCPP@ ++CXXDEPMODE = @CXXDEPMODE@ ++CXXFLAGS = @CXXFLAGS@ + CYGPATH_W = @CYGPATH_W@ + DEFS = @DEFS@ + DEPDIR = @DEPDIR@ +@@ -116,6 +164,7 @@ + FGREP = @FGREP@ + GREP = @GREP@ + HAVE_LONG_DOUBLE = @HAVE_LONG_DOUBLE@ ++HAVE_LONG_DOUBLE_VARIANT = @HAVE_LONG_DOUBLE_VARIANT@ + INSTALL = @INSTALL@ + INSTALL_DATA = @INSTALL_DATA@ + INSTALL_PROGRAM = @INSTALL_PROGRAM@ +@@ -162,6 +211,7 @@ + abs_top_srcdir = @abs_top_srcdir@ + ac_ct_AR = @ac_ct_AR@ + ac_ct_CC = @ac_ct_CC@ ++ac_ct_CXX = @ac_ct_CXX@ + ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ + am__include = @am__include@ + am__leading_dot = @am__leading_dot@ +@@ -217,22 +267,12 @@ + top_builddir = @top_builddir@ + top_srcdir = @top_srcdir@ + AUTOMAKE_OPTIONS = foreign dejagnu +- +-# Setup the testing framework, if you have one +-EXPECT = `if [ -f $(top_builddir)/../expect/expect ] ; then \ +- echo $(top_builddir)/../expect/expect ; \ +- else echo expect ; fi` +- +-RUNTEST = `if [ -f $(top_srcdir)/../dejagnu/runtest ] ; then \ +- echo $(top_srcdir)/../dejagnu/runtest ; \ +- else echo runtest; fi` +- + EXTRA_DEJAGNU_SITE_CONFIG = ../local.exp + CLEANFILES = *.exe core* *.log *.sum + EXTRA_DIST = config/default.exp libffi.call/cls_19byte.c \ + libffi.call/cls_align_longdouble_split.c \ + libffi.call/closure_loc_fn0.c libffi.call/cls_schar.c \ +-libffi.call/closure_fn1.c libffi.call/many2_win32.c \ ++libffi.call/closure_fn1.c \ + libffi.call/return_ul.c libffi.call/cls_align_double.c \ + libffi.call/return_fl2.c libffi.call/cls_1_1byte.c \ + libffi.call/cls_64byte.c libffi.call/nested_struct7.c \ +@@ -242,7 +282,7 @@ + libffi.call/cls_3byte1.c libffi.call/cls_16byte.c \ + libffi.call/struct8.c libffi.call/nested_struct8.c \ + libffi.call/cls_multi_sshort.c libffi.call/cls_3byte2.c \ +-libffi.call/fastthis2_win32.c libffi.call/cls_pointer.c \ ++libffi.call/cls_pointer.c \ + libffi.call/err_bad_typedef.c libffi.call/cls_4_1byte.c \ + libffi.call/cls_9byte2.c libffi.call/cls_multi_schar.c \ + libffi.call/stret_medium2.c libffi.call/cls_5_1_byte.c \ +@@ -258,16 +298,16 @@ + libffi.call/return_fl3.c libffi.call/stret_medium.c \ + libffi.call/nested_struct6.c libffi.call/closure_fn3.c \ + libffi.call/float3.c libffi.call/many2.c \ +-libffi.call/closure_stdcall.c libffi.call/cls_align_uint16.c \ ++libffi.call/closure_simple.c libffi.call/cls_align_uint16.c \ + libffi.call/cls_9byte1.c libffi.call/closure_fn6.c \ + libffi.call/cls_double_va.c libffi.call/cls_align_pointer.c \ + libffi.call/cls_align_longdouble.c libffi.call/closure_fn2.c \ +-libffi.call/cls_sshort.c libffi.call/many_win32.c \ ++libffi.call/cls_sshort.c \ + libffi.call/nested_struct.c libffi.call/cls_20byte.c \ + libffi.call/cls_longdouble.c libffi.call/cls_multi_uchar.c \ +-libffi.call/return_uc.c libffi.call/closure_thiscall.c \ ++libffi.call/return_uc.c \ + libffi.call/cls_18byte.c libffi.call/cls_8byte.c \ +-libffi.call/promotion.c libffi.call/struct1_win32.c \ ++libffi.call/promotion.c \ + libffi.call/return_dbl.c libffi.call/cls_24byte.c \ + libffi.call/struct4.c libffi.call/cls_6byte.c \ + libffi.call/cls_align_uint32.c libffi.call/float.c \ +@@ -275,7 +315,7 @@ + libffi.call/return_dbl1.c libffi.call/cls_3_1byte.c \ + libffi.call/cls_align_float.c libffi.call/return_fl1.c \ + libffi.call/nested_struct10.c libffi.call/nested_struct5.c \ +-libffi.call/fastthis1_win32.c libffi.call/cls_align_sint64.c \ ++libffi.call/cls_align_sint64.c \ + libffi.call/stret_large2.c libffi.call/return_sl.c \ + libffi.call/closure_fn0.c libffi.call/cls_5byte.c \ + libffi.call/cls_2byte.c libffi.call/float2.c \ +@@ -287,22 +327,25 @@ + libffi.call/pyobjc-tc.c libffi.call/cls_multi_ushortchar.c \ + libffi.call/struct1.c libffi.call/nested_struct9.c \ + libffi.call/huge_struct.c libffi.call/problem1.c \ +-libffi.call/float4.c libffi.call/fastthis3_win32.c \ +-libffi.call/return_ldl.c libffi.call/strlen2_win32.c \ +-libffi.call/closure_fn5.c libffi.call/struct2_win32.c \ ++libffi.call/float4.c \ ++libffi.call/return_ldl.c \ ++libffi.call/closure_fn5.c \ + libffi.call/struct6.c libffi.call/return_ll.c libffi.call/struct9.c \ + libffi.call/return_sc.c libffi.call/struct7.c \ + libffi.call/cls_align_uint64.c libffi.call/cls_4byte.c \ +-libffi.call/strlen_win32.c libffi.call/cls_6_1_byte.c \ +-libffi.call/cls_7_1_byte.c libffi.special/unwindtest.cc \ +-libffi.special/special.exp libffi.special/unwindtest_ffi_call.cc \ +-libffi.special/ffitestcxx.h lib/wrapper.exp lib/target-libpath.exp \ ++libffi.call/cls_6_1_byte.c \ ++libffi.call/cls_7_1_byte.c libffi.call/unwindtest.cc \ ++libffi.call/unwindtest_ffi_call.cc \ ++lib/wrapper.exp lib/target-libpath.exp \ + lib/libffi.exp libffi.call/cls_struct_va1.c \ + libffi.call/cls_uchar_va.c libffi.call/cls_uint_va.c \ + libffi.call/cls_ulong_va.c libffi.call/cls_ushort_va.c \ + libffi.call/nested_struct11.c libffi.call/uninitialized.c \ + libffi.call/va_1.c libffi.call/va_struct1.c libffi.call/va_struct2.c \ +-libffi.call/va_struct3.c ++libffi.call/va_struct3.c \ ++libffi.call/strlen2.c \ ++libffi.call/strlen3.c \ ++libffi.call/strlen4.c + + all: all-am + +@@ -343,11 +386,9 @@ + + clean-libtool: + -rm -rf .libs _libs +-tags: TAGS +-TAGS: ++tags TAGS: + +-ctags: CTAGS +-CTAGS: ++ctags CTAGS: + + cscope cscopelist: + +@@ -355,13 +396,12 @@ + check-DEJAGNU: site.exp + srcdir='$(srcdir)'; export srcdir; \ + EXPECT=$(EXPECT); export EXPECT; \ +- runtest=$(RUNTEST); \ +- if $(SHELL) -c "$$runtest --version" > /dev/null 2>&1; then \ ++ if $(SHELL) -c "$(RUNTEST) --version" > /dev/null 2>&1; then \ + exit_status=0; l='$(DEJATOOL)'; for tool in $$l; do \ +- if $$runtest $(AM_RUNTESTFLAGS) $(RUNTESTDEFAULTFLAGS) $(RUNTESTFLAGS); \ ++ if $(RUNTEST) $(AM_RUNTESTFLAGS) $(RUNTESTDEFAULTFLAGS) $(RUNTESTFLAGS); \ + then :; else exit_status=1; fi; \ + done; \ +- else echo "WARNING: could not find 'runtest'" 1>&2; :;\ ++ else echo "WARNING: could not find '$(RUNTEST)'" 1>&2; :;\ + fi; \ + exit $$exit_status + site.exp: Makefile $(EXTRA_DEJAGNU_SITE_CONFIG) +@@ -532,16 +572,17 @@ + .MAKE: check-am install-am install-strip + + .PHONY: all all-am check check-DEJAGNU check-am clean clean-generic \ +- clean-libtool distclean distclean-DEJAGNU distclean-generic \ +- distclean-libtool distdir dvi dvi-am html html-am info info-am \ +- install install-am install-data install-data-am install-dvi \ +- install-dvi-am install-exec install-exec-am install-html \ +- install-html-am install-info install-info-am install-man \ +- install-pdf install-pdf-am install-ps install-ps-am \ +- install-strip installcheck installcheck-am installdirs \ +- maintainer-clean maintainer-clean-generic mostlyclean \ +- mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ +- uninstall uninstall-am ++ clean-libtool cscopelist-am ctags-am distclean \ ++ distclean-DEJAGNU distclean-generic distclean-libtool distdir \ ++ dvi dvi-am html html-am info info-am install install-am \ ++ install-data install-data-am install-dvi install-dvi-am \ ++ install-exec install-exec-am install-html install-html-am \ ++ install-info install-info-am install-man install-pdf \ ++ install-pdf-am install-ps install-ps-am install-strip \ ++ installcheck installcheck-am installdirs maintainer-clean \ ++ maintainer-clean-generic mostlyclean mostlyclean-generic \ ++ mostlyclean-libtool pdf pdf-am ps ps-am tags-am uninstall \ ++ uninstall-am + + + # Tell versions [3.59,3.63) of GNU make to not export all variables. +diff -r c0e311e010fc Modules/_ctypes/libffi/testsuite/lib/libffi.exp +--- a/Modules/_ctypes/libffi/testsuite/lib/libffi.exp ++++ b/Modules/_ctypes/libffi/testsuite/lib/libffi.exp +@@ -222,6 +222,10 @@ + lappend options "libs= -lpthread" + } + ++ if { [string match "*.cc" $source] } { ++ lappend options "c++" ++ } ++ + verbose "options: $options" + return [target_compile $source $dest $type $options] + } +@@ -273,6 +277,46 @@ + } + } + ++proc run-many-tests { testcases extra_flags } { ++ global using_gcc ++ if { [string match $using_gcc "yes"] } { ++ set common "-W -Wall" ++ set optimizations { "-O0" "-O2" "-O3" "-Os" "-O2 -fomit-frame-pointer" } ++ } else { ++ # Assume we are using the vendor compiler. ++ set common "" ++ set optimizations { "" } ++ } ++ ++ set targetabis { "" } ++ if [string match $using_gcc "yes"] { ++ if [istarget "i?86-*-*"] { ++ set targetabis { ++ "" ++ "-DABI_NUM=FFI_STDCALL -DABI_ATTR=__STDCALL__" ++ "-DABI_NUM=FFI_THISCALL -DABI_ATTR=__THISCALL__" ++ "-DABI_NUM=FFI_FASTCALL -DABI_ATTR=__FASTCALL__" ++ } ++ } ++ } ++ ++ set common [ concat $common $extra_flags ] ++ foreach test $testcases { ++ set testname [file tail $test] ++ if [search_for $test "ABI_NUM"] { ++ set abis $targetabis ++ } else { ++ set abis { "" } ++ } ++ foreach opt $optimizations { ++ foreach abi $abis { ++ set options [concat $common $opt $abi] ++ verbose "Testing $testname, $options" 1 ++ dg-test $test $options "" ++ } ++ } ++ } ++} + + # Like check_conditional_xfail, but callable from a dg test. + +diff -r c0e311e010fc Modules/_ctypes/libffi/testsuite/libffi.call/call.exp +--- a/Modules/_ctypes/libffi/testsuite/libffi.call/call.exp ++++ b/Modules/_ctypes/libffi/testsuite/libffi.call/call.exp +@@ -19,20 +19,7 @@ + + global srcdir subdir + +-if { [string match $using_gcc "yes"] } { +- +- dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.\[cS\]]] "-O0 -W -Wall" "" +- dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.\[cS\]]] "-O2" "" +- dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.\[cS\]]] "-O3" "" +- dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.\[cS\]]] "-Os" "" +- dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.\[cS\]]] "-O2 -fomit-frame-pointer" "" +- +-} else { +- +- # Assume we are using the vendor compiler. +- dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.\[cS\]]] "" "" +- +-} ++run-many-tests [lsort [glob -nocomplain -- $srcdir/$subdir/*.{c,cc}]] "" + + dg-finish + +diff -r c0e311e010fc Modules/_ctypes/libffi/testsuite/libffi.call/closure_simple.c +--- /dev/null ++++ b/Modules/_ctypes/libffi/testsuite/libffi.call/closure_simple.c +@@ -0,0 +1,55 @@ ++/* Area: closure_call ++ Purpose: Check simple closure handling with all ABIs ++ Limitations: none. ++ PR: none. ++ Originator: */ ++ ++/* { dg-do run } */ ++#include "ffitest.h" ++ ++static void ++closure_test(ffi_cif* cif __UNUSED__, void* resp, void** args, void* userdata) ++{ ++ *(ffi_arg*)resp = ++ (int)*(int *)args[0] + (int)(*(int *)args[1]) ++ + (int)(*(int *)args[2]) + (int)(*(int *)args[3]) ++ + (int)(intptr_t)userdata; ++ ++ printf("%d %d %d %d: %d\n", ++ (int)*(int *)args[0], (int)(*(int *)args[1]), ++ (int)(*(int *)args[2]), (int)(*(int *)args[3]), ++ (int)*(ffi_arg *)resp); ++ ++} ++ ++typedef int (ABI_ATTR *closure_test_type0)(int, int, int, int); ++ ++int main (void) ++{ ++ ffi_cif cif; ++ void *code; ++ ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code); ++ ffi_type * cl_arg_types[17]; ++ int res; ++ ++ cl_arg_types[0] = &ffi_type_uint; ++ cl_arg_types[1] = &ffi_type_uint; ++ cl_arg_types[2] = &ffi_type_uint; ++ cl_arg_types[3] = &ffi_type_uint; ++ cl_arg_types[4] = NULL; ++ ++ /* Initialize the cif */ ++ CHECK(ffi_prep_cif(&cif, ABI_NUM, 4, ++ &ffi_type_sint, cl_arg_types) == FFI_OK); ++ ++ CHECK(ffi_prep_closure_loc(pcl, &cif, closure_test, ++ (void *) 3 /* userdata */, code) == FFI_OK); ++ ++ res = (*(closure_test_type0)code)(0, 1, 2, 3); ++ /* { dg-output "0 1 2 3: 9" } */ ++ ++ printf("res: %d\n",res); ++ /* { dg-output "\nres: 9" } */ ++ ++ exit(0); ++} +diff -r c0e311e010fc Modules/_ctypes/libffi/testsuite/libffi.call/closure_stdcall.c +--- a/Modules/_ctypes/libffi/testsuite/libffi.call/closure_stdcall.c ++++ /dev/null +@@ -1,72 +0,0 @@ +-/* Area: closure_call (stdcall convention) +- Purpose: Check handling when caller expects stdcall callee +- Limitations: none. +- PR: none. +- Originator: */ +- +-/* { dg-do run { target i?86-*-cygwin* i?86-*-mingw* } } */ +-#include "ffitest.h" +- +-static void +-closure_test_stdcall(ffi_cif* cif __UNUSED__, void* resp, void** args, +- void* userdata) +-{ +- *(ffi_arg*)resp = +- (int)*(int *)args[0] + (int)(*(int *)args[1]) +- + (int)(*(int *)args[2]) + (int)(*(int *)args[3]) +- + (int)(intptr_t)userdata; +- +- printf("%d %d %d %d: %d\n", +- (int)*(int *)args[0], (int)(*(int *)args[1]), +- (int)(*(int *)args[2]), (int)(*(int *)args[3]), +- (int)*(ffi_arg *)resp); +- +-} +- +-typedef int (__stdcall *closure_test_type0)(int, int, int, int); +- +-int main (void) +-{ +- ffi_cif cif; +- void *code; +- ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code); +- ffi_type * cl_arg_types[17]; +- int res; +- void* sp_pre; +- void* sp_post; +- char buf[1024]; +- +- cl_arg_types[0] = &ffi_type_uint; +- cl_arg_types[1] = &ffi_type_uint; +- cl_arg_types[2] = &ffi_type_uint; +- cl_arg_types[3] = &ffi_type_uint; +- cl_arg_types[4] = NULL; +- +- /* Initialize the cif */ +- CHECK(ffi_prep_cif(&cif, FFI_STDCALL, 4, +- &ffi_type_sint, cl_arg_types) == FFI_OK); +- +- CHECK(ffi_prep_closure_loc(pcl, &cif, closure_test_stdcall, +- (void *) 3 /* userdata */, code) == FFI_OK); +- +-#ifdef _MSC_VER +- __asm { mov sp_pre, esp } +-#else +- asm volatile (" movl %%esp,%0" : "=g" (sp_pre)); +-#endif +- res = (*(closure_test_type0)code)(0, 1, 2, 3); +-#ifdef _MSC_VER +- __asm { mov sp_post, esp } +-#else +- asm volatile (" movl %%esp,%0" : "=g" (sp_post)); +-#endif +- /* { dg-output "0 1 2 3: 9" } */ +- +- printf("res: %d\n",res); +- /* { dg-output "\nres: 9" } */ +- +- sprintf(buf, "mismatch: pre=%p vs post=%p", sp_pre, sp_post); +- printf("stack pointer %s\n", (sp_pre == sp_post ? "match" : buf)); +- /* { dg-output "\nstack pointer match" } */ +- exit(0); +-} +diff -r c0e311e010fc Modules/_ctypes/libffi/testsuite/libffi.call/closure_thiscall.c +--- a/Modules/_ctypes/libffi/testsuite/libffi.call/closure_thiscall.c ++++ /dev/null +@@ -1,72 +0,0 @@ +-/* Area: closure_call (thiscall convention) +- Purpose: Check handling when caller expects thiscall callee +- Limitations: none. +- PR: none. +- Originator: */ +- +-/* { dg-do run { target i?86-*-cygwin* i?86-*-mingw* } } */ +-#include "ffitest.h" +- +-static void +-closure_test_thiscall(ffi_cif* cif __UNUSED__, void* resp, void** args, +- void* userdata) +-{ +- *(ffi_arg*)resp = +- (int)*(int *)args[0] + (int)(*(int *)args[1]) +- + (int)(*(int *)args[2]) + (int)(*(int *)args[3]) +- + (int)(intptr_t)userdata; +- +- printf("%d %d %d %d: %d\n", +- (int)*(int *)args[0], (int)(*(int *)args[1]), +- (int)(*(int *)args[2]), (int)(*(int *)args[3]), +- (int)*(ffi_arg *)resp); +- +-} +- +-typedef int (__thiscall *closure_test_type0)(int, int, int, int); +- +-int main (void) +-{ +- ffi_cif cif; +- void *code; +- ffi_closure *pcl = ffi_closure_alloc(sizeof(ffi_closure), &code); +- ffi_type * cl_arg_types[17]; +- int res; +- void* sp_pre; +- void* sp_post; +- char buf[1024]; +- +- cl_arg_types[0] = &ffi_type_uint; +- cl_arg_types[1] = &ffi_type_uint; +- cl_arg_types[2] = &ffi_type_uint; +- cl_arg_types[3] = &ffi_type_uint; +- cl_arg_types[4] = NULL; +- +- /* Initialize the cif */ +- CHECK(ffi_prep_cif(&cif, FFI_THISCALL, 4, +- &ffi_type_sint, cl_arg_types) == FFI_OK); +- +- CHECK(ffi_prep_closure_loc(pcl, &cif, closure_test_thiscall, +- (void *) 3 /* userdata */, code) == FFI_OK); +- +-#ifdef _MSC_VER +- __asm { mov sp_pre, esp } +-#else +- asm volatile (" movl %%esp,%0" : "=g" (sp_pre)); +-#endif +- res = (*(closure_test_type0)code)(0, 1, 2, 3); +-#ifdef _MSC_VER +- __asm { mov sp_post, esp } +-#else +- asm volatile (" movl %%esp,%0" : "=g" (sp_post)); +-#endif +- /* { dg-output "0 1 2 3: 9" } */ +- +- printf("res: %d\n",res); +- /* { dg-output "\nres: 9" } */ +- +- sprintf(buf, "mismatch: pre=%p vs post=%p", sp_pre, sp_post); +- printf("stack pointer %s\n", (sp_pre == sp_post ? "match" : buf)); +- /* { dg-output "\nstack pointer match" } */ +- exit(0); +-} +diff -r c0e311e010fc Modules/_ctypes/libffi/testsuite/libffi.call/cls_double_va.c +--- a/Modules/_ctypes/libffi/testsuite/libffi.call/cls_double_va.c ++++ b/Modules/_ctypes/libffi/testsuite/libffi.call/cls_double_va.c +@@ -38,7 +38,7 @@ + + /* This printf call is variadic */ + CHECK(ffi_prep_cif_var(&cif, FFI_DEFAULT_ABI, 1, 2, &ffi_type_sint, +- arg_types) == FFI_OK); ++ arg_types) == FFI_OK); + + args[0] = &format; + args[1] = &doubleArg; +@@ -49,12 +49,10 @@ + printf("res: %d\n", (int) res); + /* { dg-output "\nres: 4" } */ + +- /* The call to cls_double_va_fn is static, so have to use a normal prep_cif */ +- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &ffi_type_sint, arg_types) == FFI_OK); ++ CHECK(ffi_prep_closure_loc(pcl, &cif, cls_double_va_fn, NULL, ++ code) == FFI_OK); + +- CHECK(ffi_prep_closure_loc(pcl, &cif, cls_double_va_fn, NULL, code) == FFI_OK); +- +- res = ((int(*)(char*, double))(code))(format, doubleArg); ++ res = ((int(*)(char*, ...))(code))(format, doubleArg); + /* { dg-output "\n7.0" } */ + printf("res: %d\n", (int) res); + /* { dg-output "\nres: 4" } */ +diff -r c0e311e010fc Modules/_ctypes/libffi/testsuite/libffi.call/cls_longdouble_va.c +--- a/Modules/_ctypes/libffi/testsuite/libffi.call/cls_longdouble_va.c ++++ b/Modules/_ctypes/libffi/testsuite/libffi.call/cls_longdouble_va.c +@@ -38,7 +38,7 @@ + + /* This printf call is variadic */ + CHECK(ffi_prep_cif_var(&cif, FFI_DEFAULT_ABI, 1, 2, &ffi_type_sint, +- arg_types) == FFI_OK); ++ arg_types) == FFI_OK); + + args[0] = &format; + args[1] = &ldArg; +@@ -49,13 +49,10 @@ + printf("res: %d\n", (int) res); + /* { dg-output "\nres: 4" } */ + +- /* The call to cls_longdouble_va_fn is static, so have to use a normal prep_cif */ +- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &ffi_type_sint, +- arg_types) == FFI_OK); ++ CHECK(ffi_prep_closure_loc(pcl, &cif, cls_longdouble_va_fn, NULL, ++ code) == FFI_OK); + +- CHECK(ffi_prep_closure_loc(pcl, &cif, cls_longdouble_va_fn, NULL, code) == FFI_OK); +- +- res = ((int(*)(char*, long double))(code))(format, ldArg); ++ res = ((int(*)(char*, ...))(code))(format, ldArg); + /* { dg-output "\n7.0" } */ + printf("res: %d\n", (int) res); + /* { dg-output "\nres: 4" } */ +diff -r c0e311e010fc Modules/_ctypes/libffi/testsuite/libffi.call/cls_struct_va1.c +--- a/Modules/_ctypes/libffi/testsuite/libffi.call/cls_struct_va1.c ++++ b/Modules/_ctypes/libffi/testsuite/libffi.call/cls_struct_va1.c +@@ -35,7 +35,7 @@ + printf ("%d %d %d %d %d %d %d %d %d %d\n", n, s1.a, s1.b, + l1.a, l1.b, l1.c, l1.d, l1.e, + s2.a, s2.b); +- * (int*) resp = 42; ++ * (ffi_arg*) resp = 42; + } + + int +diff -r c0e311e010fc Modules/_ctypes/libffi/testsuite/libffi.call/cls_uint_va.c +--- a/Modules/_ctypes/libffi/testsuite/libffi.call/cls_uint_va.c ++++ b/Modules/_ctypes/libffi/testsuite/libffi.call/cls_uint_va.c +@@ -13,9 +13,9 @@ + static void cls_ret_T_fn(ffi_cif* cif __UNUSED__, void* resp, void** args, + void* userdata __UNUSED__) + { +- *(T *)resp = *(T *)args[0]; ++ *(ffi_arg *)resp = *(T *)args[0]; + +- printf("%d: %d %d\n", *(T *)resp, *(T *)args[0], *(T *)args[1]); ++ printf("%d: %d %d\n", (int)*(ffi_arg *)resp, *(T *)args[0], *(T *)args[1]); + } + + typedef T (*cls_ret_T)(T, ...); +diff -r c0e311e010fc Modules/_ctypes/libffi/testsuite/libffi.call/fastthis1_win32.c +--- a/Modules/_ctypes/libffi/testsuite/libffi.call/fastthis1_win32.c ++++ /dev/null +@@ -1,50 +0,0 @@ +-/* Area: ffi_call +- Purpose: Check fastcall fct call on X86_WIN32 systems. +- Limitations: none. +- PR: none. +- Originator: From the original ffitest.c */ +- +-/* { dg-do run { target i?86-*-cygwin* i?86-*-mingw* } } */ +- +-#include "ffitest.h" +- +-static size_t __FASTCALL__ my_fastcall_f(char *s, float a) +-{ +- return (size_t) ((int) strlen(s) + (int) a); +-} +- +-int main (void) +-{ +- ffi_cif cif; +- ffi_type *args[MAX_ARGS]; +- void *values[MAX_ARGS]; +- ffi_arg rint; +- char *s; +- float v2; +- args[0] = &ffi_type_pointer; +- args[1] = &ffi_type_float; +- values[0] = (void*) &s; +- values[1] = (void*) &v2; +- +- /* Initialize the cif */ +- CHECK(ffi_prep_cif(&cif, FFI_FASTCALL, 2, +- &ffi_type_sint, args) == FFI_OK); +- +- s = "a"; +- v2 = 0.0; +- ffi_call(&cif, FFI_FN(my_fastcall_f), &rint, values); +- CHECK(rint == 1); +- +- s = "1234567"; +- v2 = -1.0; +- ffi_call(&cif, FFI_FN(my_fastcall_f), &rint, values); +- CHECK(rint == 6); +- +- s = "1234567890123456789012345"; +- v2 = 1.0; +- ffi_call(&cif, FFI_FN(my_fastcall_f), &rint, values); +- CHECK(rint == 26); +- +- printf("fastcall fct1 tests passed\n"); +- exit(0); +-} +diff -r c0e311e010fc Modules/_ctypes/libffi/testsuite/libffi.call/fastthis2_win32.c +--- a/Modules/_ctypes/libffi/testsuite/libffi.call/fastthis2_win32.c ++++ /dev/null +@@ -1,50 +0,0 @@ +-/* Area: ffi_call +- Purpose: Check fastcall fct call on X86_WIN32 systems. +- Limitations: none. +- PR: none. +- Originator: From the original ffitest.c */ +- +-/* { dg-do run { target i?86-*-cygwin* i?86-*-mingw* } } */ +- +-#include "ffitest.h" +- +-static size_t __FASTCALL__ my_fastcall_f(float a, char *s) +-{ +- return (size_t) ((int) strlen(s) + (int) a); +-} +- +-int main (void) +-{ +- ffi_cif cif; +- ffi_type *args[MAX_ARGS]; +- void *values[MAX_ARGS]; +- ffi_arg rint; +- char *s; +- float v2; +- args[1] = &ffi_type_pointer; +- args[0] = &ffi_type_float; +- values[1] = (void*) &s; +- values[0] = (void*) &v2; +- +- /* Initialize the cif */ +- CHECK(ffi_prep_cif(&cif, FFI_FASTCALL, 2, +- &ffi_type_sint, args) == FFI_OK); +- +- s = "a"; +- v2 = 0.0; +- ffi_call(&cif, FFI_FN(my_fastcall_f), &rint, values); +- CHECK(rint == 1); +- +- s = "1234567"; +- v2 = -1.0; +- ffi_call(&cif, FFI_FN(my_fastcall_f), &rint, values); +- CHECK(rint == 6); +- +- s = "1234567890123456789012345"; +- v2 = 1.0; +- ffi_call(&cif, FFI_FN(my_fastcall_f), &rint, values); +- CHECK(rint == 26); +- +- printf("fastcall fct2 tests passed\n"); +- exit(0); +-} +diff -r c0e311e010fc Modules/_ctypes/libffi/testsuite/libffi.call/fastthis3_win32.c +--- a/Modules/_ctypes/libffi/testsuite/libffi.call/fastthis3_win32.c ++++ /dev/null +@@ -1,56 +0,0 @@ +-/* Area: ffi_call +- Purpose: Check fastcall f call on X86_WIN32 systems. +- Limitations: none. +- PR: none. +- Originator: From the original ffitest.c */ +- +-/* { dg-do run { target i?86-*-cygwin* i?86-*-mingw* } } */ +- +-#include "ffitest.h" +- +-static size_t __FASTCALL__ my_fastcall_f(float a, char *s, int i) +-{ +- return (size_t) ((int) strlen(s) + (int) a + i); +-} +- +-int main (void) +-{ +- ffi_cif cif; +- ffi_type *args[MAX_ARGS]; +- void *values[MAX_ARGS]; +- ffi_arg rint; +- char *s; +- int v1; +- float v2; +- args[2] = &ffi_type_sint; +- args[1] = &ffi_type_pointer; +- args[0] = &ffi_type_float; +- values[2] = (void*) &v1; +- values[1] = (void*) &s; +- values[0] = (void*) &v2; +- +- /* Initialize the cif */ +- CHECK(ffi_prep_cif(&cif, FFI_FASTCALL, 3, +- &ffi_type_sint, args) == FFI_OK); +- +- s = "a"; +- v1 = 1; +- v2 = 0.0; +- ffi_call(&cif, FFI_FN(my_fastcall_f), &rint, values); +- CHECK(rint == 2); +- +- s = "1234567"; +- v2 = -1.0; +- v1 = -2; +- ffi_call(&cif, FFI_FN(my_fastcall_f), &rint, values); +- CHECK(rint == 4); +- +- s = "1234567890123456789012345"; +- v2 = 1.0; +- v1 = 2; +- ffi_call(&cif, FFI_FN(my_fastcall_f), &rint, values); +- CHECK(rint == 28); +- +- printf("fastcall fct3 tests passed\n"); +- exit(0); +-} +diff -r c0e311e010fc Modules/_ctypes/libffi/testsuite/libffi.call/ffitest.h +--- a/Modules/_ctypes/libffi/testsuite/libffi.call/ffitest.h ++++ b/Modules/_ctypes/libffi/testsuite/libffi.call/ffitest.h +@@ -15,22 +15,25 @@ + + #define MAX_ARGS 256 + +-#define CHECK(x) !(x) ? (abort(), 1) : 0 ++#define CHECK(x) (void)(!(x) ? (abort(), 1) : 0) + +-/* Define __UNUSED__ that also other compilers than gcc can run the tests. */ ++/* Define macros so that compilers other than gcc can run the tests. */ + #undef __UNUSED__ + #if defined(__GNUC__) + #define __UNUSED__ __attribute__((__unused__)) ++#define __STDCALL__ __attribute__((stdcall)) ++#define __THISCALL__ __attribute__((thiscall)) ++#define __FASTCALL__ __attribute__((fastcall)) + #else + #define __UNUSED__ ++#define __STDCALL__ __stdcall ++#define __THISCALL__ __thiscall ++#define __FASTCALL__ __fastcall + #endif + +-/* Define __FASTCALL__ so that other compilers than gcc can run the tests. */ +-#undef __FASTCALL__ +-#if defined _MSC_VER +-#define __FASTCALL__ __fastcall +-#else +-#define __FASTCALL__ __attribute__((fastcall)) ++#ifndef ABI_NUM ++#define ABI_NUM FFI_DEFAULT_ABI ++#define ABI_ATTR + #endif + + /* Prefer MAP_ANON(YMOUS) to /dev/zero, since we don't need to keep a +diff -r c0e311e010fc Modules/_ctypes/libffi/testsuite/libffi.call/many.c +--- a/Modules/_ctypes/libffi/testsuite/libffi.call/many.c ++++ b/Modules/_ctypes/libffi/testsuite/libffi.call/many.c +@@ -7,21 +7,11 @@ + /* { dg-do run } */ + #include "ffitest.h" + ++#include + #include ++#include + +-static float many(float f1, +- float f2, +- float f3, +- float f4, +- float f5, +- float f6, +- float f7, +- float f8, +- float f9, +- float f10, +- float f11, +- float f12, +- float f13) ++static float ABI_ATTR many(float f1, float f2, float f3, float f4, float f5, float f6, float f7, float f8, float f9, float f10, float f11, float f12, float f13) + { + #if 0 + printf("%f %f %f %f %f %f %f %f %f %f %f %f %f\n", +@@ -30,7 +20,7 @@ + (double) f11, (double) f12, (double) f13); + #endif + +- return ((f1/f2+f3/f4+f5/f6+f7/f8+f9/f10+f11/f12) * f13); ++ return f1+f2+f3+f4+f5+f6+f7+f8+f9+f10+f11+f12+f13; + } + + int main (void) +@@ -50,7 +40,7 @@ + } + + /* Initialize the cif */ +- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 13, ++ CHECK(ffi_prep_cif(&cif, ABI_NUM, 13, + &ffi_type_float, args) == FFI_OK); + + ffi_call(&cif, FFI_FN(many), &f, values); +@@ -62,7 +52,7 @@ + fa[8], fa[9], + fa[10],fa[11],fa[12]); + +- if (f - ff < FLT_EPSILON) ++ if (fabs(f - ff) < FLT_EPSILON) + exit(0); + else + abort(); +diff -r c0e311e010fc Modules/_ctypes/libffi/testsuite/libffi.call/many2.c +--- a/Modules/_ctypes/libffi/testsuite/libffi.call/many2.c ++++ b/Modules/_ctypes/libffi/testsuite/libffi.call/many2.c +@@ -22,7 +22,7 @@ + return a + b + c + d + e + f + g; + } + +-uint8_t ++uint8_t ABI_ATTR + bar (uint8_t a, uint8_t b, uint8_t c, uint8_t d, + uint8_t e, uint8_t f, uint8_t g) + { +@@ -42,7 +42,7 @@ + for (i = 0; i < NARGS; ++i) + ffitypes[i] = &ffi_type_uint8; + +- CHECK (ffi_prep_cif (&cif, FFI_DEFAULT_ABI, NARGS, ++ CHECK (ffi_prep_cif (&cif, ABI_NUM, NARGS, + &ffi_type_uint8, ffitypes) == FFI_OK); + + for (i = 0; i < NARGS; ++i) +diff -r c0e311e010fc Modules/_ctypes/libffi/testsuite/libffi.call/many2_win32.c +--- a/Modules/_ctypes/libffi/testsuite/libffi.call/many2_win32.c ++++ /dev/null +@@ -1,63 +0,0 @@ +-/* Area: ffi_call +- Purpose: Check stdcall many call on X86_WIN32 systems. +- Limitations: none. +- PR: none. +- Originator: From the original ffitest.c */ +- +-/* { dg-do run { target i?86-*-cygwin* i?86-*-mingw* } } */ +- +-#include "ffitest.h" +-#include +- +-static float __attribute__((fastcall)) fastcall_many(float f1, +- float f2, +- float f3, +- float f4, +- float f5, +- float f6, +- float f7, +- float f8, +- float f9, +- float f10, +- float f11, +- float f12, +- float f13) +-{ +- return ((f1/f2+f3/f4+f5/f6+f7/f8+f9/f10+f11/f12) * f13); +-} +- +-int main (void) +-{ +- ffi_cif cif; +- ffi_type *args[13]; +- void *values[13]; +- float fa[13]; +- float f, ff; +- unsigned long ul; +- +- for (ul = 0; ul < 13; ul++) +- { +- args[ul] = &ffi_type_float; +- values[ul] = &fa[ul]; +- fa[ul] = (float) ul; +- } +- +- /* Initialize the cif */ +- CHECK(ffi_prep_cif(&cif, FFI_FASTCALL, 13, +- &ffi_type_float, args) == FFI_OK); +- +- ff = fastcall_many(fa[0], fa[1], +- fa[2], fa[3], +- fa[4], fa[5], +- fa[6], fa[7], +- fa[8], fa[9], +- fa[10], fa[11], fa[12]); +- +- ffi_call(&cif, FFI_FN(fastcall_many), &f, values); +- +- if (f - ff < FLT_EPSILON) +- printf("fastcall many arg tests ok!\n"); +- else +- CHECK(0); +- exit(0); +-} +diff -r c0e311e010fc Modules/_ctypes/libffi/testsuite/libffi.call/many_win32.c +--- a/Modules/_ctypes/libffi/testsuite/libffi.call/many_win32.c ++++ /dev/null +@@ -1,63 +0,0 @@ +-/* Area: ffi_call +- Purpose: Check stdcall many call on X86_WIN32 systems. +- Limitations: none. +- PR: none. +- Originator: From the original ffitest.c */ +- +-/* { dg-do run { target i?86-*-cygwin* i?86-*-mingw* } } */ +- +-#include "ffitest.h" +-#include +- +-static float __attribute__((stdcall)) stdcall_many(float f1, +- float f2, +- float f3, +- float f4, +- float f5, +- float f6, +- float f7, +- float f8, +- float f9, +- float f10, +- float f11, +- float f12, +- float f13) +-{ +- return ((f1/f2+f3/f4+f5/f6+f7/f8+f9/f10+f11/f12) * f13); +-} +- +-int main (void) +-{ +- ffi_cif cif; +- ffi_type *args[13]; +- void *values[13]; +- float fa[13]; +- float f, ff; +- unsigned long ul; +- +- for (ul = 0; ul < 13; ul++) +- { +- args[ul] = &ffi_type_float; +- values[ul] = &fa[ul]; +- fa[ul] = (float) ul; +- } +- +- /* Initialize the cif */ +- CHECK(ffi_prep_cif(&cif, FFI_STDCALL, 13, +- &ffi_type_float, args) == FFI_OK); +- +- ff = stdcall_many(fa[0], fa[1], +- fa[2], fa[3], +- fa[4], fa[5], +- fa[6], fa[7], +- fa[8], fa[9], +- fa[10], fa[11], fa[12]); +- +- ffi_call(&cif, FFI_FN(stdcall_many), &f, values); +- +- if (f - ff < FLT_EPSILON) +- printf("stdcall many arg tests ok!\n"); +- else +- CHECK(0); +- exit(0); +-} +diff -r c0e311e010fc Modules/_ctypes/libffi/testsuite/libffi.call/nested_struct11.c +--- a/Modules/_ctypes/libffi/testsuite/libffi.call/nested_struct11.c ++++ b/Modules/_ctypes/libffi/testsuite/libffi.call/nested_struct11.c +@@ -1,7 +1,7 @@ + /* Area: ffi_call, closure_call + Purpose: Check parameter passing with nested structs + of a single type. This tests the special cases +- for homogenous floating-point aggregates in the ++ for homogeneous floating-point aggregates in the + AArch64 PCS. + Limitations: none. + PR: none. +diff -r c0e311e010fc Modules/_ctypes/libffi/testsuite/libffi.call/strlen.c +--- a/Modules/_ctypes/libffi/testsuite/libffi.call/strlen.c ++++ b/Modules/_ctypes/libffi/testsuite/libffi.call/strlen.c +@@ -7,7 +7,7 @@ + /* { dg-do run } */ + #include "ffitest.h" + +-static size_t my_strlen(char *s) ++static size_t ABI_ATTR my_strlen(char *s) + { + return (strlen(s)); + } +@@ -24,7 +24,7 @@ + values[0] = (void*) &s; + + /* Initialize the cif */ +- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1, ++ CHECK(ffi_prep_cif(&cif, ABI_NUM, 1, + &ffi_type_sint, args) == FFI_OK); + + s = "a"; +diff -r c0e311e010fc Modules/_ctypes/libffi/testsuite/libffi.call/strlen2.c +--- /dev/null ++++ b/Modules/_ctypes/libffi/testsuite/libffi.call/strlen2.c +@@ -0,0 +1,49 @@ ++/* Area: ffi_call ++ Purpose: Check strlen function call with additional arguments. ++ Limitations: none. ++ PR: none. ++ Originator: From the original ffitest.c */ ++ ++/* { dg-do run } */ ++ ++#include "ffitest.h" ++ ++static size_t ABI_ATTR my_f(char *s, float a) ++{ ++ return (size_t) ((int) strlen(s) + (int) a); ++} ++ ++int main (void) ++{ ++ ffi_cif cif; ++ ffi_type *args[MAX_ARGS]; ++ void *values[MAX_ARGS]; ++ ffi_arg rint; ++ char *s; ++ float v2; ++ args[0] = &ffi_type_pointer; ++ args[1] = &ffi_type_float; ++ values[0] = (void*) &s; ++ values[1] = (void*) &v2; ++ ++ /* Initialize the cif */ ++ CHECK(ffi_prep_cif(&cif, ABI_NUM, 2, ++ &ffi_type_sint, args) == FFI_OK); ++ ++ s = "a"; ++ v2 = 0.0; ++ ffi_call(&cif, FFI_FN(my_f), &rint, values); ++ CHECK(rint == 1); ++ ++ s = "1234567"; ++ v2 = -1.0; ++ ffi_call(&cif, FFI_FN(my_f), &rint, values); ++ CHECK(rint == 6); ++ ++ s = "1234567890123456789012345"; ++ v2 = 1.0; ++ ffi_call(&cif, FFI_FN(my_f), &rint, values); ++ CHECK(rint == 26); ++ ++ exit(0); ++} +diff -r c0e311e010fc Modules/_ctypes/libffi/testsuite/libffi.call/strlen2_win32.c +--- a/Modules/_ctypes/libffi/testsuite/libffi.call/strlen2_win32.c ++++ /dev/null +@@ -1,44 +0,0 @@ +-/* Area: ffi_call +- Purpose: Check fastcall strlen call on X86_WIN32 systems. +- Limitations: none. +- PR: none. +- Originator: From the original ffitest.c */ +- +-/* { dg-do run { target i?86-*-cygwin* i?86-*-mingw* } } */ +- +-#include "ffitest.h" +- +-static size_t __FASTCALL__ my_fastcall_strlen(char *s) +-{ +- return (strlen(s)); +-} +- +-int main (void) +-{ +- ffi_cif cif; +- ffi_type *args[MAX_ARGS]; +- void *values[MAX_ARGS]; +- ffi_arg rint; +- char *s; +- args[0] = &ffi_type_pointer; +- values[0] = (void*) &s; +- +- /* Initialize the cif */ +- CHECK(ffi_prep_cif(&cif, FFI_FASTCALL, 1, +- &ffi_type_sint, args) == FFI_OK); +- +- s = "a"; +- ffi_call(&cif, FFI_FN(my_fastcall_strlen), &rint, values); +- CHECK(rint == 1); +- +- s = "1234567"; +- ffi_call(&cif, FFI_FN(my_fastcall_strlen), &rint, values); +- CHECK(rint == 7); +- +- s = "1234567890123456789012345"; +- ffi_call(&cif, FFI_FN(my_fastcall_strlen), &rint, values); +- CHECK(rint == 25); +- +- printf("fastcall strlen tests passed\n"); +- exit(0); +-} +diff -r c0e311e010fc Modules/_ctypes/libffi/testsuite/libffi.call/strlen3.c +--- /dev/null ++++ b/Modules/_ctypes/libffi/testsuite/libffi.call/strlen3.c +@@ -0,0 +1,49 @@ ++/* Area: ffi_call ++ Purpose: Check strlen function call with additional arguments. ++ Limitations: none. ++ PR: none. ++ Originator: From the original ffitest.c */ ++ ++/* { dg-do run } */ ++ ++#include "ffitest.h" ++ ++static size_t ABI_ATTR my_f(float a, char *s) ++{ ++ return (size_t) ((int) strlen(s) + (int) a); ++} ++ ++int main (void) ++{ ++ ffi_cif cif; ++ ffi_type *args[MAX_ARGS]; ++ void *values[MAX_ARGS]; ++ ffi_arg rint; ++ char *s; ++ float v2; ++ args[1] = &ffi_type_pointer; ++ args[0] = &ffi_type_float; ++ values[1] = (void*) &s; ++ values[0] = (void*) &v2; ++ ++ /* Initialize the cif */ ++ CHECK(ffi_prep_cif(&cif, ABI_NUM, 2, ++ &ffi_type_sint, args) == FFI_OK); ++ ++ s = "a"; ++ v2 = 0.0; ++ ffi_call(&cif, FFI_FN(my_f), &rint, values); ++ CHECK(rint == 1); ++ ++ s = "1234567"; ++ v2 = -1.0; ++ ffi_call(&cif, FFI_FN(my_f), &rint, values); ++ CHECK(rint == 6); ++ ++ s = "1234567890123456789012345"; ++ v2 = 1.0; ++ ffi_call(&cif, FFI_FN(my_f), &rint, values); ++ CHECK(rint == 26); ++ ++ exit(0); ++} +diff -r c0e311e010fc Modules/_ctypes/libffi/testsuite/libffi.call/strlen4.c +--- /dev/null ++++ b/Modules/_ctypes/libffi/testsuite/libffi.call/strlen4.c +@@ -0,0 +1,55 @@ ++/* Area: ffi_call ++ Purpose: Check strlen function call with additional arguments. ++ Limitations: none. ++ PR: none. ++ Originator: From the original ffitest.c */ ++ ++/* { dg-do run } */ ++ ++#include "ffitest.h" ++ ++static size_t ABI_ATTR my_f(float a, char *s, int i) ++{ ++ return (size_t) ((int) strlen(s) + (int) a + i); ++} ++ ++int main (void) ++{ ++ ffi_cif cif; ++ ffi_type *args[MAX_ARGS]; ++ void *values[MAX_ARGS]; ++ ffi_arg rint; ++ char *s; ++ int v1; ++ float v2; ++ args[2] = &ffi_type_sint; ++ args[1] = &ffi_type_pointer; ++ args[0] = &ffi_type_float; ++ values[2] = (void*) &v1; ++ values[1] = (void*) &s; ++ values[0] = (void*) &v2; ++ ++ /* Initialize the cif */ ++ CHECK(ffi_prep_cif(&cif, ABI_NUM, 3, ++ &ffi_type_sint, args) == FFI_OK); ++ ++ s = "a"; ++ v1 = 1; ++ v2 = 0.0; ++ ffi_call(&cif, FFI_FN(my_f), &rint, values); ++ CHECK(rint == 2); ++ ++ s = "1234567"; ++ v2 = -1.0; ++ v1 = -2; ++ ffi_call(&cif, FFI_FN(my_f), &rint, values); ++ CHECK(rint == 4); ++ ++ s = "1234567890123456789012345"; ++ v2 = 1.0; ++ v1 = 2; ++ ffi_call(&cif, FFI_FN(my_f), &rint, values); ++ CHECK(rint == 28); ++ ++ exit(0); ++} +diff -r c0e311e010fc Modules/_ctypes/libffi/testsuite/libffi.call/strlen_win32.c +--- a/Modules/_ctypes/libffi/testsuite/libffi.call/strlen_win32.c ++++ /dev/null +@@ -1,44 +0,0 @@ +-/* Area: ffi_call +- Purpose: Check stdcall strlen call on X86_WIN32 systems. +- Limitations: none. +- PR: none. +- Originator: From the original ffitest.c */ +- +-/* { dg-do run { target i?86-*-cygwin* i?86-*-mingw* } } */ +- +-#include "ffitest.h" +- +-static size_t __attribute__((stdcall)) my_stdcall_strlen(char *s) +-{ +- return (strlen(s)); +-} +- +-int main (void) +-{ +- ffi_cif cif; +- ffi_type *args[MAX_ARGS]; +- void *values[MAX_ARGS]; +- ffi_arg rint; +- char *s; +- args[0] = &ffi_type_pointer; +- values[0] = (void*) &s; +- +- /* Initialize the cif */ +- CHECK(ffi_prep_cif(&cif, FFI_STDCALL, 1, +- &ffi_type_sint, args) == FFI_OK); +- +- s = "a"; +- ffi_call(&cif, FFI_FN(my_stdcall_strlen), &rint, values); +- CHECK(rint == 1); +- +- s = "1234567"; +- ffi_call(&cif, FFI_FN(my_stdcall_strlen), &rint, values); +- CHECK(rint == 7); +- +- s = "1234567890123456789012345"; +- ffi_call(&cif, FFI_FN(my_stdcall_strlen), &rint, values); +- CHECK(rint == 25); +- +- printf("stdcall strlen tests passed\n"); +- exit(0); +-} +diff -r c0e311e010fc Modules/_ctypes/libffi/testsuite/libffi.call/struct1.c +--- a/Modules/_ctypes/libffi/testsuite/libffi.call/struct1.c ++++ b/Modules/_ctypes/libffi/testsuite/libffi.call/struct1.c +@@ -14,7 +14,7 @@ + unsigned int ui; + } test_structure_1; + +-static test_structure_1 struct1(test_structure_1 ts) ++static test_structure_1 ABI_ATTR struct1(test_structure_1 ts) + { + ts.uc++; + ts.d--; +@@ -50,7 +50,7 @@ + values[0] = &ts1_arg; + + /* Initialize the cif */ +- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1, ++ CHECK(ffi_prep_cif(&cif, ABI_NUM, 1, + &ts1_type, args) == FFI_OK); + + ts1_arg.uc = '\x01'; +diff -r c0e311e010fc Modules/_ctypes/libffi/testsuite/libffi.call/struct1_win32.c +--- a/Modules/_ctypes/libffi/testsuite/libffi.call/struct1_win32.c ++++ /dev/null +@@ -1,67 +0,0 @@ +-/* Area: ffi_call +- Purpose: Check structures with fastcall/thiscall convention. +- Limitations: none. +- PR: none. +- Originator: From the original ffitest.c */ +- +-/* { dg-do run { target i?86-*-cygwin* i?86-*-mingw* } } */ +-#include "ffitest.h" +- +-typedef struct +-{ +- unsigned char uc; +- double d; +- unsigned int ui; +-} test_structure_1; +- +-static test_structure_1 __FASTCALL__ struct1(test_structure_1 ts) +-{ +- ts.uc++; +- ts.d--; +- ts.ui++; +- +- return ts; +-} +- +-int main (void) +-{ +- ffi_cif cif; +- ffi_type *args[MAX_ARGS]; +- void *values[MAX_ARGS]; +- ffi_type ts1_type; +- ffi_type *ts1_type_elements[4]; +- +- test_structure_1 ts1_arg; +- +- /* This is a hack to get a properly aligned result buffer */ +- test_structure_1 *ts1_result = +- (test_structure_1 *) malloc (sizeof(test_structure_1)); +- +- ts1_type.size = 0; +- ts1_type.alignment = 0; +- ts1_type.type = FFI_TYPE_STRUCT; +- ts1_type.elements = ts1_type_elements; +- ts1_type_elements[0] = &ffi_type_uchar; +- ts1_type_elements[1] = &ffi_type_double; +- ts1_type_elements[2] = &ffi_type_uint; +- ts1_type_elements[3] = NULL; +- +- args[0] = &ts1_type; +- values[0] = &ts1_arg; +- +- /* Initialize the cif */ +- CHECK(ffi_prep_cif(&cif, FFI_FASTCALL, 1, +- &ts1_type, args) == FFI_OK); +- +- ts1_arg.uc = '\x01'; +- ts1_arg.d = 3.14159; +- ts1_arg.ui = 555; +- +- ffi_call(&cif, FFI_FN(struct1), ts1_result, values); +- +- CHECK(ts1_result->ui == 556); +- CHECK(ts1_result->d == 3.14159 - 1); +- +- free (ts1_result); +- exit(0); +-} +diff -r c0e311e010fc Modules/_ctypes/libffi/testsuite/libffi.call/struct2.c +--- a/Modules/_ctypes/libffi/testsuite/libffi.call/struct2.c ++++ b/Modules/_ctypes/libffi/testsuite/libffi.call/struct2.c +@@ -13,7 +13,7 @@ + double d2; + } test_structure_2; + +-static test_structure_2 struct2(test_structure_2 ts) ++static test_structure_2 ABI_ATTR struct2(test_structure_2 ts) + { + ts.d1--; + ts.d2--; +@@ -46,7 +46,7 @@ + values[0] = &ts2_arg; + + /* Initialize the cif */ +- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1, &ts2_type, args) == FFI_OK); ++ CHECK(ffi_prep_cif(&cif, ABI_NUM, 1, &ts2_type, args) == FFI_OK); + + ts2_arg.d1 = 5.55; + ts2_arg.d2 = 6.66; +diff -r c0e311e010fc Modules/_ctypes/libffi/testsuite/libffi.call/struct2_win32.c +--- a/Modules/_ctypes/libffi/testsuite/libffi.call/struct2_win32.c ++++ /dev/null +@@ -1,67 +0,0 @@ +-/* Area: ffi_call +- Purpose: Check structures in fastcall/stdcall function +- Limitations: none. +- PR: none. +- Originator: From the original ffitest.c */ +- +-/* { dg-do run { target i?86-*-cygwin* i?86-*-mingw* } } */ +-#include "ffitest.h" +- +-typedef struct +-{ +- double d1; +- double d2; +-} test_structure_2; +- +-static test_structure_2 __FASTCALL__ struct2(test_structure_2 ts) +-{ +- ts.d1--; +- ts.d2--; +- +- return ts; +-} +- +-int main (void) +-{ +- ffi_cif cif; +- ffi_type *args[MAX_ARGS]; +- void *values[MAX_ARGS]; +- test_structure_2 ts2_arg; +- ffi_type ts2_type; +- ffi_type *ts2_type_elements[3]; +- +- /* This is a hack to get a properly aligned result buffer */ +- test_structure_2 *ts2_result = +- (test_structure_2 *) malloc (sizeof(test_structure_2)); +- +- ts2_type.size = 0; +- ts2_type.alignment = 0; +- ts2_type.type = FFI_TYPE_STRUCT; +- ts2_type.elements = ts2_type_elements; +- ts2_type_elements[0] = &ffi_type_double; +- ts2_type_elements[1] = &ffi_type_double; +- ts2_type_elements[2] = NULL; +- +- args[0] = &ts2_type; +- values[0] = &ts2_arg; +- +- /* Initialize the cif */ +- CHECK(ffi_prep_cif(&cif, FFI_FASTCALL, 1, &ts2_type, args) == FFI_OK); +- +- ts2_arg.d1 = 5.55; +- ts2_arg.d2 = 6.66; +- +- printf ("%g\n", ts2_arg.d1); +- printf ("%g\n", ts2_arg.d2); +- +- ffi_call(&cif, FFI_FN(struct2), ts2_result, values); +- +- printf ("%g\n", ts2_result->d1); +- printf ("%g\n", ts2_result->d2); +- +- CHECK(ts2_result->d1 == 5.55 - 1); +- CHECK(ts2_result->d2 == 6.66 - 1); +- +- free (ts2_result); +- exit(0); +-} +diff -r c0e311e010fc Modules/_ctypes/libffi/testsuite/libffi.call/struct3.c +--- a/Modules/_ctypes/libffi/testsuite/libffi.call/struct3.c ++++ b/Modules/_ctypes/libffi/testsuite/libffi.call/struct3.c +@@ -12,7 +12,7 @@ + int si; + } test_structure_3; + +-static test_structure_3 struct3(test_structure_3 ts) ++static test_structure_3 ABI_ATTR struct3(test_structure_3 ts) + { + ts.si = -(ts.si*2); + +@@ -43,7 +43,7 @@ + values[0] = &ts3_arg; + + /* Initialize the cif */ +- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1, ++ CHECK(ffi_prep_cif(&cif, ABI_NUM, 1, + &ts3_type, args) == FFI_OK); + + ts3_arg.si = -123; +diff -r c0e311e010fc Modules/_ctypes/libffi/testsuite/libffi.call/struct4.c +--- a/Modules/_ctypes/libffi/testsuite/libffi.call/struct4.c ++++ b/Modules/_ctypes/libffi/testsuite/libffi.call/struct4.c +@@ -14,7 +14,7 @@ + unsigned ui3; + } test_structure_4; + +-static test_structure_4 struct4(test_structure_4 ts) ++static test_structure_4 ABI_ATTR struct4(test_structure_4 ts) + { + ts.ui3 = ts.ui1 * ts.ui2 * ts.ui3; + +@@ -48,7 +48,7 @@ + values[0] = &ts4_arg; + + /* Initialize the cif */ +- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1, &ts4_type, args) == FFI_OK); ++ CHECK(ffi_prep_cif(&cif, ABI_NUM, 1, &ts4_type, args) == FFI_OK); + + ts4_arg.ui1 = 2; + ts4_arg.ui2 = 3; +diff -r c0e311e010fc Modules/_ctypes/libffi/testsuite/libffi.call/struct5.c +--- a/Modules/_ctypes/libffi/testsuite/libffi.call/struct5.c ++++ b/Modules/_ctypes/libffi/testsuite/libffi.call/struct5.c +@@ -12,7 +12,7 @@ + char c2; + } test_structure_5; + +-static test_structure_5 struct5(test_structure_5 ts1, test_structure_5 ts2) ++static test_structure_5 ABI_ATTR struct5(test_structure_5 ts1, test_structure_5 ts2) + { + ts1.c1 += ts2.c1; + ts1.c2 -= ts2.c2; +@@ -48,7 +48,7 @@ + values[1] = &ts5_arg2; + + /* Initialize the cif */ +- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &ts5_type, args) == FFI_OK); ++ CHECK(ffi_prep_cif(&cif, ABI_NUM, 2, &ts5_type, args) == FFI_OK); + + ts5_arg1.c1 = 2; + ts5_arg1.c2 = 6; +diff -r c0e311e010fc Modules/_ctypes/libffi/testsuite/libffi.call/struct6.c +--- a/Modules/_ctypes/libffi/testsuite/libffi.call/struct6.c ++++ b/Modules/_ctypes/libffi/testsuite/libffi.call/struct6.c +@@ -12,7 +12,7 @@ + double d; + } test_structure_6; + +-static test_structure_6 struct6 (test_structure_6 ts) ++static test_structure_6 ABI_ATTR struct6 (test_structure_6 ts) + { + ts.f += 1; + ts.d += 1; +@@ -46,7 +46,7 @@ + values[0] = &ts6_arg; + + /* Initialize the cif */ +- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1, &ts6_type, args) == FFI_OK); ++ CHECK(ffi_prep_cif(&cif, ABI_NUM, 1, &ts6_type, args) == FFI_OK); + + ts6_arg.f = 5.55f; + ts6_arg.d = 6.66; +diff -r c0e311e010fc Modules/_ctypes/libffi/testsuite/libffi.call/struct7.c +--- a/Modules/_ctypes/libffi/testsuite/libffi.call/struct7.c ++++ b/Modules/_ctypes/libffi/testsuite/libffi.call/struct7.c +@@ -13,7 +13,7 @@ + double d; + } test_structure_7; + +-static test_structure_7 struct7 (test_structure_7 ts) ++static test_structure_7 ABI_ATTR struct7 (test_structure_7 ts) + { + ts.f1 += 1; + ts.f2 += 1; +@@ -49,7 +49,7 @@ + values[0] = &ts7_arg; + + /* Initialize the cif */ +- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1, &ts7_type, args) == FFI_OK); ++ CHECK(ffi_prep_cif(&cif, ABI_NUM, 1, &ts7_type, args) == FFI_OK); + + ts7_arg.f1 = 5.55f; + ts7_arg.f2 = 55.5f; +diff -r c0e311e010fc Modules/_ctypes/libffi/testsuite/libffi.call/struct8.c +--- a/Modules/_ctypes/libffi/testsuite/libffi.call/struct8.c ++++ b/Modules/_ctypes/libffi/testsuite/libffi.call/struct8.c +@@ -14,7 +14,7 @@ + float f4; + } test_structure_8; + +-static test_structure_8 struct8 (test_structure_8 ts) ++static test_structure_8 ABI_ATTR struct8 (test_structure_8 ts) + { + ts.f1 += 1; + ts.f2 += 1; +@@ -52,7 +52,7 @@ + values[0] = &ts8_arg; + + /* Initialize the cif */ +- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1, &ts8_type, args) == FFI_OK); ++ CHECK(ffi_prep_cif(&cif, ABI_NUM, 1, &ts8_type, args) == FFI_OK); + + ts8_arg.f1 = 5.55f; + ts8_arg.f2 = 55.5f; +diff -r c0e311e010fc Modules/_ctypes/libffi/testsuite/libffi.call/struct9.c +--- a/Modules/_ctypes/libffi/testsuite/libffi.call/struct9.c ++++ b/Modules/_ctypes/libffi/testsuite/libffi.call/struct9.c +@@ -13,7 +13,7 @@ + int i; + } test_structure_9; + +-static test_structure_9 struct9 (test_structure_9 ts) ++static test_structure_9 ABI_ATTR struct9 (test_structure_9 ts) + { + ts.f += 1; + ts.i += 1; +@@ -47,7 +47,7 @@ + values[0] = &ts9_arg; + + /* Initialize the cif */ +- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1, &ts9_type, args) == FFI_OK); ++ CHECK(ffi_prep_cif(&cif, ABI_NUM, 1, &ts9_type, args) == FFI_OK); + + ts9_arg.f = 5.55f; + ts9_arg.i = 5; +diff -r c0e311e010fc Modules/_ctypes/libffi/testsuite/libffi.call/unwindtest.cc +--- /dev/null ++++ b/Modules/_ctypes/libffi/testsuite/libffi.call/unwindtest.cc +@@ -0,0 +1,117 @@ ++/* Area: ffi_closure, unwind info ++ Purpose: Check if the unwind information is passed correctly. ++ Limitations: none. ++ PR: none. ++ Originator: Jeff Sturm */ ++ ++/* { dg-do run } */ ++ ++#include "ffitest.h" ++ ++void ABI_ATTR ++closure_test_fn(ffi_cif* cif __UNUSED__, void* resp __UNUSED__, ++ void** args __UNUSED__, void* userdata __UNUSED__) ++{ ++ throw 9; ++} ++ ++typedef void (*closure_test_type)(); ++ ++void closure_test_fn1(ffi_cif* cif __UNUSED__, void* resp, ++ void** args, void* userdata __UNUSED__) ++ { ++ *(ffi_arg*)resp = ++ (int)*(float *)args[0] +(int)(*(float *)args[1]) + ++ (int)(*(float *)args[2]) + (int)*(float *)args[3] + ++ (int)(*(signed short *)args[4]) + (int)(*(float *)args[5]) + ++ (int)*(float *)args[6] + (int)(*(int *)args[7]) + ++ (int)(*(double*)args[8]) + (int)*(int *)args[9] + ++ (int)(*(int *)args[10]) + (int)(*(float *)args[11]) + ++ (int)*(int *)args[12] + (int)(*(int *)args[13]) + ++ (int)(*(int *)args[14]) + *(int *)args[15] + (int)(intptr_t)userdata; ++ ++ printf("%d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d: %d\n", ++ (int)*(float *)args[0], (int)(*(float *)args[1]), ++ (int)(*(float *)args[2]), (int)*(float *)args[3], ++ (int)(*(signed short *)args[4]), (int)(*(float *)args[5]), ++ (int)*(float *)args[6], (int)(*(int *)args[7]), ++ (int)(*(double *)args[8]), (int)*(int *)args[9], ++ (int)(*(int *)args[10]), (int)(*(float *)args[11]), ++ (int)*(int *)args[12], (int)(*(int *)args[13]), ++ (int)(*(int *)args[14]), *(int *)args[15], ++ (int)(intptr_t)userdata, (int)*(ffi_arg*)resp); ++ ++ throw (int)*(ffi_arg*)resp; ++} ++ ++typedef int (*closure_test_type1)(float, float, float, float, signed short, ++ float, float, int, double, int, int, float, ++ int, int, int, int); ++ ++int main (void) ++{ ++ ffi_cif cif; ++ void *code; ++ ffi_closure *pcl = (ffi_closure *)ffi_closure_alloc(sizeof(ffi_closure), &code); ++ ffi_type * cl_arg_types[17]; ++ ++ { ++ cl_arg_types[1] = NULL; ++ ++ CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 0, ++ &ffi_type_void, cl_arg_types) == FFI_OK); ++ CHECK(ffi_prep_closure_loc(pcl, &cif, closure_test_fn, NULL, code) == FFI_OK); ++ ++ try ++ { ++ (*((closure_test_type)(code)))(); ++ } catch (int exception_code) ++ { ++ CHECK(exception_code == 9); ++ } ++ ++ printf("part one OK\n"); ++ /* { dg-output "part one OK" } */ ++ } ++ ++ { ++ ++ cl_arg_types[0] = &ffi_type_float; ++ cl_arg_types[1] = &ffi_type_float; ++ cl_arg_types[2] = &ffi_type_float; ++ cl_arg_types[3] = &ffi_type_float; ++ cl_arg_types[4] = &ffi_type_sshort; ++ cl_arg_types[5] = &ffi_type_float; ++ cl_arg_types[6] = &ffi_type_float; ++ cl_arg_types[7] = &ffi_type_uint; ++ cl_arg_types[8] = &ffi_type_double; ++ cl_arg_types[9] = &ffi_type_uint; ++ cl_arg_types[10] = &ffi_type_uint; ++ cl_arg_types[11] = &ffi_type_float; ++ cl_arg_types[12] = &ffi_type_uint; ++ cl_arg_types[13] = &ffi_type_uint; ++ cl_arg_types[14] = &ffi_type_uint; ++ cl_arg_types[15] = &ffi_type_uint; ++ cl_arg_types[16] = NULL; ++ ++ /* Initialize the cif */ ++ CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 16, ++ &ffi_type_sint, cl_arg_types) == FFI_OK); ++ ++ CHECK(ffi_prep_closure_loc(pcl, &cif, closure_test_fn1, ++ (void *) 3 /* userdata */, code) == FFI_OK); ++ try ++ { ++ (*((closure_test_type1)code)) ++ (1.1, 2.2, 3.3, 4.4, 127, 5.5, 6.6, 8, 9, 10, 11, 12.0, 13, ++ 19, 21, 1); ++ /* { dg-output "\n1 2 3 4 127 5 6 8 9 10 11 12 13 19 21 1 3: 255" } */ ++ } catch (int exception_code) ++ { ++ CHECK(exception_code == 255); ++ } ++ printf("part two OK\n"); ++ /* { dg-output "\npart two OK" } */ ++ } ++ exit(0); ++} +diff -r c0e311e010fc Modules/_ctypes/libffi/testsuite/libffi.call/unwindtest_ffi_call.cc +--- /dev/null ++++ b/Modules/_ctypes/libffi/testsuite/libffi.call/unwindtest_ffi_call.cc +@@ -0,0 +1,54 @@ ++/* Area: ffi_call, unwind info ++ Purpose: Check if the unwind information is passed correctly. ++ Limitations: none. ++ PR: none. ++ Originator: Andreas Tobler 20061213 */ ++ ++/* { dg-do run } */ ++ ++#include "ffitest.h" ++ ++static int checking(int a __UNUSED__, short b __UNUSED__, ++ signed char c __UNUSED__) ++{ ++ throw 9; ++} ++ ++int main (void) ++{ ++ ffi_cif cif; ++ ffi_type *args[MAX_ARGS]; ++ void *values[MAX_ARGS]; ++ ffi_arg rint; ++ ++ signed int si; ++ signed short ss; ++ signed char sc; ++ ++ args[0] = &ffi_type_sint; ++ values[0] = &si; ++ args[1] = &ffi_type_sshort; ++ values[1] = &ss; ++ args[2] = &ffi_type_schar; ++ values[2] = ≻ ++ ++ /* Initialize the cif */ ++ CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 3, ++ &ffi_type_sint, args) == FFI_OK); ++ ++ si = -6; ++ ss = -12; ++ sc = -1; ++ { ++ try ++ { ++ ffi_call(&cif, FFI_FN(checking), &rint, values); ++ } catch (int exception_code) ++ { ++ CHECK(exception_code == 9); ++ } ++ printf("part one OK\n"); ++ /* { dg-output "part one OK" } */ ++ } ++ exit(0); ++} +diff -r c0e311e010fc Modules/_ctypes/libffi/testsuite/libffi.call/va_1.c +--- a/Modules/_ctypes/libffi/testsuite/libffi.call/va_1.c ++++ b/Modules/_ctypes/libffi/testsuite/libffi.call/va_1.c +@@ -94,7 +94,7 @@ + struct large_tag l1; + + int n; +- int res; ++ ffi_arg res; + + unsigned char uc; + signed char sc; +diff -r c0e311e010fc Modules/_ctypes/libffi/testsuite/libffi.call/va_struct1.c +--- a/Modules/_ctypes/libffi/testsuite/libffi.call/va_struct1.c ++++ b/Modules/_ctypes/libffi/testsuite/libffi.call/va_struct1.c +@@ -61,7 +61,7 @@ + struct large_tag l1; + + int n; +- int res; ++ ffi_arg res; + + s_type.size = 0; + s_type.alignment = 0; +diff -r c0e311e010fc Modules/_ctypes/libffi/testsuite/libffi.special/ffitestcxx.h +--- a/Modules/_ctypes/libffi/testsuite/libffi.special/ffitestcxx.h ++++ /dev/null +@@ -1,55 +0,0 @@ +-#include +-#include +-#include +-#include +-#include "fficonfig.h" +- +-#define MAX_ARGS 256 +- +- +-/* Define __UNUSED__ that also other compilers than gcc can run the tests. */ +-#undef __UNUSED__ +-#if defined(__GNUC__) +-#define __UNUSED__ __attribute__((__unused__)) +-#else +-#define __UNUSED__ +-#endif +- +-#define CHECK(x) (!(x) ? abort() : (void)0) +- +-/* Prefer MAP_ANON(YMOUS) to /dev/zero, since we don't need to keep a +- file open. */ +-#ifdef HAVE_MMAP_ANON +-# undef HAVE_MMAP_DEV_ZERO +- +-# include +-# ifndef MAP_FAILED +-# define MAP_FAILED -1 +-# endif +-# if !defined (MAP_ANONYMOUS) && defined (MAP_ANON) +-# define MAP_ANONYMOUS MAP_ANON +-# endif +-# define USING_MMAP +- +-#endif +- +-#ifdef HAVE_MMAP_DEV_ZERO +- +-# include +-# ifndef MAP_FAILED +-# define MAP_FAILED -1 +-# endif +-# define USING_MMAP +- +-#endif +- +- +-/* MinGW kludge. */ +-#ifdef _WIN64 +-#define PRIdLL "I64d" +-#define PRIuLL "I64u" +-#else +-#define PRIdLL "lld" +-#define PRIuLL "llu" +-#endif +- +diff -r c0e311e010fc Modules/_ctypes/libffi/testsuite/libffi.special/special.exp +--- a/Modules/_ctypes/libffi/testsuite/libffi.special/special.exp ++++ /dev/null +@@ -1,39 +0,0 @@ +-# Copyright (C) 2003, 2006, 2009, 2010 Free Software Foundation, Inc. +- +-# This program is free software; you can redistribute it and/or modify +-# it under the terms of the GNU General Public License as published by +-# the Free Software Foundation; either version 3 of the License, or +-# (at your option) any later version. +-# +-# This program is distributed in the hope that it will be useful, +-# but WITHOUT ANY WARRANTY; without even the implied warranty of +-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-# GNU General Public License for more details. +-# +-# You should have received a copy of the GNU General Public License +-# along with this program; see the file COPYING3. If not see +-# . +- +-dg-init +-libffi-init +- +-global srcdir subdir +- +-global cxx_options +- +-set cxx_options " -shared-libgcc -lstdc++" +- +-if { [string match $using_gcc "yes"] } { +- +- dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.cc]] $cxx_options "-O0 -W -Wall" +- dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.cc]] $cxx_options "-O2" +- dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.cc]] $cxx_options "-O3" +- dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.cc]] $cxx_options "-Os" +- +-} +- +-dg-finish +- +-# Local Variables: +-# tcl-indent-level:4 +-# End: +diff -r c0e311e010fc Modules/_ctypes/libffi/testsuite/libffi.special/unwindtest.cc +--- a/Modules/_ctypes/libffi/testsuite/libffi.special/unwindtest.cc ++++ /dev/null +@@ -1,125 +0,0 @@ +-/* Area: ffi_closure, unwind info +- Purpose: Check if the unwind information is passed correctly. +- Limitations: none. +- PR: none. +- Originator: Jeff Sturm */ +- +-/* { dg-do run } */ +- +-#include "ffitestcxx.h" +- +-#if defined HAVE_STDINT_H +-#include +-#endif +- +-#if defined HAVE_INTTYPES_H +-#include +-#endif +- +-void +-closure_test_fn(ffi_cif* cif __UNUSED__, void* resp __UNUSED__, +- void** args __UNUSED__, void* userdata __UNUSED__) +-{ +- throw 9; +-} +- +-typedef void (*closure_test_type)(); +- +-void closure_test_fn1(ffi_cif* cif __UNUSED__, void* resp, +- void** args, void* userdata __UNUSED__) +- { +- *(ffi_arg*)resp = +- (int)*(float *)args[0] +(int)(*(float *)args[1]) + +- (int)(*(float *)args[2]) + (int)*(float *)args[3] + +- (int)(*(signed short *)args[4]) + (int)(*(float *)args[5]) + +- (int)*(float *)args[6] + (int)(*(int *)args[7]) + +- (int)(*(double*)args[8]) + (int)*(int *)args[9] + +- (int)(*(int *)args[10]) + (int)(*(float *)args[11]) + +- (int)*(int *)args[12] + (int)(*(int *)args[13]) + +- (int)(*(int *)args[14]) + *(int *)args[15] + (int)(intptr_t)userdata; +- +- printf("%d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d: %d\n", +- (int)*(float *)args[0], (int)(*(float *)args[1]), +- (int)(*(float *)args[2]), (int)*(float *)args[3], +- (int)(*(signed short *)args[4]), (int)(*(float *)args[5]), +- (int)*(float *)args[6], (int)(*(int *)args[7]), +- (int)(*(double *)args[8]), (int)*(int *)args[9], +- (int)(*(int *)args[10]), (int)(*(float *)args[11]), +- (int)*(int *)args[12], (int)(*(int *)args[13]), +- (int)(*(int *)args[14]), *(int *)args[15], +- (int)(intptr_t)userdata, (int)*(ffi_arg*)resp); +- +- throw (int)*(ffi_arg*)resp; +-} +- +-typedef int (*closure_test_type1)(float, float, float, float, signed short, +- float, float, int, double, int, int, float, +- int, int, int, int); +- +-int main (void) +-{ +- ffi_cif cif; +- void *code; +- ffi_closure *pcl = (ffi_closure *)ffi_closure_alloc(sizeof(ffi_closure), &code); +- ffi_type * cl_arg_types[17]; +- +- { +- cl_arg_types[1] = NULL; +- +- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 0, +- &ffi_type_void, cl_arg_types) == FFI_OK); +- CHECK(ffi_prep_closure_loc(pcl, &cif, closure_test_fn, NULL, code) == FFI_OK); +- +- try +- { +- (*((closure_test_type)(code)))(); +- } catch (int exception_code) +- { +- CHECK(exception_code == 9); +- } +- +- printf("part one OK\n"); +- /* { dg-output "part one OK" } */ +- } +- +- { +- +- cl_arg_types[0] = &ffi_type_float; +- cl_arg_types[1] = &ffi_type_float; +- cl_arg_types[2] = &ffi_type_float; +- cl_arg_types[3] = &ffi_type_float; +- cl_arg_types[4] = &ffi_type_sshort; +- cl_arg_types[5] = &ffi_type_float; +- cl_arg_types[6] = &ffi_type_float; +- cl_arg_types[7] = &ffi_type_uint; +- cl_arg_types[8] = &ffi_type_double; +- cl_arg_types[9] = &ffi_type_uint; +- cl_arg_types[10] = &ffi_type_uint; +- cl_arg_types[11] = &ffi_type_float; +- cl_arg_types[12] = &ffi_type_uint; +- cl_arg_types[13] = &ffi_type_uint; +- cl_arg_types[14] = &ffi_type_uint; +- cl_arg_types[15] = &ffi_type_uint; +- cl_arg_types[16] = NULL; +- +- /* Initialize the cif */ +- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 16, +- &ffi_type_sint, cl_arg_types) == FFI_OK); +- +- CHECK(ffi_prep_closure_loc(pcl, &cif, closure_test_fn1, +- (void *) 3 /* userdata */, code) == FFI_OK); +- try +- { +- (*((closure_test_type1)code)) +- (1.1, 2.2, 3.3, 4.4, 127, 5.5, 6.6, 8, 9, 10, 11, 12.0, 13, +- 19, 21, 1); +- /* { dg-output "\n1 2 3 4 127 5 6 8 9 10 11 12 13 19 21 1 3: 255" } */ +- } catch (int exception_code) +- { +- CHECK(exception_code == 255); +- } +- printf("part two OK\n"); +- /* { dg-output "\npart two OK" } */ +- } +- exit(0); +-} +diff -r c0e311e010fc Modules/_ctypes/libffi/testsuite/libffi.special/unwindtest_ffi_call.cc +--- a/Modules/_ctypes/libffi/testsuite/libffi.special/unwindtest_ffi_call.cc ++++ /dev/null +@@ -1,54 +0,0 @@ +-/* Area: ffi_call, unwind info +- Purpose: Check if the unwind information is passed correctly. +- Limitations: none. +- PR: none. +- Originator: Andreas Tobler 20061213 */ +- +-/* { dg-do run } */ +- +-#include "ffitestcxx.h" +- +-static int checking(int a __UNUSED__, short b __UNUSED__, +- signed char c __UNUSED__) +-{ +- throw 9; +-} +- +-int main (void) +-{ +- ffi_cif cif; +- ffi_type *args[MAX_ARGS]; +- void *values[MAX_ARGS]; +- ffi_arg rint; +- +- signed int si; +- signed short ss; +- signed char sc; +- +- args[0] = &ffi_type_sint; +- values[0] = &si; +- args[1] = &ffi_type_sshort; +- values[1] = &ss; +- args[2] = &ffi_type_schar; +- values[2] = ≻ +- +- /* Initialize the cif */ +- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 3, +- &ffi_type_sint, args) == FFI_OK); +- +- si = -6; +- ss = -12; +- sc = -1; +- { +- try +- { +- ffi_call(&cif, FFI_FN(checking), &rint, values); +- } catch (int exception_code) +- { +- CHECK(exception_code == 9); +- } +- printf("part one OK\n"); +- /* { dg-output "part one OK" } */ +- } +- exit(0); +-} +diff -r c0e311e010fc Modules/_ctypes/libffi/texinfo.tex +--- a/Modules/_ctypes/libffi/texinfo.tex ++++ b/Modules/_ctypes/libffi/texinfo.tex +@@ -3,11 +3,11 @@ + % Load plain if necessary, i.e., if running under initex. + \expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi + % +-\def\texinfoversion{2012-06-05.14} ++\def\texinfoversion{2013-02-01.11} + % + % Copyright 1985, 1986, 1988, 1990, 1991, 1992, 1993, 1994, 1995, + % 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, +-% 2007, 2008, 2009, 2010, 2011, 2012 Free Software Foundation, Inc. ++% 2007, 2008, 2009, 2010, 2011, 2012, 2013 Free Software Foundation, Inc. + % + % This texinfo.tex file is free software: you can redistribute it and/or + % modify it under the terms of the GNU General Public License as +@@ -24,7 +24,8 @@ + % + % As a special exception, when this file is read by TeX when processing + % a Texinfo source document, you may use the result without +-% restriction. (This has been our intent since Texinfo was invented.) ++% restriction. This Exception is an additional permission under section 7 ++% of the GNU General Public License, version 3 ("GPLv3"). + % + % Please try the latest version of texinfo.tex before submitting bug + % reports; you can get the latest version from: +@@ -594,7 +595,7 @@ + \def\:{\spacefactor=1000 } + + % @* forces a line break. +-\def\*{\hfil\break\hbox{}\ignorespaces} ++\def\*{\unskip\hfil\break\hbox{}\ignorespaces} + + % @/ allows a line break. + \let\/=\allowbreak +@@ -2272,8 +2273,6 @@ + + \gdef\markupsetcodequoteleft{\let`\codequoteleft} + \gdef\markupsetcodequoteright{\let'\codequoteright} +- +-\gdef\markupsetnoligaturesquoteleft{\let`\noligaturesquoteleft} + } + + \let\markupsetuplqcode \markupsetcodequoteleft +@@ -2282,6 +2281,9 @@ + \let\markupsetuplqexample \markupsetcodequoteleft + \let\markupsetuprqexample \markupsetcodequoteright + % ++\let\markupsetuplqkbd \markupsetcodequoteleft ++\let\markupsetuprqkbd \markupsetcodequoteright ++% + \let\markupsetuplqsamp \markupsetcodequoteleft + \let\markupsetuprqsamp \markupsetcodequoteright + % +@@ -2291,8 +2293,6 @@ + \let\markupsetuplqverbatim \markupsetcodequoteleft + \let\markupsetuprqverbatim \markupsetcodequoteright + +-\let\markupsetuplqkbd \markupsetnoligaturesquoteleft +- + % Allow an option to not use regular directed right quote/apostrophe + % (char 0x27), but instead the undirected quote from cmtt (char 0x0d). + % The undirected quote is ugly, so don't make it the default, but it +@@ -2382,8 +2382,7 @@ + \aftersmartic + } + +-% like \smartslanted except unconditionally uses \ttsl, and no ic. +-% @var is set to this for defun arguments. ++% Unconditional use \ttsl, and no ic. @var is set to this for defuns. + \def\ttslanted#1{{\ttsl #1}} + + % @cite is like \smartslanted except unconditionally use \sl. We never want +@@ -2448,34 +2447,12 @@ + % @samp. + \def\samp#1{{\setupmarkupstyle{samp}\lq\tclose{#1}\rq\null}} + +-% definition of @key that produces a lozenge. Doesn't adjust to text size. +-%\setfont\keyrm\rmshape{8}{1000}{OT1} +-%\font\keysy=cmsy9 +-%\def\key#1{{\keyrm\textfont2=\keysy \leavevmode\hbox{% +-% \raise0.4pt\hbox{\angleleft}\kern-.08em\vtop{% +-% \vbox{\hrule\kern-0.4pt +-% \hbox{\raise0.4pt\hbox{\vphantom{\angleleft}}#1}}% +-% \kern-0.4pt\hrule}% +-% \kern-.06em\raise0.4pt\hbox{\angleright}}}} +- +-% definition of @key with no lozenge. If the current font is already +-% monospace, don't change it; that way, we respect @kbdinputstyle. But +-% if it isn't monospace, then use \tt. +-% +-\def\key#1{{\setupmarkupstyle{key}% +- \nohyphenation +- \ifmonospace\else\tt\fi +- #1}\null} +- +-% ctrl is no longer a Texinfo command. +-\def\ctrl #1{{\tt \rawbackslash \hat}#1} +- +-% @file, @option are the same as @samp. +-\let\file=\samp +-\let\option=\samp +- +-% @code is a modification of @t, +-% which makes spaces the same size as normal in the surrounding text. ++% @indicateurl is \samp, that is, with quotes. ++\let\indicateurl=\samp ++ ++% @code (and similar) prints in typewriter, but with spaces the same ++% size as normal in the surrounding text, without hyphenation, etc. ++% This is a subroutine for that. + \def\tclose#1{% + {% + % Change normal interword space to be same as for the current font. +@@ -2500,7 +2477,7 @@ + % We *must* turn on hyphenation at `-' and `_' in @code. + % Otherwise, it is too hard to avoid overfull hboxes + % in the Emacs manual, the Library manual, etc. +- ++% + % Unfortunately, TeX uses one parameter (\hyphenchar) to control + % both hyphenation at - and hyphenation within words. + % We must therefore turn them both off (\tclose does that) +@@ -2519,7 +2496,7 @@ + \let-\codedash + \let_\codeunder + \else +- \let-\realdash ++ \let-\normaldash + \let_\realunder + \fi + \codex +@@ -2528,7 +2505,7 @@ + + \def\codex #1{\tclose{#1}\endgroup} + +-\def\realdash{-} ++\def\normaldash{-} + \def\codedash{-\discretionary{}{}{}} + \def\codeunder{% + % this is all so @math{@code{var_name}+1} can work. In math mode, _ +@@ -2543,9 +2520,9 @@ + } + + % An additional complication: the above will allow breaks after, e.g., +-% each of the four underscores in __typeof__. This is undesirable in +-% some manuals, especially if they don't have long identifiers in +-% general. @allowcodebreaks provides a way to control this. ++% each of the four underscores in __typeof__. This is bad. ++% @allowcodebreaks provides a document-level way to turn breaking at - ++% and _ on and off. + % + \newif\ifallowcodebreaks \allowcodebreakstrue + +@@ -2564,6 +2541,13 @@ + \fi\fi + } + ++% For @command, @env, @file, @option quotes seem unnecessary, ++% so use \code rather than \samp. ++\let\command=\code ++\let\env=\code ++\let\file=\code ++\let\option=\code ++ + % @uref (abbreviation for `urlref') takes an optional (comma-separated) + % second argument specifying the text to display and an optional third + % arg as text to display instead of (rather than in addition to) the url +@@ -2710,10 +2694,6 @@ + \let\email=\uref + \fi + +-% @kbd is like @code, except that if the argument is just one @key command, +-% then @kbd has no effect. +-\def\kbd#1{{\setupmarkupstyle{kbd}\def\look{#1}\expandafter\kbdfoo\look??\par}} +- + % @kbdinputstyle -- arg is `distinct' (@kbd uses slanted tty font always), + % `example' (@kbd uses ttsl only inside of @example and friends), + % or `code' (@kbd uses normal tty font always). +@@ -2737,16 +2717,36 @@ + % Default is `distinct'. + \kbdinputstyle distinct + ++% @kbd is like @code, except that if the argument is just one @key command, ++% then @kbd has no effect. ++\def\kbd#1{{\def\look{#1}\expandafter\kbdsub\look??\par}} ++ + \def\xkey{\key} +-\def\kbdfoo#1#2#3\par{\def\one{#1}\def\three{#3}\def\threex{??}% +-\ifx\one\xkey\ifx\threex\three \key{#2}% +-\else{\tclose{\kbdfont\setupmarkupstyle{kbd}\look}}\fi +-\else{\tclose{\kbdfont\setupmarkupstyle{kbd}\look}}\fi} +- +-% For @indicateurl, @env, @command quotes seem unnecessary, so use \code. +-\let\indicateurl=\code +-\let\env=\code +-\let\command=\code ++\def\kbdsub#1#2#3\par{% ++ \def\one{#1}\def\three{#3}\def\threex{??}% ++ \ifx\one\xkey\ifx\threex\three \key{#2}% ++ \else{\tclose{\kbdfont\setupmarkupstyle{kbd}\look}}\fi ++ \else{\tclose{\kbdfont\setupmarkupstyle{kbd}\look}}\fi ++} ++ ++% definition of @key that produces a lozenge. Doesn't adjust to text size. ++%\setfont\keyrm\rmshape{8}{1000}{OT1} ++%\font\keysy=cmsy9 ++%\def\key#1{{\keyrm\textfont2=\keysy \leavevmode\hbox{% ++% \raise0.4pt\hbox{\angleleft}\kern-.08em\vtop{% ++% \vbox{\hrule\kern-0.4pt ++% \hbox{\raise0.4pt\hbox{\vphantom{\angleleft}}#1}}% ++% \kern-0.4pt\hrule}% ++% \kern-.06em\raise0.4pt\hbox{\angleright}}}} ++ ++% definition of @key with no lozenge. If the current font is already ++% monospace, don't change it; that way, we respect @kbdinputstyle. But ++% if it isn't monospace, then use \tt. ++% ++\def\key#1{{\setupmarkupstyle{key}% ++ \nohyphenation ++ \ifmonospace\else\tt\fi ++ #1}\null} + + % @clicksequence{File @click{} Open ...} + \def\clicksequence#1{\begingroup #1\endgroup} +@@ -2854,6 +2854,9 @@ + } + } + ++% ctrl is no longer a Texinfo command, but leave this definition for fun. ++\def\ctrl #1{{\tt \rawbackslash \hat}#1} ++ + % @inlinefmt{FMTNAME,PROCESSED-TEXT} and @inlineraw{FMTNAME,RAW-TEXT}. + % Ignore unless FMTNAME == tex; then it is like @iftex and @tex, + % except specified as a normal braced arg, so no newlines to worry about. +@@ -3144,12 +3147,17 @@ + % hopefully nobody will notice/care. + \edef\ecsize{\csname\curfontsize ecsize\endcsname}% + \edef\nominalsize{\csname\curfontsize nominalsize\endcsname}% +- \ifx\curfontstyle\bfstylename +- % bold: +- \font\thisecfont = ecb\ifusingit{i}{x}\ecsize \space at \nominalsize ++ \ifmonospace ++ % typewriter: ++ \font\thisecfont = ectt\ecsize \space at \nominalsize + \else +- % regular: +- \font\thisecfont = ec\ifusingit{ti}{rm}\ecsize \space at \nominalsize ++ \ifx\curfontstyle\bfstylename ++ % bold: ++ \font\thisecfont = ecb\ifusingit{i}{x}\ecsize \space at \nominalsize ++ \else ++ % regular: ++ \font\thisecfont = ec\ifusingit{ti}{rm}\ecsize \space at \nominalsize ++ \fi + \fi + \thisecfont + } +@@ -3262,6 +3270,20 @@ + \finishedtitlepagetrue + } + ++% Settings used for typesetting titles: no hyphenation, no indentation, ++% don't worry much about spacing, ragged right. This should be used ++% inside a \vbox, and fonts need to be set appropriately first. Because ++% it is always used for titles, nothing else, we call \rmisbold. \par ++% should be specified before the end of the \vbox, since a vbox is a group. ++% ++\def\raggedtitlesettings{% ++ \rmisbold ++ \hyphenpenalty=10000 ++ \parindent=0pt ++ \tolerance=5000 ++ \ptexraggedright ++} ++ + % Macros to be used within @titlepage: + + \let\subtitlerm=\tenrm +@@ -3269,7 +3291,7 @@ + + \parseargdef\title{% + \checkenv\titlepage +- \leftline{\titlefonts\rmisbold #1} ++ \vbox{\titlefonts \raggedtitlesettings #1\par}% + % print a rule at the page bottom also. + \finishedtitlepagefalse + \vskip4pt \hrule height 4pt width \hsize \vskip4pt +@@ -4166,7 +4188,7 @@ + % ..., but we might end up with active ones in the argument if + % we're called from @code, as @code{@value{foo-bar_}}, though. + % So \let them to their normal equivalents. +- \let-\realdash \let_\normalunderscore ++ \let-\normaldash \let_\normalunderscore + } + } + +@@ -4206,7 +4228,7 @@ + } + \def\ifsetfail{\doignore{ifset}} + +-% @ifclear VAR ... @end ifclear reads the `...' iff VAR has never been ++% @ifclear VAR ... @end executes the `...' iff VAR has never been + % defined with @set, or has been undefined with @clear. + % + % The `\else' inside the `\doifset' parameter is a trick to reuse the +@@ -4217,6 +4239,35 @@ + \def\ifclear{\parsearg{\doifset{\else \let\next=\ifclearfail}}} + \def\ifclearfail{\doignore{ifclear}} + ++% @ifcommandisdefined CMD ... @end executes the `...' if CMD (written ++% without the @) is in fact defined. We can only feasibly check at the ++% TeX level, so something like `mathcode' is going to considered ++% defined even though it is not a Texinfo command. ++% ++\makecond{ifcommanddefined} ++\def\ifcommanddefined{\parsearg{\doifcmddefined{\let\next=\ifcmddefinedfail}}} ++% ++\def\doifcmddefined#1#2{{% ++ \makevalueexpandable ++ \let\next=\empty ++ \expandafter\ifx\csname #2\endcsname\relax ++ #1% If not defined, \let\next as above. ++ \fi ++ \expandafter ++ }\next ++} ++\def\ifcmddefinedfail{\doignore{ifcommanddefined}} ++ ++% @ifcommandnotdefined CMD ... handled similar to @ifclear above. ++\makecond{ifcommandnotdefined} ++\def\ifcommandnotdefined{% ++ \parsearg{\doifcmddefined{\else \let\next=\ifcmdnotdefinedfail}}} ++\def\ifcmdnotdefinedfail{\doignore{ifcommandnotdefined}} ++ ++% Set the `txicommandconditionals' variable, so documents have a way to ++% test if the @ifcommand...defined conditionals are available. ++\set txicommandconditionals ++ + % @dircategory CATEGORY -- specify a category of the dir file + % which this file should belong to. Ignore this in TeX. + \let\dircategory=\comment +@@ -5543,14 +5594,6 @@ + + % Define @majorheading, @heading and @subheading + +-% NOTE on use of \vbox for chapter headings, section headings, and such: +-% 1) We use \vbox rather than the earlier \line to permit +-% overlong headings to fold. +-% 2) \hyphenpenalty is set to 10000 because hyphenation in a +-% heading is obnoxious; this forbids it. +-% 3) Likewise, headings look best if no \parindent is used, and +-% if justification is not attempted. Hence \raggedright. +- + \def\majorheading{% + {\advance\chapheadingskip by 10pt \chapbreak }% + \parsearg\chapheadingzzz +@@ -5558,10 +5601,8 @@ + + \def\chapheading{\chapbreak \parsearg\chapheadingzzz} + \def\chapheadingzzz#1{% +- {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000 +- \parindent=0pt\ptexraggedright +- \rmisbold #1\hfill}}% +- \bigskip \par\penalty 200\relax ++ \vbox{\chapfonts \raggedtitlesettings #1\par}% ++ \nobreak\bigskip \nobreak + \suppressfirstparagraphindent + } + +@@ -5720,8 +5761,7 @@ + % + % Typeset the actual heading. + \nobreak % Avoid page breaks at the interline glue. +- \vbox{\hyphenpenalty=10000 \tolerance=5000 \parindent=0pt \ptexraggedright +- \hangindent=\wd0 \centerparametersmaybe ++ \vbox{\raggedtitlesettings \hangindent=\wd0 \centerparametersmaybe + \unhbox0 #1\par}% + }% + \nobreak\bigskip % no page break after a chapter title +@@ -5743,18 +5783,18 @@ + \def\setchapterstyle #1 {\csname CHAPF#1\endcsname} + % + \def\unnchfopen #1{% +-\chapoddpage {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000 +- \parindent=0pt\ptexraggedright +- \rmisbold #1\hfill}}\bigskip \par\nobreak ++ \chapoddpage ++ \vbox{\chapfonts \raggedtitlesettings #1\par}% ++ \nobreak\bigskip\nobreak + } + \def\chfopen #1#2{\chapoddpage {\chapfonts + \vbox to 3in{\vfil \hbox to\hsize{\hfil #2} \hbox to\hsize{\hfil #1} \vfil}}% + \par\penalty 5000 % + } + \def\centerchfopen #1{% +-\chapoddpage {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000 +- \parindent=0pt +- \hfill {\rmisbold #1}\hfill}}\bigskip \par\nobreak ++ \chapoddpage ++ \vbox{\chapfonts \raggedtitlesettings \hfill #1\hfill}% ++ \nobreak\bigskip \nobreak + } + \def\CHAPFopen{% + \global\let\chapmacro=\chfopen +@@ -6520,16 +6560,9 @@ + \makedispenvdef{quotation}{\quotationstart} + % + \def\quotationstart{% +- {\parskip=0pt \aboveenvbreak}% because \aboveenvbreak inserts \parskip +- \parindent=0pt +- % +- % @cartouche defines \nonarrowing to inhibit narrowing at next level down. ++ \indentedblockstart % same as \indentedblock, but increase right margin too. + \ifx\nonarrowing\relax +- \advance\leftskip by \lispnarrowing + \advance\rightskip by \lispnarrowing +- \exdentamount = \lispnarrowing +- \else +- \let\nonarrowing = \relax + \fi + \parsearg\quotationlabel + } +@@ -6555,6 +6588,32 @@ + \fi + } + ++% @indentedblock is like @quotation, but indents only on the left and ++% has no optional argument. ++% ++\makedispenvdef{indentedblock}{\indentedblockstart} ++% ++\def\indentedblockstart{% ++ {\parskip=0pt \aboveenvbreak}% because \aboveenvbreak inserts \parskip ++ \parindent=0pt ++ % ++ % @cartouche defines \nonarrowing to inhibit narrowing at next level down. ++ \ifx\nonarrowing\relax ++ \advance\leftskip by \lispnarrowing ++ \exdentamount = \lispnarrowing ++ \else ++ \let\nonarrowing = \relax ++ \fi ++} ++ ++% Keep a nonzero parskip for the environment, since we're doing normal filling. ++% ++\def\Eindentedblock{% ++ \par ++ {\parskip=0pt \afterenvbreak}% ++} ++\def\Esmallindentedblock{\Eindentedblock} ++ + + % LaTeX-like @verbatim...@end verbatim and @verb{...} + % If we want to allow any as delimiter, +@@ -7033,7 +7092,10 @@ + \df \sl \hyphenchar\font=0 + % + % On the other hand, if an argument has two dashes (for instance), we +- % want a way to get ttsl. Let's try @var for that. ++ % want a way to get ttsl. We used to recommend @var for that, so ++ % leave the code in, but it's strange for @var to lead to typewriter. ++ % Nowadays we recommend @code, since the difference between a ttsl hyphen ++ % and a tt hyphen is pretty tiny. @code also disables ?` !`. + \def\var##1{{\setupmarkupstyle{var}\ttslanted{##1}}}% + #1% + \sl\hyphenchar\font=45 +@@ -9931,22 +9993,26 @@ + @gdef@otherbackslash{@let\=@realbackslash} + + % Same as @turnoffactive except outputs \ as {\tt\char`\\} instead of +-% the literal character `\'. +-% +-@def@normalturnoffactive{% +- @let"=@normaldoublequote +- @let$=@normaldollar %$ font-lock fix +- @let+=@normalplus +- @let<=@normalless +- @let>=@normalgreater +- @let\=@normalbackslash +- @let^=@normalcaret +- @let_=@normalunderscore +- @let|=@normalverticalbar +- @let~=@normaltilde +- @markupsetuplqdefault +- @markupsetuprqdefault +- @unsepspaces ++% the literal character `\'. Also revert - to its normal character, in ++% case the active - from code has slipped in. ++% ++{@catcode`- = @active ++ @gdef@normalturnoffactive{% ++ @let-=@normaldash ++ @let"=@normaldoublequote ++ @let$=@normaldollar %$ font-lock fix ++ @let+=@normalplus ++ @let<=@normalless ++ @let>=@normalgreater ++ @let\=@normalbackslash ++ @let^=@normalcaret ++ @let_=@normalunderscore ++ @let|=@normalverticalbar ++ @let~=@normaltilde ++ @markupsetuplqdefault ++ @markupsetuprqdefault ++ @unsepspaces ++ } + } + + % Make _ and + \other characters, temporarily. +diff -r c0e311e010fc Modules/_datetimemodule.c +--- a/Modules/_datetimemodule.c ++++ b/Modules/_datetimemodule.c +@@ -897,11 +897,11 @@ + } + } + else { +- Py_DECREF(offset); + PyErr_Format(PyExc_TypeError, + "tzinfo.%s() must return None or " + "timedelta, not '%.200s'", + name, Py_TYPE(offset)->tp_name); ++ Py_DECREF(offset); + return NULL; + } + +@@ -2153,7 +2153,7 @@ + * is odd. Note that x is odd when it's last bit is 1. The + * code below uses bitwise and operation to check the last + * bit. */ +- temp = PyNumber_And(x, one); /* temp <- x & 1 */ ++ temp = PyNumber_And(x, one); /* temp <- x & 1 */ + if (temp == NULL) { + Py_DECREF(x); + goto Done; +@@ -3224,10 +3224,10 @@ + if (op != Py_EQ && op != Py_NE) + Py_RETURN_NOTIMPLEMENTED; + if (Py_TYPE(other) != &PyDateTime_TimeZoneType) { +- if (op == Py_EQ) +- Py_RETURN_FALSE; +- else +- Py_RETURN_TRUE; ++ if (op == Py_EQ) ++ Py_RETURN_FALSE; ++ else ++ Py_RETURN_TRUE; + } + return delta_richcompare(self->offset, other->offset, op); + } +@@ -4814,7 +4814,7 @@ + static char *keywords[] = {"tz", NULL}; + + if (! PyArg_ParseTupleAndKeywords(args, kw, "|O:astimezone", keywords, +- &tzinfo)) ++ &tzinfo)) + return NULL; + + if (check_tzinfo_subclass(tzinfo) == -1) +diff -r c0e311e010fc Modules/_io/_iomodule.c +--- a/Modules/_io/_iomodule.c ++++ b/Modules/_io/_iomodule.c +@@ -235,11 +235,12 @@ + char rawmode[6], *m; + int line_buffering, isatty; + +- PyObject *raw, *modeobj = NULL, *buffer = NULL, *wrapper = NULL; ++ PyObject *raw, *modeobj = NULL, *buffer, *wrapper, *result = NULL; + + _Py_IDENTIFIER(isatty); + _Py_IDENTIFIER(fileno); + _Py_IDENTIFIER(mode); ++ _Py_IDENTIFIER(close); + + if (!PyArg_ParseTupleAndKeywords(args, kwds, "O|sizzziO:open", kwlist, + &file, &mode, &buffering, +@@ -354,6 +355,7 @@ + "OsiO", file, rawmode, closefd, opener); + if (raw == NULL) + return NULL; ++ result = raw; + + modeobj = PyUnicode_FromString(mode); + if (modeobj == NULL) +@@ -412,7 +414,7 @@ + } + + Py_DECREF(modeobj); +- return raw; ++ return result; + } + + /* wraps into a buffered file */ +@@ -433,15 +435,16 @@ + + buffer = PyObject_CallFunction(Buffered_class, "Oi", raw, buffering); + } +- Py_CLEAR(raw); + if (buffer == NULL) + goto error; ++ result = buffer; ++ Py_DECREF(raw); + + + /* if binary, returns the buffered file */ + if (binary) { + Py_DECREF(modeobj); +- return buffer; ++ return result; + } + + /* wraps into a TextIOWrapper */ +@@ -450,20 +453,37 @@ + buffer, + encoding, errors, newline, + line_buffering); +- Py_CLEAR(buffer); + if (wrapper == NULL) + goto error; ++ result = wrapper; ++ Py_DECREF(buffer); + + if (_PyObject_SetAttrId(wrapper, &PyId_mode, modeobj) < 0) + goto error; + Py_DECREF(modeobj); +- return wrapper; ++ return result; + + error: +- Py_XDECREF(raw); ++ if (result != NULL) { ++ PyObject *exc, *val, *tb, *close_result; ++ PyErr_Fetch(&exc, &val, &tb); ++ close_result = _PyObject_CallMethodId(result, &PyId_close, NULL); ++ if (close_result != NULL) { ++ Py_DECREF(close_result); ++ PyErr_Restore(exc, val, tb); ++ } else { ++ PyObject *exc2, *val2, *tb2; ++ PyErr_Fetch(&exc2, &val2, &tb2); ++ PyErr_NormalizeException(&exc, &val, &tb); ++ Py_XDECREF(exc); ++ Py_XDECREF(tb); ++ PyErr_NormalizeException(&exc2, &val2, &tb2); ++ PyException_SetContext(val2, val); ++ PyErr_Restore(exc2, val2, tb2); ++ } ++ Py_DECREF(result); ++ } + Py_XDECREF(modeobj); +- Py_XDECREF(buffer); +- Py_XDECREF(wrapper); + return NULL; + } + +diff -r c0e311e010fc Modules/_io/bufferedio.c +--- a/Modules/_io/bufferedio.c ++++ b/Modules/_io/bufferedio.c +@@ -548,13 +548,14 @@ + PyErr_Restore(exc, val, tb); + } + else { +- PyObject *val2; ++ PyObject *exc2, *val2, *tb2; ++ PyErr_Fetch(&exc2, &val2, &tb2); ++ PyErr_NormalizeException(&exc, &val, &tb); + Py_DECREF(exc); + Py_XDECREF(tb); +- PyErr_Fetch(&exc, &val2, &tb); +- PyErr_NormalizeException(&exc, &val2, &tb); ++ PyErr_NormalizeException(&exc2, &val2, &tb2); + PyException_SetContext(val2, val); +- PyErr_Restore(exc, val2, tb); ++ PyErr_Restore(exc2, val2, tb2); + } + } + +diff -r c0e311e010fc Modules/_io/fileio.c +--- a/Modules/_io/fileio.c ++++ b/Modules/_io/fileio.c +@@ -691,9 +691,9 @@ + } + continue; + } +- if (bytes_read > 0) +- break; + if (errno == EAGAIN) { ++ if (bytes_read > 0) ++ break; + Py_DECREF(result); + Py_RETURN_NONE; + } +diff -r c0e311e010fc Modules/_io/textio.c +--- a/Modules/_io/textio.c ++++ b/Modules/_io/textio.c +@@ -2613,13 +2613,14 @@ + PyErr_Restore(exc, val, tb); + } + else { +- PyObject *val2; ++ PyObject *exc2, *val2, *tb2; ++ PyErr_Fetch(&exc2, &val2, &tb2); ++ PyErr_NormalizeException(&exc, &val, &tb); + Py_DECREF(exc); + Py_XDECREF(tb); +- PyErr_Fetch(&exc, &val2, &tb); +- PyErr_NormalizeException(&exc, &val2, &tb); ++ PyErr_NormalizeException(&exc2, &val2, &tb2); + PyException_SetContext(val2, val); +- PyErr_Restore(exc, val2, tb); ++ PyErr_Restore(exc2, val2, tb2); + } + } + return res; +diff -r c0e311e010fc Modules/_multiprocessing/multiprocessing.c +--- a/Modules/_multiprocessing/multiprocessing.c ++++ b/Modules/_multiprocessing/multiprocessing.c +@@ -128,7 +128,9 @@ + {"recv", multiprocessing_recv, METH_VARARGS, ""}, + {"send", multiprocessing_send, METH_VARARGS, ""}, + #endif ++#ifndef POSIX_SEMAPHORES_NOT_ENABLED + {"sem_unlink", _PyMp_sem_unlink, METH_VARARGS, ""}, ++#endif + {NULL} + }; + +diff -r c0e311e010fc Modules/_posixsubprocess.c +--- a/Modules/_posixsubprocess.c ++++ b/Modules/_posixsubprocess.c +@@ -44,10 +44,6 @@ + #define POSIX_CALL(call) do { if ((call) == -1) goto error; } while (0) + + +-/* Maximum file descriptor, initialized on module load. */ +-static long max_fd; +- +- + /* Given the gc module call gc.enable() and return 0 on success. */ + static int + _enable_gc(PyObject *gc_module) +@@ -166,14 +162,39 @@ + } + + +-/* Close all file descriptors in the range start_fd inclusive to +- * end_fd exclusive except for those in py_fds_to_keep. If the +- * range defined by [start_fd, end_fd) is large this will take a +- * long time as it calls close() on EVERY possible fd. ++/* Get the maximum file descriptor that could be opened by this process. ++ * This function is async signal safe for use between fork() and exec(). ++ */ ++static long ++safe_get_max_fd(void) ++{ ++ long local_max_fd; ++#if defined(__NetBSD__) ++ local_max_fd = fcntl(0, F_MAXFD); ++ if (local_max_fd >= 0) ++ return local_max_fd; ++#endif ++#ifdef _SC_OPEN_MAX ++ local_max_fd = sysconf(_SC_OPEN_MAX); ++ if (local_max_fd == -1) ++#endif ++ local_max_fd = 256; /* Matches legacy Lib/subprocess.py behavior. */ ++ return local_max_fd; ++} ++ ++ ++/* Close all file descriptors in the range from start_fd and higher ++ * except for those in py_fds_to_keep. If the range defined by ++ * [start_fd, safe_get_max_fd()) is large this will take a long ++ * time as it calls close() on EVERY possible fd. ++ * ++ * It isn't possible to know for sure what the max fd to go up to ++ * is for processes with the capability of raising their maximum. + */ + static void +-_close_fds_by_brute_force(int start_fd, int end_fd, PyObject *py_fds_to_keep) ++_close_fds_by_brute_force(long start_fd, PyObject *py_fds_to_keep) + { ++ long end_fd = safe_get_max_fd(); + Py_ssize_t num_fds_to_keep = PySequence_Length(py_fds_to_keep); + Py_ssize_t keep_seq_idx; + int fd_num; +@@ -213,8 +234,8 @@ + char d_name[256]; /* Filename (null-terminated) */ + }; + +-/* Close all open file descriptors in the range start_fd inclusive to end_fd +- * exclusive. Do not close any in the sorted py_fds_to_keep list. ++/* Close all open file descriptors in the range from start_fd and higher ++ * Do not close any in the sorted py_fds_to_keep list. + * + * This version is async signal safe as it does not make any unsafe C library + * calls, malloc calls or handle any locks. It is _unfortunate_ to be forced +@@ -229,16 +250,14 @@ + * it with some cpp #define magic to work on other OSes as well if you want. + */ + static void +-_close_open_fd_range_safe(int start_fd, int end_fd, PyObject* py_fds_to_keep) ++_close_open_fds_safe(int start_fd, PyObject* py_fds_to_keep) + { + int fd_dir_fd; +- if (start_fd >= end_fd) +- return; + + fd_dir_fd = _Py_open(FD_DIR, O_RDONLY); + if (fd_dir_fd == -1) { + /* No way to get a list of open fds. */ +- _close_fds_by_brute_force(start_fd, end_fd, py_fds_to_keep); ++ _close_fds_by_brute_force(start_fd, py_fds_to_keep); + return; + } else { + char buffer[sizeof(struct linux_dirent64)]; +@@ -253,23 +272,23 @@ + entry = (struct linux_dirent64 *)(buffer + offset); + if ((fd = _pos_int_from_ascii(entry->d_name)) < 0) + continue; /* Not a number. */ +- if (fd != fd_dir_fd && fd >= start_fd && fd < end_fd && ++ if (fd != fd_dir_fd && fd >= start_fd && + !_is_fd_in_sorted_fd_sequence(fd, py_fds_to_keep)) { + while (close(fd) < 0 && errno == EINTR); + } + } + } +- close(fd_dir_fd); ++ while (close(fd_dir_fd) < 0 && errno == EINTR); + } + } + +-#define _close_open_fd_range _close_open_fd_range_safe ++#define _close_open_fds _close_open_fds_safe + + #else /* NOT (defined(__linux__) && defined(HAVE_SYS_SYSCALL_H)) */ + + +-/* Close all open file descriptors in the range start_fd inclusive to end_fd +- * exclusive. Do not close any in the sorted py_fds_to_keep list. ++/* Close all open file descriptors from start_fd and higher. ++ * Do not close any in the sorted py_fds_to_keep list. + * + * This function violates the strict use of async signal safe functions. :( + * It calls opendir(), readdir() and closedir(). Of these, the one most +@@ -282,17 +301,13 @@ + * http://womble.decadent.org.uk/readdir_r-advisory.html + */ + static void +-_close_open_fd_range_maybe_unsafe(int start_fd, int end_fd, +- PyObject* py_fds_to_keep) ++_close_open_fds_maybe_unsafe(long start_fd, PyObject* py_fds_to_keep) + { + DIR *proc_fd_dir; + #ifndef HAVE_DIRFD +- while (_is_fd_in_sorted_fd_sequence(start_fd, py_fds_to_keep) && +- (start_fd < end_fd)) { ++ while (_is_fd_in_sorted_fd_sequence(start_fd, py_fds_to_keep)) { + ++start_fd; + } +- if (start_fd >= end_fd) +- return; + /* Close our lowest fd before we call opendir so that it is likely to + * reuse that fd otherwise we might close opendir's file descriptor in + * our loop. This trick assumes that fd's are allocated on a lowest +@@ -300,8 +315,6 @@ + while (close(start_fd) < 0 && errno == EINTR); + ++start_fd; + #endif +- if (start_fd >= end_fd) +- return; + + #if defined(__FreeBSD__) + if (!_is_fdescfs_mounted_on_dev_fd()) +@@ -311,7 +324,7 @@ + proc_fd_dir = opendir(FD_DIR); + if (!proc_fd_dir) { + /* No way to get a list of open fds. */ +- _close_fds_by_brute_force(start_fd, end_fd, py_fds_to_keep); ++ _close_fds_by_brute_force(start_fd, py_fds_to_keep); + } else { + struct dirent *dir_entry; + #ifdef HAVE_DIRFD +@@ -324,7 +337,7 @@ + int fd; + if ((fd = _pos_int_from_ascii(dir_entry->d_name)) < 0) + continue; /* Not a number. */ +- if (fd != fd_used_by_opendir && fd >= start_fd && fd < end_fd && ++ if (fd != fd_used_by_opendir && fd >= start_fd && + !_is_fd_in_sorted_fd_sequence(fd, py_fds_to_keep)) { + while (close(fd) < 0 && errno == EINTR); + } +@@ -332,13 +345,13 @@ + } + if (errno) { + /* readdir error, revert behavior. Highly Unlikely. */ +- _close_fds_by_brute_force(start_fd, end_fd, py_fds_to_keep); ++ _close_fds_by_brute_force(start_fd, py_fds_to_keep); + } + closedir(proc_fd_dir); + } + } + +-#define _close_open_fd_range _close_open_fd_range_maybe_unsafe ++#define _close_open_fds _close_open_fds_maybe_unsafe + + #endif /* else NOT (defined(__linux__) && defined(HAVE_SYS_SYSCALL_H)) */ + +@@ -457,14 +470,8 @@ + + /* close FDs after executing preexec_fn, which might open FDs */ + if (close_fds) { +- int local_max_fd = max_fd; +-#if defined(__NetBSD__) +- local_max_fd = fcntl(0, F_MAXFD); +- if (local_max_fd < 0) +- local_max_fd = max_fd; +-#endif + /* TODO HP-UX could use pstat_getproc() if anyone cares about it. */ +- _close_open_fd_range(3, local_max_fd, py_fds_to_keep); ++ _close_open_fds(3, py_fds_to_keep); + } + + /* This loop matches the Lib/os.py _execvpe()'s PATH search when */ +@@ -759,11 +766,5 @@ + PyMODINIT_FUNC + PyInit__posixsubprocess(void) + { +-#ifdef _SC_OPEN_MAX +- max_fd = sysconf(_SC_OPEN_MAX); +- if (max_fd == -1) +-#endif +- max_fd = 256; /* Matches Lib/subprocess.py */ +- + return PyModule_Create(&_posixsubprocessmodule); + } +diff -r c0e311e010fc Modules/_sqlite/cursor.c +--- a/Modules/_sqlite/cursor.c ++++ b/Modules/_sqlite/cursor.c +@@ -289,9 +289,8 @@ + Py_END_ALLOW_THREADS + + row = PyTuple_New(numcols); +- if (!row) { ++ if (!row) + return NULL; +- } + + for (i = 0; i < numcols; i++) { + if (self->connection->detect_types) { +@@ -311,14 +310,12 @@ + converted = Py_None; + } else { + item = PyBytes_FromStringAndSize(val_str, nbytes); +- if (!item) { +- return NULL; +- } ++ if (!item) ++ goto error; + converted = PyObject_CallFunction(converter, "O", item); + Py_DECREF(item); +- if (!converted) { ++ if (!converted) + break; +- } + } + } else { + Py_BEGIN_ALLOW_THREADS +@@ -374,9 +371,8 @@ + nbytes = sqlite3_column_bytes(self->statement->st, i); + buffer = PyBytes_FromStringAndSize( + sqlite3_column_blob(self->statement->st, i), nbytes); +- if (!buffer) { ++ if (!buffer) + break; +- } + converted = buffer; + } + } +@@ -389,12 +385,14 @@ + } + } + +- if (PyErr_Occurred()) { +- Py_DECREF(row); +- row = NULL; +- } ++ if (PyErr_Occurred()) ++ goto error; + + return row; ++ ++error: ++ Py_DECREF(row); ++ return NULL; + } + + /* +@@ -612,6 +610,10 @@ + while (1) { + /* Actually execute the SQL statement. */ + rc = pysqlite_step(self->statement->st, self->connection); ++ if (PyErr_Occurred()) { ++ (void)pysqlite_statement_reset(self->statement); ++ goto error; ++ } + if (rc == SQLITE_DONE || rc == SQLITE_ROW) { + /* If it worked, let's get out of the loop */ + break; +@@ -685,6 +687,8 @@ + } + + self->next_row = _pysqlite_fetch_one_row(self); ++ if (self->next_row == NULL) ++ goto error; + } else if (rc == SQLITE_DONE && !multiple) { + pysqlite_statement_reset(self->statement); + Py_CLEAR(self->statement); +@@ -807,7 +811,10 @@ + rc = SQLITE_ROW; + while (rc == SQLITE_ROW) { + rc = pysqlite_step(statement, self->connection); +- /* TODO: we probably need more error handling here */ ++ if (PyErr_Occurred()) { ++ (void)sqlite3_finalize(statement); ++ goto error; ++ } + } + + if (rc != SQLITE_DONE) { +@@ -884,6 +891,11 @@ + + if (self->statement) { + rc = pysqlite_step(self->statement->st, self->connection); ++ if (PyErr_Occurred()) { ++ (void)pysqlite_statement_reset(self->statement); ++ Py_DECREF(next_row); ++ return NULL; ++ } + if (rc != SQLITE_DONE && rc != SQLITE_ROW) { + (void)pysqlite_statement_reset(self->statement); + Py_DECREF(next_row); +@@ -895,8 +907,6 @@ + self->next_row = _pysqlite_fetch_one_row(self); + if (self->next_row == NULL) { + (void)pysqlite_statement_reset(self->statement); +- Py_DECREF(next_row); +- _pysqlite_seterror(self->connection->db, NULL); + return NULL; + } + } +diff -r c0e311e010fc Modules/_sqlite/row.c +--- a/Modules/_sqlite/row.c ++++ b/Modules/_sqlite/row.c +@@ -32,40 +32,53 @@ + Py_TYPE(self)->tp_free((PyObject*)self); + } + +-int pysqlite_row_init(pysqlite_Row* self, PyObject* args, PyObject* kwargs) ++static PyObject * ++pysqlite_row_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) + { ++ pysqlite_Row *self; + PyObject* data; + pysqlite_Cursor* cursor; + +- self->data = 0; +- self->description = 0; ++ assert(type != NULL && type->tp_alloc != NULL); + +- if (!PyArg_ParseTuple(args, "OO", &cursor, &data)) { +- return -1; +- } ++ if (!_PyArg_NoKeywords("Row()", kwargs)) ++ return NULL; ++ if (!PyArg_ParseTuple(args, "OO", &cursor, &data)) ++ return NULL; + + if (!PyObject_IsInstance((PyObject*)cursor, (PyObject*)&pysqlite_CursorType)) { + PyErr_SetString(PyExc_TypeError, "instance of cursor required for first argument"); +- return -1; ++ return NULL; + } + + if (!PyTuple_Check(data)) { + PyErr_SetString(PyExc_TypeError, "tuple required for second argument"); +- return -1; ++ return NULL; + } + ++ self = (pysqlite_Row *) type->tp_alloc(type, 0); ++ if (self == NULL) ++ return NULL; ++ + Py_INCREF(data); + self->data = data; + + Py_INCREF(cursor->description); + self->description = cursor->description; + +- return 0; ++ return (PyObject *) self; ++} ++ ++PyObject* pysqlite_row_item(pysqlite_Row* self, Py_ssize_t idx) ++{ ++ PyObject* item = PyTuple_GetItem(self->data, idx); ++ Py_XINCREF(item); ++ return item; + } + + PyObject* pysqlite_row_subscript(pysqlite_Row* self, PyObject* idx) + { +- long _idx; ++ Py_ssize_t _idx; + char* key; + Py_ssize_t nitems, i; + char* compare_key; +@@ -76,7 +89,11 @@ + PyObject* item; + + if (PyLong_Check(idx)) { +- _idx = PyLong_AsLong(idx); ++ _idx = PyNumber_AsSsize_t(idx, PyExc_IndexError); ++ if (_idx == -1 && PyErr_Occurred()) ++ return NULL; ++ if (_idx < 0) ++ _idx += PyTuple_GET_SIZE(self->data); + item = PyTuple_GetItem(self->data, _idx); + Py_XINCREF(item); + return item; +@@ -198,6 +215,14 @@ + /* mp_ass_subscript */ (objobjargproc)0, + }; + ++static PySequenceMethods pysqlite_row_as_sequence = { ++ /* sq_length */ (lenfunc)pysqlite_row_length, ++ /* sq_concat */ 0, ++ /* sq_repeat */ 0, ++ /* sq_item */ (ssizeargfunc)pysqlite_row_item, ++}; ++ ++ + static PyMethodDef pysqlite_row_methods[] = { + {"keys", (PyCFunction)pysqlite_row_keys, METH_NOARGS, + PyDoc_STR("Returns the keys of the row.")}, +@@ -241,7 +266,7 @@ + 0, /* tp_descr_get */ + 0, /* tp_descr_set */ + 0, /* tp_dictoffset */ +- (initproc)pysqlite_row_init, /* tp_init */ ++ 0, /* tp_init */ + 0, /* tp_alloc */ + 0, /* tp_new */ + 0 /* tp_free */ +@@ -249,7 +274,8 @@ + + extern int pysqlite_row_setup_types(void) + { +- pysqlite_RowType.tp_new = PyType_GenericNew; ++ pysqlite_RowType.tp_new = pysqlite_row_new; + pysqlite_RowType.tp_as_mapping = &pysqlite_row_as_mapping; ++ pysqlite_RowType.tp_as_sequence = &pysqlite_row_as_sequence; + return PyType_Ready(&pysqlite_RowType); + } +diff -r c0e311e010fc Modules/_ssl.c +--- a/Modules/_ssl.c ++++ b/Modules/_ssl.c +@@ -14,6 +14,8 @@ + http://bugs.python.org/issue8108#msg102867 ? + */ + ++#define PY_SSIZE_T_CLEAN ++ + #include "Python.h" + + #ifdef WITH_THREAD +@@ -3235,12 +3237,17 @@ + PySSL_RAND_add(PyObject *self, PyObject *args) + { + char *buf; +- int len; ++ Py_ssize_t len, written; + double entropy; + + if (!PyArg_ParseTuple(args, "s#d:RAND_add", &buf, &len, &entropy)) + return NULL; +- RAND_add(buf, len, entropy); ++ do { ++ written = Py_MIN(len, INT_MAX); ++ RAND_add(buf, (int)written, entropy); ++ buf += written; ++ len -= written; ++ } while (len); + Py_INCREF(Py_None); + return Py_None; + } +@@ -3409,7 +3416,7 @@ + int nid; + const char *ln, *sn; + char buf[100]; +- int buflen; ++ Py_ssize_t buflen; + + nid = OBJ_obj2nid(obj); + if (nid == NID_undef) { +diff -r c0e311e010fc Modules/_testcapimodule.c +--- a/Modules/_testcapimodule.c ++++ b/Modules/_testcapimodule.c +@@ -3104,9 +3104,9 @@ + {"pytime_object_to_timeval", test_pytime_object_to_timeval, METH_VARARGS}, + {"pytime_object_to_timespec", test_pytime_object_to_timespec, METH_VARARGS}, + {"with_tp_del", with_tp_del, METH_VARARGS}, +- {"test_pymem", ++ {"test_pymem_alloc0", + (PyCFunction)test_pymem_alloc0, METH_NOARGS}, +- {"test_pymem_alloc0", ++ {"test_pymem_setrawallocators", + (PyCFunction)test_pymem_setrawallocators, METH_NOARGS}, + {"test_pymem_setallocators", + (PyCFunction)test_pymem_setallocators, METH_NOARGS}, +diff -r c0e311e010fc Modules/_tkinter.c +--- a/Modules/_tkinter.c ++++ b/Modules/_tkinter.c +@@ -339,8 +339,10 @@ + const char *e = s + size; + PyErr_Clear(); + q = buf = (char *)PyMem_Malloc(size); +- if (buf == NULL) ++ if (buf == NULL) { ++ PyErr_NoMemory(); + return NULL; ++ } + while (s != e) { + if (s + 1 != e && s[0] == '\xc0' && s[1] == '\x80') { + *q++ = '\0'; +@@ -861,6 +863,16 @@ + }; + + ++#if PY_SIZE_MAX > INT_MAX ++#define CHECK_STRING_LENGTH(s) do { \ ++ if (s != NULL && strlen(s) >= INT_MAX) { \ ++ PyErr_SetString(PyExc_OverflowError, "string is too long"); \ ++ return NULL; \ ++ } } while(0) ++#else ++#define CHECK_STRING_LENGTH(s) ++#endif ++ + static Tcl_Obj* + AsObj(PyObject *value) + { +@@ -869,8 +881,8 @@ + int overflow; + + if (PyBytes_Check(value)) +- return Tcl_NewStringObj(PyBytes_AS_STRING(value), +- PyBytes_GET_SIZE(value)); ++ return Tcl_NewByteArrayObj((unsigned char *)PyBytes_AS_STRING(value), ++ PyBytes_GET_SIZE(value)); + else if (PyBool_Check(value)) + return Tcl_NewBooleanObj(PyObject_IsTrue(value)); + else if (PyLong_CheckExact(value) && +@@ -1279,6 +1291,7 @@ + if (!PyArg_ParseTuple(args, "s:eval", &script)) + return NULL; + ++ CHECK_STRING_LENGTH(script); + CHECK_TCL_APPARTMENT; + + ENTER_TCL +@@ -1302,6 +1315,7 @@ + if (!PyArg_ParseTuple(args, "s:evalfile", &fileName)) + return NULL; + ++ CHECK_STRING_LENGTH(fileName); + CHECK_TCL_APPARTMENT; + + ENTER_TCL +@@ -1322,9 +1336,10 @@ + PyObject *res = NULL; + int err; + +- if (!PyArg_ParseTuple(args, "s", &script)) ++ if (!PyArg_ParseTuple(args, "s:record", &script)) + return NULL; + ++ CHECK_STRING_LENGTH(script); + CHECK_TCL_APPARTMENT; + + ENTER_TCL +@@ -1345,6 +1360,7 @@ + + if (!PyArg_ParseTuple(args, "s:adderrorinfo", &msg)) + return NULL; ++ CHECK_STRING_LENGTH(msg); + CHECK_TCL_APPARTMENT; + + ENTER_TCL +@@ -1528,6 +1544,8 @@ + if (!PyArg_ParseTuple(args, "ssO:setvar", + &name1, &name2, &newValue)) + return NULL; ++ CHECK_STRING_LENGTH(name1); ++ CHECK_STRING_LENGTH(name2); + /* XXX must hold tcl lock already??? */ + newval = AsObj(newValue); + ENTER_TCL +@@ -1573,6 +1591,7 @@ + varname_converter, &name1, &name2)) + return NULL; + ++ CHECK_STRING_LENGTH(name2); + ENTER_TCL + tres = Tcl_GetVar2Ex(Tkapp_Interp(self), name1, name2, flags); + ENTER_OVERLAP +@@ -1615,6 +1634,8 @@ + if (!PyArg_ParseTuple(args, "s|s:unsetvar", &name1, &name2)) + return NULL; + ++ CHECK_STRING_LENGTH(name1); ++ CHECK_STRING_LENGTH(name2); + ENTER_TCL + code = Tcl_UnsetVar2(Tkapp_Interp(self), name1, name2, flags); + ENTER_OVERLAP +@@ -1660,6 +1681,7 @@ + } + if (!PyArg_ParseTuple(args, "s:getint", &s)) + return NULL; ++ CHECK_STRING_LENGTH(s); + if (Tcl_GetInt(Tkapp_Interp(self), s, &v) == TCL_ERROR) + return Tkinter_Error(self); + return Py_BuildValue("i", v); +@@ -1680,6 +1702,7 @@ + } + if (!PyArg_ParseTuple(args, "s:getdouble", &s)) + return NULL; ++ CHECK_STRING_LENGTH(s); + if (Tcl_GetDouble(Tkapp_Interp(self), s, &v) == TCL_ERROR) + return Tkinter_Error(self); + return Py_BuildValue("d", v); +@@ -1700,6 +1723,7 @@ + } + if (!PyArg_ParseTuple(args, "s:getboolean", &s)) + return NULL; ++ CHECK_STRING_LENGTH(s); + if (Tcl_GetBoolean(Tkapp_Interp(self), s, &v) == TCL_ERROR) + return Tkinter_Error(self); + return PyBool_FromLong(v); +@@ -1715,6 +1739,7 @@ + if (!PyArg_ParseTuple(args, "s:exprstring", &s)) + return NULL; + ++ CHECK_STRING_LENGTH(s); + CHECK_TCL_APPARTMENT; + + ENTER_TCL +@@ -1739,6 +1764,7 @@ + if (!PyArg_ParseTuple(args, "s:exprlong", &s)) + return NULL; + ++ CHECK_STRING_LENGTH(s); + CHECK_TCL_APPARTMENT; + + ENTER_TCL +@@ -1762,6 +1788,7 @@ + + if (!PyArg_ParseTuple(args, "s:exprdouble", &s)) + return NULL; ++ CHECK_STRING_LENGTH(s); + CHECK_TCL_APPARTMENT; + PyFPE_START_PROTECT("Tkapp_ExprDouble", return 0) + ENTER_TCL +@@ -1786,6 +1813,7 @@ + + if (!PyArg_ParseTuple(args, "s:exprboolean", &s)) + return NULL; ++ CHECK_STRING_LENGTH(s); + CHECK_TCL_APPARTMENT; + ENTER_TCL + retval = Tcl_ExprBoolean(Tkapp_Interp(self), s, &v); +@@ -1838,6 +1866,7 @@ + if (!PyArg_ParseTuple(args, "et:splitlist", "utf-8", &list)) + return NULL; + ++ CHECK_STRING_LENGTH(list); + if (Tcl_SplitList(Tkapp_Interp(self), list, + &argc, &argv) == TCL_ERROR) { + PyMem_Free(list); +@@ -1899,6 +1928,7 @@ + + if (!PyArg_ParseTuple(args, "et:split", "utf-8", &list)) + return NULL; ++ CHECK_STRING_LENGTH(list); + v = Split(list); + PyMem_Free(list); + return v; +@@ -2030,6 +2060,7 @@ + + if (!PyArg_ParseTuple(args, "sO:createcommand", &cmdName, &func)) + return NULL; ++ CHECK_STRING_LENGTH(cmdName); + if (!PyCallable_Check(func)) { + PyErr_SetString(PyExc_TypeError, "command not callable"); + return NULL; +@@ -2091,6 +2122,7 @@ + + if (!PyArg_ParseTuple(args, "s:deletecommand", &cmdName)) + return NULL; ++ CHECK_STRING_LENGTH(cmdName); + + #ifdef WITH_THREAD + if (self->threaded && self->thread_id != Tcl_GetCurrentThread()) { +@@ -2782,6 +2814,10 @@ + &interactive, &wantobjects, &wantTk, + &sync, &use)) + return NULL; ++ CHECK_STRING_LENGTH(screenName); ++ CHECK_STRING_LENGTH(baseName); ++ CHECK_STRING_LENGTH(className); ++ CHECK_STRING_LENGTH(use); + + return (PyObject *) Tkapp_New(screenName, className, + interactive, wantobjects, wantTk, +diff -r c0e311e010fc Modules/getpath.c +--- a/Modules/getpath.c ++++ b/Modules/getpath.c +@@ -734,6 +734,11 @@ + + bufsz += wcslen(zip_path) + 1; + bufsz += wcslen(exec_prefix) + 1; ++ /* When running from the build directory, add room for the Modules ++ * subdirectory too. ++ */ ++ if (efound == -1) ++ bufsz += wcslen(argv0_path) + wcslen(L"Modules") + 2; + + buf = (wchar_t *)PyMem_Malloc(bufsz * sizeof(wchar_t)); + if (buf == NULL) { +@@ -781,6 +786,15 @@ + + /* Finally, on goes the directory for dynamic-load modules */ + wcscat(buf, exec_prefix); ++ /* And, if we run from a build directory, the Modules directory (for ++ * modules built with Modules/Setup.) ++ */ ++ if (efound == -1) { ++ wcscat(buf, delimiter); ++ wcscat(buf, argv0_path); ++ wcscat(buf, separator); ++ wcscat(buf, L"Modules"); ++ } + + /* And publish the results */ + module_search_path = buf; +diff -r c0e311e010fc Modules/hashtable.c +--- a/Modules/hashtable.c ++++ b/Modules/hashtable.c +@@ -233,11 +233,12 @@ + nchains++; + } + } +- printf("hash table %p: entries=%zu/%zu (%.0f%%), ", ++ printf("hash table %p: entries=%" ++ PY_FORMAT_SIZE_T "u/%" PY_FORMAT_SIZE_T "u (%.0f%%), ", + ht, ht->entries, ht->num_buckets, load * 100.0); + if (nchains) + printf("avg_chain_len=%.1f, ", (double)total_chain_len / nchains); +- printf("max_chain_len=%zu, %zu kB\n", ++ printf("max_chain_len=%" PY_FORMAT_SIZE_T "u, %" PY_FORMAT_SIZE_T "u kB\n", + max_chain_len, size / 1024); + } + #endif +diff -r c0e311e010fc Modules/itertoolsmodule.c +--- a/Modules/itertoolsmodule.c ++++ b/Modules/itertoolsmodule.c +@@ -4109,14 +4109,17 @@ + { + repeatobject *ro; + PyObject *element; +- Py_ssize_t cnt = -1; ++ Py_ssize_t cnt = -1, n_kwds = 0; + static char *kwargs[] = {"object", "times", NULL}; + + if (!PyArg_ParseTupleAndKeywords(args, kwds, "O|n:repeat", kwargs, + &element, &cnt)) + return NULL; + +- if (PyTuple_Size(args) == 2 && cnt < 0) ++ if (kwds != NULL) ++ n_kwds = PyDict_Size(kwds); ++ /* Does user supply times argument? */ ++ if ((PyTuple_Size(args) + n_kwds == 2) && cnt < 0) + cnt = 0; + + ro = (repeatobject *)type->tp_alloc(type, 0); +diff -r c0e311e010fc Modules/makesetup +--- a/Modules/makesetup ++++ b/Modules/makesetup +@@ -217,7 +217,7 @@ + *) src='$(srcdir)/'"$srcdir/$src";; + esac + case $doconfig in +- no) cc="$cc \$(CCSHARED) \$(CFLAGS) \$(CPPFLAGS)";; ++ no) cc="$cc \$(CCSHARED) \$(PY_CFLAGS) \$(PY_CPPFLAGS)";; + *) + cc="$cc \$(PY_CORE_CFLAGS)";; + esac +@@ -229,11 +229,7 @@ + esac + for mod in $mods + do +- case $objs in +- *$mod.o*) base=$mod;; +- *) base=${mod}module;; +- esac +- file="$srcdir/$base\$(SO)" ++ file="$srcdir/$mod\$(EXT_SUFFIX)" + case $doconfig in + no) SHAREDMODS="$SHAREDMODS $file";; + esac +diff -r c0e311e010fc Modules/readline.c +--- a/Modules/readline.c ++++ b/Modules/readline.c +@@ -1019,6 +1019,21 @@ + + mod_state->begidx = PyLong_FromLong(0L); + mod_state->endidx = PyLong_FromLong(0L); ++ ++#ifndef __APPLE__ ++ if (!isatty(STDOUT_FILENO)) { ++ /* Issue #19884: stdout is no a terminal. Disable meta modifier ++ keys to not write the ANSI sequence "\033[1034h" into stdout. On ++ terminals supporting 8 bit characters like TERM=xterm-256color ++ (which is now the default Fedora since Fedora 18), the meta key is ++ used to enable support of 8 bit characters (ANSI sequence ++ "\033[1034h"). ++ ++ With libedit, this call makes readline() crash. */ ++ rl_variable_bind ("enable-meta-key", "off"); ++ } ++#endif ++ + /* Initialize (allows .inputrc to override) + * + * XXX: A bug in the readline-2.2 library causes a memory leak +diff -r c0e311e010fc Modules/socketmodule.c +--- a/Modules/socketmodule.c ++++ b/Modules/socketmodule.c +@@ -33,8 +33,8 @@ + - socket.ntohl(32 bit value) --> new int object + - socket.htons(16 bit value) --> new int object + - socket.htonl(32 bit value) --> new int object +-- socket.getaddrinfo(host, port [, family, socktype, proto, flags]) +- --> List of (family, socktype, proto, canonname, sockaddr) ++- socket.getaddrinfo(host, port [, family, type, proto, flags]) ++ --> List of (family, type, proto, canonname, sockaddr) + - socket.getnameinfo(sockaddr, flags) --> (host, port) + - socket.AF_INET, socket.SOCK_STREAM, etc.: constants from + - socket.has_ipv6: boolean value indicating if IPv6 is supported +@@ -3868,8 +3868,13 @@ + static PyObject * + sock_repr(PySocketSockObject *s) + { ++ long sock_fd; ++ /* On Windows, this test is needed because SOCKET_T is unsigned */ ++ if (s->sock_fd == INVALID_SOCKET) { ++ sock_fd = -1; ++ } + #if SIZEOF_SOCKET_T > SIZEOF_LONG +- if (s->sock_fd > LONG_MAX) { ++ else if (s->sock_fd > LONG_MAX) { + /* this can occur on Win64, and actually there is a special + ugly printf formatter for decimal pointer length integer + printing, only bother if necessary*/ +@@ -3879,9 +3884,11 @@ + return NULL; + } + #endif ++ else ++ sock_fd = (long)s->sock_fd; + return PyUnicode_FromFormat( + "", +- (long)s->sock_fd, s->sock_family, ++ sock_fd, s->sock_family, + s->sock_type, + s->sock_proto); + } +@@ -5292,8 +5299,8 @@ + } + + PyDoc_STRVAR(getaddrinfo_doc, +-"getaddrinfo(host, port [, family, socktype, proto, flags])\n\ +- -> list of (family, socktype, proto, canonname, sockaddr)\n\ ++"getaddrinfo(host, port [, family, type, proto, flags])\n\ ++ -> list of (family, type, proto, canonname, sockaddr)\n\ + \n\ + Resolve host and port into addrinfo struct."); + +diff -r c0e311e010fc Modules/unicodedata.c +--- a/Modules/unicodedata.c ++++ b/Modules/unicodedata.c +@@ -13,6 +13,8 @@ + + ------------------------------------------------------------------------ */ + ++#define PY_SSIZE_T_CLEAN ++ + #include "Python.h" + #include "ucnhash.h" + #include "structmember.h" +@@ -1271,12 +1273,16 @@ + Py_UCS4 code; + + char* name; +- int namelen; ++ Py_ssize_t namelen; + unsigned int index; + if (!PyArg_ParseTuple(args, "s#:lookup", &name, &namelen)) + return NULL; ++ if (namelen > INT_MAX) { ++ PyErr_SetString(PyExc_KeyError, "name too long"); ++ return NULL; ++ } + +- if (!_getcode(self, name, namelen, &code, 1)) { ++ if (!_getcode(self, name, (int)namelen, &code, 1)) { + PyErr_Format(PyExc_KeyError, "undefined character name '%s'", name); + return NULL; + } +diff -r c0e311e010fc Modules/zlibmodule.c +--- a/Modules/zlibmodule.c ++++ b/Modules/zlibmodule.c +@@ -3,6 +3,7 @@ + + /* Windows users: read Python's PCbuild\readme.txt */ + ++#define PY_SSIZE_T_CLEAN + + #include "Python.h" + #include "structmember.h" +diff -r c0e311e010fc Objects/abstract.c +--- a/Objects/abstract.c ++++ b/Objects/abstract.c +@@ -2191,9 +2191,8 @@ + return null_error(); + + func = PyObject_GetAttrString(o, name); +- if (func == NULL) { +- return 0; +- } ++ if (func == NULL) ++ return NULL; + + va_start(va, format); + retval = callmethod(func, format, va, 0); +@@ -2213,9 +2212,8 @@ + return null_error(); + + func = _PyObject_GetAttrId(o, name); +- if (func == NULL) { +- return 0; +- } ++ if (func == NULL) ++ return NULL; + + va_start(va, format); + retval = callmethod(func, format, va, 0); +@@ -2235,9 +2233,8 @@ + return null_error(); + + func = PyObject_GetAttrString(o, name); +- if (func == NULL) { +- return 0; +- } ++ if (func == NULL) ++ return NULL; + va_start(va, format); + retval = callmethod(func, format, va, 1); + va_end(va); +diff -r c0e311e010fc Objects/exceptions.c +--- a/Objects/exceptions.c ++++ b/Objects/exceptions.c +@@ -1254,6 +1254,9 @@ + * SyntaxError extends Exception + */ + ++/* Helper function to customise error message for some syntax errors */ ++static int _report_missing_parentheses(PySyntaxErrorObject *self); ++ + static int + SyntaxError_init(PySyntaxErrorObject *self, PyObject *args, PyObject *kwds) + { +@@ -1298,6 +1301,13 @@ + Py_INCREF(self->text); + + Py_DECREF(info); ++ ++ /* Issue #21669: Custom error for 'print' & 'exec' as statements */ ++ if (self->text && PyUnicode_Check(self->text)) { ++ if (_report_missing_parentheses(self) < 0) { ++ return -1; ++ } ++ } + } + return 0; + } +@@ -2783,3 +2793,128 @@ + PyErr_Restore(new_exc, new_val, new_tb); + return new_val; + } ++ ++ ++/* To help with migration from Python 2, SyntaxError.__init__ applies some ++ * heuristics to try to report a more meaningful exception when print and ++ * exec are used like statements. ++ * ++ * The heuristics are currently expected to detect the following cases: ++ * - top level statement ++ * - statement in a nested suite ++ * - trailing section of a one line complex statement ++ * ++ * They're currently known not to trigger: ++ * - after a semi-colon ++ * ++ * The error message can be a bit odd in cases where the "arguments" are ++ * completely illegal syntactically, but that isn't worth the hassle of ++ * fixing. ++ * ++ * We also can't do anything about cases that are legal Python 3 syntax ++ * but mean something entirely different from what they did in Python 2 ++ * (omitting the arguments entirely, printing items preceded by a unary plus ++ * or minus, using the stream redirection syntax). ++ */ ++ ++static int ++_check_for_legacy_statements(PySyntaxErrorObject *self, Py_ssize_t start) ++{ ++ /* Return values: ++ * -1: an error occurred ++ * 0: nothing happened ++ * 1: the check triggered & the error message was changed ++ */ ++ static PyObject *print_prefix = NULL; ++ static PyObject *exec_prefix = NULL; ++ Py_ssize_t text_len = PyUnicode_GET_LENGTH(self->text); ++ int kind = PyUnicode_KIND(self->text); ++ void *data = PyUnicode_DATA(self->text); ++ ++ /* Ignore leading whitespace */ ++ while (start < text_len) { ++ Py_UCS4 ch = PyUnicode_READ(kind, data, start); ++ if (!Py_UNICODE_ISSPACE(ch)) ++ break; ++ start++; ++ } ++ /* Checking against an empty or whitespace-only part of the string */ ++ if (start == text_len) { ++ return 0; ++ } ++ ++ /* Check for legacy print statements */ ++ if (print_prefix == NULL) { ++ print_prefix = PyUnicode_InternFromString("print "); ++ if (print_prefix == NULL) { ++ return -1; ++ } ++ } ++ if (PyUnicode_Tailmatch(self->text, print_prefix, ++ start, text_len, -1)) { ++ Py_CLEAR(self->msg); ++ self->msg = PyUnicode_FromString( ++ "Missing parentheses in call to 'print'"); ++ return 1; ++ } ++ ++ /* Check for legacy exec statements */ ++ if (exec_prefix == NULL) { ++ exec_prefix = PyUnicode_InternFromString("exec "); ++ if (exec_prefix == NULL) { ++ return -1; ++ } ++ } ++ if (PyUnicode_Tailmatch(self->text, exec_prefix, ++ start, text_len, -1)) { ++ Py_CLEAR(self->msg); ++ self->msg = PyUnicode_FromString( ++ "Missing parentheses in call to 'exec'"); ++ return 1; ++ } ++ /* Fall back to the default error message */ ++ return 0; ++} ++ ++static int ++_report_missing_parentheses(PySyntaxErrorObject *self) ++{ ++ Py_UCS4 left_paren = 40; ++ Py_ssize_t left_paren_index; ++ Py_ssize_t text_len = PyUnicode_GET_LENGTH(self->text); ++ int legacy_check_result = 0; ++ ++ /* Skip entirely if there is an opening parenthesis */ ++ left_paren_index = PyUnicode_FindChar(self->text, left_paren, ++ 0, text_len, 1); ++ if (left_paren_index < -1) { ++ return -1; ++ } ++ if (left_paren_index != -1) { ++ /* Use default error message for any line with an opening paren */ ++ return 0; ++ } ++ /* Handle the simple statement case */ ++ legacy_check_result = _check_for_legacy_statements(self, 0); ++ if (legacy_check_result < 0) { ++ return -1; ++ ++ } ++ if (legacy_check_result == 0) { ++ /* Handle the one-line complex statement case */ ++ Py_UCS4 colon = 58; ++ Py_ssize_t colon_index; ++ colon_index = PyUnicode_FindChar(self->text, colon, ++ 0, text_len, 1); ++ if (colon_index < -1) { ++ return -1; ++ } ++ if (colon_index >= 0 && colon_index < text_len) { ++ /* Check again, starting from just after the colon */ ++ if (_check_for_legacy_statements(self, colon_index+1) < 0) { ++ return -1; ++ } ++ } ++ } ++ return 0; ++} +diff -r c0e311e010fc Objects/frameobject.c +--- a/Objects/frameobject.c ++++ b/Objects/frameobject.c +@@ -786,7 +786,7 @@ + PyObject *key = PyTuple_GET_ITEM(map, j); + PyObject *value = values[j]; + assert(PyUnicode_Check(key)); +- if (deref) { ++ if (deref && value != NULL) { + assert(PyCell_Check(value)); + value = PyCell_GET(value); + } +diff -r c0e311e010fc Objects/stringlib/README.txt +--- a/Objects/stringlib/README.txt ++++ b/Objects/stringlib/README.txt +@@ -1,4 +1,4 @@ +-bits shared by the stringobject and unicodeobject implementations (and ++bits shared by the bytesobject and unicodeobject implementations (and + possibly other modules, in a not too distant future). + + the stuff in here is included into relevant places; see the individual +diff -r c0e311e010fc Objects/unicodeobject.c +--- a/Objects/unicodeobject.c ++++ b/Objects/unicodeobject.c +@@ -1011,17 +1011,19 @@ + } + else + data = unicode->data.any; +- printf("%s: len=%zu, ",unicode_kind_name(op), ascii->length); ++ printf("%s: len=%" PY_FORMAT_SIZE_T "u, ", ++ unicode_kind_name(op), ascii->length); + + if (ascii->wstr == data) + printf("shared "); + printf("wstr=%p", ascii->wstr); + + if (!(ascii->state.ascii == 1 && ascii->state.compact == 1)) { +- printf(" (%zu), ", compact->wstr_length); ++ printf(" (%" PY_FORMAT_SIZE_T "u), ", compact->wstr_length); + if (!ascii->state.compact && compact->utf8 == unicode->data.any) + printf("shared "); +- printf("utf8=%p (%zu)", compact->utf8, compact->utf8_length); ++ printf("utf8=%p (%" PY_FORMAT_SIZE_T "u)", ++ compact->utf8, compact->utf8_length); + } + printf(", data=%p\n", data); + } +diff -r c0e311e010fc PC/pyconfig.h +--- a/PC/pyconfig.h ++++ b/PC/pyconfig.h +@@ -390,7 +390,7 @@ + #else + /* VC6, VS 2002 and eVC4 don't support the C99 LL suffix for 64-bit integer literals */ + #define Py_LL(x) x##I64 +-#endif /* _MSC_VER > 1200 */ ++#endif /* _MSC_VER > 1300 */ + #endif /* _MSC_VER */ + + #endif +@@ -436,6 +436,11 @@ + /* Define to 1 if you have the `copysign' function. */ + #define HAVE_COPYSIGN 1 + ++/* Define to 1 if you have the `round' function. */ ++#if _MSC_VER >= 1800 ++#define HAVE_ROUND 1 ++#endif ++ + /* Define to 1 if you have the `isinf' macro. */ + #define HAVE_DECL_ISINF 1 + +diff -r c0e311e010fc PC/winreg.c +--- a/PC/winreg.c ++++ b/PC/winreg.c +@@ -871,8 +871,10 @@ + /* ALSO handle ALL unknown data types here. Even if we can't + support it natively, we should handle the bits. */ + default: +- if (value == Py_None) ++ if (value == Py_None) { + *retDataSize = 0; ++ *retDataBuf = NULL; ++ } + else { + Py_buffer view; + +diff -r c0e311e010fc PCbuild/build_ssl.py +--- a/PCbuild/build_ssl.py ++++ b/PCbuild/build_ssl.py +@@ -66,7 +66,7 @@ + # Fetch SSL directory from VC properties + def get_ssl_dir(): + propfile = (os.path.join(os.path.dirname(__file__), 'pyproject.props')) +- with open(propfile) as f: ++ with open(propfile, encoding='utf-8-sig') as f: + m = re.search('openssl-([^<]+)<', f.read()) + return "..\..\openssl-"+m.group(1) + +diff -r c0e311e010fc PCbuild/pyproject.props +--- a/PCbuild/pyproject.props ++++ b/PCbuild/pyproject.props +@@ -20,7 +20,7 @@ + $(externalsDir)\sqlite-3.8.3.1 + $(externalsDir)\bzip2-1.0.6 + $(externalsDir)\xz-5.0.5 +- $(externalsDir)\openssl-1.0.1g ++ $(externalsDir)\openssl-1.0.1i + $(externalsDir)\tcltk + $(externalsDir)\tcltk64 + $(tcltkDir)\lib\tcl86t.lib;$(tcltkDir)\lib\tk86t.lib +diff -r c0e311e010fc PCbuild/readme.txt +--- a/PCbuild/readme.txt ++++ b/PCbuild/readme.txt +@@ -9,16 +9,19 @@ + + Visual C++ 2010 Express Edition + Required for building 32-bit Debug and Release configuration builds. +- This edition does not support "solution folders", which pcbuild.sln +- uses; this will not prevent building. ++ The Python build solution pcbuild.sln makes use of Solution Folders, ++ which this edition does not support. Any time pcbuild.sln is opened ++ or reloaded by Visual C++, a warning about Solution Folders will be ++ displayed which can be safely dismissed with no impact on your ++ ability to build Python. + Visual Studio 2010 Professional Edition + Required for building 64-bit Debug and Release configuration builds + Visual Studio 2010 Premium Edition + Required for building Release configuration builds that make use of + Profile Guided Optimization (PGO), on either platform. + +-The official Python releases are built with PGO using Visual Studio 2010 +-Ultimate Edition. ++Installing Service Pack 1 for Visual Studio 2010 is highly recommended ++to avoid LNK1123 errors. + + All you need to do to build is open the solution "pcbuild.sln" in Visual + Studio, select the desired combination of configuration and platform, +@@ -46,7 +49,7 @@ + development of CPython, you will most likely use this configuration. + PGInstrument, PGUpdate + Used to build Python in Release configuration using PGO, which +- requires Professional Edition of Visual Studio. See the "Profile ++ requires Premium Edition of Visual Studio. See the "Profile + Guided Optimization" section below for more information. Build + output from each of these configurations lands in its own + sub-directory of this directory. The official Python releases are +@@ -168,7 +171,7 @@ + Homepage: + http://tukaani.org/xz/ + _ssl +- Python wrapper for version 1.0.1g of the OpenSSL secure sockets ++ Python wrapper for version 1.0.1h of the OpenSSL secure sockets + library, which is built by ssl.vcxproj + Homepage: + http://www.openssl.org/ +diff -r c0e311e010fc Parser/tokenizer.c +--- a/Parser/tokenizer.c ++++ b/Parser/tokenizer.c +@@ -1597,15 +1597,24 @@ + } while (isdigit(c)); + } + if (c == 'e' || c == 'E') { +- exponent: ++ int e; ++ exponent: ++ e = c; + /* Exponent part */ + c = tok_nextc(tok); +- if (c == '+' || c == '-') ++ if (c == '+' || c == '-') { + c = tok_nextc(tok); +- if (!isdigit(c)) { +- tok->done = E_TOKEN; ++ if (!isdigit(c)) { ++ tok->done = E_TOKEN; ++ tok_backup(tok, c); ++ return ERRORTOKEN; ++ } ++ } else if (!isdigit(c)) { + tok_backup(tok, c); +- return ERRORTOKEN; ++ tok_backup(tok, e); ++ *p_start = tok->start; ++ *p_end = tok->cur; ++ return NUMBER; + } + do { + c = tok_nextc(tok); +diff -r c0e311e010fc Python/bltinmodule.c +--- a/Python/bltinmodule.c ++++ b/Python/bltinmodule.c +@@ -69,7 +69,7 @@ + func = PyTuple_GET_ITEM(args, 0); /* Better be callable */ + if (!PyFunction_Check(func)) { + PyErr_SetString(PyExc_TypeError, +- "__build__class__: func must be a function"); ++ "__build_class__: func must be a function"); + return NULL; + } + name = PyTuple_GET_ITEM(args, 1); +@@ -1327,7 +1327,7 @@ + PyDoc_STRVAR(len_doc, + "len(object)\n\ + \n\ +-Return the number of items of a sequence or mapping."); ++Return the number of items of a sequence or collection."); + + + static PyObject * +@@ -1454,10 +1454,12 @@ + } + + PyDoc_STRVAR(min_doc, +-"min(iterable[, key=func]) -> value\n\ +-min(a, b, c, ...[, key=func]) -> value\n\ ++"min(iterable, *[, default=obj, key=func]) -> value\n\ ++min(arg1, arg2, *args, *[, key=func]) -> value\n\ + \n\ +-With a single iterable argument, return its smallest item.\n\ ++With a single iterable argument, return its smallest item. The\n\ ++default keyword-only argument specifies an object to return if\n\ ++the provided iterable is empty.\n\ + With two or more arguments, return the smallest argument."); + + +@@ -1468,10 +1470,12 @@ + } + + PyDoc_STRVAR(max_doc, +-"max(iterable[, key=func]) -> value\n\ +-max(a, b, c, ...[, key=func]) -> value\n\ ++"max(iterable, *[, default=obj, key=func]) -> value\n\ ++max(arg1, arg2, *args, *[, key=func]) -> value\n\ + \n\ +-With a single iterable argument, return its largest item.\n\ ++With a single iterable argument, return its biggest item. The\n\ ++default keyword-only argument specifies an object to return if\n\ ++the provided iterable is empty.\n\ + With two or more arguments, return the largest argument."); + + +diff -r c0e311e010fc Python/ceval.c +--- a/Python/ceval.c ++++ b/Python/ceval.c +@@ -1267,6 +1267,13 @@ + /* Other threads may run now */ + + take_gil(tstate); ++ ++ /* Check if we should make a quick exit. */ ++ if (_Py_Finalizing && _Py_Finalizing != tstate) { ++ drop_gil(tstate); ++ PyThread_exit_thread(); ++ } ++ + if (PyThreadState_Swap(tstate) != NULL) + Py_FatalError("ceval: orphan tstate"); + } +diff -r c0e311e010fc Python/compile.c +--- a/Python/compile.c ++++ b/Python/compile.c +@@ -3856,12 +3856,16 @@ + target_depth = depth; + if (instr->i_opcode == FOR_ITER) { + target_depth = depth-2; +- } else if (instr->i_opcode == SETUP_FINALLY || +- instr->i_opcode == SETUP_EXCEPT) { ++ } ++ else if (instr->i_opcode == SETUP_FINALLY || ++ instr->i_opcode == SETUP_EXCEPT) { + target_depth = depth+3; + if (target_depth > maxdepth) + maxdepth = target_depth; + } ++ else if (instr->i_opcode == JUMP_IF_TRUE_OR_POP || ++ instr->i_opcode == JUMP_IF_FALSE_OR_POP) ++ depth = depth - 1; + maxdepth = stackdepth_walk(c, instr->i_target, + target_depth, maxdepth); + if (instr->i_opcode == JUMP_ABSOLUTE || +diff -r c0e311e010fc Python/import.c +--- a/Python/import.c ++++ b/Python/import.c +@@ -460,7 +460,7 @@ + while (PyDict_Next(modules, &pos, &key, &value)) { + if (PyModule_Check(value)) { + if (Py_VerboseFlag && PyUnicode_Check(key)) +- PySys_FormatStderr("# cleanup[2] removing %U\n", key, value); ++ PySys_FormatStderr("# cleanup[2] removing %U\n", key); + STORE_MODULE_WEAKREF(key, value); + PyDict_SetItem(modules, key, Py_None); + } +@@ -904,6 +904,7 @@ + &PyId__fix_up_module, + d, name, pathname, cpathname, NULL); + if (res != NULL) { ++ Py_DECREF(res); + res = exec_code_in_module(name, d, co); + } + return res; +diff -r c0e311e010fc Python/sysmodule.c +--- a/Python/sysmodule.c ++++ b/Python/sysmodule.c +@@ -863,29 +863,16 @@ + } + #endif /* USE_MALLOPT */ + +-static PyObject * +-sys_getsizeof(PyObject *self, PyObject *args, PyObject *kwds) ++size_t ++_PySys_GetSizeOf(PyObject *o) + { + PyObject *res = NULL; +- static PyObject *gc_head_size = NULL; +- static char *kwlist[] = {"object", "default", 0}; +- PyObject *o, *dflt = NULL; + PyObject *method; +- +- if (!PyArg_ParseTupleAndKeywords(args, kwds, "O|O:getsizeof", +- kwlist, &o, &dflt)) +- return NULL; +- +- /* Initialize static variable for GC head size */ +- if (gc_head_size == NULL) { +- gc_head_size = PyLong_FromSsize_t(sizeof(PyGC_Head)); +- if (gc_head_size == NULL) +- return NULL; +- } ++ size_t size; + + /* Make sure the type is initialized. float gets initialized late */ + if (PyType_Ready(Py_TYPE(o)) < 0) +- return NULL; ++ return (size_t)-1; + + method = _PyObject_LookupSpecial(o, &PyId___sizeof__); + if (method == NULL) { +@@ -899,24 +886,45 @@ + Py_DECREF(method); + } + +- /* Has a default value been given */ +- if ((res == NULL) && (dflt != NULL) && +- PyErr_ExceptionMatches(PyExc_TypeError)) +- { +- PyErr_Clear(); +- Py_INCREF(dflt); +- return dflt; +- } +- else if (res == NULL) +- return res; ++ if (res == NULL) ++ return (size_t)-1; ++ ++ size = PyLong_AsSize_t(res); ++ Py_DECREF(res); ++ if (size == (size_t)-1 && PyErr_Occurred()) ++ return (size_t)-1; + + /* add gc_head size */ +- if (PyObject_IS_GC(o)) { +- PyObject *tmp = res; +- res = PyNumber_Add(tmp, gc_head_size); +- Py_DECREF(tmp); ++ if (PyObject_IS_GC(o)) ++ size += sizeof(PyGC_Head); ++ return size; ++} ++ ++static PyObject * ++sys_getsizeof(PyObject *self, PyObject *args, PyObject *kwds) ++{ ++ static char *kwlist[] = {"object", "default", 0}; ++ size_t size; ++ PyObject *o, *dflt = NULL; ++ ++ if (!PyArg_ParseTupleAndKeywords(args, kwds, "O|O:getsizeof", ++ kwlist, &o, &dflt)) ++ return NULL; ++ ++ size = _PySys_GetSizeOf(o); ++ ++ if (size == (size_t)-1 && PyErr_Occurred()) { ++ /* Has a default value been given */ ++ if (dflt != NULL && PyErr_ExceptionMatches(PyExc_TypeError)) { ++ PyErr_Clear(); ++ Py_INCREF(dflt); ++ return dflt; ++ } ++ else ++ return NULL; + } +- return res; ++ ++ return PyLong_FromSize_t(size); + } + + PyDoc_STRVAR(getsizeof_doc, +@@ -1546,7 +1554,7 @@ + #define STRIFY(name) QUOTE(name) + #define MAJOR STRIFY(PY_MAJOR_VERSION) + #define MINOR STRIFY(PY_MINOR_VERSION) +-#define TAG NAME "-" MAJOR MINOR; ++#define TAG NAME "-" MAJOR MINOR + const char *_PySys_ImplCacheTag = TAG; + #undef NAME + #undef QUOTE +diff -r c0e311e010fc Tools/buildbot/external-amd64.bat +--- a/Tools/buildbot/external-amd64.bat ++++ b/Tools/buildbot/external-amd64.bat +@@ -6,16 +6,23 @@ + + if not exist tcltk64\bin\tcl86tg.dll ( + cd tcl-8.6.1.0\win +- nmake -f makefile.vc DEBUG=1 MACHINE=AMD64 INSTALLDIR=..\..\tcltk64 clean all +- nmake -f makefile.vc DEBUG=1 MACHINE=AMD64 INSTALLDIR=..\..\tcltk64 install ++ nmake -f makefile.vc OPTS=symbols MACHINE=AMD64 INSTALLDIR=..\..\tcltk64 clean core shell dlls ++ nmake -f makefile.vc OPTS=symbols MACHINE=AMD64 INSTALLDIR=..\..\tcltk64 install-binaries install-libraries + cd ..\.. + ) + + if not exist tcltk64\bin\tk86tg.dll ( +- cd tk-8.6.1.0\win +- nmake -f makefile.vc OPTS=noxp DEBUG=1 MACHINE=AMD64 INSTALLDIR=..\..\tcltk64 TCLDIR=..\..\tcl-8.6.1.0 clean +- nmake -f makefile.vc OPTS=noxp DEBUG=1 MACHINE=AMD64 INSTALLDIR=..\..\tcltk64 TCLDIR=..\..\tcl-8.6.1.0 all +- nmake -f makefile.vc OPTS=noxp DEBUG=1 MACHINE=AMD64 INSTALLDIR=..\..\tcltk64 TCLDIR=..\..\tcl-8.6.1.0 install ++ cd tk-8.6.1.0\win ++ nmake -f makefile.vc OPTS=symbols MACHINE=AMD64 INSTALLDIR=..\..\tcltk64 TCLDIR=..\..\tcl-8.6.1.0 clean ++ nmake -f makefile.vc OPTS=symbols MACHINE=AMD64 INSTALLDIR=..\..\tcltk64 TCLDIR=..\..\tcl-8.6.1.0 all ++ nmake -f makefile.vc OPTS=symbols MACHINE=AMD64 INSTALLDIR=..\..\tcltk64 TCLDIR=..\..\tcl-8.6.1.0 install-binaries install-libraries + cd ..\.. + ) + ++if not exist tcltk64\lib\tix8.4.3\tix84g.dll ( ++ cd tix-8.4.3.4\win ++ nmake -f python.mak DEBUG=1 MACHINE=AMD64 TCL_DIR=..\..\tcl-8.6.1.0 TK_DIR=..\..\tk-8.6.1.0 INSTALL_DIR=..\..\tcltk64 clean ++ nmake -f python.mak DEBUG=1 MACHINE=AMD64 TCL_DIR=..\..\tcl-8.6.1.0 TK_DIR=..\..\tk-8.6.1.0 INSTALL_DIR=..\..\tcltk64 all ++ nmake -f python.mak DEBUG=1 MACHINE=AMD64 TCL_DIR=..\..\tcl-8.6.1.0 TK_DIR=..\..\tk-8.6.1.0 INSTALL_DIR=..\..\tcltk64 install ++ cd ..\.. ++) +diff -r c0e311e010fc Tools/buildbot/external-common.bat +--- a/Tools/buildbot/external-common.bat ++++ b/Tools/buildbot/external-common.bat +@@ -7,15 +7,12 @@ + @rem if exist bzip2-1.0.6 rd /s/q bzip2-1.0.6 + @rem if exist tcltk rd /s/q tcltk + @rem if exist tcltk64 rd /s/q tcltk64 +-@rem if exist tcl8.4.12 rd /s/q tcl8.4.12 +-@rem if exist tcl8.4.16 rd /s/q tcl8.4.16 +-@rem if exist tcl-8.4.18.1 rd /s/q tcl-8.4.18.1 +-@rem if exist tk8.4.12 rd /s/q tk8.4.12 +-@rem if exist tk8.4.16 rd /s/q tk8.4.16 +-@rem if exist tk-8.4.18.1 rd /s/q tk-8.4.18.1 ++@rem if exist tcl-8.6.1.0 rd /s/q tcl-8.6.1.0 ++@rem if exist tk-8.6.1.0 rd /s/q tk-8.6.1.0 ++@rem if exist tix-8.4.3.4 rd /s/q tix-8.4.3.4 + @rem if exist db-4.4.20 rd /s/q db-4.4.20 +-@rem if exist openssl-1.0.1e rd /s/q openssl-1.0.1g +-@rem if exist sqlite-3.7.12 rd /s/q sqlite-3.7.12 ++@rem if exist openssl-1.0.1i rd /s/q openssl-1.0.1i ++@rem if exist sqlite-3.7.12 rd /s/q sqlite-3.7.12 + + @rem bzip + if not exist bzip2-1.0.6 ( +@@ -24,9 +21,9 @@ + ) + + @rem OpenSSL +-if not exist openssl-1.0.1g ( +- rd /s/q openssl-1.0.1e +- svn export http://svn.python.org/projects/external/openssl-1.0.1g ++if not exist openssl-1.0.1i ( ++ rd /s/q openssl-1.0.1h ++ svn export http://svn.python.org/projects/external/openssl-1.0.1i + ) + + @rem tcl/tk +@@ -35,6 +32,7 @@ + svn export http://svn.python.org/projects/external/tcl-8.6.1.0 + ) + if not exist tk-8.6.1.0 svn export http://svn.python.org/projects/external/tk-8.6.1.0 ++if not exist tix-8.4.3.4 svn export http://svn.python.org/projects/external/tix-8.4.3.4 + + @rem sqlite3 + if not exist sqlite-3.8.3.1 ( +diff -r c0e311e010fc Tools/buildbot/external.bat +--- a/Tools/buildbot/external.bat ++++ b/Tools/buildbot/external.bat +@@ -7,15 +7,23 @@ + if not exist tcltk\bin\tcl86tg.dll ( + @rem all and install need to be separate invocations, otherwise nmakehlp is not found on install + cd tcl-8.6.1.0\win +- nmake -f makefile.vc DEBUG=1 INSTALLDIR=..\..\tcltk clean all +- nmake -f makefile.vc DEBUG=1 INSTALLDIR=..\..\tcltk install ++ nmake -f makefile.vc OPTS=symbols INSTALLDIR=..\..\tcltk clean core shell dlls ++ nmake -f makefile.vc OPTS=symbols INSTALLDIR=..\..\tcltk install-binaries install-libraries + cd ..\.. + ) + + if not exist tcltk\bin\tk86tg.dll ( + cd tk-8.6.1.0\win +- nmake -f makefile.vc OPTS=noxp DEBUG=1 INSTALLDIR=..\..\tcltk TCLDIR=..\..\tcl-8.6.1.0 clean +- nmake -f makefile.vc OPTS=noxp DEBUG=1 INSTALLDIR=..\..\tcltk TCLDIR=..\..\tcl-8.6.1.0 all +- nmake -f makefile.vc OPTS=noxp DEBUG=1 INSTALLDIR=..\..\tcltk TCLDIR=..\..\tcl-8.6.1.0 install ++ nmake -f makefile.vc OPTS=symbols INSTALLDIR=..\..\tcltk TCLDIR=..\..\tcl-8.6.1.0 clean ++ nmake -f makefile.vc OPTS=symbols INSTALLDIR=..\..\tcltk TCLDIR=..\..\tcl-8.6.1.0 all ++ nmake -f makefile.vc OPTS=symbols INSTALLDIR=..\..\tcltk TCLDIR=..\..\tcl-8.6.1.0 install-binaries install-libraries + cd ..\.. + ) ++ ++if not exist tcltk\lib\tix8.4.3\tix84g.dll ( ++ cd tix-8.4.3.4\win ++ nmake -f python.mak DEBUG=1 MACHINE=IX86 TCL_DIR=..\..\tcl-8.6.1.0 TK_DIR=..\..\tk-8.6.1.0 INSTALL_DIR=..\..\tcltk clean ++ nmake -f python.mak DEBUG=1 MACHINE=IX86 TCL_DIR=..\..\tcl-8.6.1.0 TK_DIR=..\..\tk-8.6.1.0 INSTALL_DIR=..\..\tcltk all ++ nmake -f python.mak DEBUG=1 MACHINE=IX86 TCL_DIR=..\..\tcl-8.6.1.0 TK_DIR=..\..\tk-8.6.1.0 INSTALL_DIR=..\..\tcltk install ++ cd ..\.. ++) +diff -r c0e311e010fc Tools/clinic/clinic.py +--- a/Tools/clinic/clinic.py ++++ b/Tools/clinic/clinic.py +@@ -2044,11 +2044,9 @@ + # automatically add converter for default format unit + # (but without stomping on the existing one if it's already + # set, in case you subclass) +- if ((cls.format_unit != 'O&') and ++ if ((cls.format_unit not in ('O&', '')) and + (cls.format_unit not in legacy_converters)): + legacy_converters[cls.format_unit] = cls +- if cls.format_unit: +- legacy_converters[cls.format_unit] = cls + return cls + + def add_legacy_c_converter(format_unit, **kwargs): +diff -r c0e311e010fc Tools/msi/msi.py +--- a/Tools/msi/msi.py ++++ b/Tools/msi/msi.py +@@ -1320,27 +1320,38 @@ + add_data(db, "RemoveFile", + [("MenuDir", "TARGETDIR", None, "MenuDir", 2)]) + tcltkshortcuts = [] ++ if msilib.Win64: ++ bitted = "64 bit" ++ else: ++ bitted = "32 bit" + if have_tcl: + tcltkshortcuts = [ +- ("IDLE", "MenuDir", "IDLE|IDLE (Python GUI)", "pythonw.exe", +- tcltk.id, r'"[TARGETDIR]Lib\idlelib\idle.pyw"', None, None, "python_icon.exe", 0, None, "TARGETDIR"), ++ ("IDLE", "MenuDir", ++ "IDLE|IDLE (Python "+short_version+" GUI - "+bitted+")", ++ "pythonw.exe", tcltk.id, r'"[TARGETDIR]Lib\idlelib\idle.pyw"', ++ None, None, "python_icon.exe", 0, None, "TARGETDIR"), + ] + add_data(db, "Shortcut", + tcltkshortcuts + + [# Advertised shortcuts: targets are features, not files +- ("Python", "MenuDir", "PYTHON|Python (command line)", "python.exe", +- default_feature.id, None, None, None, "python_icon.exe", 2, None, "TARGETDIR"), ++ ("Python", "MenuDir", ++ "PYTHON|Python "+short_version+" (command line - "+bitted+")", ++ "python.exe", default_feature.id, None, None, None, ++ "python_icon.exe", 2, None, "TARGETDIR"), + # Advertising the Manual breaks on (some?) Win98, and the shortcut lacks an + # icon first. + #("Manual", "MenuDir", "MANUAL|Python Manuals", "documentation", + # htmlfiles.id, None, None, None, None, None, None, None), + ## Non-advertised shortcuts: must be associated with a registry component +- ("Manual", "MenuDir", "MANUAL|Python Manuals", "REGISTRY.doc", +- "[#%s]" % docfile, None, +- None, None, None, None, None, None), +- ("PyDoc", "MenuDir", "MODDOCS|Module Docs", "python.exe", +- default_feature.id, r'-m pydoc -b', None, None, "python_icon.exe", 0, None, "TARGETDIR"), +- ("Uninstall", "MenuDir", "UNINST|Uninstall Python", "REGISTRY", ++ ("Manual", "MenuDir", "MANUAL|Python "+short_version+" Manuals", ++ "REGISTRY.doc", "[#%s]" % docfile, ++ None, None, None, None, None, None, None), ++ ("PyDoc", "MenuDir", ++ "MODDOCS|Python "+short_version+" Docs Server (pydoc - "+ ++ bitted+")", "python.exe", default_feature.id, r'-m pydoc -b', ++ None, None, "python_icon.exe", 0, None, "TARGETDIR"), ++ ("Uninstall", "MenuDir", "UNINST|Uninstall Python "+ ++ short_version+" ("+bitted+")", "REGISTRY", + SystemFolderName+"msiexec", "/x%s" % product_code, + None, None, None, None, None, None), + ]) +diff -r c0e311e010fc Tools/parser/test_unparse.py +--- a/Tools/parser/test_unparse.py ++++ /dev/null +@@ -1,276 +0,0 @@ +-import unittest +-import test.support +-import io +-import os +-import random +-import tokenize +-import unparse +-import ast +- +-def read_pyfile(filename): +- """Read and return the contents of a Python source file (as a +- string), taking into account the file encoding.""" +- with open(filename, "rb") as pyfile: +- encoding = tokenize.detect_encoding(pyfile.readline)[0] +- with open(filename, "r", encoding=encoding) as pyfile: +- source = pyfile.read() +- return source +- +-for_else = """\ +-def f(): +- for x in range(10): +- break +- else: +- y = 2 +- z = 3 +-""" +- +-while_else = """\ +-def g(): +- while True: +- break +- else: +- y = 2 +- z = 3 +-""" +- +-relative_import = """\ +-from . import fred +-from .. import barney +-from .australia import shrimp as prawns +-""" +- +-nonlocal_ex = """\ +-def f(): +- x = 1 +- def g(): +- nonlocal x +- x = 2 +- y = 7 +- def h(): +- nonlocal x, y +-""" +- +-# also acts as test for 'except ... as ...' +-raise_from = """\ +-try: +- 1 / 0 +-except ZeroDivisionError as e: +- raise ArithmeticError from e +-""" +- +-class_decorator = """\ +-@f1(arg) +-@f2 +-class Foo: pass +-""" +- +-elif1 = """\ +-if cond1: +- suite1 +-elif cond2: +- suite2 +-else: +- suite3 +-""" +- +-elif2 = """\ +-if cond1: +- suite1 +-elif cond2: +- suite2 +-""" +- +-try_except_finally = """\ +-try: +- suite1 +-except ex1: +- suite2 +-except ex2: +- suite3 +-else: +- suite4 +-finally: +- suite5 +-""" +- +-with_simple = """\ +-with f(): +- suite1 +-""" +- +-with_as = """\ +-with f() as x: +- suite1 +-""" +- +-with_two_items = """\ +-with f() as x, g() as y: +- suite1 +-""" +- +-class ASTTestCase(unittest.TestCase): +- def assertASTEqual(self, ast1, ast2): +- self.assertEqual(ast.dump(ast1), ast.dump(ast2)) +- +- def check_roundtrip(self, code1, filename="internal"): +- ast1 = compile(code1, filename, "exec", ast.PyCF_ONLY_AST) +- unparse_buffer = io.StringIO() +- unparse.Unparser(ast1, unparse_buffer) +- code2 = unparse_buffer.getvalue() +- ast2 = compile(code2, filename, "exec", ast.PyCF_ONLY_AST) +- self.assertASTEqual(ast1, ast2) +- +-class UnparseTestCase(ASTTestCase): +- # Tests for specific bugs found in earlier versions of unparse +- +- def test_del_statement(self): +- self.check_roundtrip("del x, y, z") +- +- def test_shifts(self): +- self.check_roundtrip("45 << 2") +- self.check_roundtrip("13 >> 7") +- +- def test_for_else(self): +- self.check_roundtrip(for_else) +- +- def test_while_else(self): +- self.check_roundtrip(while_else) +- +- def test_unary_parens(self): +- self.check_roundtrip("(-1)**7") +- self.check_roundtrip("(-1.)**8") +- self.check_roundtrip("(-1j)**6") +- self.check_roundtrip("not True or False") +- self.check_roundtrip("True or not False") +- +- def test_integer_parens(self): +- self.check_roundtrip("3 .__abs__()") +- +- def test_huge_float(self): +- self.check_roundtrip("1e1000") +- self.check_roundtrip("-1e1000") +- self.check_roundtrip("1e1000j") +- self.check_roundtrip("-1e1000j") +- +- def test_min_int(self): +- self.check_roundtrip(str(-2**31)) +- self.check_roundtrip(str(-2**63)) +- +- def test_imaginary_literals(self): +- self.check_roundtrip("7j") +- self.check_roundtrip("-7j") +- self.check_roundtrip("0j") +- self.check_roundtrip("-0j") +- +- def test_lambda_parentheses(self): +- self.check_roundtrip("(lambda: int)()") +- +- def test_chained_comparisons(self): +- self.check_roundtrip("1 < 4 <= 5") +- self.check_roundtrip("a is b is c is not d") +- +- def test_function_arguments(self): +- self.check_roundtrip("def f(): pass") +- self.check_roundtrip("def f(a): pass") +- self.check_roundtrip("def f(b = 2): pass") +- self.check_roundtrip("def f(a, b): pass") +- self.check_roundtrip("def f(a, b = 2): pass") +- self.check_roundtrip("def f(a = 5, b = 2): pass") +- self.check_roundtrip("def f(*, a = 1, b = 2): pass") +- self.check_roundtrip("def f(*, a = 1, b): pass") +- self.check_roundtrip("def f(*, a, b = 2): pass") +- self.check_roundtrip("def f(a, b = None, *, c, **kwds): pass") +- self.check_roundtrip("def f(a=2, *args, c=5, d, **kwds): pass") +- self.check_roundtrip("def f(*args, **kwargs): pass") +- +- def test_relative_import(self): +- self.check_roundtrip(relative_import) +- +- def test_nonlocal(self): +- self.check_roundtrip(nonlocal_ex) +- +- def test_raise_from(self): +- self.check_roundtrip(raise_from) +- +- def test_bytes(self): +- self.check_roundtrip("b'123'") +- +- def test_annotations(self): +- self.check_roundtrip("def f(a : int): pass") +- self.check_roundtrip("def f(a: int = 5): pass") +- self.check_roundtrip("def f(*args: [int]): pass") +- self.check_roundtrip("def f(**kwargs: dict): pass") +- self.check_roundtrip("def f() -> None: pass") +- +- def test_set_literal(self): +- self.check_roundtrip("{'a', 'b', 'c'}") +- +- def test_set_comprehension(self): +- self.check_roundtrip("{x for x in range(5)}") +- +- def test_dict_comprehension(self): +- self.check_roundtrip("{x: x*x for x in range(10)}") +- +- def test_class_decorators(self): +- self.check_roundtrip(class_decorator) +- +- def test_class_definition(self): +- self.check_roundtrip("class A(metaclass=type, *[], **{}): pass") +- +- def test_elifs(self): +- self.check_roundtrip(elif1) +- self.check_roundtrip(elif2) +- +- def test_try_except_finally(self): +- self.check_roundtrip(try_except_finally) +- +- def test_starred_assignment(self): +- self.check_roundtrip("a, *b, c = seq") +- self.check_roundtrip("a, (*b, c) = seq") +- self.check_roundtrip("a, *b[0], c = seq") +- self.check_roundtrip("a, *(b, c) = seq") +- +- def test_with_simple(self): +- self.check_roundtrip(with_simple) +- +- def test_with_as(self): +- self.check_roundtrip(with_as) +- +- def test_with_two_items(self): +- self.check_roundtrip(with_two_items) +- +- +-class DirectoryTestCase(ASTTestCase): +- """Test roundtrip behaviour on all files in Lib and Lib/test.""" +- +- # test directories, relative to the root of the distribution +- test_directories = 'Lib', os.path.join('Lib', 'test') +- +- def test_files(self): +- # get names of files to test +- dist_dir = os.path.join(os.path.dirname(__file__), os.pardir, os.pardir) +- +- names = [] +- for d in self.test_directories: +- test_dir = os.path.join(dist_dir, d) +- for n in os.listdir(test_dir): +- if n.endswith('.py') and not n.startswith('bad'): +- names.append(os.path.join(test_dir, n)) +- +- # Test limited subset of files unless the 'cpu' resource is specified. +- if not test.support.is_resource_enabled("cpu"): +- names = random.sample(names, 10) +- +- for filename in names: +- if test.support.verbose: +- print('Testing %s' % filename) +- source = read_pyfile(filename) +- self.check_roundtrip(source) +- +- +-def test_main(): +- test.support.run_unittest(UnparseTestCase, DirectoryTestCase) +- +-if __name__ == '__main__': +- test_main() +diff -r c0e311e010fc Tools/scripts/md5sum.py +--- a/Tools/scripts/md5sum.py ++++ b/Tools/scripts/md5sum.py +@@ -9,7 +9,7 @@ + rmode = 'rb' + + usage = """ +-usage: sum5 [-b] [-t] [-l] [-s bufsize] [file ...] ++usage: md5sum.py [-b] [-t] [-l] [-s bufsize] [file ...] + -b : read files in binary mode (default) + -t : read files in text mode (you almost certainly don't want this!) + -l : print last pathname component only +@@ -17,6 +17,7 @@ + file ... : files to sum; '-' or no files means stdin + """ % bufsize + ++import io + import sys + import os + import getopt +@@ -24,7 +25,7 @@ + + def sum(*files): + sts = 0 +- if files and isinstance(files[-1], file): ++ if files and isinstance(files[-1], io.IOBase): + out, files = files[-1], files[:-1] + else: + out = sys.stdout +@@ -53,12 +54,14 @@ + return sts + + def printsumfp(fp, filename, out=sys.stdout): +- m = md5.new() ++ m = md5() + try: + while 1: + data = fp.read(bufsize) + if not data: + break ++ if isinstance(data, str): ++ data = data.encode(fp.encoding) + m.update(data) + except IOError as msg: + sys.stderr.write('%s: I/O error: %s\n' % (filename, msg)) +diff -r c0e311e010fc Tools/scripts/pydocgui.pyw +--- a/Tools/scripts/pydocgui.pyw ++++ /dev/null +@@ -1,7 +0,0 @@ +-# Note: this file must not be named pydoc.pyw, lest it just end up +-# importing itself (Python began allowing import of .pyw files +-# between 2.2a1 and 2.2a2). +-import pydoc +- +-if __name__ == '__main__': +- pydoc.gui() +diff -r c0e311e010fc config.guess +--- a/config.guess ++++ b/config.guess +@@ -1,8 +1,8 @@ + #! /bin/sh + # Attempt to guess a canonical system name. +-# Copyright 1992-2013 Free Software Foundation, Inc. ++# Copyright 1992-2014 Free Software Foundation, Inc. + +-timestamp='2013-06-10' ++timestamp='2014-03-23' + + # This file is free software; you can redistribute it and/or modify it + # under the terms of the GNU General Public License as published by +@@ -50,7 +50,7 @@ + GNU config.guess ($timestamp) + + Originally written by Per Bothner. +-Copyright 1992-2013 Free Software Foundation, Inc. ++Copyright 1992-2014 Free Software Foundation, Inc. + + This is free software; see the source for copying conditions. There is NO + warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." +@@ -149,7 +149,7 @@ + LIBC=gnu + #endif + EOF +- eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'` ++ eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC' | sed 's, ,,g'` + ;; + esac + +@@ -826,7 +826,7 @@ + *:MINGW*:*) + echo ${UNAME_MACHINE}-pc-mingw32 + exit ;; +- i*:MSYS*:*) ++ *:MSYS*:*) + echo ${UNAME_MACHINE}-pc-msys + exit ;; + i*:windows32*:*) +@@ -969,10 +969,10 @@ + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'` + test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; } + ;; +- or1k:Linux:*:*) +- echo ${UNAME_MACHINE}-unknown-linux-${LIBC} ++ openrisc*:Linux:*:*) ++ echo or1k-unknown-linux-${LIBC} + exit ;; +- or32:Linux:*:*) ++ or32:Linux:*:* | or1k*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + padre:Linux:*:*) +@@ -1260,16 +1260,26 @@ + if test "$UNAME_PROCESSOR" = unknown ; then + UNAME_PROCESSOR=powerpc + fi +- if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then +- if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ +- (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ +- grep IS_64BIT_ARCH >/dev/null +- then +- case $UNAME_PROCESSOR in +- i386) UNAME_PROCESSOR=x86_64 ;; +- powerpc) UNAME_PROCESSOR=powerpc64 ;; +- esac ++ if test `echo "$UNAME_RELEASE" | sed -e 's/\..*//'` -le 10 ; then ++ if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then ++ if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ ++ (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ ++ grep IS_64BIT_ARCH >/dev/null ++ then ++ case $UNAME_PROCESSOR in ++ i386) UNAME_PROCESSOR=x86_64 ;; ++ powerpc) UNAME_PROCESSOR=powerpc64 ;; ++ esac ++ fi + fi ++ elif test "$UNAME_PROCESSOR" = i386 ; then ++ # Avoid executing cc on OS X 10.9, as it ships with a stub ++ # that puts up a graphical alert prompting to install ++ # developer tools. Any system running Mac OS X 10.7 or ++ # later (Darwin 11 and later) is required to have a 64-bit ++ # processor. This is not true of the ARM version of Darwin ++ # that Apple uses in portable devices. ++ UNAME_PROCESSOR=x86_64 + fi + echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} + exit ;; +@@ -1361,154 +1371,6 @@ + exit ;; + esac + +-eval $set_cc_for_build +-cat >$dummy.c < +-# include +-#endif +-main () +-{ +-#if defined (sony) +-#if defined (MIPSEB) +- /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, +- I don't know.... */ +- printf ("mips-sony-bsd\n"); exit (0); +-#else +-#include +- printf ("m68k-sony-newsos%s\n", +-#ifdef NEWSOS4 +- "4" +-#else +- "" +-#endif +- ); exit (0); +-#endif +-#endif +- +-#if defined (__arm) && defined (__acorn) && defined (__unix) +- printf ("arm-acorn-riscix\n"); exit (0); +-#endif +- +-#if defined (hp300) && !defined (hpux) +- printf ("m68k-hp-bsd\n"); exit (0); +-#endif +- +-#if defined (NeXT) +-#if !defined (__ARCHITECTURE__) +-#define __ARCHITECTURE__ "m68k" +-#endif +- int version; +- version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; +- if (version < 4) +- printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); +- else +- printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); +- exit (0); +-#endif +- +-#if defined (MULTIMAX) || defined (n16) +-#if defined (UMAXV) +- printf ("ns32k-encore-sysv\n"); exit (0); +-#else +-#if defined (CMU) +- printf ("ns32k-encore-mach\n"); exit (0); +-#else +- printf ("ns32k-encore-bsd\n"); exit (0); +-#endif +-#endif +-#endif +- +-#if defined (__386BSD__) +- printf ("i386-pc-bsd\n"); exit (0); +-#endif +- +-#if defined (sequent) +-#if defined (i386) +- printf ("i386-sequent-dynix\n"); exit (0); +-#endif +-#if defined (ns32000) +- printf ("ns32k-sequent-dynix\n"); exit (0); +-#endif +-#endif +- +-#if defined (_SEQUENT_) +- struct utsname un; +- +- uname(&un); +- +- if (strncmp(un.version, "V2", 2) == 0) { +- printf ("i386-sequent-ptx2\n"); exit (0); +- } +- if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ +- printf ("i386-sequent-ptx1\n"); exit (0); +- } +- printf ("i386-sequent-ptx\n"); exit (0); +- +-#endif +- +-#if defined (vax) +-# if !defined (ultrix) +-# include +-# if defined (BSD) +-# if BSD == 43 +- printf ("vax-dec-bsd4.3\n"); exit (0); +-# else +-# if BSD == 199006 +- printf ("vax-dec-bsd4.3reno\n"); exit (0); +-# else +- printf ("vax-dec-bsd\n"); exit (0); +-# endif +-# endif +-# else +- printf ("vax-dec-bsd\n"); exit (0); +-# endif +-# else +- printf ("vax-dec-ultrix\n"); exit (0); +-# endif +-#endif +- +-#if defined (alliant) && defined (i860) +- printf ("i860-alliant-bsd\n"); exit (0); +-#endif +- +- exit (1); +-} +-EOF +- +-$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` && +- { echo "$SYSTEM_NAME"; exit; } +- +-# Apollos put the system type in the environment. +- +-test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; } +- +-# Convex versions that predate uname can use getsysinfo(1) +- +-if [ -x /usr/convex/getsysinfo ] +-then +- case `getsysinfo -f cpu_type` in +- c1*) +- echo c1-convex-bsd +- exit ;; +- c2*) +- if getsysinfo -f scalar_acc +- then echo c32-convex-bsd +- else echo c2-convex-bsd +- fi +- exit ;; +- c34*) +- echo c34-convex-bsd +- exit ;; +- c38*) +- echo c38-convex-bsd +- exit ;; +- c4*) +- echo c4-convex-bsd +- exit ;; +- esac +-fi +- + cat >&2 <' 10.2 && \ +- test ${cur_target} '<' 10.6 ++ cur_target_major=`sw_vers -productVersion | \ ++ sed 's/\([[0-9]]*\)\.\([[0-9]]*\).*/\1/'` ++ cur_target_minor=`sw_vers -productVersion | \ ++ sed 's/\([[0-9]]*\)\.\([[0-9]]*\).*/\2/'` ++ cur_target="${cur_target_major}.${cur_target_minor}" ++ if test ${cur_target_major} -eq 10 && \ ++ test ${cur_target_minor} -ge 3 && \ ++ test ${cur_target_minor} -le 5 + then ++ # OS X 10.3 through 10.5 + cur_target=10.3 + if test ${enable_universalsdk} + then +@@ -2017,12 +2024,14 @@ + # Use -undefined dynamic_lookup whenever possible (10.3 and later). + # This allows an extension to be used in any Python + +- if test ${MACOSX_DEPLOYMENT_TARGET} '>' 10.2 ++ dep_target_major=`echo ${MACOSX_DEPLOYMENT_TARGET} | \ ++ sed 's/\([[0-9]]*\)\.\([[0-9]]*\).*/\1/'` ++ dep_target_minor=`echo ${MACOSX_DEPLOYMENT_TARGET} | \ ++ sed 's/\([[0-9]]*\)\.\([[0-9]]*\).*/\2/'` ++ if test ${dep_target_major} -eq 10 && \ ++ test ${dep_target_minor} -le 2 + then +- LDSHARED='$(CC) -bundle -undefined dynamic_lookup' +- LDCXXSHARED='$(CXX) -bundle -undefined dynamic_lookup' +- BLDSHARED="$LDSHARED" +- else ++ # building for OS X 10.0 through 10.2 + LDSHARED='$(CC) -bundle' + LDCXXSHARED='$(CXX) -bundle' + if test "$enable_framework" ; then +@@ -2036,6 +2045,11 @@ + LDSHARED="$LDSHARED "'-bundle_loader $(BINDIR)/python$(VERSION)$(EXE)' + LDCXXSHARED="$LDCXXSHARED "'-bundle_loader $(BINDIR)/python$(VERSION)$(EXE)' + fi ++ else ++ # building for OS X 10.3 and later ++ LDSHARED='$(CC) -bundle -undefined dynamic_lookup' ++ LDCXXSHARED='$(CXX) -bundle -undefined dynamic_lookup' ++ BLDSHARED="$LDSHARED" + fi + ;; + Linux*|GNU*|QNX*) +diff -r c0e311e010fc setup.py +--- a/setup.py ++++ b/setup.py +@@ -19,6 +19,12 @@ + + cross_compiling = "_PYTHON_HOST_PLATFORM" in os.environ + ++# Add special CFLAGS reserved for building the interpreter and the stdlib ++# modules (Issue #21121). ++cflags = sysconfig.get_config_var('CFLAGS') ++py_cflags_nodist = sysconfig.get_config_var('PY_CFLAGS_NODIST') ++sysconfig.get_config_vars()['CFLAGS'] = cflags + ' ' + py_cflags_nodist ++ + def get_platform(): + # cross build + if "_PYTHON_HOST_PLATFORM" in os.environ: +@@ -697,7 +703,9 @@ + if host_platform == 'darwin': + os_release = int(os.uname()[2].split('.')[0]) + dep_target = sysconfig.get_config_var('MACOSX_DEPLOYMENT_TARGET') +- if dep_target and dep_target.split('.') < ['10', '5']: ++ if (dep_target and ++ (tuple(int(n) for n in dep_target.split('.')[0:2]) ++ < (10, 5) ) ): + os_release = 8 + if os_release < 9: + # MacOSX 10.4 has a broken readline. Don't try to build --- python3.4-3.4.1.orig/debian/patches/hurd-disable-nonworking-constants.diff +++ python3.4-3.4.1/debian/patches/hurd-disable-nonworking-constants.diff @@ -0,0 +1,38 @@ +# DP: Comment out constant exposed on the API which are not implemented on +# DP: GNU/Hurd. They would not work at runtime anyway. + +Index: b/Modules/socketmodule.c +=================================================================== +--- a/Modules/socketmodule.c ++++ b/Modules/socketmodule.c +@@ -6129,9 +6129,11 @@ + #ifdef SO_OOBINLINE + PyModule_AddIntMacro(m, SO_OOBINLINE); + #endif ++#ifndef __GNU__ + #ifdef SO_REUSEPORT + PyModule_AddIntMacro(m, SO_REUSEPORT); + #endif ++#endif + #ifdef SO_SNDBUF + PyModule_AddIntMacro(m, SO_SNDBUF); + #endif +Index: b/Modules/posixmodule.c +=================================================================== +--- a/Modules/posixmodule.c ++++ b/Modules/posixmodule.c +@@ -11724,12 +11724,14 @@ + #ifdef O_LARGEFILE + if (PyModule_AddIntMacro(m, O_LARGEFILE)) return -1; + #endif ++#ifndef __GNU__ + #ifdef O_SHLOCK + if (PyModule_AddIntMacro(m, O_SHLOCK)) return -1; + #endif + #ifdef O_EXLOCK + if (PyModule_AddIntMacro(m, O_EXLOCK)) return -1; + #endif ++#endif + #ifdef O_EXEC + if (PyModule_AddIntMacro(m, O_EXEC)) return -1; + #endif --- python3.4-3.4.1.orig/debian/patches/issue21264.diff +++ python3.4-3.4.1/debian/patches/issue21264.diff @@ -0,0 +1,28 @@ +# DP: Fix issue #21264, test_compileall test failures in the installed location + +--- a/Lib/test/test_compileall.py ++++ b/Lib/test/test_compileall.py +@@ -187,19 +187,19 @@ + os.utime(pycpath, (time.time()-60,)*2) + mtime = os.stat(pycpath).st_mtime + # Without force, no recompilation +- self.assertRunOK(PYTHONPATH=self.directory) ++ self.assertRunOK(self.directory) + mtime2 = os.stat(pycpath).st_mtime + self.assertEqual(mtime, mtime2) + # Now force it. +- self.assertRunOK('-f', PYTHONPATH=self.directory) ++ self.assertRunOK('-f', self.directory) + mtime2 = os.stat(pycpath).st_mtime + self.assertNotEqual(mtime, mtime2) + + def test_no_args_respects_quiet_flag(self): + script_helper.make_script(self.directory, 'baz', '') +- noisy = self.assertRunOK(PYTHONPATH=self.directory) ++ noisy = self.assertRunOK(self.directory) + self.assertIn(b'Listing ', noisy) +- quiet = self.assertRunOK('-q', PYTHONPATH=self.directory) ++ quiet = self.assertRunOK('-q', self.directory) + self.assertNotIn(b'Listing ', quiet) + + # Ensure that the default behavior of compileall's CLI is to create --- python3.4-3.4.1.orig/debian/patches/langpack-gettext.diff +++ python3.4-3.4.1/debian/patches/langpack-gettext.diff @@ -0,0 +1,36 @@ +# DP: Description: support alternative gettext tree in +# DP: /usr/share/locale-langpack; if a file is present in both trees, +# DP: prefer the newer one +# DP: Upstream status: Ubuntu-Specific + +Index: b/Lib/gettext.py +=================================================================== +--- a/Lib/gettext.py ++++ b/Lib/gettext.py +@@ -378,11 +378,26 @@ + if lang == 'C': + break + mofile = os.path.join(localedir, lang, 'LC_MESSAGES', '%s.mo' % domain) ++ mofile_lp = os.path.join("/usr/share/locale-langpack", lang, ++ 'LC_MESSAGES', '%s.mo' % domain) ++ ++ # first look into the standard locale dir, then into the ++ # langpack locale dir ++ ++ # standard mo file + if os.path.exists(mofile): + if all: + result.append(mofile) + else: + return mofile ++ ++ # langpack mofile -> use it ++ if os.path.exists(mofile_lp): ++ if all: ++ result.append(mofile_lp) ++ else: ++ return mofile_lp ++ + return result + + --- python3.4-3.4.1.orig/debian/patches/lib-argparse.diff +++ python3.4-3.4.1/debian/patches/lib-argparse.diff @@ -0,0 +1,22 @@ +# DP: argparse.py: Make the gettext import conditional + +--- a/Lib/argparse.py ++++ b/Lib/argparse.py +@@ -90,7 +90,16 @@ + import sys as _sys + import textwrap as _textwrap + +-from gettext import gettext as _, ngettext ++try: ++ from gettext import gettext as _, ngettext ++except ImportError: ++ def _(message): ++ return message ++ def ngettext(singular,plural,n): ++ if n == 1: ++ return singular ++ else: ++ return plural + + + SUPPRESS = '==SUPPRESS==' --- python3.4-3.4.1.orig/debian/patches/lib2to3-no-pickled-grammar.diff +++ python3.4-3.4.1/debian/patches/lib2to3-no-pickled-grammar.diff @@ -0,0 +1,14 @@ +--- a/Lib/lib2to3/pgen2/driver.py ++++ b/Lib/lib2to3/pgen2/driver.py +@@ -119,7 +119,10 @@ + if force or not _newer(gp, gt): + logger.info("Generating grammar tables from %s", gt) + g = pgen.generate_grammar(gt) +- if save: ++ # the pickle files mismatch, when built on different architectures. ++ # don't save these for now. An alternative solution might be to ++ # include the multiarch triplet into the file name ++ if False: + logger.info("Writing grammar tables to %s", gp) + try: + g.dump(gp) --- python3.4-3.4.1.orig/debian/patches/libffi-shared.diff +++ python3.4-3.4.1/debian/patches/libffi-shared.diff @@ -0,0 +1,13 @@ +Index: b/setup.py +=================================================================== +--- a/setup.py ++++ b/setup.py +@@ -1946,7 +1946,7 @@ class PyBuildExt(build_ext): + break + ffi_lib = None + if ffi_inc is not None: +- for lib_name in ('ffi_convenience', 'ffi_pic', 'ffi'): ++ for lib_name in ('ffi', 'ffi_convenience', 'ffi_pic', 'ffi'): + if (self.compiler.find_library_file(lib_dirs, lib_name)): + ffi_lib = lib_name + break --- python3.4-3.4.1.orig/debian/patches/link-opt.diff +++ python3.4-3.4.1/debian/patches/link-opt.diff @@ -0,0 +1,26 @@ +# DP: Call the linker with -O1 -Bsymbolic-functions + +Index: b/configure.ac +=================================================================== +--- a/configure.ac ++++ b/configure.ac +@@ -2039,8 +2039,8 @@ then + fi + ;; + Linux*|GNU*|QNX*) +- LDSHARED='$(CC) -shared' +- LDCXXSHARED='$(CXX) -shared';; ++ LDSHARED='$(CC) -shared -Wl,-O1 -Wl,-Bsymbolic-functions' ++ LDCXXSHARED='$(CXX) -shared -Wl,-O1 -Wl,-Bsymbolic-functions';; + BSD/OS*/4*) + LDSHARED="gcc -shared" + LDCXXSHARED="g++ -shared";; +@@ -2138,7 +2138,7 @@ then + LINKFORSHARED="-Wl,-E -Wl,+s";; + # LINKFORSHARED="-Wl,-E -Wl,+s -Wl,+b\$(BINLIBDEST)/lib-dynload";; + BSD/OS/4*) LINKFORSHARED="-Xlinker -export-dynamic";; +- Linux*|GNU*) LINKFORSHARED="-Xlinker -export-dynamic";; ++ Linux*|GNU*) LINKFORSHARED="-Xlinker -export-dynamic -Wl,-O1 -Wl,-Bsymbolic-functions";; + # -u libsys_s pulls in all symbols in libsys + Darwin/*) + LINKFORSHARED="$extra_undefs -framework CoreFoundation" --- python3.4-3.4.1.orig/debian/patches/link-timemodule.diff +++ python3.4-3.4.1/debian/patches/link-timemodule.diff @@ -0,0 +1,13 @@ +Index: b/Modules/Setup.dist +=================================================================== +--- a/Modules/Setup.dist ++++ b/Modules/Setup.dist +@@ -171,7 +171,7 @@ + #cmath cmathmodule.c _math.c # -lm # complex math library functions + #math mathmodule.c _math.c # -lm # math library functions, e.g. sin() + #_struct _struct.c # binary structure packing/unpacking +-#time timemodule.c # -lm # time operations and variables ++#time timemodule.c -lrt # -lm # time operations and variables + #_weakref _weakref.c # basic weak reference support + #_testcapi _testcapimodule.c # Python C API test module + #_random _randommodule.c # Random number generator --- python3.4-3.4.1.orig/debian/patches/locale-module.diff +++ python3.4-3.4.1/debian/patches/locale-module.diff @@ -0,0 +1,19 @@ +# DP: * Lib/locale.py: +# DP: - Don't map 'utf8', 'utf-8' to 'utf', which is not a known encoding +# DP: for glibc. + +Index: b/Lib/locale.py +=================================================================== +--- a/Lib/locale.py ++++ b/Lib/locale.py +@@ -1222,8 +1222,8 @@ + 'turkish': 'tr_TR.ISO8859-9', + 'uk': 'uk_UA.KOI8-U', + 'uk_ua': 'uk_UA.KOI8-U', +- 'univ': 'en_US.utf', +- 'universal': 'en_US.utf', ++ 'univ': 'en_US.UTF-8', ++ 'universal': 'en_US.UTF-8', + 'universal.utf8@ucs4': 'en_US.UTF-8', + 'ur': 'ur_PK.CP1256', + 'ur_in': 'ur_IN.UTF-8', --- python3.4-3.4.1.orig/debian/patches/lto-link-flags.diff +++ python3.4-3.4.1/debian/patches/lto-link-flags.diff @@ -0,0 +1,22 @@ +Index: b/Makefile.pre.in +=================================================================== +--- a/Makefile.pre.in ++++ b/Makefile.pre.in +@@ -128,7 +128,7 @@ CONFINCLUDEPY= $(CONFINCLUDEDIR)/python$ + SHLIB_SUFFIX= @SHLIB_SUFFIX@ + EXT_SUFFIX= @EXT_SUFFIX@ + LDSHARED= @LDSHARED@ $(PY_LDFLAGS) +-BLDSHARED= @BLDSHARED@ $(PY_LDFLAGS) ++BLDSHARED= @BLDSHARED@ $(PY_LDFLAGS) $(PY_CFLAGS) + LDCXXSHARED= @LDCXXSHARED@ + DESTSHARED= $(BINLIBDEST)/lib-dynload + +@@ -542,7 +542,7 @@ clinic: $(BUILDPYTHON) + + # Build the interpreter + $(BUILDPYTHON): Modules/python.o $(LIBRARY) $(LDLIBRARY) $(PY3LIBRARY) +- $(LINKCC) $(PY_LDFLAGS) $(LINKFORSHARED) -o $@ Modules/python.o $(BLDLIBRARY) $(LIBS) $(MODLIBS) $(SYSLIBS) $(LDLAST) ++ $(LINKCC) $(PY_LDFLAGS) $(PY_CFLAGS) $(LINKFORSHARED) -o $@ Modules/python.o $(BLDLIBRARY) $(LIBS) $(MODLIBS) $(SYSLIBS) $(LDLAST) + + platform: $(BUILDPYTHON) pybuilddir.txt + $(RUNSHARED) $(PYTHON_FOR_BUILD) -c 'import sys ; from sysconfig import get_platform ; print(get_platform()+"-"+sys.version[0:3])' >platform --- python3.4-3.4.1.orig/debian/patches/makesetup-bashism.diff +++ python3.4-3.4.1/debian/patches/makesetup-bashism.diff @@ -0,0 +1,15 @@ +# DP: Fix bashism in makesetup shell script + +Index: b/Modules/makesetup +=================================================================== +--- a/Modules/makesetup ++++ b/Modules/makesetup +@@ -277,7 +277,7 @@ sed -e 's/[ ]*#.*//' -e '/^[ ]*$/d' | + -) ;; + *) sedf="@sed.in.$$" + trap 'rm -f $sedf' 0 1 2 3 +- echo "1i\\" >$sedf ++ printf "1i\\" >$sedf + str="# Generated automatically from $makepre by makesetup." + echo "$str" >>$sedf + echo "s%_MODOBJS_%$OBJS%" >>$sedf --- python3.4-3.4.1.orig/debian/patches/multiarch-extname.diff +++ python3.4-3.4.1/debian/patches/multiarch-extname.diff @@ -0,0 +1,84 @@ +Index: b/Lib/distutils/dir_util.py +=================================================================== +--- a/Lib/distutils/dir_util.py ++++ b/Lib/distutils/dir_util.py +@@ -96,6 +96,9 @@ + for dir in sorted(need_dir): + mkpath(dir, mode, verbose=verbose, dry_run=dry_run) + ++import sysconfig ++_multiarch = None ++ + def copy_tree(src, dst, preserve_mode=1, preserve_times=1, + preserve_symlinks=0, update=0, verbose=1, dry_run=0): + """Copy an entire directory tree 'src' to a new location 'dst'. +@@ -132,6 +135,9 @@ + raise DistutilsFileError( + "error listing files in '%s': %s" % (src, errstr)) + ++ ext_suffix = sysconfig.get_config_var ('EXT_SUFFIX') ++ new_suffix = "%s-%s%s" % (ext_suffix[:-3], _multiarch, ext_suffix[-3:]) ++ + if not dry_run: + mkpath(dst, verbose=verbose) + +@@ -140,6 +146,9 @@ + for n in names: + src_name = os.path.join(src, n) + dst_name = os.path.join(dst, n) ++ if _multiarch and n.endswith(ext_suffix) and not n.endswith(new_suffix): ++ dst_name = os.path.join(dst, n.replace(ext_suffix, new_suffix)) ++ log.info("renaming extension %s -> %s", n, n.replace(ext_suffix, new_suffix)) + + if n.startswith('.nfs'): + # skip NFS rename files +Index: b/Lib/distutils/command/install_lib.py +=================================================================== +--- a/Lib/distutils/command/install_lib.py ++++ b/Lib/distutils/command/install_lib.py +@@ -56,6 +56,7 @@ + self.compile = None + self.optimize = None + self.skip_build = None ++ self.multiarch = None # if we should rename the extensions + + def finalize_options(self): + # Get all the information we need to install pure Python modules +@@ -68,6 +69,7 @@ + ('compile', 'compile'), + ('optimize', 'optimize'), + ('skip_build', 'skip_build'), ++ ('multiarch', 'multiarch'), + ) + + if self.compile is None: +@@ -108,6 +110,8 @@ + + def install(self): + if os.path.isdir(self.build_dir): ++ import distutils.dir_util ++ distutils.dir_util._multiarch = self.multiarch + outfiles = self.copy_tree(self.build_dir, self.install_dir) + else: + self.warn("'%s' does not exist -- no Python modules to install" % +Index: b/Lib/distutils/command/install.py +=================================================================== +--- a/Lib/distutils/command/install.py ++++ b/Lib/distutils/command/install.py +@@ -207,6 +207,7 @@ + + # enable custom installation, known values: deb + self.install_layout = None ++ self.multiarch = None + + self.compile = None + self.optimize = None +@@ -464,6 +465,8 @@ + self.install_platbase = self.exec_prefix + if self.install_layout: + if self.install_layout.lower() in ['deb']: ++ import sysconfig ++ self.multiarch = sysconfig.get_config_var('MULTIARCH') + self.select_scheme("deb_system") + elif self.install_layout.lower() in ['unix']: + self.select_scheme("unix_prefix") --- python3.4-3.4.1.orig/debian/patches/multiarch.diff +++ python3.4-3.4.1/debian/patches/multiarch.diff @@ -0,0 +1,162 @@ +Index: b/Lib/sysconfig.py +=================================================================== +--- a/Lib/sysconfig.py ++++ b/Lib/sysconfig.py +@@ -339,6 +339,8 @@ def get_makefile_filename(): + config_dir_name = 'config-%s%s' % (_PY_VERSION_SHORT, sys.abiflags) + else: + config_dir_name = 'config' ++ if hasattr(sys.implementation, '_multiarch'): ++ config_dir_name += '-%s' % sys.implementation._multiarch + return os.path.join(get_path('stdlib'), config_dir_name, 'Makefile') + + def _generate_posix_vars(): +@@ -545,6 +547,12 @@ def get_config_vars(*args): + # the init-function. + _CONFIG_VARS['userbase'] = _getuserbase() + ++ multiarch = get_config_var('MULTIARCH') ++ if multiarch: ++ _CONFIG_VARS['multiarchsubdir'] = '/' + multiarch ++ else: ++ _CONFIG_VARS['multiarchsubdir'] = '' ++ + # Always convert srcdir to an absolute path + srcdir = _CONFIG_VARS.get('srcdir', _PROJECT_BASE) + if os.name == 'posix': +Index: b/Lib/distutils/sysconfig.py +=================================================================== +--- a/Lib/distutils/sysconfig.py ++++ b/Lib/distutils/sysconfig.py +@@ -111,6 +111,9 @@ def get_python_inc(plat_specific=0, pref + incdir = os.path.join(get_config_var('srcdir'), 'Include') + return os.path.normpath(incdir) + python_dir = 'python' + get_python_version() + build_flags ++ if not python_build and plat_specific: ++ import sysconfig ++ return sysconfig.get_path('platinclude') + return os.path.join(prefix, "include", python_dir) + elif os.name == "nt": + return os.path.join(prefix, "include") +@@ -275,6 +278,8 @@ def get_makefile_filename(): + return os.path.join(_sys_home or project_base, "Makefile") + lib_dir = get_python_lib(plat_specific=0, standard_lib=1) + config_file = 'config-{}{}'.format(get_python_version(), build_flags) ++ if hasattr(sys.implementation, '_multiarch'): ++ config_file += '-%s' % sys.implementation._multiarch + return os.path.join(lib_dir, config_file, 'Makefile') + + +Index: b/Makefile.pre.in +=================================================================== +--- a/Makefile.pre.in ++++ b/Makefile.pre.in +@@ -724,6 +724,7 @@ Modules/signalmodule.o: $(srcdir)/Module + + Python/dynload_shlib.o: $(srcdir)/Python/dynload_shlib.c Makefile + $(CC) -c $(PY_CORE_CFLAGS) \ ++ $(if $(MULTIARCH),-DMULTIARCH='"$(MULTIARCH)"') \ + -DSOABI='"$(SOABI)"' \ + -o $@ $(srcdir)/Python/dynload_shlib.c + +@@ -735,6 +736,7 @@ Python/dynload_hpux.o: $(srcdir)/Python/ + Python/sysmodule.o: $(srcdir)/Python/sysmodule.c Makefile + $(CC) -c $(PY_CORE_CFLAGS) \ + -DABIFLAGS='"$(ABIFLAGS)"' \ ++ -DMULTIARCH='"$(MULTIARCH)"' \ + -o $@ $(srcdir)/Python/sysmodule.c + + $(IO_OBJS): $(IO_H) +@@ -1116,7 +1118,7 @@ maninstall: altmaninstall + (cd $(DESTDIR)$(MANDIR)/man1; $(LN) -s python$(VERSION).1 python3.1) + + # Install the library +-PLATDIR= plat-$(MACHDEP) ++PLATDIR= plat-$(MULTIARCH) + EXTRAPLATDIR= @EXTRAPLATDIR@ + MACHDEPS= $(PLATDIR) $(EXTRAPLATDIR) + XMLLIBSUBDIRS= xml xml/dom xml/etree xml/parsers xml/sax +@@ -1257,6 +1259,10 @@ libinstall: build_all $(srcdir)/Lib/$(PL + $(srcdir)/Lib/$(PLATDIR): + mkdir $(srcdir)/Lib/$(PLATDIR) + cp $(srcdir)/Lib/plat-generic/regen $(srcdir)/Lib/$(PLATDIR)/regen ++ if [ -n "$(MULTIARCH)" ]; then \ ++ cp -p $(srcdir)/Lib/plat-linux/*.py $(srcdir)/Lib/$(PLATDIR)/.; \ ++ rm -f $(srcdir)/Lib/$(PLATDIR)/IN.py; \ ++ fi + export PATH; PATH="`pwd`:$$PATH"; \ + export PYTHONPATH; PYTHONPATH="`pwd`/Lib"; \ + export DYLD_FRAMEWORK_PATH; DYLD_FRAMEWORK_PATH="`pwd`"; \ +@@ -1304,10 +1310,10 @@ inclinstall: + + # Install the library and miscellaneous stuff needed for extending/embedding + # This goes into $(exec_prefix) +-LIBPL= $(LIBDEST)/config-$(LDVERSION) ++LIBPL= $(LIBDEST)/config-$(LDVERSION)-$(MULTIARCH) + + # pkgconfig directory +-LIBPC= $(LIBDIR)/pkgconfig ++LIBPC= $(LIBDIR)/$(MULTIARCH)/pkgconfig + + libainstall: all python-config + @for i in $(LIBDIR) $(LIBPL) $(LIBPC); \ +Index: b/Python/dynload_shlib.c +=================================================================== +--- a/Python/dynload_shlib.c ++++ b/Python/dynload_shlib.c +@@ -36,6 +36,9 @@ const char *_PyImport_DynLoadFiletab[] = + #ifdef __CYGWIN__ + ".dll", + #else /* !__CYGWIN__ */ ++#ifdef MULTIARCH ++ "." SOABI "-" MULTIARCH ".so", ++#endif + "." SOABI ".so", + ".abi" PYTHON_ABI_STRING ".so", + ".so", +Index: b/Modules/Setup.dist +=================================================================== +--- a/Modules/Setup.dist ++++ b/Modules/Setup.dist +@@ -91,7 +91,7 @@ SITEPATH= + TESTPATH= + + # Path components for machine- or system-dependent modules and shared libraries +-MACHDEPPATH=:plat-$(MACHDEP) ++MACHDEPPATH=:plat-$(MULTIARCH) + EXTRAMACHDEPPATH= + + COREPYTHONPATH=$(DESTPATH)$(SITEPATH)$(TESTPATH)$(MACHDEPPATH)$(EXTRAMACHDEPPATH) +Index: b/Python/sysmodule.c +=================================================================== +--- a/Python/sysmodule.c ++++ b/Python/sysmodule.c +@@ -1595,6 +1595,15 @@ make_impl_info(PyObject *version_info) + if (res < 0) + goto error; + ++ /* For Debian multiarch support. */ ++ value = PyUnicode_FromString(MULTIARCH); ++ if (value == NULL) ++ goto error; ++ res = PyDict_SetItemString(impl_info, "_multiarch", value); ++ Py_DECREF(value); ++ if (res < 0) ++ goto error; ++ + /* dict ready */ + + ns = _PyNamespace_New(impl_info); +Index: b/configure.ac +=================================================================== +--- a/configure.ac ++++ b/configure.ac +@@ -4098,7 +4098,7 @@ AC_MSG_RESULT($LDVERSION) + + dnl define LIBPL after ABIFLAGS and LDVERSION is defined. + AC_SUBST(PY_ENABLE_SHARED) +-LIBPL="${prefix}/lib/python${VERSION}/config-${LDVERSION}" ++LIBPL="${prefix}/lib/python${VERSION}/config-${LDVERSION}-${MULTIARCH}" + AC_SUBST(LIBPL) + + # Check whether right shifting a negative integer extends the sign bit --- python3.4-3.4.1.orig/debian/patches/no-large-file-support.diff +++ python3.4-3.4.1/debian/patches/no-large-file-support.diff @@ -0,0 +1,14 @@ +# DP: disable large file support for GNU/Hurd + +--- a/configure.ac ++++ b/configure.ac +@@ -1402,6 +1402,9 @@ + use_lfs=no + fi + ++# Don't use largefile support anyway. ++use_lfs=no ++ + if test "$use_lfs" = "yes"; then + # Two defines needed to enable largefile support on various platforms + # These may affect some typedefs --- python3.4-3.4.1.orig/debian/patches/no-zip-on-sys.path.diff +++ python3.4-3.4.1/debian/patches/no-zip-on-sys.path.diff @@ -0,0 +1,124 @@ +# DP: Do not add /usr/lib/pythonXY.zip on sys.path. + +Index: b/Modules/getpath.c +=================================================================== +--- a/Modules/getpath.c ++++ b/Modules/getpath.c +@@ -470,7 +470,9 @@ calculate_path(void) + wchar_t *path = NULL; + wchar_t *prog = Py_GetProgramName(); + wchar_t argv0_path[MAXPATHLEN+1]; ++#ifdef WITH_ZIP_PATH + wchar_t zip_path[MAXPATHLEN+1]; ++#endif + int pfound, efound; /* 1 if found; -1 if found build directory */ + wchar_t *buf; + size_t bufsz; +@@ -675,6 +677,7 @@ calculate_path(void) + else + reduce(prefix); + ++#ifdef WITH_ZIP_PATH + wcsncpy(zip_path, prefix, MAXPATHLEN); + zip_path[MAXPATHLEN] = L'\0'; + if (pfound > 0) { /* Use the reduced prefix returned by Py_GetPrefix() */ +@@ -687,6 +690,7 @@ calculate_path(void) + bufsz = wcslen(zip_path); /* Replace "00" with version */ + zip_path[bufsz - 6] = VERSION[0]; + zip_path[bufsz - 5] = VERSION[2]; ++#endif + + efound = search_for_exec_prefix(argv0_path, home, + _exec_prefix, lib_python); +@@ -732,7 +736,9 @@ calculate_path(void) + defpath = delim + 1; + } + ++#ifdef WITH_ZIP_PATH + bufsz += wcslen(zip_path) + 1; ++#endif + bufsz += wcslen(exec_prefix) + 1; + /* When running from the build directory, add room for the Modules + * subdirectory too. +@@ -754,9 +760,11 @@ calculate_path(void) + else + buf[0] = '\0'; + ++#ifdef WITH_ZIP_PATH + /* Next is the default zip path */ + wcscat(buf, zip_path); + wcscat(buf, delimiter); ++#endif + + /* Next goes merge of compile-time $PYTHONPATH with + * dynamically located prefix. +Index: b/Lib/test/test_cmd_line_script.py +=================================================================== +--- a/Lib/test/test_cmd_line_script.py ++++ b/Lib/test/test_cmd_line_script.py +@@ -256,11 +256,6 @@ class CmdLineTest(unittest.TestCase): + script_dir, '', + importlib.machinery.SourcelessFileLoader) + +- def test_directory_error(self): +- with temp_dir() as script_dir: +- msg = "can't find '__main__' module in %r" % script_dir +- self._check_import_error(script_dir, msg) +- + def test_zipfile(self): + with temp_dir() as script_dir: + script_name = _make_test_script(script_dir, '__main__') +@@ -276,13 +271,6 @@ class CmdLineTest(unittest.TestCase): + self._check_script(zip_name, run_name, zip_name, zip_name, '', + zipimport.zipimporter) + +- def test_zipfile_error(self): +- with temp_dir() as script_dir: +- script_name = _make_test_script(script_dir, 'not_main') +- zip_name, run_name = make_zip_script(script_dir, 'test_zip', script_name) +- msg = "can't find '__main__' module in %r" % zip_name +- self._check_import_error(zip_name, msg) +- + def test_module_in_package(self): + with temp_dir() as script_dir: + pkg_dir = os.path.join(script_dir, 'test_pkg') +Index: b/Lib/test/test_zipimport_support.py +=================================================================== +--- a/Lib/test/test_zipimport_support.py ++++ b/Lib/test/test_zipimport_support.py +@@ -185,35 +185,6 @@ class ZipSupportTests(unittest.TestCase) + finally: + del sys.modules["test_zipped_doctest"] + +- def test_doctest_main_issue4197(self): +- test_src = textwrap.dedent("""\ +- class Test: +- ">>> 'line 2'" +- pass +- +- import doctest +- doctest.testmod() +- """) +- pattern = 'File "%s", line 2, in %s' +- with temp_dir() as d: +- script_name = make_script(d, 'script', test_src) +- rc, out, err = assert_python_ok(script_name) +- expected = pattern % (script_name, "__main__.Test") +- if verbose: +- print ("Expected line", expected) +- print ("Got stdout:") +- print (ascii(out)) +- self.assertIn(expected.encode('utf-8'), out) +- zip_name, run_name = make_zip_script(d, "test_zip", +- script_name, '__main__.py') +- rc, out, err = assert_python_ok(zip_name) +- expected = pattern % (run_name, "__main__.Test") +- if verbose: +- print ("Expected line", expected) +- print ("Got stdout:") +- print (ascii(out)) +- self.assertIn(expected.encode('utf-8'), out) +- + def test_pdb_issue4201(self): + test_src = textwrap.dedent("""\ + def f(): --- python3.4-3.4.1.orig/debian/patches/platform-lsbrelease.diff +++ python3.4-3.4.1/debian/patches/platform-lsbrelease.diff @@ -0,0 +1,77 @@ +# DP: Use /etc/lsb-release to identify the platform. + +Index: b/Lib/platform.py +=================================================================== +--- a/Lib/platform.py ++++ b/Lib/platform.py +@@ -265,7 +265,7 @@ + _supported_dists = ( + 'SuSE', 'debian', 'fedora', 'redhat', 'centos', + 'mandrake', 'mandriva', 'rocks', 'slackware', 'yellowdog', 'gentoo', +- 'UnitedLinux', 'turbolinux', 'arch', 'mageia') ++ 'UnitedLinux', 'turbolinux', 'arch', 'mageia', 'Ubuntu') + + def _parse_release_file(firstline): + +@@ -294,6 +294,10 @@ + id = l[1] + return '', version, id + ++_distributor_id_file_re = re.compile("(?:DISTRIB_ID\s*=)\s*(.*)", re.I) ++_release_file_re = re.compile("(?:DISTRIB_RELEASE\s*=)\s*(.*)", re.I) ++_codename_file_re = re.compile("(?:DISTRIB_CODENAME\s*=)\s*(.*)", re.I) ++ + def linux_distribution(distname='', version='', id='', + + supported_dists=_supported_dists, +@@ -318,6 +322,25 @@ + args given as parameters. + + """ ++ # check for the Debian/Ubuntu /etc/lsb-release file first, needed so ++ # that the distribution doesn't get identified as Debian. ++ try: ++ with open("/etc/lsb-release", "r") as etclsbrel: ++ for line in etclsbrel: ++ m = _distributor_id_file_re.search(line) ++ if m: ++ _u_distname = m.group(1).strip() ++ m = _release_file_re.search(line) ++ if m: ++ _u_version = m.group(1).strip() ++ m = _codename_file_re.search(line) ++ if m: ++ _u_id = m.group(1).strip() ++ if _u_distname and _u_version: ++ return (_u_distname, _u_version, _u_id) ++ except (EnvironmentError, UnboundLocalError): ++ pass ++ + try: + etc = os.listdir(_UNIXCONFDIR) + except OSError: +Index: b/Lib/test/test_platform.py +=================================================================== +--- a/Lib/test/test_platform.py ++++ b/Lib/test/test_platform.py +@@ -297,20 +297,6 @@ + returncode = ret >> 8 + self.assertEqual(returncode, len(data)) + +- def test_linux_distribution_encoding(self): +- # Issue #17429 +- with tempfile.TemporaryDirectory() as tempdir: +- filename = os.path.join(tempdir, 'fedora-release') +- with open(filename, 'w', encoding='utf-8') as f: +- f.write('Fedora release 19 (Schr\xf6dinger\u2019s Cat)\n') +- +- with mock.patch('platform._UNIXCONFDIR', tempdir): +- distname, version, distid = platform.linux_distribution() +- +- self.assertEqual(distname, 'Fedora') +- self.assertEqual(version, '19') +- self.assertEqual(distid, 'Schr\xf6dinger\u2019s Cat') +- + def test_main(): + support.run_unittest( + PlatformTest --- python3.4-3.4.1.orig/debian/patches/profiled-build.diff +++ python3.4-3.4.1/debian/patches/profiled-build.diff @@ -0,0 +1,24 @@ +# DP: Ignore errors in the profile task. + +Index: b/Makefile.pre.in +=================================================================== +--- a/Makefile.pre.in ++++ b/Makefile.pre.in +@@ -478,7 +478,16 @@ build_all_generate_profile: + + run_profile_task: + : # FIXME: can't run for a cross build +- $(RUNSHARED) ./$(BUILDPYTHON) $(PROFILE_TASK) ++ task="$(PROFILE_TASK)"; \ ++ case "$$task" in \ ++ *-s\ *) \ ++ $(RUNSHARED) ./$(BUILDPYTHON) $$task; \ ++ while [ -f $(srcdir)/build/pynexttest ]; do \ ++ $(RUNSHARED) ./$(BUILDPYTHON) $$task; \ ++ done;; \ ++ *) \ ++ $(RUNSHARED) ./$(BUILDPYTHON) $$task; \ ++ esac + + build_all_use_profile: + $(MAKE) all CFLAGS="$(CFLAGS) -fprofile-use -fprofile-correction" --- python3.4-3.4.1.orig/debian/patches/revert-r83234.diff +++ python3.4-3.4.1/debian/patches/revert-r83234.diff @@ -0,0 +1,227 @@ +--- a/Doc/conf.py ++++ b/Doc/conf.py +@@ -13,7 +13,7 @@ + # --------------------- + + extensions = ['sphinx.ext.refcounting', 'sphinx.ext.coverage', +- 'sphinx.ext.doctest', 'pyspecific'] ++ 'sphinx.ext.doctest'] + templates_path = ['tools/sphinxext'] + + # General substitutions. +--- a/Doc/tools/sphinxext/pyspecific.py ++++ b/Doc/tools/sphinxext/pyspecific.py +@@ -84,32 +84,6 @@ + return [pnode] + + +-# Support for documenting decorators +- +-from sphinx import addnodes +-from sphinx.domains.python import PyModulelevel, PyClassmember +- +-class PyDecoratorMixin(object): +- def handle_signature(self, sig, signode): +- ret = super(PyDecoratorMixin, self).handle_signature(sig, signode) +- signode.insert(0, addnodes.desc_addname('@', '@')) +- return ret +- +- def needs_arglist(self): +- return False +- +-class PyDecoratorFunction(PyDecoratorMixin, PyModulelevel): +- def run(self): +- # a decorator function is a function after all +- self.name = 'py:function' +- return PyModulelevel.run(self) +- +-class PyDecoratorMethod(PyDecoratorMixin, PyClassmember): +- def run(self): +- self.name = 'py:method' +- return PyClassmember.run(self) +- +- + # Support for documenting version of removal in deprecations + + from sphinx.locale import versionlabels +@@ -227,6 +201,7 @@ + # Support for documenting Opcodes + + import re ++from sphinx import addnodes + + opcode_sig_re = re.compile(r'(\w+(?:\+\d)?)(?:\s*\((.*)\))?') + +@@ -280,5 +255,3 @@ + app.add_description_unit('pdbcommand', 'pdbcmd', '%s (pdb command)', + parse_pdb_command) + app.add_description_unit('2to3fixer', '2to3fixer', '%s (2to3 fixer)') +- app.add_directive_to_domain('py', 'decorator', PyDecoratorFunction) +- app.add_directive_to_domain('py', 'decoratormethod', PyDecoratorMethod) +--- a/Doc/library/contextlib.rst ++++ b/Doc/library/contextlib.rst +@@ -15,7 +15,7 @@ + Functions provided: + + +-.. decorator:: contextmanager ++.. function:: contextmanager(func) + + This function is a :term:`decorator` that can be used to define a factory + function for :keyword:`with` statement context managers, without needing to +--- a/Doc/library/abc.rst ++++ b/Doc/library/abc.rst +@@ -126,7 +126,7 @@ + + It also provides the following decorators: + +-.. decorator:: abstractmethod(function) ++.. function:: abstractmethod(function) + + A decorator indicating abstract methods. + +--- a/Doc/library/unittest.rst ++++ b/Doc/library/unittest.rst +@@ -666,20 +666,20 @@ + + The following decorators implement test skipping and expected failures: + +-.. decorator:: skip(reason) ++.. function:: skip(reason) + + Unconditionally skip the decorated test. *reason* should describe why the + test is being skipped. + +-.. decorator:: skipIf(condition, reason) ++.. function:: skipIf(condition, reason) + + Skip the decorated test if *condition* is true. + +-.. decorator:: skipUnless(condition, reason) ++.. function:: skipUnless(condition, reason) + + Skip the decorated test unless *condition* is true. + +-.. decorator:: expectedFailure ++.. function:: expectedFailure + + Mark the test as an expected failure. If the test fails when run, the test + is not counted as a failure. +@@ -973,11 +973,11 @@ + :attr:`exception` attribute. This can be useful if the intention + is to perform additional checks on the exception raised:: + +- with self.assertRaises(SomeException) as cm: +- do_something() ++ with self.assertRaises(SomeException) as cm: ++ do_something() + +- the_exception = cm.exception +- self.assertEqual(the_exception.error_code, 3) ++ the_exception = cm.exception ++ self.assertEqual(the_exception.error_code, 3) + + .. versionchanged:: 3.1 + Added the ability to use :meth:`assertRaises` as a context manager. +--- a/Doc/library/importlib.rst ++++ b/Doc/library/importlib.rst +@@ -469,7 +469,7 @@ + This module contains the various objects that help in the construction of + an :term:`importer`. + +-.. decorator:: module_for_loader ++.. function:: module_for_loader(method) + + A :term:`decorator` for a :term:`loader` method, + to handle selecting the proper +@@ -494,7 +494,7 @@ + Use of this decorator handles all the details of which module object a + loader should initialize as specified by :pep:`302`. + +-.. decorator:: set_loader ++.. function:: set_loader(fxn) + + A :term:`decorator` for a :term:`loader` method, + to set the :attr:`__loader__` +@@ -502,7 +502,7 @@ + does nothing. It is assumed that the first positional argument to the + wrapped method is what :attr:`__loader__` should be set to. + +-.. decorator:: set_package ++.. function:: set_package(fxn) + + A :term:`decorator` for a :term:`loader` to set the :attr:`__package__` + attribute on the module returned by the loader. If :attr:`__package__` is +--- a/Doc/library/functools.rst ++++ b/Doc/library/functools.rst +@@ -111,7 +111,7 @@ + + .. versionadded:: 3.2 + +-.. decorator:: total_ordering ++.. function:: total_ordering(cls) + + Given a class defining one or more rich comparison ordering methods, this + class decorator supplies the rest. This simplifies the effort involved +@@ -217,7 +217,7 @@ + Missing attributes no longer trigger an :exc:`AttributeError`. + + +-.. decorator:: wraps(wrapped, assigned=WRAPPER_ASSIGNMENTS, updated=WRAPPER_UPDATES) ++.. function:: wraps(wrapped, assigned=WRAPPER_ASSIGNMENTS, updated=WRAPPER_UPDATES) + + This is a convenience function for invoking ``partial(update_wrapper, + wrapped=wrapped, assigned=assigned, updated=updated)`` as a function decorator +--- a/Doc/documenting/markup.rst ++++ b/Doc/documenting/markup.rst +@@ -177,37 +177,6 @@ + are modified), side effects, and possible exceptions. A small example may be + provided. + +-.. describe:: decorator +- +- Describes a decorator function. The signature should *not* represent the +- signature of the actual function, but the usage as a decorator. For example, +- given the functions +- +- .. code-block:: python +- +- def removename(func): +- func.__name__ = '' +- return func +- +- def setnewname(name): +- def decorator(func): +- func.__name__ = name +- return func +- return decorator +- +- the descriptions should look like this:: +- +- .. decorator:: removename +- +- Remove name of the decorated function. +- +- .. decorator:: setnewname(name) +- +- Set name of the decorated function to *name*. +- +- There is no ``deco`` role to link to a decorator that is marked up with +- this directive; rather, use the ``:func:`` role. +- + .. describe:: class + + Describes a class. The signature can include parentheses with parameters +@@ -225,12 +194,6 @@ + parameter. The description should include similar information to that + described for ``function``. + +-.. describe:: decoratormethod +- +- Same as ``decorator``, but for decorators that are methods. +- +- Refer to a decorator method using the ``:meth:`` role. +- + .. describe:: opcode + + Describes a Python :term:`bytecode` instruction. --- python3.4-3.4.1.orig/debian/patches/revert-r83274.diff +++ python3.4-3.4.1/debian/patches/revert-r83274.diff @@ -0,0 +1,12 @@ +--- a/Doc/conf.py ++++ b/Doc/conf.py +@@ -65,9 +65,6 @@ + # Options for HTML output + # ----------------------- + +-html_theme = 'default' +-html_theme_options = {'collapsiblesidebar': True} +- + # If not '', a 'Last updated on:' timestamp is inserted at every page bottom, + # using the given strftime format. + html_last_updated_fmt = '%b %d, %Y' --- python3.4-3.4.1.orig/debian/patches/series.in +++ python3.4-3.4.1/debian/patches/series.in @@ -0,0 +1,46 @@ +hg-updates.diff +deb-setup.diff +deb-locations.diff +site-locations.diff +distutils-install-layout.diff +locale-module.diff +distutils-link.diff +distutils-sysconfig.diff +tkinter-import.diff +gdbm-import.diff +link-opt.diff +setup-modules.diff +platform-lsbrelease.diff +bdist-wininst-notfound.diff +no-zip-on-sys.path.diff +profiled-build.diff +makesetup-bashism.diff +hurd-disable-nonworking-constants.diff +enable-fpectl.diff +#if defined (Ubuntu) +langpack-gettext.diff +#endif +#if defined (arch_os_hurd) +no-large-file-support.diff +#endif +#ifdef OLD_SPHINX +doc-build.diff +revert-r83234.diff +revert-r83274.diff +#endif +disable-sem-check.diff +lib-argparse.diff +ctypes-arm.diff +link-timemodule.diff +lto-link-flags.diff +libffi-shared.diff +multiarch.diff +distutils-init.diff +lib2to3-no-pickled-grammar.diff +ext-no-libpython-link.diff +test-no-random-order.diff +multiarch-extname.diff +tempfile-minimal.diff +disable-some-tests.diff +issue21264.diff +ensurepip-wheels.diff --- python3.4-3.4.1.orig/debian/patches/setup-modules.diff +++ python3.4-3.4.1/debian/patches/setup-modules.diff @@ -0,0 +1,52 @@ +# DP: Modules/Setup.dist: patches to build some extensions statically + +Index: b/Modules/Setup.dist +=================================================================== +--- a/Modules/Setup.dist ++++ b/Modules/Setup.dist +@@ -175,7 +175,7 @@ + #_weakref _weakref.c # basic weak reference support + #_testcapi _testcapimodule.c # Python C API test module + #_random _randommodule.c # Random number generator +-#_elementtree -I$(srcdir)/Modules/expat -DHAVE_EXPAT_CONFIG_H -DUSE_PYEXPAT_CAPI _elementtree.c # elementtree accelerator ++#_elementtree _elementtree.c -lexpat # elementtree accelerator + #_pickle _pickle.c # pickle accelerator + #_datetime _datetimemodule.c # datetime accelerator + #_bisect _bisectmodule.c # Bisection algorithms +@@ -204,10 +204,7 @@ + + # Socket module helper for SSL support; you must comment out the other + # socket line above, and possibly edit the SSL variable: +-#SSL=/usr/local/ssl +-#_ssl _ssl.c \ +-# -DUSE_SSL -I$(SSL)/include -I$(SSL)/include/openssl \ +-# -L$(SSL)/lib -lssl -lcrypto ++#_ssl _ssl.c -lssl -lcrypto + + # The crypt module is now disabled by default because it breaks builds + # on many systems (where -lcrypt is needed), e.g. Linux (I believe). +@@ -249,6 +246,7 @@ + #_sha256 sha256module.c + #_sha512 sha512module.c + ++#_hashlib _hashopenssl.c -lssl -lcrypto + + # The _tkinter module. + # +@@ -337,6 +335,7 @@ + # Fred Drake's interface to the Python parser + #parser parsermodule.c + ++#_ctypes _ctypes/_ctypes.c _ctypes/callbacks.c _ctypes/callproc.c _ctypes/stgdict.c _ctypes/cfield.c _ctypes/malloc_closure.c -lffi + + # Lee Busby's SIGFPE modules. + # The library to link fpectl with is platform specific. +@@ -371,7 +370,7 @@ + # + # More information on Expat can be found at www.libexpat.org. + # +-#pyexpat expat/xmlparse.c expat/xmlrole.c expat/xmltok.c pyexpat.c -I$(srcdir)/Modules/expat -DHAVE_EXPAT_CONFIG_H -DUSE_PYEXPAT_CAPI ++#pyexpat pyexpat.c -lexpat + + # Hye-Shik Chang's CJKCodecs + --- python3.4-3.4.1.orig/debian/patches/site-locations.diff +++ python3.4-3.4.1/debian/patches/site-locations.diff @@ -0,0 +1,51 @@ +# DP: Set site-packages/dist-packages + +Index: b/Lib/site.py +=================================================================== +--- a/Lib/site.py ++++ b/Lib/site.py +@@ -7,12 +7,18 @@ + This will append site-specific paths to the module search path. On + Unix (including Mac OSX), it starts with sys.prefix and + sys.exec_prefix (if different) and appends +-lib/python/site-packages as well as lib/site-python. ++lib/python3/dist-packages as well as lib/site-python. + On other platforms (such as Windows), it tries each of the + prefixes directly, as well as with lib/site-packages appended. The + resulting directories, if they exist, are appended to sys.path, and + also inspected for path configuration files. + ++For Debian and derivatives, this sys.path is augmented with directories ++for packages distributed within the distribution. Local addons go ++into /usr/local/lib/python/dist-packages, Debian addons ++install into /usr/lib/python3/dist-packages. ++/usr/lib/python/site-packages is not used. ++ + If a file named "pyvenv.cfg" exists one directory above sys.executable, + sys.prefix and sys.exec_prefix are set to that directory and + it is also checked for site-packages and site-python (sys.base_prefix and +@@ -304,10 +310,21 @@ + seen.add(prefix) + + if os.sep == '/': ++ if 'VIRTUAL_ENV' in os.environ or sys.base_prefix != sys.prefix: ++ sitepackages.append(os.path.join(prefix, "lib", ++ "python" + sys.version[:3], ++ "site-packages")) ++ sitepackages.append(os.path.join(prefix, "local/lib", ++ "python" + sys.version[:3], ++ "dist-packages")) ++ sitepackages.append(os.path.join(prefix, "lib", ++ "python3", ++ "dist-packages")) ++ # this one is deprecated for Debian + sitepackages.append(os.path.join(prefix, "lib", +- "python" + sys.version[:3], +- "site-packages")) +- sitepackages.append(os.path.join(prefix, "lib", "site-python")) ++ "python" + sys.version[:3], ++ "dist-packages")) ++ sitepackages.append(os.path.join(prefix, "lib", "dist-python")) + else: + sitepackages.append(prefix) + sitepackages.append(os.path.join(prefix, "lib", "site-packages")) --- python3.4-3.4.1.orig/debian/patches/sysconfig-debian-schemes.diff +++ python3.4-3.4.1/debian/patches/sysconfig-debian-schemes.diff @@ -0,0 +1,67 @@ +# DP: Add schemes 'deb_system' and 'posix_local', make the latter the default + +--- a/Lib/sysconfig.py ++++ b/Lib/sysconfig.py +@@ -32,6 +32,30 @@ + 'scripts': '{base}/bin', + 'data': '{base}', + }, ++ 'deb_system': { ++ 'stdlib': '{installed_base}/lib/python{py_version_short}', ++ 'platstdlib': '{platbase}/lib/python{py_version_short}', ++ 'purelib': '{base}/lib/python3/dist-packages', ++ 'platlib': '{platbase}/lib/python3/dist-packages', ++ 'include': ++ '{installed_base}/include/python{py_version_short}{abiflags}', ++ 'platinclude': ++ '{installed_platbase}/include/python{py_version_short}{abiflags}', ++ 'scripts': '{base}/bin', ++ 'data': '{base}', ++ }, ++ 'posix_local': { ++ 'stdlib': '{installed_base}/lib/python{py_version_short}', ++ 'platstdlib': '{platbase}/lib/python{py_version_short}', ++ 'purelib': '{base}/local/lib/python{py_version_short}/dist-packages', ++ 'platlib': '{platbase}/local/lib/python{py_version_short}/dist-packages', ++ 'include': ++ '{installed_base}/local/include/python{py_version_short}{abiflags}', ++ 'platinclude': ++ '{installed_platbase}/local/include/python{py_version_short}{abiflags}', ++ 'scripts': '{base}/local/bin', ++ 'data': '{base}', ++ }, + 'posix_home': { + 'stdlib': '{installed_base}/lib/python', + 'platstdlib': '{base}/lib/python', +@@ -162,7 +186,7 @@ + _PYTHON_BUILD = is_python_build(True) + + if _PYTHON_BUILD: +- for scheme in ('posix_prefix', 'posix_home'): ++ for scheme in ('posix_prefix', 'posix_home', 'posix_local', 'deb_system'): + _INSTALL_SCHEMES[scheme]['include'] = '{srcdir}/Include' + _INSTALL_SCHEMES[scheme]['platinclude'] = '{projectbase}/.' + +@@ -200,7 +224,12 @@ + def _get_default_scheme(): + if os.name == 'posix': + # the default scheme for posix is posix_prefix +- return 'posix_prefix' ++ if 'real_prefix' in sys.__dict__ or 'VIRTUAL_ENV' in os.environ: ++ # virtual environments ++ return 'posix_prefix' ++ else: ++ # Debian default ++ return 'posix_local' + return os.name + + +@@ -485,7 +514,7 @@ + else: + inc_dir = _sys_home or _PROJECT_BASE + else: +- inc_dir = get_path('platinclude') ++ inc_dir = get_path('platinclude', 'posix_prefix') + return os.path.join(inc_dir, 'pyconfig.h') + + --- python3.4-3.4.1.orig/debian/patches/sysconfigdata.diff +++ python3.4-3.4.1/debian/patches/sysconfigdata.diff @@ -0,0 +1,76 @@ +# DP: Issue #15298: Generate _sysconfigdata.py in the build dir, not the source dir. + +diff -r 2ecdda96f970 Lib/sysconfig.py +--- a/Lib/sysconfig.py Tue Jul 10 18:27:54 2012 +0200 ++++ b/Lib/sysconfig.py Tue Jul 10 22:06:43 2012 +0200 +@@ -390,7 +390,7 @@ + if _PYTHON_BUILD: + vars['LDSHARED'] = vars['BLDSHARED'] + +- destfile = os.path.join(os.path.dirname(__file__), '_sysconfigdata.py') ++ destfile = '_sysconfigdata.py' + with open(destfile, 'w', encoding='utf8') as f: + f.write('# system configuration generated and used by' + ' the sysconfig module\n') +diff -r 2ecdda96f970 Makefile.pre.in +--- a/Makefile.pre.in Tue Jul 10 18:27:54 2012 +0200 ++++ b/Makefile.pre.in Tue Jul 10 22:06:43 2012 +0200 +@@ -410,7 +410,7 @@ + Objects/unicodectype.o \ + Objects/weakrefobject.o + +-SYSCONFIGDATA=$(srcdir)/Lib/_sysconfigdata.py ++SYSCONFIGDATA=_sysconfigdata.py + + ########################################################################## + # objects that get linked into the Python library +@@ -472,6 +472,9 @@ + # Generate the sysconfig build-time data + $(SYSCONFIGDATA): $(BUILDPYTHON) + $(RUNSHARED) $(PYTHON_FOR_BUILD) -S -m sysconfig --generate-posix-vars ++ $(RUNSHARED) $(PYTHON_FOR_BUILD) -S -c 'import os,sys ; from distutils.util import get_platform ; d=os.path.join("build", "lib."+get_platform()+"-"+sys.version[0:3]+("-pydebug" if hasattr(sys, "gettotalrefcount") else "")); print(d, end="")' > pybuilddir.txt ++ mkdir -p `cat pybuilddir.txt` ++ cp $(SYSCONFIGDATA) `cat pybuilddir.txt`/. + + # Build the shared modules + sharedmods: $(BUILDPYTHON) $(SYSCONFIGDATA) +@@ -1036,7 +1039,7 @@ + else true; \ + fi; \ + done +- @for i in $(srcdir)/Lib/*.py ; \ ++ @for i in $(srcdir)/Lib/*.py $(SYSCONFIGDATA); \ + do \ + if test -x $$i; then \ + $(INSTALL_SCRIPT) $$i $(DESTDIR)$(LIBDEST); \ +diff -r 2ecdda96f970 setup.py +--- a/setup.py Tue Jul 10 18:27:54 2012 +0200 ++++ b/setup.py Tue Jul 10 22:06:43 2012 +0200 +@@ -33,10 +33,6 @@ + # This global variable is used to hold the list of modules to be disabled. + disabled_module_list = [] + +-# File which contains the directory for shared mods (for sys.path fixup +-# when running from the build dir, see Modules/getpath.c) +-_BUILDDIR_COOKIE = "pybuilddir.txt" +- + def add_dir_to_list(dirlist, dir): + """Add the directory 'dir' to the list 'dirlist' (after any relative + directories) if: +@@ -250,12 +246,9 @@ + args['compiler_so'] = compiler + ' ' + ccshared + ' ' + cflags + self.compiler.set_executables(**args) + +- # Not only do we write the builddir cookie, but we manually install +- # the shared modules directory if it isn't already in sys.path. +- # Otherwise trying to import the extensions after building them +- # will fail. +- with open(_BUILDDIR_COOKIE, "wb") as f: +- f.write(self.build_lib.encode('utf-8', 'surrogateescape')) ++ # We manually install the shared modules directory if it isn't ++ # already in sys.path. Otherwise trying to import the ++ # extensions after building them will fail. + abs_build_lib = os.path.join(os.getcwd(), self.build_lib) + if abs_build_lib not in sys.path: + sys.path.append(abs_build_lib) + --- python3.4-3.4.1.orig/debian/patches/tempfile-minimal.diff +++ python3.4-3.4.1/debian/patches/tempfile-minimal.diff @@ -0,0 +1,170 @@ +# DP: Avoid shutil import when it is not available. + +Index: b/Lib/tempfile.py +=================================================================== +--- a/Lib/tempfile.py ++++ b/Lib/tempfile.py +@@ -31,7 +31,146 @@ import functools as _functools + import warnings as _warnings + import io as _io + import os as _os +-import shutil as _shutil ++try: ++ import shutil as _shutil ++ _rmtree = _shutil.rmtree ++except ImportError: ++ import sys as _sys ++ import stat as _stat ++ # version vulnerable to race conditions ++ def _rmtree_unsafe(path, onerror): ++ try: ++ if _os.path.islink(path): ++ # symlinks to directories are forbidden, see bug #1669 ++ raise OSError("Cannot call rmtree on a symbolic link") ++ except OSError: ++ onerror(_os.path.islink, path, _sys.exc_info()) ++ # can't continue even if onerror hook returns ++ return ++ names = [] ++ try: ++ names = _os.listdir(path) ++ except OSError: ++ onerror(_os.listdir, path, _sys.exc_info()) ++ for name in names: ++ fullname = _os.path.join(path, name) ++ try: ++ mode = _os.lstat(fullname).st_mode ++ except OSError: ++ mode = 0 ++ if _stat.S_ISDIR(mode): ++ _rmtree_unsafe(fullname, onerror) ++ else: ++ try: ++ _os.unlink(fullname) ++ except OSError: ++ onerror(_os.unlink, fullname, _sys.exc_info()) ++ try: ++ _os.rmdir(path) ++ except OSError: ++ onerror(_os.rmdir, path, _sys.exc_info()) ++ ++ # Version using fd-based APIs to protect against races ++ def _rmtree_safe_fd(topfd, path, onerror): ++ names = [] ++ try: ++ names = _os.listdir(topfd) ++ except OSError as err: ++ err.filename = path ++ onerror(_os.listdir, path, _sys.exc_info()) ++ for name in names: ++ fullname = _os.path.join(path, name) ++ try: ++ orig_st = _os.stat(name, dir_fd=topfd, follow_symlinks=False) ++ mode = orig_st.st_mode ++ except OSError: ++ mode = 0 ++ if _stat.S_ISDIR(mode): ++ try: ++ dirfd = _os.open(name, _os.O_RDONLY, dir_fd=topfd) ++ except OSError: ++ onerror(_os.open, fullname, _sys.exc_info()) ++ else: ++ try: ++ if _os.path.samestat(orig_st, _os.fstat(dirfd)): ++ _rmtree_safe_fd(dirfd, fullname, onerror) ++ try: ++ _os.rmdir(name, dir_fd=topfd) ++ except OSError: ++ onerror(_os.rmdir, fullname, _sys.exc_info()) ++ else: ++ try: ++ # This can only happen if someone replaces ++ # a directory with a symlink after the call to ++ # stat.S_ISDIR above. ++ raise OSError("Cannot call rmtree on a symbolic " ++ "link") ++ except OSError: ++ onerror(_os.path.islink, fullname, _sys.exc_info()) ++ finally: ++ _os.close(dirfd) ++ else: ++ try: ++ _os.unlink(name, dir_fd=topfd) ++ except OSError: ++ onerror(_os.unlink, fullname, _sys.exc_info()) ++ ++ _use_fd_functions = ({_os.open, _os.stat, _os.unlink, _os.rmdir} <= ++ _os.supports_dir_fd and ++ _os.listdir in _os.supports_fd and ++ _os.stat in _os.supports_follow_symlinks) ++ ++ def _rmtree(path, ignore_errors=False, onerror=None): ++ """Recursively delete a directory tree. ++ ++ If ignore_errors is set, errors are ignored; otherwise, if onerror ++ is set, it is called to handle the error with arguments (func, ++ path, exc_info) where func is platform and implementation dependent; ++ path is the argument to that function that caused it to fail; and ++ exc_info is a tuple returned by sys.exc_info(). If ignore_errors ++ is false and onerror is None, an exception is raised. ++ ++ """ ++ if ignore_errors: ++ def onerror(*args): ++ pass ++ elif onerror is None: ++ def onerror(*args): ++ raise ++ if _use_fd_functions: ++ # While the unsafe rmtree works fine on bytes, the fd based does not. ++ if isinstance(path, bytes): ++ path = _os.fsdecode(path) ++ # Note: To guard against symlink races, we use the standard ++ # lstat()/open()/fstat() trick. ++ try: ++ orig_st = _os.lstat(path) ++ except Exception: ++ onerror(_os.lstat, path, _sys.exc_info()) ++ return ++ try: ++ fd = _os.open(path, _os.O_RDONLY) ++ except Exception: ++ onerror(_os.lstat, path, _sys.exc_info()) ++ return ++ try: ++ if _os.path.samestat(orig_st, _os.fstat(fd)): ++ _rmtree_safe_fd(fd, path, onerror) ++ try: ++ _os.rmdir(path) ++ except OSError: ++ onerror(_os.rmdir, path, _sys.exc_info()) ++ else: ++ try: ++ # symlinks to directories are forbidden, see bug #1669 ++ raise OSError("Cannot call rmtree on a symbolic link") ++ except OSError: ++ onerror(_os.path.islink, path, _sys.exc_info()) ++ finally: ++ _os.close(fd) ++ else: ++ return _rmtree_unsafe(path, onerror) ++ + import errno as _errno + from random import Random as _Random + import weakref as _weakref +@@ -676,7 +815,7 @@ class TemporaryDirectory(object): + + @classmethod + def _cleanup(cls, name, warn_message=None): +- _shutil.rmtree(name) ++ _rmtree(name) + if warn_message is not None: + _warnings.warn(warn_message, ResourceWarning) + +@@ -694,5 +833,5 @@ class TemporaryDirectory(object): + if self._finalizer is not None: + self._finalizer.detach() + if self.name is not None and not self._closed: +- _shutil.rmtree(self.name) ++ _rmtree(self.name) + self._closed = True --- python3.4-3.4.1.orig/debian/patches/test-no-random-order.diff +++ python3.4-3.4.1/debian/patches/test-no-random-order.diff @@ -0,0 +1,14 @@ +# DP: Don't run the test suite in random order. + +Index: b/Tools/scripts/run_tests.py +=================================================================== +--- a/Tools/scripts/run_tests.py ++++ b/Tools/scripts/run_tests.py +@@ -39,7 +39,6 @@ def main(regrtest_args): + args.extend(['-W', 'error::BytesWarning']) + + args.extend(['-m', 'test', # Run the test suite +- '-r', # Randomize test order + '-w', # Re-run failed tests in verbose mode + ]) + if sys.platform == 'win32': --- python3.4-3.4.1.orig/debian/patches/tkinter-import.diff +++ python3.4-3.4.1/debian/patches/tkinter-import.diff @@ -0,0 +1,18 @@ +# DP: suggest installation of python-tk package on failing _tkinter import + +Index: b/Lib/tkinter/__init__.py +=================================================================== +--- a/Lib/tkinter/__init__.py ++++ b/Lib/tkinter/__init__.py +@@ -35,7 +35,10 @@ + # Attempt to configure Tcl/Tk without requiring PATH + from tkinter import _fix + +-import _tkinter # If this fails your Python may not be configured for Tk ++try: ++ import _tkinter ++except ImportError as msg: ++ raise ImportError(str(msg) + ', please install the python3-tk package') + TclError = _tkinter.TclError + from tkinter.constants import * + import re --- python3.4-3.4.1.orig/debian/pdb.1.in +++ python3.4-3.4.1/debian/pdb.1.in @@ -0,0 +1,16 @@ +.TH PDB@VER@ 1 +.SH NAME +pdb@VER@ \- the Python debugger +.SH SYNOPSIS +.PP +.B pdb@VER@ +.I script [...] +.SH DESCRIPTION +.PP +See /usr/lib/python@VER@/pdb.doc for more information on the use +of pdb. When the debugger is started, help is available via the +help command. +.SH SEE ALSO +python@VER@(1). Chapter 9 of the Python Library Reference +(The Python Debugger). Available in the python@VER@-doc package at +/usr/share/doc/python@VER@/html/lib/module-pdb.html. --- python3.4-3.4.1.orig/debian/pydoc.1.in +++ python3.4-3.4.1/debian/pydoc.1.in @@ -0,0 +1,53 @@ +.TH PYDOC@VER@ 1 +.SH NAME +pydoc@VER@ \- the Python documentation tool +.SH SYNOPSIS +.PP +.B pydoc@VER@ +.I name +.PP +.B pydoc@VER@ -k +.I keyword +.PP +.B pydoc@VER@ -p +.I port +.PP +.B pydoc@VER@ -g +.PP +.B pydoc@VER@ -w +.I module [...] +.SH DESCRIPTION +.PP +.B pydoc@VER@ +.I name +Show text documentation on something. +.I name +may be the name of a +Python keyword, topic, function, module, or package, or a dotted +reference to a class or function within a module or module in a +package. If +.I name +contains a '/', it is used as the path to a +Python source file to document. If name is 'keywords', 'topics', +or 'modules', a listing of these things is displayed. +.PP +.B pydoc@VER@ -k +.I keyword +Search for a keyword in the synopsis lines of all available modules. +.PP +.B pydoc@VER@ -p +.I port +Start an HTTP server on the given port on the local machine. +.PP +.B pydoc@VER@ -g +Pop up a graphical interface for finding and serving documentation. +.PP +.B pydoc@VER@ -w +.I name [...] +Write out the HTML documentation for a module to a file in the current +directory. If +.I name +contains a '/', it is treated as a filename; if +it names a directory, documentation is written for all the contents. +.SH AUTHOR +Moshe Zadka, based on "pydoc --help" --- python3.4-3.4.1.orig/debian/pygettext.1 +++ python3.4-3.4.1/debian/pygettext.1 @@ -0,0 +1,108 @@ +.TH PYGETTEXT 1 "" "pygettext 1.4" +.SH NAME +pygettext \- Python equivalent of xgettext(1) +.SH SYNOPSIS +.B pygettext +[\fIOPTIONS\fR] \fIINPUTFILE \fR... +.SH DESCRIPTION +pygettext is deprecated. The current version of xgettext supports +many languages, including Python. + +pygettext uses Python's standard tokenize module to scan Python +source code, generating .pot files identical to what GNU xgettext generates +for C and C++ code. From there, the standard GNU tools can be used. +.PP +pygettext searches only for _() by default, even though GNU xgettext +recognizes the following keywords: gettext, dgettext, dcgettext, +and gettext_noop. See the \fB\-k\fR/\fB\--keyword\fR flag below for how to +augment this. +.PP +.SH OPTIONS +.TP +\fB\-a\fR, \fB\-\-extract\-all\fR +Extract all strings. +.TP +\fB\-d\fR, \fB\-\-default\-domain\fR=\fINAME\fR +Rename the default output file from messages.pot to name.pot. +.TP +\fB\-E\fR, \fB\-\-escape\fR +Replace non-ASCII characters with octal escape sequences. +.TP +\fB\-D\fR, \fB\-\-docstrings\fR +Extract module, class, method, and function docstrings. +These do not need to be wrapped in _() markers, and in fact cannot +be for Python to consider them docstrings. (See also the \fB\-X\fR option). +.TP +\fB\-h\fR, \fB\-\-help\fR +Print this help message and exit. +.TP +\fB\-k\fR, \fB\-\-keyword\fR=\fIWORD\fR +Keywords to look for in addition to the default set, which are: _ +.IP +You can have multiple \fB\-k\fR flags on the command line. +.TP +\fB\-K\fR, \fB\-\-no\-default\-keywords\fR +Disable the default set of keywords (see above). +Any keywords explicitly added with the \fB\-k\fR/\fB\--keyword\fR option +are still recognized. +.TP +\fB\-\-no\-location\fR +Do not write filename/lineno location comments. +.TP +\fB\-n\fR, \fB\-\-add\-location\fR +Write filename/lineno location comments indicating where each +extracted string is found in the source. These lines appear before +each msgid. The style of comments is controlled by the +\fB\-S\fR/\fB\--style\fR option. This is the default. +.TP +\fB\-o\fR, \fB\-\-output\fR=\fIFILENAME\fR +Rename the default output file from messages.pot to FILENAME. +If FILENAME is `-' then the output is sent to standard out. +.TP +\fB\-p\fR, \fB\-\-output\-dir\fR=\fIDIR\fR +Output files will be placed in directory DIR. +.TP +\fB\-S\fR, \fB\-\-style\fR=\fISTYLENAME\fR +Specify which style to use for location comments. +Two styles are supported: +.RS +.IP \(bu 4 +Solaris # File: filename, line: line-number +.IP \(bu 4 +GNU #: filename:line +.RE +.IP +The style name is case insensitive. +GNU style is the default. +.TP +\fB\-v\fR, \fB\-\-verbose\fR +Print the names of the files being processed. +.TP +\fB\-V\fR, \fB\-\-version\fR +Print the version of pygettext and exit. +.TP +\fB\-w\fR, \fB\-\-width\fR=\fICOLUMNS\fR +Set width of output to columns. +.TP +\fB\-x\fR, \fB\-\-exclude\-file\fR=\fIFILENAME\fR +Specify a file that contains a list of strings that are not be +extracted from the input files. Each string to be excluded must +appear on a line by itself in the file. +.TP +\fB\-X\fR, \fB\-\-no\-docstrings\fR=\fIFILENAME\fR +Specify a file that contains a list of files (one per line) that +should not have their docstrings extracted. This is only useful in +conjunction with the \fB\-D\fR option above. +.PP +If `INPUTFILE' is -, standard input is read. +.SH BUGS +pygettext attempts to be option and feature compatible with GNU xgettext +where ever possible. However some options are still missing or are not fully +implemented. Also, xgettext's use of command line switches with option +arguments is broken, and in these cases, pygettext just defines additional +switches. +.SH AUTHOR +pygettext is written by Barry Warsaw . +.PP +Joonas Paalasmaa put this manual page together +based on "pygettext --help". --- python3.4-3.4.1.orig/debian/pyhtml2devhelp.py +++ python3.4-3.4.1/debian/pyhtml2devhelp.py @@ -0,0 +1,273 @@ +#! /usr/bin/python3 + +from html.parser import HTMLParser +import formatter +import os, sys, re + +class PyHTMLParser(HTMLParser): + pages_to_include = set(('whatsnew/index.html', 'tutorial/index.html', 'using/index.html', + 'reference/index.html', 'library/index.html', 'howto/index.html', + 'extending/index.html', 'c-api/index.html', 'install/index.html', + 'distutils/index.html')) + + def __init__(self, formatter, basedir, fn, indent, parents=set()): + HTMLParser.__init__(self, formatter) + self.basedir = basedir + self.dir, self.fn = os.path.split(fn) + self.data = '' + self.parents = parents + self.link = {} + self.indent = indent + self.last_indent = indent - 1 + self.sub_indent = 0 + self.sub_count = 0 + self.next_link = False + + def process_link(self): + new_href = os.path.join(self.dir, self.link['href']) + text = self.link['text'] + indent = self.indent + self.sub_indent + if self.last_indent == indent: + print('%s' % (' ' * self.last_indent)) + self.sub_count -= 1 + print('%s' % (' ' * indent, new_href, text)) + self.sub_count += 1 + self.last_indent = self.indent + self.sub_indent + + def handle_starttag(self, tag, attrs): + if tag == 'a': + self.start_a(attrs) + elif tag == 'li': + self.start_li(attrs) + + def handle_endtag(self, tag): + if tag == 'a': + self.end_a() + elif tag == 'li': + self.end_li() + + def start_li(self, attrs): + self.sub_indent += 1 + self.next_link = True + + def end_li(self): + indent = self.indent + self.sub_indent + if self.sub_count > 0: + print('%s' % (' ' * self.last_indent)) + self.sub_count -= 1 + self.last_indent -= 1 + self.sub_indent -= 1 + + def start_a(self, attrs): + self.link = {} + for attr in attrs: + self.link[attr[0]] = attr[1] + self.data = '' + + def end_a(self): + process = False + text = self.data.replace('\t', '').replace('\n', ' ').replace('&', '&').replace('<', '<').replace('>', '>') + self.link['text'] = text + # handle a tag without href attribute + try: + href = self.link['href'] + except KeyError: + return + + abs_href = os.path.join(self.basedir, href) + if abs_href in self.parents: + return + if href.startswith('..') or href.startswith('http:') \ + or href.startswith('mailto:') or href.startswith('news:'): + return + if href in ('', 'about.html', 'modindex.html', 'genindex.html', 'glossary.html', + 'search.html', 'contents.html', 'download.html', 'bugs.html', + 'license.html', 'copyright.html'): + return + + if 'class' in self.link: + if self.link['class'] in ('biglink'): + process = True + if self.link['class'] in ('reference external'): + if self.next_link: + process = True + next_link = False + + if process == True: + self.process_link() + if href in self.pages_to_include: + self.parse_file(os.path.join(self.dir, href)) + + def finish(self): + if self.sub_count > 0: + print('%s' % (' ' * self.last_indent)) + + def handle_data(self, data): + self.data += data + + def parse_file(self, href): + # TODO basedir bestimmen + parent = os.path.join(self.basedir, self.fn) + self.parents.add(parent) + parser = PyHTMLParser(formatter.NullFormatter(), + self.basedir, href, self.indent + 1, + self.parents) + text = open(self.basedir + '/' + href, encoding='latin_1').read() + parser.feed(text) + parser.finish() + parser.close() + if parent in self.parents: + self.parents.remove(parent) + +class PyIdxHTMLParser(HTMLParser): + def __init__(self, formatter, basedir, fn, indent): + HTMLParser.__init__(self, formatter) + self.basedir = basedir + self.dir, self.fn = os.path.split(fn) + self.data = '' + self.link = {} + self.indent = indent + self.active = False + self.indented = False + self.nolink = False + self.header = '' + self.last_letter = 'Z' + self.last_text = '' + + def process_link(self): + new_href = os.path.join(self.dir, self.link['href']) + text = self.link['text'] + if not self.active: + return + if text.startswith('['): + return + if self.link.get('rel', None) in ('prev', 'parent', 'next', 'contents', 'index'): + return + if self.indented: + text = self.last_text + ' ' + text + else: + # Save it in case we need it again + self.last_text = re.sub(' \([\w\-\.\s]+\)', '', text) + indent = self.indent + print('%s' % (' ' * indent, new_href, text)) + + def handle_starttag(self, tag, attrs): + if tag == 'a': + self.start_a(attrs) + elif tag == 'dl': + self.start_dl(attrs) + elif tag == 'dt': + self.start_dt(attrs) + elif tag == 'h2': + self.start_h2(attrs) + elif tag == 'td': + self.start_td(attrs) + elif tag == 'table': + self.start_table(attrs) + + def handle_endtag(self, tag): + if tag == 'a': + self.end_a() + elif tag == 'dl': + self.end_dl() + elif tag == 'dt': + self.end_dt() + elif tag == 'h2': + self.end_h2() + elif tag == 'td': + self.end_td() + elif tag == 'table': + self.end_table() + + def start_dl(self, attrs): + if self.last_text: + # Looks like we found the second part to a command + self.indented = True + + def end_dl(self): + self.indented = False + + def start_dt(self, attrs): + self.data = '' + self.nolink = True + + def end_dt(self): + if not self.active: + return + if self.nolink == True: + # Looks like we found the first part to a command + self.last_text = re.sub(' \([\w\-\.\s]+\)', '', self.data) + self.nolink = False + + def start_h2(self, attrs): + for k, v in attrs: + if k == 'id': + self.header = v + if v == '_': + self.active = True + + def end_h2(self): + pass + + def start_td(self, attrs): + self.indented = False + self.last_text = '' + + def end_td(self): + pass + + def start_table(self, attrs): + pass + + def end_table(self): + if self.header == self.last_letter: + self.active = False + + def start_a(self, attrs): + self.nolink = False + self.link = {} + for attr in attrs: + self.link[attr[0]] = attr[1] + self.data = '' + + def end_a(self): + text = self.data.replace('\t', '').replace('\n', ' ') + text = text.replace("Whats ", "What's ") + self.link['text'] = text + # handle a tag without href attribute + try: + href = self.link['href'] + except KeyError: + return + self.process_link() + + def handle_data(self, data): + self.data += data + + def handle_entityref(self, name): + self.data += '&%s;' % name + +def main(): + base = sys.argv[1] + fn = sys.argv[2] + version = sys.argv[3] + + parser = PyHTMLParser(formatter.NullFormatter(), base, fn, indent=0) + print('') + print('' % (version, version, version)) + print('') + parser.parse_file(fn) + print('') + + print('') + + fn = 'genindex-all.html' + parser = PyIdxHTMLParser(formatter.NullFormatter(), base, fn, indent=1) + text = open(base + '/' + fn, encoding='latin_1').read() + parser.feed(text) + parser.close() + + print('') + print('') + +main() --- python3.4-3.4.1.orig/debian/pylogo.xpm +++ python3.4-3.4.1/debian/pylogo.xpm @@ -0,0 +1,351 @@ +/* XPM */ +static char * pylogo_xpm[] = { +"32 32 316 2", +" c None", +". c #8DB0CE", +"+ c #6396BF", +"@ c #4985B7", +"# c #4181B5", +"$ c #417EB2", +"% c #417EB1", +"& c #4D83B0", +"* c #6290B6", +"= c #94B2CA", +"- c #70A1C8", +"; c #3D83BC", +"> c #3881BD", +", c #387DB6", +"' c #387CB5", +") c #387BB3", +"! c #3779B0", +"~ c #3778AE", +"{ c #3776AB", +"] c #3776AA", +"^ c #3775A9", +"/ c #4A7FAC", +"( c #709FC5", +"_ c #3A83BE", +": c #5795C7", +"< c #94B9DB", +"[ c #73A4CE", +"} c #3D80B7", +"| c #387CB4", +"1 c #377AB2", +"2 c #377AB0", +"3 c #3777AC", +"4 c #3774A7", +"5 c #3773A5", +"6 c #3C73A5", +"7 c #4586BB", +"8 c #4489C1", +"9 c #A7C7E1", +"0 c #F7F9FD", +"a c #E1E9F1", +"b c #4C89BC", +"c c #3779AF", +"d c #3778AD", +"e c #3873A5", +"f c #4B7CA4", +"g c #3982BE", +"h c #4389C1", +"i c #A6C6E1", +"j c #F6F9FC", +"k c #D6E4F0", +"l c #4A88BB", +"m c #3773A6", +"n c #366F9F", +"o c #366E9D", +"p c #376E9C", +"q c #4A8BC0", +"r c #79A7CD", +"s c #548EBD", +"t c #387AB0", +"u c #3773A4", +"v c #366D9C", +"w c #387FBA", +"x c #387DB7", +"y c #387BB4", +"z c #3775A8", +"A c #366FA0", +"B c #4981AF", +"C c #427BAA", +"D c #3772A4", +"E c #376B97", +"F c #77A3C8", +"G c #4586BC", +"H c #3882BE", +"I c #3B76A7", +"J c #3B76A6", +"K c #366E9E", +"L c #376B98", +"M c #376B96", +"N c #5681A3", +"O c #F5EEB8", +"P c #FFED60", +"Q c #FFE85B", +"R c #FFE659", +"S c #FDE55F", +"T c #5592C4", +"U c #3A83BF", +"V c #3882BD", +"W c #387FB9", +"X c #3779AE", +"Y c #366F9E", +"Z c #366C98", +"` c #376A94", +" . c #5D85A7", +".. c #F5EDB7", +"+. c #FFEA5D", +"@. c #FFE75A", +"#. c #FFE354", +"$. c #FDDD56", +"%. c #669DC8", +"&. c #3885C3", +"*. c #3884C2", +"=. c #387EB8", +"-. c #387CB6", +";. c #377AB1", +">. c #3772A3", +",. c #366D9B", +"'. c #F5EBB5", +"). c #FFE557", +"!. c #FFE455", +"~. c #FFDF50", +"{. c #FFDB4C", +"]. c #FAD862", +"^. c #8EB4D2", +"/. c #3C86C1", +"(. c #3883C0", +"_. c #3882BF", +":. c #3881BC", +"<. c #3880BB", +"[. c #3775AA", +"}. c #F5EAB3", +"|. c #FFE051", +"1. c #FFDE4F", +"2. c #FFDA4A", +"3. c #FED446", +"4. c #F5DF9D", +"5. c #77A5CA", +"6. c #3885C2", +"7. c #387BB2", +"8. c #6B8EA8", +"9. c #F8E7A1", +"0. c #FFE153", +"a. c #FFDD4E", +"b. c #FFDB4B", +"c. c #FFD746", +"d. c #FFD645", +"e. c #FFD342", +"f. c #F6DB8D", +"g. c #508DBE", +"h. c #3771A3", +"i. c #376A95", +"j. c #3D6F97", +"k. c #C3CBC2", +"l. c #FBD964", +"m. c #FFDC4D", +"n. c #FFD544", +"o. c #FFD040", +"p. c #F9CF58", +"q. c #3F83BB", +"r. c #376B95", +"s. c #3A6C95", +"t. c #4E7BA0", +"u. c #91AABC", +"v. c #F6E4A3", +"w. c #FFDA4B", +"x. c #FFD646", +"y. c #FFD443", +"z. c #FFD241", +"A. c #FFCE3D", +"B. c #FFCC3B", +"C. c #FCC83E", +"D. c #3880BC", +"E. c #3C79AC", +"F. c #5F8DB4", +"G. c #7AA0C0", +"H. c #82A6C3", +"I. c #82A3BF", +"J. c #82A2BE", +"K. c #82A1BB", +"L. c #82A1B9", +"M. c #8BA4B5", +"N. c #C1C5AE", +"O. c #F2E19F", +"P. c #FDD74C", +"Q. c #FFD94A", +"R. c #FFD343", +"S. c #FFCE3E", +"T. c #FFCB39", +"U. c #FFC937", +"V. c #FEC636", +"W. c #3D79AB", +"X. c #9DB6C6", +"Y. c #D0CFA2", +"Z. c #EFE598", +"`. c #F8EE9B", +" + c #F8EB97", +".+ c #F8E996", +"++ c #F8E894", +"@+ c #FAE489", +"#+ c #FCDB64", +"$+ c #FFDA4D", +"%+ c #FFCF3E", +"&+ c #FFCB3A", +"*+ c #FFC734", +"=+ c #FFC532", +"-+ c #3F82B7", +";+ c #387EB9", +">+ c #9EB9D0", +",+ c #F2E287", +"'+ c #FDEB69", +")+ c #FEEC60", +"!+ c #FFEB5E", +"~+ c #FFE254", +"{+ c #FFE152", +"]+ c #FFD747", +"^+ c #FFC633", +"/+ c #FCC235", +"(+ c #578FBE", +"_+ c #6996BC", +":+ c #DED9A8", +"<+ c #FEEC62", +"[+ c #FFE658", +"}+ c #FFDF51", +"|+ c #FFDE50", +"1+ c #FFD03F", +"2+ c #FFCD3C", +"3+ c #FFC431", +"4+ c #FFBF2C", +"5+ c #FAC244", +"6+ c #85AACA", +"7+ c #A1BBD2", +"8+ c #F7E47C", +"9+ c #FFE456", +"0+ c #FFC735", +"a+ c #FFBC29", +"b+ c #F7D280", +"c+ c #9DBAD2", +"d+ c #3B7CB2", +"e+ c #ABC2D6", +"f+ c #FDEB7B", +"g+ c #FFC12E", +"h+ c #FDBD30", +"i+ c #F4DEA8", +"j+ c #5F91BA", +"k+ c #ABC1D4", +"l+ c #FDEE7E", +"m+ c #FFE253", +"n+ c #FFCC3C", +"o+ c #FFBA27", +"p+ c #FAC75B", +"q+ c #4A82B0", +"r+ c #3877AB", +"s+ c #3774A6", +"t+ c #AAC0D4", +"u+ c #FDEE7D", +"v+ c #FFEC5F", +"w+ c #FFE255", +"x+ c #FFD848", +"y+ c #FFD444", +"z+ c #FFCF3F", +"A+ c #FFBC2A", +"B+ c #FFBB28", +"C+ c #FDBA32", +"D+ c #447AA8", +"E+ c #4379A7", +"F+ c #FFE95C", +"G+ c #FFE558", +"H+ c #FFE355", +"I+ c #FED84B", +"J+ c #FCD149", +"K+ c #FBCE47", +"L+ c #FBCD46", +"M+ c #FBC840", +"N+ c #FBC63E", +"O+ c #FBC037", +"P+ c #FAC448", +"Q+ c #FDD44C", +"R+ c #FCD14E", +"S+ c #FFC836", +"T+ c #FFC22F", +"U+ c #FFC02D", +"V+ c #FFE052", +"W+ c #FFC636", +"X+ c #FFCF5C", +"Y+ c #FFD573", +"Z+ c #FFC33E", +"`+ c #FEBD2D", +" @ c #FFDB4D", +".@ c #FFD949", +"+@ c #FFD545", +"@@ c #FFD140", +"#@ c #FFCB48", +"$@ c #FFF7E4", +"%@ c #FFFCF6", +"&@ c #FFE09D", +"*@ c #FFBA2E", +"=@ c #FDBE2F", +"-@ c #FFD748", +";@ c #FFCA38", +">@ c #FFC844", +",@ c #FFF2D7", +"'@ c #FFF9EC", +")@ c #FFDB94", +"!@ c #FFB92D", +"~@ c #FAC54D", +"{@ c #FDD54E", +"]@ c #FFBD2D", +"^@ c #FFC858", +"/@ c #FFD174", +"(@ c #FFBF3E", +"_@ c #FCBD3C", +":@ c #FAD66A", +"<@ c #FECD3F", +"[@ c #FFC330", +"}@ c #FFBD2A", +"|@ c #FFB724", +"1@ c #FFB521", +"2@ c #FFB526", +"3@ c #FBC457", +"4@ c #F7E09E", +"5@ c #F8D781", +"6@ c #FAC349", +"7@ c #FCC134", +"8@ c #FEBE2C", +"9@ c #FBBE3F", +"0@ c #F7CF79", +"a@ c #F5D795", +" . + @ # $ % % & * = ", +" - ; > > , ' ) ! ~ { ] ^ / ", +" ( _ : < [ } | 1 2 ~ 3 4 5 5 6 ", +" 7 8 9 0 a b 2 c d 3 { 5 5 5 e f ", +" g h i j k l c ~ { { m 5 5 n o p ", +" > > q r s t c c d 4 5 u n v v v ", +" w x ' y 2 c d d z 5 u A v v v v ", +" B C 5 D v v v v E ", +" F G H H H x ' ) c c c d I J 5 K v v L M N O P Q R S ", +" T U H V V W ' ) c c X ~ 5 5 5 Y v v Z ` ` ...+.@.#.#.$. ", +" %.&.*.> w W =.-.;.c 3 { ^ 5 5 >.o v ,.E ` ` .'.).!.#.~.{.]. ", +"^./.(._.:.<., ' ) ;.X d [.5 5 >.K v ,.E ` ` ` .}.#.|.1.{.2.3.4.", +"5.6.(.H H x ' 7.c c 3 3 4 5 D K v v ,.` ` ` ` 8.9.0.a.b.c.d.e.f.", +"g._.> <.w ' ' | 2 3 { z 5 5 h.v v v i.` ` ` j.k.l.m.{.d.n.e.o.p.", +"q.> > :.-.' 1 c c c ] 5 5 >.v v ,.r.` ` s.t.u.v.{.w.x.y.z.A.B.C.", +"D.D.w -.' 1 c c c E.F.G.H.I.J.J.K.L.L.L.M.N.O.P.Q.c.R.S.B.T.U.V.", +"D.D.=.' ' 1 c c W.X.Y.Z.`.`.`.`.`. +.+++@+#+$+Q.d.R.%+B.&+*+=+=+", +"-+;+-.' ;.2 c c >+,+'+)+P P P !+Q R ~+{+1.{.]+d.y.%+B.&+^+=+=+/+", +"(+' ' ;.c X X _+:+<+P P P P !+R [+~+}+|+{.]+n.R.1+2+&+^+=+3+4+5+", +"6+' ) ! ~ { { 7+8+P P P P !+R 9+#.{+{.w.]+y.z.S.&+0+=+=+3+4+a+b+", +"c+d+7.! d 3 z e+f+P P P !+R 9+#.{+m.{.]+y.1+B.&+0+=+=+g+4+a+h+i+", +" j+c d 3 { 4 k+l+P P !+@.9+m+1.m.{.]+y.1+n+B.*+=+=+g+a+a+o+p+ ", +" q+r+{ s+m t+u+v+@.R w+{+}+{.x+d.y+z+n+B.0+=+=+g+A+a+B+C+ ", +" * D+E+E+ +.F+G+H+}+}+{.I+J+K+L+M+M+M+M+N+O+O+O+O+P+ ", +" ).).#.{+a.{.x+Q+R+ ", +" #.m+1.a.{.x+y.o.2+B.S+=+=+T+U+O+ ", +" 0.V+{.{.x+n.o.2+B.B.W+X+Y+Z+a+`+ ", +" @{..@+@n.@@B.B.S+^+#@$@%@&@*@=@ ", +" ].-@x.y.o.%+;@S+=+=+>@,@'@)@!@~@ ", +" {@z.z+2+U.=+=+=+T+]@^@/@(@_@ ", +" :@<@U.=+=+[@4+}@|@1@2@3@ ", +" 4@5@6@7@8@a+a+9@0@a@ "}; --- python3.4-3.4.1.orig/debian/pymindeps.py +++ python3.4-3.4.1/debian/pymindeps.py @@ -0,0 +1,178 @@ +#! /usr/bin/python3 + +# Matthias Klose +# Modified to only exclude module imports from a given module. + +# Copyright 2004 Toby Dickenson +# +# Permission is hereby granted, free of charge, to any person obtaining +# a copy of this software and associated documentation files (the +# "Software"), to deal in the Software without restriction, including +# without limitation the rights to use, copy, modify, merge, publish, +# distribute, sublicense, and/or sell copies of the Software, and to +# permit persons to whom the Software is furnished to do so, subject +# to the following conditions: +# +# The above copyright notice and this permission notice shall be included +# in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +# IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +# CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +import os, sys, pprint +import modulefinder +import imp + +class mymf(modulefinder.ModuleFinder): + def __init__(self,*args,**kwargs): + self._depgraph = {} + self._types = {} + self._last_caller = None + modulefinder.ModuleFinder.__init__(self, *args, **kwargs) + + def import_hook(self, name, caller=None, fromlist=None, level=-1): + old_last_caller = self._last_caller + try: + self._last_caller = caller + return modulefinder.ModuleFinder.import_hook(self, name, caller, + fromlist, level) + finally: + self._last_caller = old_last_caller + + def import_module(self, partnam, fqname, parent): + m = modulefinder.ModuleFinder.import_module(self, + partnam, fqname, parent) + if m is not None and self._last_caller: + caller = self._last_caller.__name__ + if '.' in caller: + caller = caller[:caller.index('.')] + callee = m.__name__ + if '.' in callee: + callee = callee[:callee.index('.')] + #print "XXX last_caller", caller, "MOD", callee + #self._depgraph.setdefault(self._last_caller.__name__,{})[r.__name__] = 1 + #if caller in ('pdb', 'doctest') or callee in ('pdb', 'doctest'): + # print caller, "-->", callee + if caller != callee: + self._depgraph.setdefault(caller,{})[callee] = 1 + return m + + def find_module(self, name, path, parent=None): + if parent is not None: + # assert path is not None + fullname = parent.__name__+'.'+name + elif name == "__init__": + fullname = os.path.basename(path[0]) + else: + fullname = name + if self._last_caller: + caller = self._last_caller.__name__ + if fullname in excluded_imports.get(caller, []): + #self.msgout(3, "find_module -> Excluded", fullname) + raise ImportError(name) + + if fullname in self.excludes: + #self.msgout(3, "find_module -> Excluded", fullname) + raise ImportError(name) + + if path is None: + if name in sys.builtin_module_names: + return (None, None, ("", "", imp.C_BUILTIN)) + + path = self.path + return imp.find_module(name, path) + + def load_module(self, fqname, fp, pathname, file_info): + suffix, mode, type = file_info + m = modulefinder.ModuleFinder.load_module(self, fqname, + fp, pathname, file_info) + if m is not None: + self._types[m.__name__] = type + return m + + def load_package(self, fqname, pathname): + m = modulefinder.ModuleFinder.load_package(self, fqname,pathname) + if m is not None: + self._types[m.__name__] = imp.PKG_DIRECTORY + return m + +def reduce_depgraph(dg): + pass + +# guarded imports, which don't need to be included in python-minimal +excluded_imports = { + 'argparse': set(('gettext',)), + 'codecs': set(('encodings',)), + 'collections': set(('cPickle', 'pickle', 'doctest')), + 'copy': set(('reprlib',)), + #'functools': set(('_dummy_thread',)), + 'hashlib': set(('logging', '_hashlib')), + #'hashlib': set(('_hashlib', '_md5', '_sha', '_sha256','_sha512',)), + 'heapq': set(('doctest',)), + #'io': set(('_dummy_thread',)), + 'logging': set(('multiprocessing',)), + 'os': set(('nt', 'ntpath', 'os2', 'os2emxpath', 'mac', 'macpath', + 'riscos', 'riscospath', 'riscosenviron')), + 'optparse': set(('gettext',)), + 'pickle': set(('argparse', 'doctest', 'pprint')), + 'platform': set(('plistlib', 'tempfile')), + 'reprlib': set(('_dummy_thread',)), + #'socket': set(('_ssl',)), + '_sitebuiltins': set(('pydoc',)), + 'subprocess': set(('dummy_threading',)), + 'sysconfig': set(('pprint','_osx_support')), + 'tempfile': set(('_dummy_thread', 'shutil')), + } + +def main(argv): + # Parse command line + import getopt + try: + opts, args = getopt.getopt(sys.argv[1:], "dmp:qx:") + except getopt.error as msg: + print(msg) + return + + # Process options + debug = 1 + domods = 0 + addpath = [] + exclude = [] + for o, a in opts: + if o == '-d': + debug = debug + 1 + if o == '-m': + domods = 1 + if o == '-p': + addpath = addpath + a.split(os.pathsep) + if o == '-q': + debug = 0 + if o == '-x': + exclude.append(a) + + path = sys.path[:] + path = addpath + path + + if debug > 1: + print(("version:", sys.version)) + print("path:") + for item in path: + print((" ", repr(item))) + + #exclude = ['__builtin__', 'sys', 'os'] + exclude = [] + mf = mymf(path, debug, exclude) + for arg in args: + mf.run_script(arg) + + depgraph = reduce_depgraph(mf._depgraph) + + pprint.pprint({'depgraph':mf._depgraph, 'types':mf._types}) + +if __name__=='__main__': + main(sys.argv[1:]) --- python3.4-3.4.1.orig/debian/pysetup3.1 +++ python3.4-3.4.1/debian/pysetup3.1 @@ -0,0 +1,42 @@ +.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.40.4. +.TH PYSETUP3.3 "1" "January 2012" "pysetup3.3 3.3" "User Commands" +.SH NAME +pysetup3.3 \- pysetup tool +.SH SYNOPSIS +.B pysetup +[\fIoptions\fR] \fIaction \fR[\fIaction_options\fR] +.SH DESCRIPTION +.SS "Actions:" +.IP +run: Run one or several commands +metadata: Display the metadata of a project +install: Install a project +remove: Remove a project +search: Search for a project in the indexes +list: List installed projects +graph: Display a graph +create: Create a project +generate\-setup: Generate a backward\-compatible setup.py +.PP +To get more help on an action, use: +.IP +pysetup action \fB\-\-help\fR +.SS "Global options:" +.TP +\fB\-\-verbose\fR (\fB\-v\fR) +run verbosely (default) +.TP +\fB\-\-quiet\fR (\fB\-q\fR) +run quietly (turns verbosity off) +.TP +\fB\-\-dry\-run\fR (\fB\-n\fR) +don't actually do anything +.TP +\fB\-\-help\fR (\fB\-h\fR) +show detailed help message +.TP +\fB\-\-no\-user\-cfg\fR +ignore pydistutils.cfg in your home directory +.TP +\fB\-\-version\fR +Display the version --- python3.4-3.4.1.orig/debian/python3-config.1 +++ python3.4-3.4.1/debian/python3-config.1 @@ -0,0 +1,102 @@ +.TH PYTHON\-CONFIG 1 "November 27, 2011" +.SH NAME +python\-config \- output build options for python C/C++ extensions or embedding +.SH SYNOPSIS +.BI "python\-config" +[ +.BI "\-\-prefix" +] +[ +.BI "\-\-exec\-prefix" +] +[ +.BI "\-\-includes" +] +[ +.BI "\-\-libs" +] +[ +.BI "\-\-cflags" +] +[ +.BI "\-\-ldflags" +] +[ +.BI "\-\-extension\-suffix" +] +[ +.BI "\-\-abiflags" +] +[ +.BI "\-\-help" +] +.SH DESCRIPTION +.B python\-config +helps compiling and linking programs, which embed the Python interpreter, or +extension modules that can be loaded dynamically (at run time) into +the interpreter. +.SH OPTIONS +.TP +.BI "\-\-abiflags" +print the the ABI flags as specified by PEP 3149. +.TP +.BI "\-\-cflags" +print the C compiler flags. +.TP +.BI "\-\-ldflags" +print the flags that should be passed to the linker. +.TP +.BI "\-\-includes" +similar to \fI\-\-cflags\fP but only with \-I options (path to python header files). +.TP +.BI "\-\-libs" +similar to \fI\-\-ldflags\fP but only with \-l options (used libraries). +.TP +.BI "\-\-prefix" +prints the prefix (base directory) under which python can be found. +.TP +.BI "\-\-exec\-prefix" +print the prefix used for executable program directories (such as bin, sbin, etc). +.TP +.BI "\-\-extension\-suffix" +print the extension suffix used for binary extensions. +.TP +.BI "\-\-help" +print the usage message. +.PP + +.SH EXAMPLES +To build the singe\-file c program \fIprog\fP against the python library, use +.PP +.RS +gcc $(python\-config \-\-cflags \-\-ldflags) progr.cpp \-o progr.cpp +.RE +.PP +The same in a makefile: +.PP +.RS +CFLAGS+=$(shell python\-config \-\-cflags) +.RE +.RS +LDFLAGS+=$(shell python\-config \-\-ldflags) +.RE +.RS +all: progr +.RE + +To build a dynamically loadable python module, use +.PP +.RS +gcc $(python\-config \-\-cflags \-\-ldflags) \-shared \-fPIC progr.cpp \-o progr.so +.RE + +.SH "SEE ALSO" +python (1) +.br +http://docs.python.org/extending/extending.html +.br +/usr/share/doc/python/faq/extending.html + +.SH AUTHORS +This manual page was written by Johann Felix Soden +for the Debian project (and may be used by others). --- python3.4-3.4.1.orig/debian/pyvenv3.1 +++ python3.4-3.4.1/debian/pyvenv3.1 @@ -0,0 +1,34 @@ +.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.40.10. +.TH PYVENV-3.3 "1" "June 2012" "pyvenv-3.3 3.3" "User Commands" +.SH NAME +pyvenv-3.3 \- create virtual python environments +.SH DESCRIPTION +usage: venv [\-h] [\-\-system\-site\-packages] [\-\-symlinks] [\-\-clear] [\-\-upgrade] +.IP +ENV_DIR [ENV_DIR ...] +.PP +Creates virtual Python environments in one or more target directories. +.SS "positional arguments:" +.TP +ENV_DIR +A directory to create the environment in. +.SS "optional arguments:" +.TP +\fB\-h\fR, \fB\-\-help\fR +show this help message and exit +.TP +\fB\-\-system\-site\-packages\fR +Give the virtual environment access to the system +site\-packages dir. +.TP +\fB\-\-symlinks\fR +Attempt to symlink rather than copy. +.TP +\fB\-\-clear\fR +Delete the environment directory if it already exists. +If not specified and the directory exists, an error is +raised. +.TP +\fB\-\-upgrade\fR +Upgrade the environment directory to use this version +of Python, assuming Python has been upgraded in\-place. --- python3.4-3.4.1.orig/debian/rules +++ python3.4-3.4.1/debian/rules @@ -0,0 +1,1435 @@ +#!/usr/bin/make -f + +unexport LANG LC_ALL LC_CTYPE LC_COLLATE LC_TIME LC_NUMERIC LC_MESSAGES +unexport CFLAGS CXXFLAGS LDFLAGS CPPFLAGS + +export SHELL = /bin/bash + +# Uncomment this to turn on verbose mode. +#export DH_VERBOSE=1 + +vafilt = $(subst $(2)=,,$(filter $(2)=%,$(1))) +DPKG_VARS := $(shell dpkg-architecture) +DEB_BUILD_ARCH ?= $(call vafilt,$(DPKG_VARS),DEB_BUILD_ARCH) +DEB_BUILD_GNU_TYPE ?= $(call vafilt,$(DPKG_VARS),DEB_BUILD_GNU_TYPE) +DEB_HOST_ARCH ?= $(call vafilt,$(DPKG_VARS),DEB_HOST_ARCH) +DEB_HOST_ARCH_ENDIAN ?= $(call vafilt,$(DPKG_VARS),DEB_HOST_ARCH_ENDIAN) +DEB_HOST_ARCH_OS ?= $(call vafilt,$(DPKG_VARS),DEB_HOST_ARCH_OS) +DEB_HOST_GNU_TYPE ?= $(call vafilt,$(DPKG_VARS),DEB_HOST_GNU_TYPE) +DEB_HOST_MULTIARCH ?= $(call vafilt,$(DPKG_VARS),DEB_HOST_MULTIARCH) + +CHANGELOG_VARS := $(shell dpkg-parsechangelog | \ + sed -n 's/ /_/g;/^[^_]/s/^\([^:]*\):_\(.*\)/\1=\2/p') +PKGSOURCE := $(call vafilt,$(CHANGELOG_VARS),Source) +PKGVERSION := $(call vafilt,$(CHANGELOG_VARS),Version) + +on_buildd := $(shell [ -f /CurrentlyBuilding -o "$$LOGNAME" = buildd -o "$$USER" = buildd ] && echo yes) + +ifneq (,$(findstring nocheck, $(DEB_BUILD_OPTIONS))) + WITHOUT_CHECK := yes +endif +WITHOUT_BENCH := +ifneq (,$(findstring nobench, $(DEB_BUILD_OPTIONS))) + WITHOUT_BENCH := yes +endif +ifeq ($(on_buildd),yes) + ifneq (,$(filter $(DEB_HOST_ARCH), armel hppa mips mipsel mips64 mips64el s390 hurd-i386 kfreebsd-amd64 kfreebsd-i386)) + WITHOUT_CHECK := yes + endif + ifneq (,$(filter $(DEB_HOST_ARCH), armel hppa mips mipsel mips64 mips64el s390 hurd-i386 kfreebsd-amd64 kfreebsd-i386)) + WITHOUT_BENCH := yes + WITHOUT_STONE := yes + endif +endif +ifneq ($(DEB_HOST_GNU_TYPE),$(DEB_BUILD_GNU_TYPE)) + WITHOUT_BENCH := yes + WITHOUT_CHECK := yes + WITHOUT_STONE := yes +endif + +COMMA = , +ifneq (,$(filter parallel=%,$(subst $(COMMA), ,$(DEB_BUILD_OPTIONS)))) + NJOBS := -j $(subst parallel=,,$(filter parallel=%,$(subst $(COMMA), ,$(DEB_BUILD_OPTIONS)))) +endif + +distribution := $(shell lsb_release -is) +distrelease := $(shell lsb_release -cs) + +VER=3.4 +SVER=3.4~b1 +NVER=3.5 +PVER=python3.4 +PRIORITY=$(shell echo $(VER) | tr -d '.')0 + +PREVVER := $(shell awk '/^python/ && NR > 1 {print substr($$2,2,length($$2)-2); exit}' debian/changelog) + +# default versions are built from the python-defaults source package +# keep the definition to adjust package priorities. +DEFAULT_VERSION = no +STATIC_PYTHON=yes + +MIN_MODS := $(shell awk '/^ / && $$2 == "module" { print $$1 }' \ + debian/PVER-minimal.README.Debian.in) +MIN_EXTS := $(shell awk '/^ / && $$2 ~ /^extension/ { print $$1 }' \ + debian/PVER-minimal.README.Debian.in) +MIN_BUILTINS := $(shell awk '/^ / && $$2 == "builtin" { print $$1 }' \ + debian/PVER-minimal.README.Debian.in) +MIN_PACKAGES := $(shell awk '/^ / && $$2 == "package" { print $$1 }' \ + debian/PVER-minimal.README.Debian.in) +MIN_ENCODINGS := $(foreach i, \ + $(filter-out \ + big5% bz2% cp932.py cp949.py cp950.py euc_% \ + gb% iso2022% johab.py shift_jis% , \ + $(shell cd Lib/encodings && echo *.py)), \ + encodings/$(i)) \ + codecs.py stringprep.py + +with_tk := no +with_interp := static +#with_interp := shared + +PY_INTERPRETER = /usr/bin/python$(VER) + +ifeq ($(DEFAULT_VERSION),yes) + PY_PRIO = standard + #PYSTDDEP = , python (>= $(VER)) +else + PY_PRIO = optional +endif +ifeq ($(distribution),Ubuntu) + PY_MINPRIO = required + PY_MINPRIO = optional + with_fpectl = yes + #with_udeb = yes +else + PY_MINPRIO = $(PY_PRIO) + with_fpectl = yes +endif +ifeq (,$(filter $(distrelease),lenny etch squeeze wheezy lucid maverick natty oneiric)) + bd_qual = :any +endif +ifeq (,$(filter $(distrelease),lenny etch squeeze wheezy lucid maverick natty oneiric)) + ma_filter = cat +else + ma_filter = grep -v '^Multi-Arch:' +endif +ifneq (,$(filter $(distrelease),sid experimental)) + bd_gcc = gcc (>= 4:4.9.1-1), +endif +ifeq (,$(filter $(distrelease),lenny etch squeeze wheezy lucid maverick natty oneiric precise quantal raring saucy trusty)) + bd_dpkgdev = dpkg-dev (>= 1.17.11), +endif + +CC=$(DEB_HOST_GNU_TYPE)-gcc +CXX=$(DEB_HOST_GNU_TYPE)-g++ + +AR=$(DEB_HOST_GNU_TYPE)-ar +RANLIB=$(DEB_HOST_GNU_TYPE)-ranlib + +DPKG_CPPFLAGS:= $(shell dpkg-buildflags --get CPPFLAGS) +DPKG_CFLAGS := $(shell dpkg-buildflags --get CFLAGS) +DPKG_LDFLAGS := $(shell dpkg-buildflags --get LDFLAGS) +OPT_CFLAGS := $(filter-out -O%,$(DPKG_CFLAGS)) # default is -O3 +DEBUG_CFLAGS := $(patsubst -O%,-O0,$(DPKG_CFLAGS)) + +# on alpha, use -O2 only, use -mieee +ifeq ($(DEB_HOST_ARCH),alpha) + OPT_CFLAGS += -mieee + DEBUG_CFLAGS += -mieee + EXTRA_OPT_FLAGS += -O2 +endif +ifeq ($(DEB_HOST_ARCH),m68k) + EXTRA_OPT_FLAGS += -O2 +endif + +ifeq ($(DEB_HOST_GNU_TYPE),$(DEB_BUILD_GNU_TYPE)) + ifeq ($(DEB_HOST_ARCH_OS),linux) + ifneq (,$(findstring $(DEB_HOST_ARCH), amd64 armel armhf i386 powerpc ppc64 ppc64el)) + with_pgo := yes + endif + endif +endif + +ifneq (,$(findstring $(DEB_HOST_ARCH), amd64 armel armhf i386 powerpc ppc64 ppc64el)) + with_lto := yes +endif + +ifneq (,$(findstring noopt, $(DEB_BUILD_OPTIONS))) + OPT_CFLAGS := $(filter-out -O%, $(OPT_CFLAGS)) + EXTRA_OPT_CFLAGS = -O0 + with_pgo = + with_lto = +endif + +ifeq ($(with_lto),yes) + LTO_CFLAGS = -g -flto -fuse-linker-plugin + with_fat_lto := $(shell dpkg --compare-versions $$($(CC) --version \ + | sed -n '/^$(CC)/s,.* ,,p') ge 4.9 && echo yes) + ifeq ($(with_fat_lto),yes) + LTO_CFLAGS += -ffat-lto-objects + endif + EXTRA_OPT_CFLAGS += $(LTO_CFLAGS) + AR=$(DEB_HOST_GNU_TYPE)-gcc-ar + RANLIB=$(DEB_HOST_GNU_TYPE)-gcc-ranlib +endif + +make_build_target = $(if $(with_pgo),profile-opt) + +buildd_static := $(CURDIR)/build-static +buildd_shared := $(CURDIR)/build-shared +buildd_debug := $(CURDIR)/build-debug +buildd_shdebug := $(CURDIR)/build-shdebug + +d := debian/tmp +scriptdir = usr/share/lib/python$(VER) +scriptdir = usr/share/python$(VER) +scriptdir = usr/lib/python$(VER) + +# package names and directories +p_base := $(PVER) +p_min := $(PVER)-minimal +p_lib := lib$(PVER) +p_tk := $(PVER)-tk +p_dev := $(PVER)-dev +p_exam := $(PVER)-examples +p_idle := idle-$(PVER) +p_doc := $(PVER)-doc +p_dbg := $(PVER)-dbg +p_udeb := $(PVER)-udeb +p_venv := $(PVER)-venv + +p_lbase := lib$(PVER)-stdlib +p_lmin := lib$(PVER)-minimal +p_ldev := lib$(PVER)-dev +p_ldbg := lib$(PVER)-dbg +p_ltst := lib$(PVER)-testsuite + +d_base := debian/$(p_base) +d_min := debian/$(p_min) +d_lib := debian/$(p_lib) +d_tk := debian/$(p_tk) +d_dev := debian/$(p_dev) +d_exam := debian/$(p_exam) +d_idle := debian/$(p_idle) +d_doc := debian/$(p_doc) +d_dbg := debian/$(p_dbg) +d_udeb := debian/$(p_udeb) +d_venv := debian/$(p_venv) + +d_lbase := debian/$(p_lbase) +d_lmin := debian/$(p_lmin) +d_ldev := debian/$(p_ldev) +d_ldbg := debian/$(p_ldbg) +d_ltst := debian/$(p_ltst) + +build-arch: stamps/stamp-build +build-indep: stamps/stamp-build-doc +build: build-arch +stamps/stamp-build: stamps/stamp-build-static stamps/stamp-mincheck \ + stamps/stamp-build-shared stamps/stamp-build-debug \ + stamps/stamp-build-shared-debug \ + stamps/stamp-check stamps/stamp-pystone stamps/stamp-pybench + touch $@ + +PROFILE_EXCLUDES = test_compiler test_distutils test_subprocess \ + test_multiprocessing test_socketserver \ + test_thread test_threaded_import test_threadedtempfile \ + test_threading test_threading_local test_threadsignals \ + test_concurrent_futures test_ctypes \ + test_dbm_dumb test_dbm_ndbm test_pydoc test_sundry \ + test_signal test_ioctl test_gdb test_ensurepip test_venv + +# FIXME: these fail in the profile build +PROFILE_EXCLUDES += \ + test_cmd_line_script test_zipimport_support + +# FIXME: update profiled-build.diff to support --next +# --next=20 +PROFILE_TASK = ../Lib/test/regrtest.py \ + -s \ + -j 1 -unone,decimal \ + -x $(sort $(TEST_EXCLUDES) $(PROFILE_EXCLUDES)) + +stamps/stamp-build-static: stamps/stamp-configure-static + dh_testdir + $(MAKE) $(NJOBS) -C $(buildd_static) \ + EXTRA_CFLAGS="$(EXTRA_OPT_CFLAGS)" \ + PROFILE_TASK='$(PROFILE_TASK)' $(make_build_target) + + : # check that things are correctly built +ifeq ($(DEB_HOST_GNU_TYPE),$(DEB_BUILD_GNU_TYPE)) + ifneq (,$(filter $(DEB_HOST_ARCH_OS), linux)) + cd $(buildd_static) && ./python -c 'from _multiprocessing import SemLock' + endif +endif + + touch stamps/stamp-build-static + +run-profile-task: + $(MAKE) -C $(buildd_static) \ + PROFILE_TASK='$(PROFILE_TASK)' run_profile_task + +stamps/stamp-build-shared: stamps/stamp-configure-shared + dh_testdir + $(MAKE) $(NJOBS) -C $(buildd_shared) \ + EXTRA_CFLAGS="$(EXTRA_OPT_CFLAGS)" + : # build a static library with PIC objects + $(MAKE) $(NJOBS) -C $(buildd_shared) \ + EXTRA_CFLAGS="$(EXTRA_OPT_CFLAGS)" \ + LIBRARY=libpython$(VER)m-pic.a libpython$(VER)m-pic.a + touch stamps/stamp-build-shared + +stamps/stamp-build-debug: stamps/stamp-configure-debug + dh_testdir + $(MAKE) $(NJOBS) -C $(buildd_debug) \ + EXTRA_CFLAGS="$(DEBUG_CFLAGS)" + touch stamps/stamp-build-debug + +stamps/stamp-build-shared-debug: stamps/stamp-configure-shared-debug + dh_testdir + : # build the shared debug library + $(MAKE) $(NJOBS) -C $(buildd_shdebug) \ + EXTRA_CFLAGS="$(DEBUG_CFLAGS)" \ + libpython$(VER)dm.so pybuilddir.txt + touch stamps/stamp-build-shared-debug + +common_configure_args = \ + --prefix=/usr \ + --enable-ipv6 \ + --enable-loadable-sqlite-extensions \ + --with-dbmliborder=bdb:gdbm \ + --with-computed-gotos \ + --without-ensurepip \ + --with-system-expat \ + --with-system-libmpdec \ + +ifneq (,$(filter $(DEB_HOST_ARCH), avr32 or1k)) + common_configure_args += --without-ffi +else + common_configure_args += --with-system-ffi +endif + +ifeq ($(with_fpectl),yes) + common_configure_args += \ + --with-fpectl +endif + +ifneq ($(DEB_HOST_GNU_TYPE),$(DEB_BUILD_GNU_TYPE)) + common_configure_args += --host=$(DEB_HOST_GNU_TYPE) --build=$(DEB_BUILD_GNU_TYPE) + config_site = ac_cv_file__dev_ptmx=yes ac_cv_file__dev_ptc=yes + ifeq (,$(filter $(DEB_HOST_ARCH),arm m68k)) + ifeq ($(DEB_HOST_ARCH_ENDIAN),little) + config_site += ac_cv_little_endian_double=yes + else + config_site += ac_cv_big_endian_double=yes + endif + endif +endif + +stamps/stamp-configure-shared: stamps/stamp-patch + rm -rf $(buildd_shared) + mkdir -p $(buildd_shared) + cd $(buildd_shared) && \ + CC="$(CC)" CXX="$(CXX)" AR="$(AR)" RANLIB="$(RANLIB)" CFLAGS="$(OPT_CFLAGS)" \ + CPPFLAGS="$(DPKG_CPPFLAGS)" LDFLAGS="$(DPKG_LDFLAGS)" \ + $(config_site) \ + ../configure \ + --enable-shared \ + $(common_configure_args) + + $(call __post_configure,$(buildd_shared)) + + @echo XXXXXXX pyconfig.h + -cat $(buildd_shared)/pyconfig.h + + touch $@ + +stamps/stamp-configure-static: stamps/stamp-patch + rm -rf $(buildd_static) + mkdir -p $(buildd_static) + cd $(buildd_static) && \ + CC="$(CC)" CXX="$(CXX)" AR="$(AR)" RANLIB="$(RANLIB)" CFLAGS="$(OPT_CFLAGS)" \ + CPPFLAGS="$(DPKG_CPPFLAGS)" LDFLAGS="$(DPKG_LDFLAGS)" \ + $(config_site) \ + ../configure \ + $(common_configure_args) + + $(call __post_configure,$(buildd_static)) + touch $@ + +stamps/stamp-configure-debug: stamps/stamp-patch + rm -rf $(buildd_debug) + mkdir -p $(buildd_debug) + cd $(buildd_debug) && \ + CC="$(CC)" CXX="$(CXX)" AR="$(AR)" RANLIB="$(RANLIB)" CFLAGS="$(DEBUG_CFLAGS)" \ + CPPFLAGS="$(DPKG_CPPFLAGS)" LDFLAGS="$(DPKG_LDFLAGS)" \ + $(config_site) \ + ../configure \ + $(common_configure_args) \ + --with-pydebug + + $(call __post_configure,$(buildd_debug)) + touch $@ + +stamps/stamp-configure-shared-debug: stamps/stamp-patch + rm -rf $(buildd_shdebug) + mkdir -p $(buildd_shdebug) + cd $(buildd_shdebug) && \ + CC="$(CC)" CXX="$(CXX)" AR="$(AR)" RANLIB="$(RANLIB)" CFLAGS="$(DEBUG_CFLAGS)" \ + CPPFLAGS="$(DPKG_CPPFLAGS)" LDFLAGS="$(DPKG_LDFLAGS)" \ + $(config_site) \ + ../configure \ + $(common_configure_args) \ + --enable-shared \ + --with-pydebug + + $(call __post_configure,$(buildd_shdebug)) + touch $@ + +define __post_configure + egrep \ + "^#($$(awk -v ORS='|' '$$2 ~ /^extension$$/ {print $$1}' debian/PVER-minimal.README.Debian.in)XX)" \ + Modules/Setup.dist \ + | sed -e 's/^#//' -e 's/-Wl,-Bdynamic//;s/-Wl,-Bstatic//' \ + >> $(1)/Modules/Setup.local + + : # unconditionally run makesetup + cd $(1) && \ + ../Modules/makesetup -c ../Modules/config.c.in -s Modules \ + Modules/Setup.config Modules/Setup.local Modules/Setup + mv $(1)/config.c $(1)/Modules/ + + : # and fix the timestamps + $(MAKE) -C $(1) Makefile Modules/config.c +endef + +stamps/stamp-mincheck: stamps/stamp-build-static debian/PVER-minimal.README.Debian.in +ifeq ($(DEB_HOST_GNU_TYPE),$(DEB_BUILD_GNU_TYPE)) + for m in $(MIN_MODS) $(MIN_PACKAGES) $(MIN_EXTS) $(MIN_BUILTINS); do \ + echo "import $$m"; \ + done > $(buildd_static)/minmods.py + cd $(buildd_static) && ./python ../debian/pymindeps.py minmods.py \ + > mindeps.txt + -if [ -x /usr/bin/dot ]; then \ + cd $(buildd_static) && ./python ../debian/depgraph.py \ + < mindeps.txt > mindeps.dot; \ + dot -Tpng -o mindeps.png mindeps.dot; \ + else true; fi + cd $(buildd_static) && ./python ../debian/mincheck.py \ + minmods.py mindeps.txt +endif + touch stamps/stamp-mincheck + +TEST_RESOURCES = all +ifeq ($(on_buildd),yes) + TEST_RESOURCES := $(TEST_RESOURCES),-network,-urlfetch +endif +TESTOPTS = -j 1 -w -u$(TEST_RESOURCES) +TEST_EXCLUDES = +TEST_EXCLUDES += test_ensurepip test_venv +ifeq ($(on_buildd),yes) + TEST_EXCLUDES += test_tcl test_codecmaps_cn test_codecmaps_hk \ + test_codecmaps_jp test_codecmaps_kr test_codecmaps_tw \ + test_normalization test_ossaudiodev +endif +ifeq (,$(wildcard /dev/dsp)) + TEST_EXCLUDES += test_linuxaudiodev test_ossaudiodev +endif +ifneq (,$(filter $(DEB_HOST_ARCH), hppa)) + TEST_EXCLUDES += test_fork1 test_multiprocessing test_socketserver test_threading test_wait3 test_wait4 test_gdb +endif +# hangs on Aarch64, see LP: #1264354 +ifneq (,$(filter $(DEB_HOST_ARCH),arm64)) + TEST_EXCLUDES += test_faulthandler +endif +ifneq (,$(filter $(DEB_HOST_ARCH), arm avr32)) + TEST_EXCLUDES += test_ctypes +endif +ifneq (,$(filter $(DEB_HOST_ARCH), arm armel avr32 m68k)) + ifeq ($(on_buildd),yes) + TEST_EXCLUDES += test_compiler + endif +endif +ifneq (,$(filter $(DEB_HOST_ARCH), sparc sparc64)) + TEST_EXCLUDES += test_gdb +endif + +# FIXME: re-enable once fixed, see #708652 +ifneq (,$(filter $(DEB_HOST_ARCH_OS), hurd)) + TEST_EXCLUDES += test_asyncore test_curses test_exceptions \ + test_faulthandler test_imaplib test_io test_logging test_mmap \ + test_random test_signal test_socket test_socketserver test_ssl \ + test_threading test_pydoc test_runpy test_telnetlib test_tk +endif + +# FIXME: re-enable once fixed, see #708653 +ifneq (,$(filter $(DEB_HOST_ARCH_OS), kfreebsd)) + TEST_EXCLUDES += test_io test_signal test_socket test_socketserver \ + test_threading test_threadsignals test_threaded_import \ + test_time test_pty test_curses +endif + +# for debug builds only +TEST_EXCLUDES += test_gdb + +ifneq (,$(TEST_EXCLUDES)) + TESTOPTS += -x $(sort $(TEST_EXCLUDES)) +endif + +ifneq (,$(wildcard /usr/bin/localedef)) + SET_LOCPATH = LOCPATH=$(CURDIR)/locales +endif + +stamps/stamp-check: +ifeq ($(WITHOUT_CHECK),yes) + echo "check run disabled for this build" > $(buildd_static)/test_results +else + : # build locales needed by the testsuite + rm -rf locales + mkdir locales + if which localedef >/dev/null 2>&1; then \ + sh debian/locale-gen; \ + fi + + @echo ========== test environment ============ + @env + @echo ======================================== + + ifeq (,$(findstring $(DEB_HOST_ARCH), alpha)) + ( \ + echo '#! /bin/sh'; \ + echo 'set -x'; \ + echo 'export $(SET_LOCPATH)'; \ + echo '$(buildd_static)/python $(CURDIR)/debian/script.py test_results '\''make test TESTOPTS="$(filter-out test_gdb,$(TESTOPTS))"'\'; \ + echo 'echo DONE'; \ + ) > $(buildd_debug)/run_tests + chmod 755 $(buildd_debug)/run_tests + @echo "BEGIN test debug" + -tmphome=$$(mktemp -d); export HOME=$$tmphome; \ + cd $(buildd_debug) && time xvfb-run -a -e xvfb-run.log ./run_tests; \ + rm -rf $$tmphome + @echo "END test debug" + endif + + ( \ + echo '#! /bin/sh'; \ + echo 'set -x'; \ + echo 'export $(SET_LOCPATH)'; \ + echo '$(buildd_static)/python $(CURDIR)/debian/script.py test_results '\''make test EXTRA_CFLAGS="$(EXTRA_OPT_CFLAGS)" TESTOPTS="$(TESTOPTS)"'\'; \ + echo 'echo DONE'; \ + ) > $(buildd_static)/run_tests + chmod 755 $(buildd_static)/run_tests + @echo "BEGIN test static" + -tmphome=$$(mktemp -d); export HOME=$$tmphome; \ + cd $(buildd_static) && time xvfb-run -a -e xvfb-run.log ./run_tests; \ + rm -rf $$tmphome + @echo "END test static" + + ( \ + echo '#! /bin/sh'; \ + echo 'set -x'; \ + echo 'export $(SET_LOCPATH)'; \ + echo '$(buildd_static)/python $(CURDIR)/debian/script.py test_results '\''make test EXTRA_CFLAGS="$(EXTRA_OPT_CFLAGS)" TESTOPTS="$(TESTOPTS)"'\'; \ + echo 'echo DONE'; \ + ) > $(buildd_shared)/run_tests + chmod 755 $(buildd_shared)/run_tests + @echo "BEGIN test shared" + -tmphome=$$(mktemp -d); export HOME=$$tmphome; \ + cd $(buildd_shared) && time xvfb-run -a -e xvfb-run.log ./run_tests; \ + rm -rf $$tmphome + @echo "END test shared" +endif + cp -p $(buildd_static)/test_results debian/ + touch stamps/stamp-check + +stamps/stamp-pystone: +ifeq ($(WITHOUT_STONE),yes) + @echo "pystone run disabled for this build" +else + @echo "BEGIN pystone static" + cd $(buildd_static) && ./python ../Lib/test/pystone.py + cd $(buildd_static) && ./python ../Lib/test/pystone.py + @echo "END pystone static" + @echo "BEGIN pystone shared" + cd $(buildd_shared) \ + && LD_LIBRARY_PATH=. ./python ../Lib/test/pystone.py + cd $(buildd_shared) \ + && LD_LIBRARY_PATH=. ./python ../Lib/test/pystone.py + @echo "END pystone shared" + @echo "BEGIN pystone debug" + cd $(buildd_debug) && ./python ../Lib/test/pystone.py + cd $(buildd_debug) && ./python ../Lib/test/pystone.py + @echo "END pystone debug" +endif + touch stamps/stamp-pystone + +stamps/stamp-pybench: + echo "pybench run disabled for this build" > $(buildd_static)/pybench.log + +#ifeq (,$(filter $(DEB_HOST_ARCH), arm armel avr32 hppa mips mipsel mips64 mips64el m68k)) + pybench_options = -C 2 -n 5 -w 4 +#endif + +stamps/stamp-pybenchx: +ifeq ($(WITHOUT_BENCH),yes) + echo "pybench run disabled for this build" > $(buildd_static)/pybench.log +else + @echo "BEGIN pybench static" + cd $(buildd_static) \ + && time ./python ../Tools/pybench/pybench.py -f run1.pybench $(pybench_options) + cd $(buildd_static) \ + && ./python ../Tools/pybench/pybench.py -f run2.pybench -c run1.pybench $(pybench_options) + @echo "END pybench static" + @echo "BEGIN pybench shared" + cd $(buildd_shared) \ + && LD_LIBRARY_PATH=. ./python ../Tools/pybench/pybench.py -f run1.pybench $(pybench_options) + cd $(buildd_shared) \ + && LD_LIBRARY_PATH=. ./python ../Tools/pybench/pybench.py -f run2.pybench -c run1.pybench $(pybench_options) + @echo "END pybench shared" + @echo "BEGIN shared/static comparision" + $(buildd_static)/python Tools/pybench/pybench.py \ + -s $(buildd_static)/run2.pybench -c $(buildd_shared)/run2.pybench \ + | tee $(buildd_static)/pybench.log + @echo "END shared/static comparision" +endif + touch stamps/stamp-pybench + +minimal-test: + rm -rf mintest + mkdir -p mintest/lib mintest/dynlib mintest/testlib mintest/all-lib + cp -p $(buildd_static)/python mintest/ + cp -p $(foreach i,$(MIN_MODS),Lib/$(i).py) \ + mintest/lib/ + cp -a $(foreach i,$(MIN_PACKAGES),Lib/$(i)) \ + mintest/lib/ + cp -p $(wildcard $(foreach i,$(MIN_EXTS),$(buildd_static)/build/lib*/$(i).*.so)) \ + mintest/dynlib/ + cp -p Lib/unittest.py mintest/lib/ + cp -pr Lib/test mintest/lib/ + cp -pr Lib mintest/all-lib + cp -p $(buildd_static)/build/lib*/*.so mintest/all-lib/ + ( \ + echo "import sys"; \ + echo "sys.path = ["; \ + echo " '$(CURDIR)/mintest/lib',"; \ + echo " '$(CURDIR)/mintest/dynlib',"; \ + echo "]"; \ + cat Lib/test/regrtest.py; \ + ) > mintest/lib/test/mintest.py + cd mintest && ./python -E -S lib/test/mintest.py \ + -x test_codecencodings_cn test_codecencodings_hk \ + test_codecencodings_jp test_codecencodings_kr \ + test_codecencodings_tw test_codecs test_multibytecodec \ + +stamps/stamp-doc-html: + dh_testdir + $(MAKE) -C Doc html + touch stamps/stamp-doc-html + +build-doc: stamps/stamp-patch stamps/stamp-build-doc +stamps/stamp-build-doc: stamps/stamp-doc-html + touch stamps/stamp-build-doc + +control-file: + sed -e "s/@PVER@/$(PVER)/g" \ + -e "s/@VER@/$(VER)/g" \ + -e "s/@PYSTDDEP@/$(PYSTDDEP)/g" \ + -e "s/@PRIO@/$(PY_PRIO)/g" \ + -e "s/@MINPRIO@/$(PY_MINPRIO)/g" \ + -e "s/@bd_qual@/$(bd_qual)/g" \ + -e "s/@bd_gcc@/$(bd_gcc)/g" \ + -e "s/@bd_dpkgdev@/$(bd_dpkgdev)/g" \ + debian/control.in \ + $(if $(with_udeb),debian/control.udeb) \ + | $(ma_filter) \ + > debian/control.tmp +ifeq ($(distribution),Ubuntu) + ifneq (,$(findstring ubuntu, $(PKGVERSION))) + m='Ubuntu Core Developers '; \ + sed -i "/^Maintainer:/s/\(.*\)/Maintainer: $$m\nXSBC-Original-\1/" \ + debian/control.tmp + endif +endif + [ -e debian/control ] \ + && cmp -s debian/control debian/control.tmp \ + && rm -f debian/control.tmp && exit 0; \ + mv debian/control.tmp debian/control + + + +clean: control-file + dh_testdir + dh_testroot + $(MAKE) -f debian/rules unpatch + rm -rf stamps .pc + rm -f debian/test_results + + $(MAKE) -C Doc clean + sed 's/^@/#/' Makefile.pre.in | $(MAKE) -f - srcdir=. distclean + rm -rf $(buildd_static) $(buildd_shared) $(buildd_debug) $(buildd_shdebug) + find -name '*.py[co]' | xargs -r rm -f + rm -f Lib/lib2to3/*.pickle + rm -f Lib/dist-packages + rm -rf Lib/plat-$(DEB_HOST_MULTIARCH) + rm -rf locales + rm -rf $(d)-dbg + + for f in debian/*.in; do \ + f2=`echo $$f | sed "s,PVER,$(PVER),g;s/@VER@/$(VER)/g;s,\.in$$,,"`; \ + if [ $$f2 != debian/control ] && [ $$f2 != debian/source.lintian-overrides ]; then \ + rm -f $$f2; \ + fi; \ + done + + dh_clean + +stamps/stamp-control: + : # We have to prepare the various control files + + for f in debian/*.in; do \ + f2=`echo $$f | sed "s,PVER,$(PVER),g;s/@VER@/$(VER)/g;s,\.in$$,,"`; \ + if [ $$f2 != debian/control ]; then \ + sed -e "s/@PVER@/$(PVER)/g;s/@VER@/$(VER)/g;s/@SVER@/$(SVER)/g" \ + -e "s/@PRIORITY@/$(PRIORITY)/g" \ + -e "s,@SCRIPTDIR@,/$(scriptdir),g" \ + -e "s,@INFO@,$(info_docs),g" \ + -e "s,@HOST_QUAL@,:$(DEB_HOST_ARCH),g" \ + <$$f >$$f2; \ + fi; \ + done + +2to3-man: + help2man --no-info --version-string=$(VER) --no-discard-stderr \ + --name 'Python2 to Python3 converter' \ + 2to3-$(VER) > debian/2to3-3.1 + help2man --no-info --version-string=$(VER) --no-discard-stderr \ + --name 'pysetup tool' \ + pysetup$(VER) > debian/pysetup3.1 + help2man --no-info --version-string=$(VER) --no-discard-stderr \ + --name 'create virtual python environments' \ + pyvenv-$(VER) > debian/pyvenv3.1 + +install: build-arch stamps/stamp-install +stamps/stamp-install: stamps/stamp-build control-file stamps/stamp-control + dh_testdir + dh_testroot + dh_clean -k + dh_installdirs + + : # make install into tmp and subsequently move the files into + : # their packages' directories. + install -d $(d)/usr +ifeq ($(with_interp),static) + $(MAKE) -C $(buildd_static) install prefix=$(CURDIR)/$(d)/usr + sed -e '/^OPT/s,-O3,-O2,' \ + -e 's/$(LTO_CFLAGS)//g' \ + -e 's,^RUNSHARED *=.*,RUNSHARED=,' \ + -e '/BLDLIBRARY/s/-L\. //' \ + $(buildd_shared)/$(shell cat $(buildd_shared)/pybuilddir.txt)/_sysconfigdata.py \ + > $(d)/$(scriptdir)/_sysconfigdata.py +else + $(MAKE) -C $(buildd_shared) install prefix=$(CURDIR)/$(d)/usr +endif + mkdir -p $(d)/usr/include/$(DEB_HOST_MULTIARCH)/$(PVER)m + mv $(d)/usr/include/$(PVER)m/pyconfig.h \ + $(d)/usr/include/$(DEB_HOST_MULTIARCH)/$(PVER)m/. + rm -f $(d)/$(scriptdir)/lib-dynload/*.py + sed -i 's/ -O3 / -O2 /g;s/$(LTO_CFLAGS)//g;s/-fprofile-use *-fprofile-correction//g' \ + $(d)/$(scriptdir)/_sysconfigdata.py + mv $(d)/$(scriptdir)/_sysconfigdata.py \ + $(d)/$(scriptdir)/plat-$(DEB_HOST_MULTIARCH)/_sysconfigdata_m.py + cp -p debian/_sysconfigdata.py $(d)/$(scriptdir)/ + + -find $(d)/usr/lib/python$(VER) -name '*_failed*.so' + find $(d)/usr/lib/python$(VER) -name '*_failed*.so' | xargs -r rm -f + + for i in $(d)/$(scriptdir)/lib-dynload/*.so; do \ + b=$$(basename $$i .cpython-34m.so); \ + d=$${b}.cpython-34m-$(DEB_HOST_MULTIARCH).so; \ + mv $$i $(d)/$(scriptdir)/lib-dynload/$$d; \ + done + + mv $(d)/usr/lib/libpython*.a $(d)/usr/lib/$(DEB_HOST_MULTIARCH)/ + + mkdir -p $(d)/usr/lib/python3 + mv $(d)/usr/lib/python$(VER)/site-packages \ + $(d)/usr/lib/python3/dist-packages + rm -f $(d)/usr/lib/python3/dist-packages/README + + : # remove files, which are not packaged + rm -rf $(d)/usr/lib/python$(VER)/ctypes/macholib + rm -f $(d)/$(scriptdir)/plat-*/regen + rm -f $(d)/$(scriptdir)/lib2to3/*.pickle + rm -f $(d)/usr/share/man/man1/python3.1 + + : # cannot build it, zlib maintainer won't provide a mingw build + find $(d) -name 'wininst*.exe' | xargs -r rm -f + + : # fix some file permissions + chmod a-x $(d)/$(scriptdir)/{runpy,fractions,lib2to3/refactor,tkinter/tix}.py + chmod a-x $(d)/$(scriptdir)/test/test_pathlib.py + +# : # move manpages to new names +# if [ -d $(d)/usr/man/man1 ]; then \ +# mkdir -p $(d)/usr/share/man +# mv $(d)/usr/man/man1/* $(d)/usr/share/man/man1/; \ +# rm -rf $(d)/usr/man/; \ +# fi + + mkdir -p $(d)/usr/share/man/man1 + cp -p Misc/python.man $(d)/usr/share/man/man1/python$(VER).1 + ln -sf python$(VER).1 $(d)/usr/share/man/man1/python$(VER)m.1 + cp -p debian/pydoc.1 $(d)/usr/share/man/man1/pydoc$(VER).1 + + : # Symlinks to /usr/bin for some tools + ln -sf ../lib/python$(VER)/pdb.py $(d)/usr/bin/pdb$(VER) + cp -p debian/pdb.1 $(d)/usr/share/man/man1/pdb$(VER).1 + cp -p debian/2to3-3.1 $(d)/usr/share/man/man1/2to3-$(VER).1 + cp -p debian/pysetup3.1 $(d)/usr/share/man/man1/pysetup$(VER).1 + cp -p debian/pyvenv3.1 $(d)/usr/share/man/man1/pyvenv-$(VER).1 + + : # versioned install only + rm -f $(d)/usr/bin/{2to3,idle3,pydoc3,pysetup3,python3,python3-config} + rm -f $(d)/usr/lib/*/pkgconfig/python3.pc + + dh_installdirs -p$(p_lib) \ + usr/lib/$(DEB_HOST_MULTIARCH) \ + $(scriptdir)/config-$(VER)m-$(DEB_HOST_MULTIARCH) \ + usr/share/doc + : # install the shared library + cp -p $(buildd_shared)/libpython$(VER)m.so.1.0 \ + $(d_lib)/usr/lib/$(DEB_HOST_MULTIARCH)/ + dh_link -p$(p_lib) \ + /usr/lib/$(DEB_HOST_MULTIARCH)/libpython$(VER)m.so.1.0 \ + /usr/lib/$(DEB_HOST_MULTIARCH)/libpython$(VER)m.so.1 \ + /usr/lib/$(DEB_HOST_MULTIARCH)/libpython$(VER)m.so.1 \ + /$(scriptdir)/config-$(VER)m-$(DEB_HOST_MULTIARCH)/libpython$(VER)m.so \ + /usr/lib/$(DEB_HOST_MULTIARCH)/libpython$(VER)m.so.1 \ + /$(scriptdir)/config-$(VER)m-$(DEB_HOST_MULTIARCH)/libpython$(VER).so + + ln -sf $(p_base) $(d_lib)/usr/share/doc/$(p_lib) + + ln -sf libpython$(VER)m.so.1 $(d)/usr/lib/$(DEB_HOST_MULTIARCH)/libpython$(VER)m.so + +ifeq ($(with_interp),shared) + : # install the statically linked runtime + install -m755 $(buildd_static)/python $(d)/usr/bin/python$(VER)-static +endif + + cp -p Tools/i18n/pygettext.py $(d)/usr/bin/pygettext$(VER) + cp -p debian/pygettext.1 $(d)/usr/share/man/man1/pygettext$(VER).1 + + : # install the Makefile of the shared python build + sed -e '/^OPT/s,-O3,-O2,' \ + -e 's/$(LTO_CFLAGS)//g' \ + -e 's,^RUNSHARED *=.*,RUNSHARED=,' \ + -e '/BLDLIBRARY/s/-L\. //' \ + $(buildd_shared)/Makefile \ + > $(d)/$(scriptdir)/config-$(VER)m-$(DEB_HOST_MULTIARCH)/Makefile + + : # Move the minimal libraries into $(p_lmin). + dh_installdirs -p$(p_lmin) \ + etc/$(PVER) \ + usr/bin \ + usr/share/man/man1 \ + $(scriptdir)/lib-dynload + -cd $(d); for i in $(MIN_EXTS); do \ + test -e $(scriptdir)/lib-dynload/$$i.*.so \ + && echo $(scriptdir)/lib-dynload/$$i.*.so; \ + done + + DH_COMPAT=2 dh_movefiles -p$(p_lmin) --sourcedir=$(d) \ + $(foreach i,$(MIN_MODS),$(scriptdir)/$(i).py) \ + $(foreach i,$(MIN_PACKAGES),$(scriptdir)/$(i)) \ + $(foreach i,$(MIN_ENCODINGS),$(scriptdir)/$(i)) \ + $(scriptdir)/site.py \ + $(scriptdir)/_sysconfigdata.py \ + $(scriptdir)/plat-$(DEB_HOST_MULTIARCH)/_sysconfigdata_m.py \ + `cd $(d); for i in $(MIN_EXTS); do \ + test -e $(scriptdir)/lib-dynload/$$i.*.so \ + && echo $(scriptdir)/lib-dynload/$$i.*.so; \ + done` + ls -l $(d_lmin)/$(scriptdir)/lib-dynload/*.so + + : # Move the binary into $(p_min). + dh_installdirs -p$(p_min) \ + usr/bin \ + usr/share/man/man1 + DH_COMPAT=2 dh_movefiles -p$(p_min) --sourcedir=$(d) \ + usr/bin/python$(VER) \ + usr/bin/python$(VER)m \ + usr/share/man/man1/python$(VER).1 \ + usr/share/man/man1/python$(VER)m.1 + + rv=0; \ + for i in $(MIN_EXTS); do \ + if [ -f $(d)/$(scriptdir)/lib-dynload/$$i.so ]; then \ + echo >&2 "extension $$i not mentioned in Setup.dist"; \ + rv=1; \ + fi; \ + done; \ + exit $$rv; + + : # Install sitecustomize.py + cp -p debian/sitecustomize.py $(d_lmin)/etc/$(PVER)/ + dh_link -p$(p_lmin) \ + /etc/$(PVER)/sitecustomize.py /$(scriptdir)/sitecustomize.py + + : # Move the static library and the header files into $(p_dev). +# mv $(d)/usr/share/include/python$(VER)/* $(d)/usr/include/python$(VER)/. +# rm -rf $(d)/usr/share/include + + cp $(d)/usr/bin/$(PVER)m-config $(d)/usr/bin/$(DEB_HOST_MULTIARCH)-$(PVER)m-config + ln -sf $(DEB_HOST_MULTIARCH)-$(PVER)m-config $(d)/usr/bin/$(DEB_HOST_MULTIARCH)-$(PVER)-config + + dh_installdirs -p$(p_ldev) \ + usr/bin \ + $(scriptdir) \ + usr/include \ + usr/share/man/man1 + + DH_COMPAT=2 dh_movefiles -p$(p_ldev) --sourcedir=$(d) \ + usr/bin/$(DEB_HOST_MULTIARCH)-$(PVER)*-config \ + usr/lib/python$(VER)/config-$(VER)m-$(DEB_HOST_MULTIARCH) \ + usr/include \ + usr/lib/$(DEB_HOST_MULTIARCH)/libpython$(VER)m.{a,so} \ + usr/lib/$(DEB_HOST_MULTIARCH)/pkgconfig/python-$(VER)*.pc \ + usr/lib/python$(VER)/distutils/command/wininst-*.exe + + sed 's/@subdir@/$(PVER)m/;s/@header@/pyconfig.h/' \ + debian/multiarch.h.in > $(d_ldev)/usr/include/$(PVER)m/pyconfig.h + + sed -i '/^Cflags:/s,$$, -I$${includedir}/$(DEB_HOST_MULTIARCH)/python$(VER)m,' \ + $(d_ldev)/usr/lib/$(DEB_HOST_MULTIARCH)/pkgconfig/python-$(VER).pc + + dh_link -p$(p_ldev) \ + /usr/lib/$(PVER)/config-$(VER)m-$(DEB_HOST_MULTIARCH)/libpython$(VER)m.a \ + /usr/lib/$(DEB_HOST_MULTIARCH)/libpython$(VER)m.a + + cp -p $(buildd_shared)/libpython$(VER)m-pic.a \ + $(d_ldev)/usr/lib/python$(VER)/config-$(VER)m-$(DEB_HOST_MULTIARCH)/ + + : # symlinks for the "old" include directory name + ln -sf python$(VER)m $(d_ldev)/usr/include/python$(VER) + + dh_installdirs -p$(p_dev) \ + usr/share/doc/python$(VER) \ + usr/share/man/man1 \ + $(scriptdir) \ + $(scriptdir)/doc/html + cp -p Misc/HISTORY Misc/README.valgrind Misc/gdbinit \ + debian/README.maintainers \ + debian/test_results $(buildd_static)/pybench.log \ + $(d_dev)/usr/share/doc/python$(VER)/ + + DH_COMPAT=2 dh_movefiles -p$(p_dev) --sourcedir=$(d) \ + usr/bin/python$(VER)*-config + + : # in $(p_ldev), prefix python-config with triplets + cp -p debian/python3-config.1 \ + $(d_ldev)/usr/share/man/man1/$(DEB_HOST_MULTIARCH)-$(PVER)m-config.1 + ln -sf $(DEB_HOST_MULTIARCH)-$(PVER)m-config.1.gz \ + $(d_ldev)/usr/share/man/man1/$(DEB_HOST_MULTIARCH)-$(PVER)-config.1.gz +ifneq ($(DEB_HOST_MULTIARCH),$(DEB_HOST_GNU_TYPE)) + ln -sf $(DEB_HOST_MULTIARCH)-$(PVER)m-config \ + $(d_ldev)/usr/bin/$(DEB_HOST_GNU_TYPE)-$(PVER)m-config + ln -sf $(DEB_HOST_MULTIARCH)-$(PVER)-config \ + $(d_ldev)/usr/bin/$(DEB_HOST_GNU_TYPE)-$(PVER)-config + ln -sf $(DEB_HOST_MULTIARCH)-$(PVER)-config.1.gz \ + $(d_ldev)/usr/share/man/man1/$(DEB_HOST_GNU_TYPE)-$(PVER)-config.1.gz + ln -sf $(DEB_HOST_MULTIARCH)-$(PVER)-config.1.gz \ + $(d_ldev)/usr/share/man/man1/$(DEB_HOST_GNU_TYPE)-$(PVER)m-config.1.gz +endif + ln -sf $(DEB_HOST_MULTIARCH)-$(PVER)m-config $(d_dev)/usr/bin/$(PVER)m-config + ln -sf $(DEB_HOST_MULTIARCH)-$(PVER)m-config.1.gz $(d_dev)/usr/share/man/man1/$(PVER)m-config.1.gz + + ln -sf $(DEB_HOST_MULTIARCH)-$(PVER)-config $(d_dev)/usr/bin/$(PVER)-config + ln -sf $(DEB_HOST_MULTIARCH)-$(PVER)-config.1.gz $(d_dev)/usr/share/man/man1/$(PVER)-config.1.gz + +ifeq ($(with_tk),yes) + : # Move the Tkinter files into $(p_tk). + dh_installdirs -p$(p_tk) \ + $(scriptdir) \ + usr/lib/python$(VER)/lib-dynload + DH_COMPAT=2 dh_movefiles -p$(p_tk) --sourcedir=$(d) \ + usr/lib/python$(VER)/lib-dynload/_tkinter*.so +endif + + : # The test framework into $(p_lbase) + DH_COMPAT=2 dh_movefiles -p$(p_lbase) --sourcedir=$(d) \ + $(scriptdir)/test/{regrtest.py,support,__init__.py,pystone.py} + + : # The complete testsuite into $(p_lbase) + DH_COMPAT=2 dh_movefiles -p$(p_ltst) --sourcedir=$(d) \ + $(scriptdir)/test \ + $(scriptdir)/ctypes/test \ + $(scriptdir)/distutils/tests \ + $(scriptdir)/lib2to3/tests \ + $(scriptdir)/sqlite3/test \ + $(scriptdir)/idlelib/idle_test \ + $(scriptdir)/tkinter/test \ + $(scriptdir)/unittest/test + : # test_ctypes fails with test_macholib.py installed + rm -f $(d_ltst)/$(scriptdir)/ctypes/test/test_macholib.py + : # test_bdist_wininst fails, '*.exe' files are not installed + rm -f $(d_ltst)/$(scriptdir)/distutils/tests/test_bdist_wininst.py + + : # fixed upstream ... + chmod -x $(d_ltst)/$(scriptdir)/test/{test_dbm_gnu,test_dbm_ndbm}.py + + : # Move the demos and tools into $(p_exam)'s doc directory + dh_installdirs -p$(p_exam) \ + usr/share/doc/python$(VER)/examples + DH_COMPAT=2 dh_movefiles -p$(p_exam) --sourcedir=$(d) \ + $(scriptdir)/turtledemo + + cp -rp Tools/* $(d_exam)/usr/share/doc/python$(VER)/examples/ + rm -rf $(d_exam)/usr/share/doc/python$(VER)/examples/Tools/{buildbot,msi} + : # XXX: We don't need rgb.txt, we'll use our own: + rm -rf $(d_exam)/usr/share/doc/python$(VER)/examples/Tools/pynche/X + + : # IDLE + mv $(d)/usr/bin/idle$(VER) $(d)/usr/bin/idle-python$(VER) + rm -f $(d)/usr/lib/python$(VER)/idlelib/idle.bat + dh_installdirs -p$(p_idle) \ + usr/bin \ + usr/share/man/man1 + DH_COMPAT=2 dh_movefiles -p$(p_idle) --sourcedir=$(d) \ + usr/bin/idle-python$(VER) + cp -p debian/idle-$(PVER).1 $(d_idle)/usr/share/man/man1/ + + : # Replace all '#!' calls to python with $(PY_INTERPRETER) + : # and make them executable + for i in `find debian -mindepth 3 -type f ! -name '*.dpatch'`; do \ + sed '1s,#!.*python[^ ]*\(.*\),#! $(PY_INTERPRETER)\1,' \ + $$i > $$i.temp; \ + if cmp --quiet $$i $$i.temp; then \ + rm -f $$i.temp; \ + else \ + mv -f $$i.temp $$i; \ + chmod 755 $$i; \ + echo "fixed interpreter: $$i"; \ + fi; \ + done + + : # Move the docs into $(p_base)'s /usr/share/doc/$(PVER) directory, + : # all other packages only have a copyright file. + dh_installdocs -p$(p_base) \ + README Misc/NEWS Misc/ACKS + ln -sf NEWS.gz $(d_base)/usr/share/doc/$(p_base)/changelog.gz + dh_installdocs --all -N$(p_base) -N$(p_dev) -N$(p_dbg) -N$(p_lib) debian/README.Debian + + : # IDLE has its own changelogs, docs... + dh_installchangelogs -p$(p_idle) Lib/idlelib/ChangeLog + dh_installdocs -p$(p_idle) Lib/idlelib/{NEWS,README,TODO,extend}.txt + + mkdir -p $(d_idle)/usr/share/applications + cp -p debian/idle.desktop \ + $(d_idle)/usr/share/applications/idle-$(PVER).desktop + + : # those packages have own README.Debian's + install -m 644 -p debian/README.$(p_base) \ + $(d_base)/usr/share/doc/$(PVER)/README.Debian + install -m 644 -p debian/README.$(p_idle) \ + $(d_idle)/usr/share/doc/$(p_idle)/README.Debian +ifeq ($(with_tk),yes) + cp -p debian/README.Tk $(d_tk)/usr/share/doc/$(p_tk)/ +endif + + : # pyvenv and ensurepip files into $(p_venv) + dh_installdirs -p$(p_venv) \ + usr/bin \ + usr/share/man/man1 \ + usr/lib/python$(VER) + dh_movefiles -p$(p_venv) \ + usr/bin/pyvenv-$(VER) \ + usr/share/man/man1/pyvenv-$(VER).1 \ + usr/lib/python$(VER)/ensurepip + + : # library files into $(p_lbase) + dh_installdirs -p$(p_lbase) \ + usr/lib + dh_movefiles -p$(p_lbase) \ + usr/lib/python$(VER) + + : # The rest goes into $(p_base) + mkdir -p $(d)/usr/lib/python3/dist-packages + (cd $(d) && tar cf - .) | (cd $(d_base) && tar xpf -) + rm -f $(d_base)/usr/bin/python + rm -f $(d_base)/usr/bin/pyvenv + + : # Install menu icon + dh_installdirs -p$(p_base) usr/share/pixmaps + cp -p debian/pylogo.xpm $(d_base)/usr/share/pixmaps/$(PVER).xpm + + : # generate binfmt file + mkdir -p $(d_min)/usr/share/binfmts +ifeq ($(DEB_HOST_GNU_TYPE),$(DEB_BUILD_GNU_TYPE)) + $(buildd_static)/python debian/mkbinfmt.py $(PVER) \ + > $(d_min)/usr/share/binfmts/$(PVER) +else + $(PVER) debian/mkbinfmt.py $(PVER) > $(d_min)/usr/share/binfmts/$(PVER) +endif + + : # desktop entry + mkdir -p $(d_base)/usr/share/applications + cp -p debian/$(PVER).desktop \ + $(d_base)/usr/share/applications/$(PVER).desktop + + : # remove some things + -find debian -name .cvsignore | xargs rm -f + -find debian -name '*.py[co]' | xargs rm -f + + : # remove empty directories, when all components are in place + -find debian ! -name lib-dynload ! -name dist-packages -type d -empty -delete + + : # install debug package + rm -rf $(d)-dbg + $(MAKE) -C $(buildd_debug) install DESTDIR=$(CURDIR)/$(d)-dbg + : # install the Makefile of the shared python debug build + sed -e '/^OPT/s,-O3,-O2,' \ + -e 's/$(LTO_CFLAGS)//g' \ + -e 's,^RUNSHARED *=.*,RUNSHARED=,' \ + -e '/BLDLIBRARY/s/-L\. //' \ + $(buildd_shdebug)/Makefile \ + > $(d)-dbg/$(scriptdir)/config-$(VER)dm-$(DEB_HOST_MULTIARCH)/Makefile + sed -e 's,^RUNSHARED *=.*,RUNSHARED=,' \ + -e '/BLDLIBRARY/s/-L\. //' \ + $(buildd_shdebug)/$(shell cat $(buildd_shdebug)/pybuilddir.txt)/_sysconfigdata.py \ + > $(d)-dbg/$(scriptdir)/_sysconfigdata.py + rm -f $(d)-dbg/$(scriptdir)/lib-dynload/_sysconfigdata.py + sed -i 's/ -O3 / -O2 /g;s/$(LTO_CFLAGS)//g;s/-fprofile-use *-fprofile-correction//g' \ + $(d)-dbg/$(scriptdir)/_sysconfigdata.py + mv $(d)-dbg/$(scriptdir)/_sysconfigdata.py \ + $(d)-dbg/$(scriptdir)/plat-$(DEB_HOST_MULTIARCH)/_sysconfigdata_dm.py + + mv $(d)-dbg/usr/lib/libpython*.a $(d)-dbg/usr/lib/$(DEB_HOST_MULTIARCH)/ + + for i in $(d)-dbg/$(scriptdir)/lib-dynload/*.so; do \ + b=$$(basename $$i .cpython-34dm.so); \ + d=$${b}.cpython-34dm-$(DEB_HOST_MULTIARCH).so; \ + mv $$i $(d)-dbg/$(scriptdir)/lib-dynload/$$d; \ + done + + dh_installdirs -p$(p_ldbg) \ + usr/bin \ + usr/share/man/man1 \ + $(scriptdir)/lib-dynload \ + $(scriptdir)/plat-$(DEB_HOST_MULTIARCH) \ + usr/include/$(PVER)dm \ + usr/include/$(DEB_HOST_MULTIARCH)/$(PVER)dm \ + usr/lib/$(DEB_HOST_MULTIARCH)/pkgconfig + + cp -p $(d)-dbg/$(scriptdir)/lib-dynload/*.so \ + $(d_ldbg)/$(scriptdir)/lib-dynload/ + cp -p $(d)-dbg/$(scriptdir)/plat-$(DEB_HOST_MULTIARCH)/_sysconfigdata_dm.py \ + $(d_ldbg)/$(scriptdir)/plat-$(DEB_HOST_MULTIARCH)/ + cp -p $(buildd_shdebug)/libpython$(VER)dm.so.1.0 \ + $(d_ldbg)/usr/lib/$(DEB_HOST_MULTIARCH)/ + dh_link -p$(p_ldbg) \ + /usr/lib/$(DEB_HOST_MULTIARCH)/libpython$(VER)dm.so.1.0 \ + /usr/lib/$(DEB_HOST_MULTIARCH)/libpython$(VER)dm.so.1 \ + /usr/lib/$(DEB_HOST_MULTIARCH)/libpython$(VER)dm.so.1 \ + /usr/lib/$(DEB_HOST_MULTIARCH)/libpython$(VER)dm.so + sed -e '/^Libs:/s,-lpython$(VER),-lpython$(VER)dm,' \ + -e '/^Cflags:/s,$$, -I$${includedir}/$(DEB_HOST_MULTIARCH)/python$(VER)dm,' \ + $(d)-dbg/usr/lib/$(DEB_HOST_MULTIARCH)/pkgconfig/python-$(VER).pc \ + > $(d_ldbg)/usr/lib/$(DEB_HOST_MULTIARCH)/pkgconfig/python-$(VER)-dbg.pc + + dh_installdirs -p$(p_dbg) \ + usr/bin \ + usr/share/man/man1 \ + usr/share/doc/$(p_base) + cp -p Misc/SpecialBuilds.txt $(d_dbg)/usr/share/doc/$(p_base)/ + cp -p debian/$(PVER)-dbg.README.Debian \ + $(d_dbg)/usr/share/doc/$(p_base)/README.debug + cp -p $(buildd_debug)/python $(d_dbg)/usr/bin/$(PVER)dm + ln -sf python$(VER)dm $(d_dbg)/usr/bin/$(PVER)-dbg + +ifneq ($(with_tk),yes) + rm -f $(d_ldbg)/$(scriptdir)/lib-dynload/_tkinter*.so + rm -f $(d_ldbg)/usr/lib/debug/$(scriptdir)/lib-dynload/_tkinter*.so +endif +ifneq ($(with_gdbm),yes) + rm -f $(d_ldbg)/$(scriptdir)/lib-dynload/_gdbm*.so + rm -f $(d_ldbg)/usr/lib/debug/$(scriptdir)/lib-dynload/_gdbm*.so +endif + + cp -a $(d)-dbg/$(scriptdir)/config-$(VER)dm-$(DEB_HOST_MULTIARCH) \ + $(d_ldbg)/$(scriptdir)/ + dh_link -p$(p_ldbg) \ + /usr/lib/$(DEB_HOST_MULTIARCH)/libpython$(VER)dm.so \ + /$(scriptdir)/config-$(VER)dm-$(DEB_HOST_MULTIARCH)/libpython$(VER)dm.so \ + /usr/lib/$(DEB_HOST_MULTIARCH)/libpython$(VER)dm.so \ + /$(scriptdir)/config-$(VER)dm-$(DEB_HOST_MULTIARCH)/libpython$(VER).so \ + /$(scriptdir)/config-$(VER)dm-$(DEB_HOST_MULTIARCH)/libpython$(VER)dm.a \ + /usr/lib/$(DEB_HOST_MULTIARCH)/libpython$(VER)dm.a + + for i in $(d_ldev)/usr/include/$(PVER)m/*; do \ + i=$$(basename $$i); \ + case $$i in pyconfig.h) continue; esac; \ + ln -sf ../$(PVER)m/$$i $(d_ldbg)/usr/include/$(PVER)dm/$$i; \ + done + cp -p $(buildd_debug)/pyconfig.h $(d_ldbg)/usr/include/$(DEB_HOST_MULTIARCH)/$(PVER)dm/ + sed 's/@subdir@/$(PVER)dm/;s/@header@/pyconfig.h/' \ + debian/multiarch.h.in > $(d_ldbg)/usr/include/$(PVER)dm/pyconfig.h + + ln -sf $(PVER).1.gz $(d_dbg)/usr/share/man/man1/$(PVER)-dbg.1.gz + + : # in $(p_ldbg), prefix python-config with triplets + cp $(d)-dbg/usr/bin/$(PVER)dm-config \ + $(d_ldbg)/usr/bin/$(DEB_HOST_MULTIARCH)-$(PVER)dm-config + ln -sf $(DEB_HOST_MULTIARCH)-$(PVER)dm-config \ + $(d_ldbg)/usr/bin/$(DEB_HOST_MULTIARCH)-$(PVER)-dbg-config + ln -sf $(DEB_HOST_MULTIARCH)-$(PVER)m-config.1.gz \ + $(d_ldbg)/usr/share/man/man1/$(DEB_HOST_MULTIARCH)-$(PVER)dm-config.1.gz + ln -sf $(DEB_HOST_MULTIARCH)-$(PVER)m-config.1.gz \ + $(d_ldbg)/usr/share/man/man1/$(DEB_HOST_MULTIARCH)-$(PVER)-dbg-config.1.gz +ifneq ($(DEB_HOST_MULTIARCH),$(DEB_HOST_GNU_TYPE)) + ln -sf $(DEB_HOST_MULTIARCH)-$(PVER)dm-config \ + $(d_ldbg)/usr/bin/$(DEB_HOST_GNU_TYPE)-$(PVER)dm-config + ln -sf $(DEB_HOST_MULTIARCH)-$(PVER)-config.1.gz \ + $(d_ldbg)/usr/share/man/man1/$(DEB_HOST_GNU_TYPE)-$(PVER)dm-config.1.gz + ln -sf $(DEB_HOST_MULTIARCH)-$(PVER)dm-config \ + $(d_ldbg)/usr/bin/$(DEB_HOST_GNU_TYPE)-$(PVER)-dbg-config + ln -sf $(DEB_HOST_MULTIARCH)-$(PVER)dm-config.1.gz \ + $(d_ldbg)/usr/share/man/man1/$(DEB_HOST_GNU_TYPE)-$(PVER)-dbg-config.1.gz +endif + ln -sf $(DEB_HOST_MULTIARCH)-$(PVER)dm-config $(d_dbg)/usr/bin/$(PVER)dm-config + ln -sf $(DEB_HOST_MULTIARCH)-$(PVER)dm-config.1.gz $(d_dbg)/usr/share/man/man1/$(PVER)dm-config.1.gz + + ln -sf $(DEB_HOST_MULTIARCH)-$(PVER)-dbg-config $(d_dbg)/usr/bin/$(PVER)-dbg-config + ln -sf $(DEB_HOST_MULTIARCH)-$(PVER)-dbg-config.1.gz $(d_dbg)/usr/share/man/man1/$(PVER)-dbg-config.1.gz + + : # symlinks for the "old" include / config directory names + ln -sf $(PVER)-config.1.gz $(d_dbg)/usr/share/man/man1/$(PVER)-dbg-config.1.gz + ln -sf $(PVER).1.gz $(d_dbg)/usr/share/man/man1/$(PVER)dm.1.gz + ln -sf $(PVER)-config.1.gz $(d_dbg)/usr/share/man/man1/$(PVER)dm-config.1.gz + +ifeq ($(with_udeb),yes) + : # Copy the most important files from $(p_min) into $(p_udeb). + dh_installdirs -p$(p_udeb) \ + etc/$(PVER) \ + usr/bin \ + usr/include/$(PVER)mu \ + $(scriptdir)/lib-dynload \ + $(scriptdir)/config-$(VER)m-$(DEB_HOST_MULTIARCH) + cp -p $(d_min)/usr/bin/python$(VER) $(d_udeb)/usr/bin/ + ln -sf python$(VER)mu $(d_udeb)/usr/bin/python$(VER) + ln -sf python$(VER) $(d_udeb)/usr/bin/python3 + cp -p $(foreach i,$(MIN_MODS),$(d_min)/$(scriptdir)/$(i).py) \ + $(d_udeb)/$(scriptdir)/ + cp -a $(foreach i,$(MIN_PACKAGES),$(d_min)/$(scriptdir)/$(i)) \ + $(d_udeb)/$(scriptdir)/ + cp -p $(foreach i,$(MIN_ENCODINGS),$(d_min)/$(scriptdir)/$(i)) \ + $(d_udeb)/$(scriptdir)/ + cp -p $(d_min)/$(scriptdir)/config-$(VER)m-$(DEB_HOST_MULTIARCH)/Makefile \ + $(d_udeb)/$(scriptdir)/config-$(VER)m-$(DEB_HOST_MULTIARCH)/ + cp -p $(d_min)/usr/include/$(DEB_HOST_MULTIARCH)/$(PVER)m/pyconfig.h \ + $(d_udeb)/usr/include/$(DEB_HOST_MULTIARCH)/$(PVER)m/ + cp -p $(d_min)/$(scriptdir)/site.py $(d_udeb)/$(scriptdir)/ + cp -p debian/sitecustomize.py $(d_udeb)/etc/$(PVER)/ + dh_link -p$(p_udeb) /etc/$(PVER)/sitecustomize.py \ + /$(scriptdir)/sitecustomize.py +endif + + for i in debian/*.overrides; do \ + b=$$(basename $$i .overrides); \ + install -D -m 644 $$i debian/$$b/usr/share/lintian/overrides/$$b; \ + done + + touch stamps/stamp-install + +# Build architecture-independent files here. +binary-indep: build-indep install stamps/stamp-control + dh_testdir -i + dh_testroot -i + + : # $(p_doc) package + dh_installdirs -p$(p_doc) \ + usr/share/doc/$(p_base) \ + usr/share/doc/$(p_doc) + dh_installdocs -p$(p_doc) + cp -a Doc/build/html $(d_doc)/usr/share/doc/$(p_base)/ + rm -f $(d_doc)/usr/share/doc/$(p_base)/html/_static/jquery.js + dh_link -p$(p_doc) \ + /usr/share/doc/$(p_base)/html /usr/share/doc/$(p_doc)/html \ + /usr/share/javascript/jquery/jquery.js /usr/share/doc/$(p_base)/html/_static/jquery.js \ + /usr/share/javascript/underscore/underscore.js /usr/share/doc/$(p_base)/html/_static/underscore.js + + : # devhelp docs + cd $(buildd_static) && ./python ../debian/pyhtml2devhelp.py \ + ../$(d_doc)/usr/share/doc/$(p_base)/html index.html $(VER) \ + > ../$(d_doc)/usr/share/doc/$(p_base)/html/$(PVER).devhelp + gzip -9v $(d_doc)/usr/share/doc/$(p_base)/html/$(PVER).devhelp + dh_link -p$(p_doc) \ + /usr/share/doc/$(p_base)/html /usr/share/devhelp/books/$(PVER) + + for i in $(p_ltst); do \ + rm -rf debian/$$i/usr/share/doc/$$i; \ + ln -s $(p_base) debian/$$i/usr/share/doc/$$i; \ + done + + dh_installdebconf -i $(dh_args) + dh_installexamples -i $(dh_args) + dh_installmenu -i $(dh_args) + -dh_icons -i $(dh_args) || dh_iconcache -i $(dh_args) + dh_installchangelogs -i $(dh_args) + dh_link -i $(dh_args) + dh_compress -i $(dh_args) -X.py -X.cls -X.css -X.txt -X.json -X.js -Xobjects.inv -Xgdbinit + dh_fixperms -i $(dh_args) + + : # make python scripts starting with '#!' executable + for i in `find debian -mindepth 3 -type f ! -name '*.dpatch' ! -perm 755`; do \ + if head -1 $$i | grep -q '^#!'; then \ + chmod 755 $$i; \ + echo "make executable: $$i"; \ + fi; \ + done + -find $(d_doc) -name '*.txt' -perm 755 -exec chmod 644 {} \; + + dh_installdeb -i $(dh_args) + dh_gencontrol -i $(dh_args) + dh_md5sums -i $(dh_args) + dh_builddeb -i $(dh_args) + +# Build architecture-dependent files here. +binary-arch: build-arch install + dh_testdir -a + dh_testroot -a +# dh_installdebconf -a + dh_installexamples -a + dh_installmenu -a + -dh_icons -a || dh_iconcache -a +# dh_installmime -a + dh_installchangelogs -a + for i in $(p_dev) $(p_dbg) $(p_venv); do \ + rm -rf debian/$$i/usr/share/doc/$$i; \ + ln -s $(p_base) debian/$$i/usr/share/doc/$$i; \ + done + for i in $(p_lbase); do \ + rm -rf debian/$$i/usr/share/doc/$$i; \ + ln -s $(p_lmin) debian/$$i/usr/share/doc/$$i; \ + done + for i in $(p_ldev) $(p_ldbg) $(p_lib); do \ + rm -rf debian/$$i/usr/share/doc/$$i; \ + ln -s $(p_lbase) debian/$$i/usr/share/doc/$$i; \ + done + -find debian ! -perm -200 -print -exec chmod +w {} \; +ifneq ($(with_tk),yes) + rm -f $(d_lbase)/$(scriptdir)/lib-dynload/_tkinter*.so +endif +ifneq ($(with_gdbm),yes) + rm -f $(d_lbase)/$(scriptdir)/lib-dynload/_gdbm*.so +endif + + dh_strip -a -N$(p_dbg) -Xdebug -Xdbg --dbg-package=$(p_dbg) + cp Tools/gdb/libpython.py $(d_dbg)/usr/lib/debug/usr/bin/$(PVER)m-gdb.py + ln -sf $(PVER)m-gdb.py $(d_dbg)/usr/lib/debug/usr/bin/$(PVER)-gdb.py + ln -sf $(PVER)m-gdb.py $(d_dbg)/usr/lib/debug/usr/bin/$(PVER)dm-gdb.py + ln -sf $(PVER)m-gdb.py $(d_dbg)/usr/lib/debug/usr/bin/$(PVER)-dbg-gdb.py + ln -sf ../bin/$(PVER)m-gdb.py \ + $(d_dbg)/usr/lib/debug/usr/lib/lib$(PVER)m.so.1.0-gdb.py + ln -sf ../bin/$(PVER)m-gdb.py \ + $(d_dbg)/usr/lib/lib$(PVER)dm.so.1.0-gdb.py + dh_link -a + dh_compress -a -X.py + dh_fixperms -a + chmod 644 $(d_lmin)/$(scriptdir)/token.py + + : # make python scripts starting with '#!' executable + for i in `find debian -mindepth 3 -type f ! -name '*.dpatch' ! -perm 755`; do \ + if head -1 $$i | grep -q '^#!'; then \ + chmod 755 $$i; \ + echo "make executable: $$i"; \ + fi; \ + done + + dh_makeshlibs -p$(p_lib) -V '$(p_lib)' + dh_makeshlibs -p$(p_ldbg) -V '$(p_ldbg)' +# don't include the following symbols, found in extensions +# which either can be built as builtin or extension. + sed -ri \ + -e '/^ (PyInit_|_add_one_to_index|asdl_)/d' \ + -e '/^ (PyExpat_XML_|PyExpat_Xml)/d' \ + -e '/^ (ffi_type_|_ctypes_)/d' \ + $(d_lib)/DEBIAN/symbols $(d_ldbg)/DEBIAN/symbols + dh_installdeb -a + dh_shlibdeps -a + dep=`sed -n '/^shlibs:Depends/s/.*\(libc6[^,]*\).*/\1/p' $(d_min).substvars`; \ + echo "shlibs:Pre-Depends=$$dep" >> $(d_min).substvars + sed -i '/^shlibs:Depends/s/libc6[^,]*[, ]*//' $(d_min).substvars + dh_gencontrol -a + dh_md5sums -a + dh_builddeb -a + +# rules to patch the unpacked files in the source directory +# --------------------------------------------------------------------------- +# various rules to unpack addons and (un)apply patches. +# - patch / apply-patches +# - unpatch / reverse-patches + +patchdir = debian/patches + +old_sphinx := $(shell dpkg --compare-versions $$(dpkg -l python-sphinx | awk '/^ii *python-sphinx/ {print $$3}') lt 1 && echo yes || echo no) + +$(patchdir)/series: $(patchdir)/series.in + cpp -E \ + -D$(distribution) \ + $(if $(filter $(old_sphinx),yes),-DOLD_SPHINX) \ + -Darch_os_$(DEB_HOST_ARCH_OS) -Darch_$(DEB_HOST_ARCH) \ + -o - $(patchdir)/series.in \ + | egrep -v '^(#.*|$$)' > $(patchdir)/series + +patch-stamp: stamps/stamp-patch +patch: stamps/stamp-patch +stamps/stamp-patch: $(patchdir)/series + dh_testdir + uname -a + @echo USER=$$USER, LOGNAME=$$LOGNAME + QUILT_PATCHES=$(patchdir) quilt push -a || test $$? = 2 + rm -rf autom4te.cache configure + autoconf + mkdir -p stamps + echo ""; echo "Patches applied in this version:" > stamps/pxx + for i in $$(cat $(patchdir)/series); do \ + echo ""; echo "$$i:"; \ + sed -n 's/^# *DP: */ /p' $(patchdir)/$$i; \ + done >> stamps/pxx + + touch Parser/acceler.c Parser/grammar1.c Parser/listnode.c \ + Parser/node.c Parser/parser.c Parser/bitset.c Parser/metagrammar.c \ + Parser/firstsets.c Parser/grammar.c Parser/pgen.c + touch Objects/obmalloc.c Python/dynamic_annotations.c \ + Python/mysnprintf.c Python/pyctype.c Parser/tokenizer_pgen.c \ + Parser/printgrammar.c Parser/parsetok_pgen.c Parser/pgenmain.c + @sleep 1 + touch Grammar/Grammar + @sleep 1 + touch Include/graminit.h + @sleep 1 + touch Python/graminit.c + + ln -sf site-packages Lib/dist-packages + + mv stamps/pxx $@ + +reverse-patches: unpatch +unpatch: + QUILT_PATCHES=$(patchdir) quilt pop -a -R || test $$? = 2 + rm -f stamps/stamp-patch $(patchdir)/series + rm -rf configure autom4te.cache + +update-patches: $(patchdir)/series + export QUILT_PATCHES=$(patchdir); \ + export QUILT_REFRESH_ARGS="--no-timestamps --no-index -pab"; \ + export QUILT_DIFF_ARGS="--no-timestamps --no-index -pab"; \ + while quilt push; do quilt refresh; done + +binary: binary-indep binary-arch + +.PHONY: control-file configure build clean binary-indep binary-arch binary install + +# Local Variables: +# mode: makefile +# end: --- python3.4-3.4.1.orig/debian/script.py +++ python3.4-3.4.1/debian/script.py @@ -0,0 +1,61 @@ +#! /usr/bin/python3 + +# Copyright (C) 2012 Colin Watson . +# +# Permission is hereby granted, free of charge, to any person obtaining +# a copy of this software and associated documentation files (the +# "Software"), to deal in the Software without restriction, including +# without limitation the rights to use, copy, modify, merge, publish, +# distribute, sublicense, and/or sell copies of the Software, and to +# permit persons to whom the Software is furnished to do so, subject +# to the following conditions: +# +# The above copyright notice and this permission notice shall be included +# in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +# IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +# CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +"""Trivial script(1) workalike, but without reading from standard input.""" + +import os +import pty +import select +import sys + +filename = sys.argv[1] +command = sys.argv[2] + +pid, master = pty.fork() +if pid == 0: # child + os.execlp("sh", "sh", "-c", command) + +# parent +with open(filename, "wb") as logfile: + try: + while True: + rfds, _, _ = select.select([master], [], []) + if master in rfds: + data = os.read(master, 65536) + os.write(1, data) + logfile.write(data) + logfile.flush() + except (IOError, OSError): + pass + +pid, status = os.wait() +returncode = 0 +if os.WIFSIGNALED(status): + returncode = -os.WTERMSIG(status) +elif os.WIFEXITED(status): + returncode = os.WEXITSTATUS(status) +else: + # Should never happen + raise RuntimeError("Unknown child exit status!") +os.close(master) +sys.exit(returncode) --- python3.4-3.4.1.orig/debian/sitecustomize.py.in +++ python3.4-3.4.1/debian/sitecustomize.py.in @@ -0,0 +1,7 @@ +# install the apport exception handler if available +try: + import apport_python_hook +except ImportError: + pass +else: + apport_python_hook.install() --- python3.4-3.4.1.orig/debian/source.lintian-overrides +++ python3.4-3.4.1/debian/source.lintian-overrides @@ -0,0 +1,2 @@ +# generated during the build +python3.4 source: quilt-build-dep-but-no-series-file --- python3.4-3.4.1.orig/debian/source.lintian-overrides.in +++ python3.4-3.4.1/debian/source.lintian-overrides.in @@ -0,0 +1,2 @@ +# generated during the build +@PVER@ source: quilt-build-dep-but-no-series-file --- python3.4-3.4.1.orig/debian/source/format +++ python3.4-3.4.1/debian/source/format @@ -0,0 +1 @@ +1.0 --- python3.4-3.4.1.orig/debian/tests/control +++ python3.4-3.4.1/debian/tests/control @@ -0,0 +1,19 @@ +Tests: testsuite +Depends: build-essential, locales, python3.4-dev, libpython3.4-testsuite, python3-gdbm +# need to turn off apport +Restrictions: needs-root + +Tests: testsuite-dbg +Depends: build-essential, locales, python3.4-dev, python3.4-dbg, libpython3.4-testsuite, python3-gdbm-dbg, gdb +# need to turn off apport +Restrictions: needs-root + +Tests: failing-tests +Depends: build-essential, python3.4-dev, libpython3.4-testsuite, python3-gdbm +# need to turn off apport +Restrictions: needs-root allow-stderr + +Tests: failing-tests-dbg +Depends: build-essential, python3.4-dev, python3.4-dbg, libpython3.4-testsuite, python3-gdbm-dbg, gdb +# need to turn off apport +Restrictions: needs-root allow-stderr --- python3.4-3.4.1.orig/debian/tests/failing-tests +++ python3.4-3.4.1/debian/tests/failing-tests @@ -0,0 +1,94 @@ +#!/bin/sh + +set -e + +if [ "$(whoami)" = root ]; then + if [ -n "$SUDO_USER" ] && getent passwd "$SUDO_USER" > /dev/null; then + su_user="$SUDO_USER" + else + su_user=nobody + fi + + if [ -e /etc/default/apport ]; then + # stop apport + stop apport 2>/dev/null || true + sed -i '/^enabled=/s/=.*/=0/' /etc/default/apport 2>/dev/null + + if status apport | grep -q start; then + echo >&2 "apport is running. needs to be disabled before running the tests" + exit 1 + fi + fi +fi + +tmphome=$ADTTMP/home +mkdir -p $tmphome +if [ -n "$su_user" ]; then + chmod go+rx $ADTTMP + chown $su_user:nogroup $tmphome +fi +ls -la $ADTTMP + +# no root access needed after this point + +debian_dir=$(dirname $(dirname $0)) + +export LOCPATH=$(pwd)/locales +sh $debian_dir/locale-gen + +export LANG=C + +TESTPYTHON="python3.4 -W default -bb -E -R -m test" +TESTOPTS="-j 1 -w -uall,-network,-urlfetch,-gui" +TESTEXCLUSIONS= + +# test_dbm: Fails from time to time ... +TESTEXCLUSIONS="$TESTEXCLUSIONS test_dbm" + +# test_ensurepip: not yet installed, http://bugs.debian.org/732703 +# ... and then test_venv fails too +TESTEXCLUSIONS="$TESTEXCLUSIONS test_ensurepip test_venv " + +# test_zipfile: Issue 17753, requires write access to test and email.test +TESTEXCLUSIONS="$TESTEXCLUSIONS test_zipfile" + +if [ "$su_user" = nobody ]; then + log=/dev/null +else + log=testsuite.log +fi + +script=$debian_dir/script.py +echo "Running the failing tests with the standard interpreter:" +progressions= +for tst in $TESTEXCLUSIONS; do + if [ -f "$script" ]; then + cmd="HOME=$tmphome python3.4 $script \"$log\" \"$TESTPYTHON $TESTOPTS $tst\"" + else + cmd="HOME=$tmphome $TESTPYTHON $TESTOPTS $tst" + fi + + echo "Running $tst ..." + if [ "$(whoami)" = root ]; then + echo "su -s /bin/sh -c $cmd $su_user" + if su -s /bin/sh -c "$cmd" $su_user; then + progressions="$progressions $tst" + else + : + fi + else + echo "$cmd" + if eval $cmd; then + progressions="$progressions $tst" + else + : + fi + fi +done + +if [ -n "$progressions" ]; then + echo "Tests run: $TESTEXCLUSIONS" + echo "Progressions:$progressions" +fi + +exit 0 --- python3.4-3.4.1.orig/debian/tests/failing-tests-dbg +++ python3.4-3.4.1/debian/tests/failing-tests-dbg @@ -0,0 +1,94 @@ +#!/bin/sh + +set -e + +if [ "$(whoami)" = root ]; then + if [ -n "$SUDO_USER" ] && getent passwd "$SUDO_USER" > /dev/null; then + su_user="$SUDO_USER" + else + su_user=nobody + fi + + if [ -e /etc/default/apport ]; then + # stop apport + stop apport 2>/dev/null || true + sed -i '/^enabled=/s/=.*/=0/' /etc/default/apport 2>/dev/null + + if status apport | grep -q start; then + echo >&2 "apport is running. needs to be disabled before running the tests" + exit 1 + fi + fi +fi + +tmphome=$ADTTMP/home +mkdir -p $tmphome +if [ -n "$su_user" ]; then + chmod go+rx $ADTTMP + chown $su_user:nogroup $tmphome +fi +ls -la $ADTTMP + +# no root access needed after this point + +debian_dir=$(dirname $(dirname $0)) + +export LOCPATH=$(pwd)/locales +sh $debian_dir/locale-gen + +export LANG=C + +TESTPYTHON="python3.4dm -W default -bb -E -R -m test" +TESTOPTS="-j 1 -w -uall,-network,-urlfetch,-gui" +TESTEXCLUSIONS= + +# test_dbm: Fails from time to time ... +TESTEXCLUSIONS="$TESTEXCLUSIONS test_dbm" + +# test_ensurepip: not yet installed, http://bugs.debian.org/732703 +# ... and then test_venv fails too +TESTEXCLUSIONS="$TESTEXCLUSIONS test_ensurepip test_venv " + +# test_zipfile: Issue 17753, requires write access to test and email.test +TESTEXCLUSIONS="$TESTEXCLUSIONS test_zipfile" + +if [ "$su_user" = nobody ]; then + log=/dev/null +else + log=testsuite-dbg.log +fi + +script=$debian_dir/script.py +echo "Running the failing tests with the debug enabled interpreter:" +progressions= +for tst in $TESTEXCLUSIONS; do + if [ -f "$script" ]; then + cmd="HOME=$tmphome python3.4 $script \"$log\" \"$TESTPYTHON $TESTOPTS $tst\"" + else + cmd="HOME=$tmphome $TESTPYTHON $TESTOPTS $tst" + fi + + echo "Running $tst ..." + if [ "$(whoami)" = root ]; then + echo "su -s /bin/sh -c $cmd $su_user" + if su -s /bin/sh -c "$cmd" $su_user; then + progressions="$progressions $tst" + else + : + fi + else + echo "$cmd" + if eval $cmd; then + progressions="$progressions $tst" + else + : + fi + fi +done + +if [ -n "$progressions" ]; then + echo "Tests run: $TESTEXCLUSIONS" + echo "Progressions:$progressions" +fi + +exit 0 --- python3.4-3.4.1.orig/debian/tests/testsuite +++ python3.4-3.4.1/debian/tests/testsuite @@ -0,0 +1,83 @@ +#!/bin/sh + +set -e + +if [ "$(whoami)" = root ]; then + if [ -n "$SUDO_USER" ] && getent passwd "$SUDO_USER" > /dev/null; then + su_user="$SUDO_USER" + else + su_user=nobody + fi + + if [ -e /etc/default/apport ]; then + # stop apport + stop apport 2>/dev/null || true + sed -i '/^enabled=/s/=.*/=0/' /etc/default/apport 2>/dev/null + + if status apport | grep -q start; then + echo >&2 "apport is running. needs to be disabled before running the tests" + exit 1 + fi + fi +fi +tmphome=$ADTTMP/home +mkdir -p $tmphome +if [ -n "$su_user" ]; then + chmod go+rx $ADTTMP + chown $su_user:nogroup $tmphome +fi +ls -la $ADTTMP + +tmphome=$ADTTMP/home +mkdir -p $tmphome +if [ -n "$su_user" ]; then + chown $su_user $tmphome +fi + +# no root access needed after this point + +debian_dir=$(dirname $(dirname $0)) + +export LOCPATH=$(pwd)/locales +sh $debian_dir/locale-gen + +export LANG=C + +TESTPYTHON="python3.4 -W default -bb -E -R -m test" +TESTOPTS="-j 1 -w -uall,-network,-urlfetch,-gui" +TESTEXCLUSIONS="-x" + +# test_dbm: Fails from time to time ... +TESTEXCLUSIONS="$TESTEXCLUSIONS test_dbm" + +# test_ensurepip: not yet installed, http://bugs.debian.org/732703 +# ... and then test_venv fails too +TESTEXCLUSIONS="$TESTEXCLUSIONS test_ensurepip test_venv " + +# test_gdb: not run for the optimized build +TESTEXCLUSIONS="$TESTEXCLUSIONS test_gdb" + +# test_zipfile: Issue 17753, requires write access to test and email.test +TESTEXCLUSIONS="$TESTEXCLUSIONS test_zipfile" + +if [ "$su_user" = nobody ]; then + log=/dev/null +else + log=testsuite.log +fi + +script=$debian_dir/script.py +if [ -f "$script" ]; then + cmd="HOME=$tmphome python3.4 $script \"$log\" \"$TESTPYTHON $TESTOPTS $TESTEXCLUSIONS\"" +else + cmd="HOME=$tmphome $TESTPYTHON $TESTOPTS $TESTEXCLUSIONS" +fi + +echo "Running the python testsuite with the standard interpreter:" +if [ "$(whoami)" = root ]; then + echo "su -s /bin/sh -c $cmd $su_user" + su -s /bin/sh -c "$cmd" $su_user +else + echo "$cmd" + eval $cmd +fi --- python3.4-3.4.1.orig/debian/tests/testsuite-dbg +++ python3.4-3.4.1/debian/tests/testsuite-dbg @@ -0,0 +1,75 @@ +#!/bin/sh + +set -e + +if [ "$(whoami)" = root ]; then + if [ -n "$SUDO_USER" ] && getent passwd "$SUDO_USER" > /dev/null; then + su_user="$SUDO_USER" + else + su_user=nobody + fi + + if [ -e /etc/default/apport ]; then + # stop apport + stop apport 2>/dev/null || true + sed -i '/^enabled=/s/=.*/=0/' /etc/default/apport 2>/dev/null + + if status apport | grep -q start; then + echo >&2 "apport is running. needs to be disabled before running the tests" + exit 1 + fi + fi +fi + +tmphome=$ADTTMP/home +mkdir -p $tmphome +if [ -n "$su_user" ]; then + chmod go+rx $ADTTMP + chown $su_user:nogroup $tmphome +fi +ls -la $ADTTMP + +# no root access needed after this point + +debian_dir=$(dirname $(dirname $0)) + +export LOCPATH=$(pwd)/locales +sh $debian_dir/locale-gen + +export LANG=C + +TESTPYTHON="python3.4dm -W default -bb -E -R -m test" +TESTOPTS="-j 1 -w -uall,-network,-urlfetch,-gui" +TESTEXCLUSIONS="-x" + +# test_dbm: Fails from time to time ... +TESTEXCLUSIONS="$TESTEXCLUSIONS test_dbm" + +# test_ensurepip: not yet installed, http://bugs.debian.org/732703 +# ... and then test_venv fails too +TESTEXCLUSIONS="$TESTEXCLUSIONS test_ensurepip test_venv " + +# test_zipfile: Issue 17753, requires write access to test and email.test +TESTEXCLUSIONS="$TESTEXCLUSIONS test_zipfile" + +if [ "$su_user" = nobody ]; then + log=/dev/null +else + log=testsuite-dbg.log +fi + +script=$debian_dir/script.py +if [ -f "$script" ]; then + cmd="HOME=$tmphome python3.4 $script \"$log\" \"$TESTPYTHON $TESTOPTS $TESTEXCLUSIONS\"" +else + cmd="HOME=$tmphome $TESTPYTHON $TESTOPTS $TESTEXCLUSIONS" +fi + +echo "Running the python testsuite with the debug enabled interpreter:" +if [ "$(whoami)" = root ]; then + echo "su -s /bin/sh -c $cmd $su_user" + su -s /bin/sh -c "$cmd" $su_user +else + echo "$cmd" + eval $cmd +fi --- python3.4-3.4.1.orig/debian/watch +++ python3.4-3.4.1/debian/watch @@ -0,0 +1,3 @@ +version=3 +opts=dversionmangle=s/.*\+//,uversionmangle=s/([abcr]+[1-9])$/~$1/ \ + http://www.python.org/ftp/python/3\.4(\.\d)?/Python-(3\.4[.\dabcr]*)\.tgz