diff -r e55cc0834e9c -r 13161c1d9c5f Doc/library/functions.rst
--- a/Doc/library/functions.rst Wed Apr 15 17:08:45 2015 -0400
+++ b/Doc/library/functions.rst Wed Apr 15 09:26:22 2015 -0400
@@ -1225,8 +1225,8 @@
.. function:: round(number[, ndigits])
Return the floating point value *number* rounded to *ndigits* digits after
- the decimal point. If *ndigits* is omitted, it returns the nearest integer
- to its input. Delegates to ``number.__round__(ndigits)``.
+ the decimal point. If *ndigits* is omitted, it defaults to zero. Delegates
+ to ``number.__round__(ndigits)``.
For the built-in types supporting :func:`round`, values are rounded to the
closest multiple of 10 to the power minus *ndigits*; if two multiples are
diff -r e55cc0834e9c -r 13161c1d9c5f Doc/library/tarfile.rst
--- a/Doc/library/tarfile.rst Wed Apr 15 17:08:45 2015 -0400
+++ b/Doc/library/tarfile.rst Wed Apr 15 09:26:22 2015 -0400
@@ -367,7 +367,7 @@
available.
-.. method:: TarFile.extractall(path=".", members=None, *, numeric_owner=False)
+.. method:: TarFile.extractall(path=".", members=None)
Extract all members from the archive to the current working directory or
directory *path*. If optional *members* is given, it must be a subset of the
@@ -377,10 +377,6 @@
reset each time a file is created in it. And, if a directory's permissions do
not allow writing, extracting files to it will fail.
- If *numeric_owner* is :const:`True`, the uid and gid numbers from the tarfile
- are used to set the owner/group for the extracted files. Otherwise, the named
- values from the tarfile are used.
-
.. warning::
Never extract archives from untrusted sources without prior inspection.
@@ -388,11 +384,8 @@
that have absolute filenames starting with ``"/"`` or filenames with two
dots ``".."``.
- .. versionchanged:: 3.5
- Added the *numeric_only* parameter.
-
-.. method:: TarFile.extract(member, path="", set_attrs=True, *, numeric_owner=False)
+.. method:: TarFile.extract(member, path="", set_attrs=True)
Extract a member from the archive to the current working directory, using its
full name. Its file information is extracted as accurately as possible. *member*
@@ -400,10 +393,6 @@
directory using *path*. File attributes (owner, mtime, mode) are set unless
*set_attrs* is false.
- If *numeric_owner* is :const:`True`, the uid and gid numbers from the tarfile
- are used to set the owner/group for the extracted files. Otherwise, the named
- values from the tarfile are used.
-
.. note::
The :meth:`extract` method does not take care of several extraction issues.
@@ -416,9 +405,6 @@
.. versionchanged:: 3.2
Added the *set_attrs* parameter.
- .. versionchanged:: 3.5
- Added the *numeric_only* parameter.
-
.. method:: TarFile.extractfile(member)
Extract a member from the archive as a file object. *member* may be a filename
@@ -841,3 +827,4 @@
because all the metadata is stored using *UTF-8*. *encoding* is only used in
the rare cases when binary pax headers are decoded or when strings with
surrogate characters are stored.
+
diff -r e55cc0834e9c -r 13161c1d9c5f Doc/whatsnew/3.5.rst
--- a/Doc/whatsnew/3.5.rst Wed Apr 15 17:08:45 2015 -0400
+++ b/Doc/whatsnew/3.5.rst Wed Apr 15 09:26:22 2015 -0400
@@ -479,6 +479,19 @@
:meth:`socket.socket.send`.
(Contributed by Giampaolo Rodola' in :issue:`17552`.)
+sysconfig
+---------
+
+* The user scripts directory on Windows is now versioned.
+ (Contributed by Paul Moore in :issue:`23437`.)
+
+
+tarfile
+-------
+
+* The :func:`tarfile.open` function now supports ``'x'`` (exclusive creation)
+ mode. (Contributed by Berker Peksag in :issue:`21717`.)
+
subprocess
----------
@@ -487,25 +500,6 @@
API than :func:`~subprocess.call`, :func:`~subprocess.check_call` and
:func:`~subprocess.check_output`.
-sysconfig
----------
-
-* The user scripts directory on Windows is now versioned.
- (Contributed by Paul Moore in :issue:`23437`.)
-
-tarfile
--------
-
-* The :func:`tarfile.open` function now supports ``'x'`` (exclusive creation)
- mode. (Contributed by Berker Peksag in :issue:`21717`.)
-
-* The :meth:`~tarfile.TarFile.extractall` and :meth:`~tarfile.TarFile.extract`
- methods now take a keyword parameter *numeric_only*. If set to ``True``,
- the extracted files and directories will be owned by the numeric uid and gid
- from the tarfile. If set to ``False`` (the default, and the behavior in
- versions prior to 3.5), they will be owned bythe named user and group in the
- tarfile. (Contributed by Michael Vogt and Eric Smith in :issue:`23193`.)
-
time
----
diff -r e55cc0834e9c -r 13161c1d9c5f Lib/difflib.py
--- a/Lib/difflib.py Wed Apr 15 17:08:45 2015 -0400
+++ b/Lib/difflib.py Wed Apr 15 09:26:22 2015 -0400
@@ -1173,7 +1173,7 @@
+tree
four
"""
-
+ _check_types(a, b, fromfile, tofile, fromfiledate, tofiledate, lineterm)
started = False
for group in SequenceMatcher(None,a,b).get_grouped_opcodes(n):
if not started:
@@ -1260,7 +1260,7 @@
! tree
four
"""
-
+ _check_types(a, b, fromfile, tofile, fromfiledate, tofiledate, lineterm)
prefix = dict(insert='+ ', delete='- ', replace='! ', equal=' ')
started = False
for group in SequenceMatcher(None,a,b).get_grouped_opcodes(n):
@@ -1292,6 +1292,49 @@
for line in b[j1:j2]:
yield prefix[tag] + line
+def _check_types(a, b, *args):
+ # Checking types is weird, but it's better than producing garbled
+ # output. E.g. if someone passes filenames as bytes to unified_diff(),
+ # without this check we would produce output lines like:
+ # --- b'oldfile.txt'
+ # +++ b'newfile.txt'
+ # (because that's how str.format() incorporates bytes objects).
+ if a and not isinstance(a[0], str):
+ raise TypeError('lines to compare must be str, not %r' % a[0])
+ if b and not isinstance(b[0], str):
+ raise TypeError('lines to compare must be str, not %r' % b[0])
+ for arg in args:
+ if not isinstance(arg, str):
+ raise TypeError('all arguments must be str, not: %r' % (arg,))
+
+def diff_bytes(dfunc, a, b, fromfile=b'', tofile=b'',
+ fromfiledate=b'', tofiledate=b'', n=3, lineterm=b'\n'):
+ r"""
+ Compare `a` and `b`, two sequences of lines represented as bytes rather
+ than strings. This is a wrapper for `dfunc`, which is typically either
+ unified_diff() or context_diff() (the function object, not the name).
+ All inputs are losslessly converted to strings so that `dfunc` only has
+ to worry about strings, and decoded back to bytes on return. This is
+ necessary to compare files with unknown or inconsistent encoding. All
+ other inputs (except `n`) must be bytes rather than str.
+ """
+ def decode(s):
+ try:
+ return s.decode('ascii', 'surrogateescape')
+ except AttributeError:
+ raise TypeError('all arguments must be bytes, not %r' % s)
+ a = list(map(decode, a))
+ b = list(map(decode, b))
+ fromfile = decode(fromfile)
+ tofile = decode(tofile)
+ fromfiledate = decode(fromfiledate)
+ tofiledate = decode(tofiledate)
+ lineterm = decode(lineterm)
+
+ lines = dfunc(a, b, fromfile, tofile, fromfiledate, tofiledate, n, lineterm)
+ for line in lines:
+ yield line.encode('ascii', 'surrogateescape')
+
def ndiff(a, b, linejunk=None, charjunk=IS_CHARACTER_JUNK):
r"""
Compare `a` and `b` (lists of strings); return a `Differ`-style delta.
diff -r e55cc0834e9c -r 13161c1d9c5f Lib/tarfile.py
--- a/Lib/tarfile.py Wed Apr 15 17:08:45 2015 -0400
+++ b/Lib/tarfile.py Wed Apr 15 09:26:22 2015 -0400
@@ -1972,13 +1972,12 @@
self.members.append(tarinfo)
- def extractall(self, path=".", members=None, *, numeric_owner=False):
+ def extractall(self, path=".", members=None):
"""Extract all members from the archive to the current working
directory and set owner, modification time and permissions on
directories afterwards. `path' specifies a different directory
to extract to. `members' is optional and must be a subset of the
- list returned by getmembers(). If `numeric_owner` is True, only
- the numbers for user/group names are used and not the names.
+ list returned by getmembers().
"""
directories = []
@@ -1992,8 +1991,7 @@
tarinfo = copy.copy(tarinfo)
tarinfo.mode = 0o700
# Do not set_attrs directories, as we will do that further down
- self.extract(tarinfo, path, set_attrs=not tarinfo.isdir(),
- numeric_owner=numeric_owner)
+ self.extract(tarinfo, path, set_attrs=not tarinfo.isdir())
# Reverse sort directories.
directories.sort(key=lambda a: a.name)
@@ -2003,7 +2001,7 @@
for tarinfo in directories:
dirpath = os.path.join(path, tarinfo.name)
try:
- self.chown(tarinfo, dirpath, numeric_owner=numeric_owner)
+ self.chown(tarinfo, dirpath)
self.utime(tarinfo, dirpath)
self.chmod(tarinfo, dirpath)
except ExtractError as e:
@@ -2012,14 +2010,12 @@
else:
self._dbg(1, "tarfile: %s" % e)
- def extract(self, member, path="", set_attrs=True, *, numeric_owner=False):
+ def extract(self, member, path="", set_attrs=True):
"""Extract a member from the archive to the current working directory,
using its full name. Its file information is extracted as accurately
as possible. `member' may be a filename or a TarInfo object. You can
specify a different directory using `path'. File attributes (owner,
- mtime, mode) are set unless `set_attrs' is False. If `numeric_owner`
- is True, only the numbers for user/group names are used and not
- the names.
+ mtime, mode) are set unless `set_attrs' is False.
"""
self._check("r")
@@ -2034,8 +2030,7 @@
try:
self._extract_member(tarinfo, os.path.join(path, tarinfo.name),
- set_attrs=set_attrs,
- numeric_owner=numeric_owner)
+ set_attrs=set_attrs)
except OSError as e:
if self.errorlevel > 0:
raise
@@ -2081,8 +2076,7 @@
# blkdev, etc.), return None instead of a file object.
return None
- def _extract_member(self, tarinfo, targetpath, set_attrs=True,
- numeric_owner=False):
+ def _extract_member(self, tarinfo, targetpath, set_attrs=True):
"""Extract the TarInfo object tarinfo to a physical
file called targetpath.
"""
@@ -2120,7 +2114,7 @@
self.makefile(tarinfo, targetpath)
if set_attrs:
- self.chown(tarinfo, targetpath, numeric_owner)
+ self.chown(tarinfo, targetpath)
if not tarinfo.issym():
self.chmod(tarinfo, targetpath)
self.utime(tarinfo, targetpath)
@@ -2209,24 +2203,19 @@
except KeyError:
raise ExtractError("unable to resolve link inside archive")
- def chown(self, tarinfo, targetpath, numeric_owner):
- """Set owner of targetpath according to tarinfo. If numeric_owner
- is True, use .gid/.uid instead of .gname/.uname.
+ def chown(self, tarinfo, targetpath):
+ """Set owner of targetpath according to tarinfo.
"""
if pwd and hasattr(os, "geteuid") and os.geteuid() == 0:
# We have to be root to do so.
- if numeric_owner:
+ try:
+ g = grp.getgrnam(tarinfo.gname)[2]
+ except KeyError:
g = tarinfo.gid
+ try:
+ u = pwd.getpwnam(tarinfo.uname)[2]
+ except KeyError:
u = tarinfo.uid
- else:
- try:
- g = grp.getgrnam(tarinfo.gname)[2]
- except KeyError:
- g = tarinfo.gid
- try:
- u = pwd.getpwnam(tarinfo.uname)[2]
- except KeyError:
- u = tarinfo.uid
try:
if tarinfo.issym() and hasattr(os, "lchown"):
os.lchown(targetpath, u, g)
diff -r e55cc0834e9c -r 13161c1d9c5f Lib/test/test_difflib.py
--- a/Lib/test/test_difflib.py Wed Apr 15 17:08:45 2015 -0400
+++ b/Lib/test/test_difflib.py Wed Apr 15 09:26:22 2015 -0400
@@ -322,12 +322,158 @@
self.assertEqual(fmt(0,0), '0')
+class TestBytes(unittest.TestCase):
+ # don't really care about the content of the output, just the fact
+ # that it's bytes and we don't crash
+ def check(self, diff):
+ diff = list(diff) # trigger exceptions first
+ for line in diff:
+ self.assertTrue(
+ isinstance(line, bytes),
+ "all lines of diff should be bytes, but got: %r" % line)
+
+ def test_byte_content(self):
+ "if we receive byte strings, we return byte strings"
+ a = [b'hello', b'andrew']
+ b = [b'hello', b'andr\xe9'] # latin-1 bytes
+
+ unified = difflib.unified_diff
+ context = difflib.context_diff
+
+ check = self.check
+ check(difflib.diff_bytes(unified, a, a))
+ check(difflib.diff_bytes(unified, a, b))
+
+ # now with filenames (content and filenames are all bytes!)
+ check(difflib.diff_bytes(unified, a, a, b'a', b'a'))
+ check(difflib.diff_bytes(unified, a, b, b'a', b'b'))
+
+ # and with filenames and dates
+ check(difflib.diff_bytes(unified, a, a, b'a', b'a', b'2005', b'2013'))
+ check(difflib.diff_bytes(unified, a, b, b'a', b'b', b'2005', b'2013'))
+
+ # same all over again, with context diff
+ check(difflib.diff_bytes(context, a, a))
+ check(difflib.diff_bytes(context, a, b))
+ check(difflib.diff_bytes(context, a, a, b'a', b'a'))
+ check(difflib.diff_bytes(context, a, b, b'a', b'b'))
+ check(difflib.diff_bytes(context, a, a, b'a', b'a', b'2005', b'2013'))
+ check(difflib.diff_bytes(context, a, b, b'a', b'b', b'2005', b'2013'))
+
+ def test_byte_filenames(self):
+ # somebody renamed a file from ISO-8859-2 to UTF-8
+ fna = b'\xb3odz.txt' # "łodz.txt"
+ fnb = b'\xc5\x82odz.txt'
+
+ # they transcoded the content at the same time
+ a = [b'\xa3odz is a city in Poland.']
+ b = [b'\xc5\x81odz is a city in Poland.']
+
+ check = self.check
+ unified = difflib.unified_diff
+ context = difflib.context_diff
+ check(difflib.diff_bytes(unified, a, b, fna, fnb))
+ check(difflib.diff_bytes(context, a, b, fna, fnb))
+
+ def assertDiff(expect, actual):
+ # do not compare expect and equal as lists, because unittest
+ # uses difflib to report difference between lists
+ actual = list(actual)
+ self.assertEqual(len(expect), len(actual))
+ for e, a in zip(expect, actual):
+ self.assertEqual(e, a)
+
+ expect = [
+ b'--- \xb3odz.txt',
+ b'+++ \xc5\x82odz.txt',
+ b'@@ -1 +1 @@',
+ b'-\xa3odz is a city in Poland.',
+ b'+\xc5\x81odz is a city in Poland.',
+ ]
+ actual = difflib.diff_bytes(unified, a, b, fna, fnb, lineterm=b'')
+ assertDiff(expect, actual)
+
+ # with dates (plain ASCII)
+ datea = b'2005-03-18'
+ dateb = b'2005-03-19'
+ check(difflib.diff_bytes(unified, a, b, fna, fnb, datea, dateb))
+ check(difflib.diff_bytes(context, a, b, fna, fnb, datea, dateb))
+
+ expect = [
+ # note the mixed encodings here: this is deeply wrong by every
+ # tenet of Unicode, but it doesn't crash, it's parseable by
+ # patch, and it's how UNIX(tm) diff behaves
+ b'--- \xb3odz.txt\t2005-03-18',
+ b'+++ \xc5\x82odz.txt\t2005-03-19',
+ b'@@ -1 +1 @@',
+ b'-\xa3odz is a city in Poland.',
+ b'+\xc5\x81odz is a city in Poland.',
+ ]
+ actual = difflib.diff_bytes(unified, a, b, fna, fnb, datea, dateb,
+ lineterm=b'')
+ assertDiff(expect, actual)
+
+ def test_mixed_types_content(self):
+ 'type of input content must be consistent: all str or all bytes'
+ a = [b'hello']
+ b = ['hello']
+
+ def assertTypeError(generator, *args):
+ try:
+ list(callable(args, *args))
+ self.fail('expected TypeError')
+ except TypeError:
+ pass
+
+ assertTypeError(difflib.unified_diff, a, b)
+ assertTypeError(difflib.unified_diff, b, a)
+ assertTypeError(difflib.context_diff, a, b)
+ assertTypeError(difflib.context_diff, b, a)
+
+ assertTypeError(difflib.diff_bytes, difflib.unified_diff, a, b)
+ assertTypeError(difflib.diff_bytes, difflib.unified_diff, b, a)
+ assertTypeError(difflib.diff_bytes, difflib.context_diff, a, b)
+ assertTypeError(difflib.diff_bytes, difflib.context_diff, b, a)
+
+ def test_mixed_types_filenames(self):
+ 'cannot pass filenames as bytes if content is str'
+ # this may not be the right behaviour, but at least the test
+ # demonstrates how things work
+ a = ['hello\n']
+ b = ['ohell\n']
+ fna = b'ol\xe9.txt' # filename transcoded from ISO-8859-1
+ fnb = b'ol\xc3a9.txt' # to UTF-8
+ try:
+ list(difflib.unified_diff(a, b, fna, fnb))
+ self.fail('expected TypeError')
+ except TypeError:
+ pass
+
+ def test_mixed_types_dates(self):
+ 'type of dates must be consistent with type of contents'
+ a = [b'foo\n']
+ b = [b'bar\n']
+ datea = '1 fév'
+ dateb = '3 fév'
+ try:
+ list(difflib.diff_bytes(a, b, 'a', 'b', datea, dateb,
+ dfunc=difflib.unified_diff))
+ self.fail('expected TypeError')
+ except TypeError:
+ pass
+
+ # if input is str, non-ASCII dates are fine
+ a = ['foo\n']
+ b = ['bar\n']
+ list(difflib.unified_diff(a, b, 'a', 'b', datea, dateb))
+
+
def test_main():
difflib.HtmlDiff._default_prefix = 0
Doctests = doctest.DocTestSuite(difflib)
run_unittest(
TestWithAscii, TestAutojunk, TestSFpatches, TestSFbugs,
- TestOutputFormat, Doctests)
+ TestOutputFormat, TestBytes, Doctests)
if __name__ == '__main__':
test_main()
diff -r e55cc0834e9c -r 13161c1d9c5f Lib/test/test_float.py
--- a/Lib/test/test_float.py Wed Apr 15 17:08:45 2015 -0400
+++ b/Lib/test/test_float.py Wed Apr 15 09:26:22 2015 -0400
@@ -773,14 +773,6 @@
test(sfmt, NAN, ' nan')
test(sfmt, -NAN, ' nan')
- def test_None_ndigits(self):
- for x in round(1.23), round(1.23, None), round(1.23, ndigits=None):
- self.assertEqual(x, 1)
- self.assertIsInstance(x, int)
- for x in round(1.78), round(1.78, None), round(1.78, ndigits=None):
- self.assertEqual(x, 2)
- self.assertIsInstance(x, int)
-
# Beginning with Python 2.6 float has cross platform compatible
# ways to create and represent inf and nan
diff -r e55cc0834e9c -r 13161c1d9c5f Lib/test/test_sysconfig.py
--- a/Lib/test/test_sysconfig.py Wed Apr 15 17:08:45 2015 -0400
+++ b/Lib/test/test_sysconfig.py Wed Apr 15 09:26:22 2015 -0400
@@ -390,19 +390,10 @@
self.assertEqual(vars['SO'], vars['EXT_SUFFIX'])
@unittest.skipUnless(sys.platform == 'linux', 'Linux-specific test')
- def test_triplet_in_ext_suffix(self):
- import ctypes, platform, re
- machine = platform.machine()
+ def test_bitness_in_ext_suffix(self):
suffix = sysconfig.get_config_var('EXT_SUFFIX')
- if re.match('(aarch64|arm|mips|ppc|powerpc|s390|sparc)', machine):
- self.assertTrue('linux' in suffix, suffix)
- if re.match('(i[3-6]86|x86_64)$', machine):
- if ctypes.sizeof(ctypes.c_char_p()) == 4:
- self.assertTrue(suffix.endswith('i386-linux-gnu.so') \
- or suffix.endswith('x86_64-linux-gnux32.so'),
- suffix)
- else: # 8 byte pointer size
- self.assertTrue(suffix.endswith('x86_64-linux-gnu.so'), suffix)
+ bitness = '-32b' if sys.maxsize < 2**32 else '-64b'
+ self.assertTrue(suffix.endswith(bitness + '.so'), suffix)
class MakefileTests(unittest.TestCase):
diff -r e55cc0834e9c -r 13161c1d9c5f Lib/test/test_tarfile.py
--- a/Lib/test/test_tarfile.py Wed Apr 15 17:08:45 2015 -0400
+++ b/Lib/test/test_tarfile.py Wed Apr 15 09:26:22 2015 -0400
@@ -2,10 +2,8 @@
import os
import io
from hashlib import md5
-from contextlib import contextmanager
import unittest
-import unittest.mock
import tarfile
from test import support, script_helper
@@ -2266,136 +2264,6 @@
self._test_partial_input("r:bz2")
-def root_is_uid_gid_0():
- try:
- import pwd, grp
- except ImportError:
- return False
- if pwd.getpwuid(0)[0] != 'root':
- return False
- if grp.getgrgid(0)[0] != 'root':
- return False
- return True
-
-
-class NumericOwnerTest(unittest.TestCase):
- # mock the following:
- # os.chown: so we can test what's being called
- # os.chmod: so the modes are not actually changed. if they are, we can't
- # delete the files/directories
- # os.geteuid: so we can lie and say we're root (uid = 0)
-
- @staticmethod
- def _make_test_archive(filename_1, dirname_1, filename_2):
- # the file contents to write
- fobj = io.BytesIO(b"content")
-
- # create a tar file with a file, a directory, and a file within that
- # directory. Assign various .uid/.gid values to them
- items = [(filename_1, 99, 98, tarfile.REGTYPE, fobj),
- (dirname_1, 77, 76, tarfile.DIRTYPE, None),
- (filename_2, 88, 87, tarfile.REGTYPE, fobj),
- ]
- with tarfile.open(tmpname, 'w') as tarfl:
- for name, uid, gid, typ, contents in items:
- t = tarfile.TarInfo(name)
- t.uid = uid
- t.gid = gid
- t.uname = 'root'
- t.gname = 'root'
- t.type = typ
- tarfl.addfile(t, contents)
-
- # return the full pathname to the tar file
- return tmpname
-
- @staticmethod
- @contextmanager
- def _setup_test(mock_geteuid):
- mock_geteuid.return_value = 0 # lie and say we're root
- fname = 'numeric-owner-testfile'
- dirname = 'dir'
-
- # the names we want stored in the tarfile
- filename_1 = fname
- dirname_1 = dirname
- filename_2 = os.path.join(dirname, fname)
-
- # create the tarfile with the contents we're after
- tar_filename = NumericOwnerTest._make_test_archive(filename_1,
- dirname_1,
- filename_2)
-
- # open the tarfile for reading. yield it and the names of the items
- # we stored into the file
- with tarfile.open(tar_filename) as tarfl:
- yield tarfl, filename_1, dirname_1, filename_2
-
- @unittest.mock.patch('os.chown')
- @unittest.mock.patch('os.chmod')
- @unittest.mock.patch('os.geteuid')
- def test_extract_with_numeric_owner(self, mock_geteuid, mock_chmod,
- mock_chown):
- with self._setup_test(mock_geteuid) as (tarfl, filename_1, _,
- filename_2):
- tarfl.extract(filename_1, TEMPDIR, numeric_owner=True)
- tarfl.extract(filename_2 , TEMPDIR, numeric_owner=True)
-
- # convert to filesystem paths
- f_filename_1 = os.path.join(TEMPDIR, filename_1)
- f_filename_2 = os.path.join(TEMPDIR, filename_2)
-
- mock_chown.assert_has_calls([unittest.mock.call(f_filename_1, 99, 98),
- unittest.mock.call(f_filename_2, 88, 87),
- ],
- any_order=True)
-
- @unittest.mock.patch('os.chown')
- @unittest.mock.patch('os.chmod')
- @unittest.mock.patch('os.geteuid')
- def test_extractall_with_numeric_owner(self, mock_geteuid, mock_chmod,
- mock_chown):
- with self._setup_test(mock_geteuid) as (tarfl, filename_1, dirname_1,
- filename_2):
- tarfl.extractall(TEMPDIR, numeric_owner=True)
-
- # convert to filesystem paths
- f_filename_1 = os.path.join(TEMPDIR, filename_1)
- f_dirname_1 = os.path.join(TEMPDIR, dirname_1)
- f_filename_2 = os.path.join(TEMPDIR, filename_2)
-
- mock_chown.assert_has_calls([unittest.mock.call(f_filename_1, 99, 98),
- unittest.mock.call(f_dirname_1, 77, 76),
- unittest.mock.call(f_filename_2, 88, 87),
- ],
- any_order=True)
-
- # this test requires that uid=0 and gid=0 really be named 'root'. that's
- # because the uname and gname in the test file are 'root', and extract()
- # will look them up using pwd and grp to find their uid and gid, which we
- # test here to be 0.
- @unittest.skipUnless(root_is_uid_gid_0(),
- 'uid=0,gid=0 must be named "root"')
- @unittest.mock.patch('os.chown')
- @unittest.mock.patch('os.chmod')
- @unittest.mock.patch('os.geteuid')
- def test_extract_without_numeric_owner(self, mock_geteuid, mock_chmod,
- mock_chown):
- with self._setup_test(mock_geteuid) as (tarfl, filename_1, _, _):
- tarfl.extract(filename_1, TEMPDIR, numeric_owner=False)
-
- # convert to filesystem paths
- f_filename_1 = os.path.join(TEMPDIR, filename_1)
-
- mock_chown.assert_called_with(f_filename_1, 0, 0)
-
- @unittest.mock.patch('os.geteuid')
- def test_keyword_only(self, mock_geteuid):
- with self._setup_test(mock_geteuid) as (tarfl, filename_1, _, _):
- self.assertRaises(TypeError,
- tarfl.extract, filename_1, TEMPDIR, False, True)
-
-
def setUpModule():
support.unlink(TEMPDIR)
os.makedirs(TEMPDIR)
diff -r e55cc0834e9c -r 13161c1d9c5f Lib/test/test_unpack.py
--- a/Lib/test/test_unpack.py Wed Apr 15 17:08:45 2015 -0400
+++ b/Lib/test/test_unpack.py Wed Apr 15 09:26:22 2015 -0400
@@ -76,7 +76,7 @@
>>> a, b, c, d = Seq()
Traceback (most recent call last):
...
- ValueError: not enough values to unpack (expected 4, got 3)
+ ValueError: need more than 3 values to unpack
Unpacking sequence too long
diff -r e55cc0834e9c -r 13161c1d9c5f Lib/test/test_unpack_ex.py
--- a/Lib/test/test_unpack_ex.py Wed Apr 15 17:08:45 2015 -0400
+++ b/Lib/test/test_unpack_ex.py Wed Apr 15 09:26:22 2015 -0400
@@ -85,14 +85,7 @@
>>> a, *b, c, d, e = Seq()
Traceback (most recent call last):
...
- ValueError: not enough values to unpack (expected at least 4, got 3)
-
-Unpacking sequence too short and target appears last
-
- >>> a, b, c, d, *e = Seq()
- Traceback (most recent call last):
- ...
- ValueError: not enough values to unpack (expected at least 4, got 3)
+ ValueError: need more than 3 values to unpack
Unpacking a sequence where the test for too long raises a different kind of
error
diff -r e55cc0834e9c -r 13161c1d9c5f Misc/ACKS
--- a/Misc/ACKS Wed Apr 15 17:08:45 2015 -0400
+++ b/Misc/ACKS Wed Apr 15 09:26:22 2015 -0400
@@ -1458,7 +1458,6 @@
Pauli Virtanen
Frank Visser
Johannes Vogel
-Michael Vogt
Radu Voicilas
Alex Volkov
Martijn Vries
diff -r e55cc0834e9c -r 13161c1d9c5f Misc/NEWS
--- a/Misc/NEWS Wed Apr 15 17:08:45 2015 -0400
+++ b/Misc/NEWS Wed Apr 15 09:26:22 2015 -0400
@@ -10,10 +10,6 @@
Core and Builtins
-----------------
-- Issue #22980: Under Linux, GNU/KFreeBSD and the Hurd, C extensions now include
- the architecture triplet in the extension name, to make it easy to test builds
- for different ABIs in the same working tree.
-
- Issue #22631: Added Linux-specific socket constant CAN_RAW_FD_FRAMES.
Patch courtesy of Joe Jevnik.
@@ -36,13 +32,6 @@
Library
-------
-- Issue 19933: Provide default argument for ndigits in round. Patch by
- Vajrasky Kok.
-
-- Issue #23193: Add a numeric_owner parameter to
- tarfile.TarFile.extract and tarfile.TarFile.extractall. Patch by
- Michael Vogt and Eric Smith.
-
- Issue #23342: Add a subprocess.run() function than returns a CalledProcess
instance for a more consistent API than the existing call* functions.
@@ -389,6 +378,10 @@
Core and Builtins
-----------------
+- Issue #22980: Under Linux, C extensions now include bitness in the file
+ name, to make it easy to test 32-bit and 64-bit builds in the same
+ working tree.
+
- Issue #23571: PyObject_Call() and PyCFunction_Call() now raise a SystemError
if a function returns a result and raises an exception. The SystemError is
chained to the previous exception.
diff -r e55cc0834e9c -r 13161c1d9c5f Objects/floatobject.c
--- a/Objects/floatobject.c Wed Apr 15 17:08:45 2015 -0400
+++ b/Objects/floatobject.c Wed Apr 15 09:26:22 2015 -0400
@@ -986,9 +986,8 @@
x = PyFloat_AsDouble(v);
if (!PyArg_ParseTuple(args, "|O", &o_ndigits))
return NULL;
- if (o_ndigits == NULL || o_ndigits == Py_None) {
- /* single-argument round or with None ndigits:
- * round to nearest integer */
+ if (o_ndigits == NULL) {
+ /* single-argument round: round to nearest integer */
rounded = round(x);
if (fabs(x-rounded) == 0.5)
/* halfway case: round to even */
diff -r e55cc0834e9c -r 13161c1d9c5f Python/ceval.c
--- a/Python/ceval.c Wed Apr 15 17:08:45 2015 -0400
+++ b/Python/ceval.c Wed Apr 15 09:26:22 2015 -0400
@@ -3825,17 +3825,9 @@
if (w == NULL) {
/* Iterator done, via error or exhaustion. */
if (!PyErr_Occurred()) {
- if (argcntafter == -1) {
- PyErr_Format(PyExc_ValueError,
- "not enough values to unpack (expected %d, got %d)",
- argcnt, i);
- }
- else {
- PyErr_Format(PyExc_ValueError,
- "not enough values to unpack "
- "(expected at least %d, got %d)",
- argcnt + argcntafter, i);
- }
+ PyErr_Format(PyExc_ValueError,
+ "need more than %d value%s to unpack",
+ i, i == 1 ? "" : "s");
}
goto Error;
}
@@ -3852,9 +3844,8 @@
return 1;
}
Py_DECREF(w);
- PyErr_Format(PyExc_ValueError,
- "too many values to unpack (expected %d)",
- argcnt);
+ PyErr_Format(PyExc_ValueError, "too many values to unpack "
+ "(expected %d)", argcnt);
goto Error;
}
@@ -3866,9 +3857,8 @@
ll = PyList_GET_SIZE(l);
if (ll < argcntafter) {
- PyErr_Format(PyExc_ValueError,
- "not enough values to unpack (expected at least %d, got %zd)",
- argcnt + argcntafter, argcnt + ll);
+ PyErr_Format(PyExc_ValueError, "need more than %zd values to unpack",
+ argcnt + ll);
goto Error;
}
diff -r e55cc0834e9c -r 13161c1d9c5f Tools/msi/bundle/Default.thm
--- a/Tools/msi/bundle/Default.thm Wed Apr 15 17:08:45 2015 -0400
+++ b/Tools/msi/bundle/Default.thm Wed Apr 15 09:26:22 2015 -0400
@@ -104,7 +104,7 @@
- #(loc.SuccessRestartText)
+ #(loc.SuccessRestartText)
@@ -113,9 +113,9 @@
#(loc.FailureHeader)
- #(loc.FailureHyperlinkLogText)
-
- #(loc.FailureRestartText)
+ #(loc.FailureHyperlinkLogText)
+
+ #(loc.FailureRestartText)
diff -r e55cc0834e9c -r 13161c1d9c5f configure
--- a/configure Wed Apr 15 17:08:45 2015 -0400
+++ b/configure Wed Apr 15 09:26:22 2015 -0400
@@ -694,17 +694,15 @@
DLLLIBRARY
LDLIBRARY
LIBRARY
+MULTIARCH
BUILDEXEEXT
EGREP
+GREP
+CPP
NO_AS_NEEDED
-PLATFORM_TRIPLET
-PLATDIR
-MULTIARCH
ac_ct_CXX
MAINCC
CXX
-GREP
-CPP
OBJEXT
EXEEXT
ac_ct_CC
@@ -714,6 +712,7 @@
CC
EXPORT_MACOSX_DEPLOYMENT_TARGET
CONFIGURE_MACOSX_DEPLOYMENT_TARGET
+PLATDIR
SGI_ABI
_PYTHON_HOST_PLATFORM
MACHDEP
@@ -1649,43 +1648,6 @@
} # ac_fn_c_try_compile
-# ac_fn_c_try_cpp LINENO
-# ----------------------
-# Try to preprocess conftest.$ac_ext, and return whether this succeeded.
-ac_fn_c_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_c_preproc_warn_flag$ac_c_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_c_try_cpp
-
# ac_fn_c_try_link LINENO
# -----------------------
# Try to link conftest.$ac_ext, and return whether this succeeded.
@@ -1732,6 +1694,43 @@
} # ac_fn_c_try_link
+# ac_fn_c_try_cpp LINENO
+# ----------------------
+# Try to preprocess conftest.$ac_ext, and return whether this succeeded.
+ac_fn_c_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_c_preproc_warn_flag$ac_c_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_c_try_cpp
+
# ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES
# -------------------------------------------------------
# Tests whether HEADER exists, giving a warning if it cannot be compiled using
@@ -3499,6 +3498,9 @@
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $MACHDEP" >&5
$as_echo "$MACHDEP" >&6; }
+
+PLATDIR=plat-$MACHDEP
+
# Record the configure-time value of MACOSX_DEPLOYMENT_TARGET,
# it may influence the way we can build extensions, so distutils
# needs to check it
@@ -4405,6 +4407,496 @@
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for --with-cxx-main=" >&5
+$as_echo_n "checking for --with-cxx-main=... " >&6; }
+
+# Check whether --with-cxx_main was given.
+if test "${with_cxx_main+set}" = set; then :
+ withval=$with_cxx_main;
+
+ case $withval in
+ no) with_cxx_main=no
+ MAINCC='$(CC)';;
+ yes) with_cxx_main=yes
+ MAINCC='$(CXX)';;
+ *) with_cxx_main=yes
+ MAINCC=$withval
+ if test -z "$CXX"
+ then
+ CXX=$withval
+ fi;;
+ esac
+else
+
+ with_cxx_main=no
+ MAINCC='$(CC)'
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_cxx_main" >&5
+$as_echo "$with_cxx_main" >&6; }
+
+preset_cxx="$CXX"
+if test -z "$CXX"
+then
+ case "$CC" in
+ gcc) if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}g++", so it can be a program name with args.
+set dummy ${ac_tool_prefix}g++; 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_path_CXX+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ case $CXX in
+ [\\/]* | ?:[\\/]*)
+ ac_cv_path_CXX="$CXX" # Let the user override the test with a path.
+ ;;
+ *)
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in notfound
+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_path_CXX="$as_dir/$ac_word$ac_exec_ext"
+ $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
+
+ ;;
+esac
+fi
+CXX=$ac_cv_path_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
+
+
+fi
+if test -z "$ac_cv_path_CXX"; then
+ ac_pt_CXX=$CXX
+ # Extract the first word of "g++", so it can be a program name with args.
+set dummy g++; 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_path_ac_pt_CXX+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ case $ac_pt_CXX in
+ [\\/]* | ?:[\\/]*)
+ ac_cv_path_ac_pt_CXX="$ac_pt_CXX" # Let the user override the test with a path.
+ ;;
+ *)
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in notfound
+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_path_ac_pt_CXX="$as_dir/$ac_word$ac_exec_ext"
+ $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
+
+ ;;
+esac
+fi
+ac_pt_CXX=$ac_cv_path_ac_pt_CXX
+if test -n "$ac_pt_CXX"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_CXX" >&5
+$as_echo "$ac_pt_CXX" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_pt_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_pt_CXX
+ fi
+else
+ CXX="$ac_cv_path_CXX"
+fi
+ ;;
+ cc) if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}c++", so it can be a program name with args.
+set dummy ${ac_tool_prefix}c++; 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_path_CXX+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ case $CXX in
+ [\\/]* | ?:[\\/]*)
+ ac_cv_path_CXX="$CXX" # Let the user override the test with a path.
+ ;;
+ *)
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in notfound
+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_path_CXX="$as_dir/$ac_word$ac_exec_ext"
+ $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
+
+ ;;
+esac
+fi
+CXX=$ac_cv_path_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
+
+
+fi
+if test -z "$ac_cv_path_CXX"; then
+ ac_pt_CXX=$CXX
+ # Extract the first word of "c++", so it can be a program name with args.
+set dummy c++; 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_path_ac_pt_CXX+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ case $ac_pt_CXX in
+ [\\/]* | ?:[\\/]*)
+ ac_cv_path_ac_pt_CXX="$ac_pt_CXX" # Let the user override the test with a path.
+ ;;
+ *)
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in notfound
+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_path_ac_pt_CXX="$as_dir/$ac_word$ac_exec_ext"
+ $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
+
+ ;;
+esac
+fi
+ac_pt_CXX=$ac_cv_path_ac_pt_CXX
+if test -n "$ac_pt_CXX"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_CXX" >&5
+$as_echo "$ac_pt_CXX" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_pt_CXX" = x; then
+ CXX="c++"
+ 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_pt_CXX
+ fi
+else
+ CXX="$ac_cv_path_CXX"
+fi
+ ;;
+ clang|*/clang) if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}clang++", so it can be a program name with args.
+set dummy ${ac_tool_prefix}clang++; 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_path_CXX+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ case $CXX in
+ [\\/]* | ?:[\\/]*)
+ ac_cv_path_CXX="$CXX" # Let the user override the test with a path.
+ ;;
+ *)
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in notfound
+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_path_CXX="$as_dir/$ac_word$ac_exec_ext"
+ $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
+
+ ;;
+esac
+fi
+CXX=$ac_cv_path_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
+
+
+fi
+if test -z "$ac_cv_path_CXX"; then
+ ac_pt_CXX=$CXX
+ # Extract the first word of "clang++", so it can be a program name with args.
+set dummy clang++; 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_path_ac_pt_CXX+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ case $ac_pt_CXX in
+ [\\/]* | ?:[\\/]*)
+ ac_cv_path_ac_pt_CXX="$ac_pt_CXX" # Let the user override the test with a path.
+ ;;
+ *)
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in notfound
+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_path_ac_pt_CXX="$as_dir/$ac_word$ac_exec_ext"
+ $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
+
+ ;;
+esac
+fi
+ac_pt_CXX=$ac_cv_path_ac_pt_CXX
+if test -n "$ac_pt_CXX"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_CXX" >&5
+$as_echo "$ac_pt_CXX" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_pt_CXX" = x; then
+ CXX="clang++"
+ 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_pt_CXX
+ fi
+else
+ CXX="$ac_cv_path_CXX"
+fi
+ ;;
+ esac
+ if test "$CXX" = "notfound"
+ then
+ CXX=""
+ fi
+fi
+if test -z "$CXX"
+then
+ if test -n "$ac_tool_prefix"; then
+ for ac_prog in $CCC c++ g++ gcc CC cxx cc++ cl
+ 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 $CCC c++ g++ gcc CC cxx cc++ cl
+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="notfound"
+ 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
+
+ if test "$CXX" = "notfound"
+ then
+ CXX=""
+ fi
+fi
+if test "$preset_cxx" != "$CXX"
+then
+ { $as_echo "$as_me:${as_lineno-$LINENO}:
+
+ By default, distutils will build C++ extension modules with \"$CXX\".
+ If this is not intended, then set CXX on the configure command line.
+ " >&5
+$as_echo "$as_me:
+
+ By default, distutils will build C++ extension modules with \"$CXX\".
+ If this is not intended, then set CXX on the configure command line.
+ " >&6;}
+fi
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for -Wl,--no-as-needed" >&5
+$as_echo_n "checking for -Wl,--no-as-needed... " >&6; }
+save_LDFLAGS="$LDFLAGS"
+LDFLAGS="$LDFLAGS -Wl,--no-as-needed"
+
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ NO_AS_NEEDED="-Wl,--no-as-needed"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+else
+ NO_AS_NEEDED=""
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LDFLAGS="$save_LDFLAGS"
+
+
+
+# checks for UNIX variants that set C preprocessor variables
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
@@ -4542,6 +5034,7 @@
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5
$as_echo_n "checking for grep that handles long lines and -e... " >&6; }
if ${ac_cv_path_GREP+:} false; then :
@@ -4605,626 +5098,6 @@
GREP="$ac_cv_path_GREP"
-
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for --with-cxx-main=" >&5
-$as_echo_n "checking for --with-cxx-main=... " >&6; }
-
-# Check whether --with-cxx_main was given.
-if test "${with_cxx_main+set}" = set; then :
- withval=$with_cxx_main;
-
- case $withval in
- no) with_cxx_main=no
- MAINCC='$(CC)';;
- yes) with_cxx_main=yes
- MAINCC='$(CXX)';;
- *) with_cxx_main=yes
- MAINCC=$withval
- if test -z "$CXX"
- then
- CXX=$withval
- fi;;
- esac
-else
-
- with_cxx_main=no
- MAINCC='$(CC)'
-
-fi
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_cxx_main" >&5
-$as_echo "$with_cxx_main" >&6; }
-
-preset_cxx="$CXX"
-if test -z "$CXX"
-then
- case "$CC" in
- gcc) if test -n "$ac_tool_prefix"; then
- # Extract the first word of "${ac_tool_prefix}g++", so it can be a program name with args.
-set dummy ${ac_tool_prefix}g++; 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_path_CXX+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- case $CXX in
- [\\/]* | ?:[\\/]*)
- ac_cv_path_CXX="$CXX" # Let the user override the test with a path.
- ;;
- *)
- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in notfound
-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_path_CXX="$as_dir/$ac_word$ac_exec_ext"
- $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
-
- ;;
-esac
-fi
-CXX=$ac_cv_path_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
-
-
-fi
-if test -z "$ac_cv_path_CXX"; then
- ac_pt_CXX=$CXX
- # Extract the first word of "g++", so it can be a program name with args.
-set dummy g++; 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_path_ac_pt_CXX+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- case $ac_pt_CXX in
- [\\/]* | ?:[\\/]*)
- ac_cv_path_ac_pt_CXX="$ac_pt_CXX" # Let the user override the test with a path.
- ;;
- *)
- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in notfound
-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_path_ac_pt_CXX="$as_dir/$ac_word$ac_exec_ext"
- $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
-
- ;;
-esac
-fi
-ac_pt_CXX=$ac_cv_path_ac_pt_CXX
-if test -n "$ac_pt_CXX"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_CXX" >&5
-$as_echo "$ac_pt_CXX" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
- if test "x$ac_pt_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_pt_CXX
- fi
-else
- CXX="$ac_cv_path_CXX"
-fi
- ;;
- cc) if test -n "$ac_tool_prefix"; then
- # Extract the first word of "${ac_tool_prefix}c++", so it can be a program name with args.
-set dummy ${ac_tool_prefix}c++; 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_path_CXX+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- case $CXX in
- [\\/]* | ?:[\\/]*)
- ac_cv_path_CXX="$CXX" # Let the user override the test with a path.
- ;;
- *)
- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in notfound
-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_path_CXX="$as_dir/$ac_word$ac_exec_ext"
- $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
-
- ;;
-esac
-fi
-CXX=$ac_cv_path_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
-
-
-fi
-if test -z "$ac_cv_path_CXX"; then
- ac_pt_CXX=$CXX
- # Extract the first word of "c++", so it can be a program name with args.
-set dummy c++; 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_path_ac_pt_CXX+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- case $ac_pt_CXX in
- [\\/]* | ?:[\\/]*)
- ac_cv_path_ac_pt_CXX="$ac_pt_CXX" # Let the user override the test with a path.
- ;;
- *)
- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in notfound
-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_path_ac_pt_CXX="$as_dir/$ac_word$ac_exec_ext"
- $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
-
- ;;
-esac
-fi
-ac_pt_CXX=$ac_cv_path_ac_pt_CXX
-if test -n "$ac_pt_CXX"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_CXX" >&5
-$as_echo "$ac_pt_CXX" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
- if test "x$ac_pt_CXX" = x; then
- CXX="c++"
- 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_pt_CXX
- fi
-else
- CXX="$ac_cv_path_CXX"
-fi
- ;;
- clang|*/clang) if test -n "$ac_tool_prefix"; then
- # Extract the first word of "${ac_tool_prefix}clang++", so it can be a program name with args.
-set dummy ${ac_tool_prefix}clang++; 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_path_CXX+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- case $CXX in
- [\\/]* | ?:[\\/]*)
- ac_cv_path_CXX="$CXX" # Let the user override the test with a path.
- ;;
- *)
- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in notfound
-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_path_CXX="$as_dir/$ac_word$ac_exec_ext"
- $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
-
- ;;
-esac
-fi
-CXX=$ac_cv_path_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
-
-
-fi
-if test -z "$ac_cv_path_CXX"; then
- ac_pt_CXX=$CXX
- # Extract the first word of "clang++", so it can be a program name with args.
-set dummy clang++; 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_path_ac_pt_CXX+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- case $ac_pt_CXX in
- [\\/]* | ?:[\\/]*)
- ac_cv_path_ac_pt_CXX="$ac_pt_CXX" # Let the user override the test with a path.
- ;;
- *)
- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in notfound
-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_path_ac_pt_CXX="$as_dir/$ac_word$ac_exec_ext"
- $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
-
- ;;
-esac
-fi
-ac_pt_CXX=$ac_cv_path_ac_pt_CXX
-if test -n "$ac_pt_CXX"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_CXX" >&5
-$as_echo "$ac_pt_CXX" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
- if test "x$ac_pt_CXX" = x; then
- CXX="clang++"
- 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_pt_CXX
- fi
-else
- CXX="$ac_cv_path_CXX"
-fi
- ;;
- esac
- if test "$CXX" = "notfound"
- then
- CXX=""
- fi
-fi
-if test -z "$CXX"
-then
- if test -n "$ac_tool_prefix"; then
- for ac_prog in $CCC c++ g++ gcc CC cxx cc++ cl
- 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 $CCC c++ g++ gcc CC cxx cc++ cl
-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="notfound"
- 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
-
- if test "$CXX" = "notfound"
- then
- CXX=""
- fi
-fi
-if test "$preset_cxx" != "$CXX"
-then
- { $as_echo "$as_me:${as_lineno-$LINENO}:
-
- By default, distutils will build C++ extension modules with \"$CXX\".
- If this is not intended, then set CXX on the configure command line.
- " >&5
-$as_echo "$as_me:
-
- By default, distutils will build C++ extension modules with \"$CXX\".
- If this is not intended, then set CXX on the configure command line.
- " >&6;}
-fi
-
-
-MULTIARCH=$($CC --print-multiarch 2>/dev/null)
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for the platform triplet based on compiler characteristics" >&5
-$as_echo_n "checking for the platform triplet based on compiler characteristics... " >&6; }
-cat >> conftest.c <conftest.out 2>/dev/null; then
- PLATFORM_TRIPLET=`grep -v '^#' conftest.out | grep -v '^ *$' | tr -d ' '`
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PLATFORM_TRIPLET" >&5
-$as_echo "$PLATFORM_TRIPLET" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
-$as_echo "none" >&6; }
-fi
-rm -f conftest.c conftest.out
-
-if test x$PLATFORM_TRIPLET != x && test x$MULTIARCH != x; then
- if test x$PLATFORM_TRIPLET != x$MULTIARCH; then
- as_fn_error $? "internal configure error for the platform triplet, please file a bug report" "$LINENO" 5
- fi
-fi
-PLATDIR=plat-$MACHDEP
-
-
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for -Wl,--no-as-needed" >&5
-$as_echo_n "checking for -Wl,--no-as-needed... " >&6; }
-save_LDFLAGS="$LDFLAGS"
-LDFLAGS="$LDFLAGS -Wl,--no-as-needed"
-
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- NO_AS_NEEDED="-Wl,--no-as-needed"
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-else
- NO_AS_NEEDED=""
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-LDFLAGS="$save_LDFLAGS"
-
-
-
-# checks for UNIX variants that set C preprocessor variables
-
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5
$as_echo_n "checking for egrep... " >&6; }
if ${ac_cv_path_EGREP+:} false; then :
@@ -5543,6 +5416,10 @@
esac;;
esac
+MULTIARCH=$($CC --print-multiarch 2>/dev/null)
+
+
+
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking LIBRARY" >&5
$as_echo_n "checking LIBRARY... " >&6; }
@@ -14352,7 +14229,15 @@
$as_echo "$ABIFLAGS" >&6; }
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking SOABI" >&5
$as_echo_n "checking SOABI... " >&6; }
-SOABI='cpython-'`echo $VERSION | tr -d .`${ABIFLAGS}${PLATFORM_TRIPLET:+-$PLATFORM_TRIPLET}
+
+case $ac_sys_system in
+ Linux*|GNU*)
+ BITNESS_SUFFIX=-$(($ac_cv_sizeof_void_p * 8))b;;
+ *)
+ BITNESS_SUFFIX=;;
+esac
+SOABI='cpython-'`echo $VERSION | tr -d .`${ABIFLAGS}${BITNESS_SUFFIX}
+
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $SOABI" >&5
$as_echo "$SOABI" >&6; }
diff -r e55cc0834e9c -r 13161c1d9c5f configure.ac
--- a/configure.ac Wed Apr 15 17:08:45 2015 -0400
+++ b/configure.ac Wed Apr 15 09:26:22 2015 -0400
@@ -425,7 +425,7 @@
esac
_PYTHON_HOST_PLATFORM="$MACHDEP${_host_cpu:+-$_host_cpu}"
fi
-
+
# Some systems cannot stand _XOPEN_SOURCE being defined at all; they
# disable features if it is defined, without any means to access these
# features as extensions. For these systems, we skip the definition of
@@ -556,6 +556,9 @@
fi
AC_MSG_RESULT($MACHDEP)
+AC_SUBST(PLATDIR)
+PLATDIR=plat-$MACHDEP
+
# Record the configure-time value of MACOSX_DEPLOYMENT_TARGET,
# it may influence the way we can build extensions, so distutils
# needs to check it
@@ -664,8 +667,6 @@
fi
fi
AC_PROG_CC
-AC_PROG_CPP
-AC_PROG_GREP
AC_SUBST(CXX)
AC_SUBST(MAINCC)
@@ -723,132 +724,6 @@
fi
-MULTIARCH=$($CC --print-multiarch 2>/dev/null)
-AC_SUBST(MULTIARCH)
-
-AC_MSG_CHECKING([for the platform triplet based on compiler characteristics])
-cat >> conftest.c <conftest.out 2>/dev/null; then
- PLATFORM_TRIPLET=`grep -v '^#' conftest.out | grep -v '^ *$' | tr -d ' '`
- AC_MSG_RESULT([$PLATFORM_TRIPLET])
-else
- AC_MSG_RESULT([none])
-fi
-rm -f conftest.c conftest.out
-
-if test x$PLATFORM_TRIPLET != x && test x$MULTIARCH != x; then
- if test x$PLATFORM_TRIPLET != x$MULTIARCH; then
- AC_MSG_ERROR([internal configure error for the platform triplet, please file a bug report])
- fi
-fi
-PLATDIR=plat-$MACHDEP
-AC_SUBST(PLATDIR)
-AC_SUBST(PLATFORM_TRIPLET)
-
-
AC_MSG_CHECKING([for -Wl,--no-as-needed])
save_LDFLAGS="$LDFLAGS"
LDFLAGS="$LDFLAGS -Wl,--no-as-needed"
@@ -916,6 +791,10 @@
esac;;
esac
+MULTIARCH=$($CC --print-multiarch 2>/dev/null)
+AC_SUBST(MULTIARCH)
+
+
AC_SUBST(LIBRARY)
AC_MSG_CHECKING(LIBRARY)
if test -z "$LIBRARY"
@@ -4304,7 +4183,15 @@
AC_MSG_CHECKING(ABIFLAGS)
AC_MSG_RESULT($ABIFLAGS)
AC_MSG_CHECKING(SOABI)
-SOABI='cpython-'`echo $VERSION | tr -d .`${ABIFLAGS}${PLATFORM_TRIPLET:+-$PLATFORM_TRIPLET}
+
+case $ac_sys_system in
+ Linux*|GNU*)
+ BITNESS_SUFFIX=-$(($ac_cv_sizeof_void_p * 8))b;;
+ *)
+ BITNESS_SUFFIX=;;
+esac
+SOABI='cpython-'`echo $VERSION | tr -d .`${ABIFLAGS}${BITNESS_SUFFIX}
+
AC_MSG_RESULT($SOABI)
AC_SUBST(EXT_SUFFIX)