changeset: 79081:78aba41a8105 branch: 3.2 parent: 79077:fe8bd8b621a2 user: doko@ubuntu.com date: Fri Sep 21 13:52:29 2012 +0200 files: Misc/NEWS setup.py description: - Issue #11715: Fix multiarch detection without having Debian development tools (dpkg-dev) installed. diff -r fe8bd8b621a2 -r 78aba41a8105 Misc/NEWS --- a/Misc/NEWS Thu Sep 20 23:48:23 2012 -0400 +++ b/Misc/NEWS Fri Sep 21 13:52:29 2012 +0200 @@ -541,6 +541,9 @@ Build ----- +- Issue #11715: Fix multiarch detection without having Debian development + tools (dpkg-dev) installed. + - Issue #15819: Make sure we can build Python out-of-tree from a readonly source directory. (Somewhat related to Issue #9860.) diff -r fe8bd8b621a2 -r 78aba41a8105 setup.py --- a/setup.py Thu Sep 20 23:48:23 2012 -0400 +++ b/setup.py Fri Sep 21 13:52:29 2012 +0200 @@ -376,6 +376,27 @@ def add_multiarch_paths(self): # Debian/Ubuntu multiarch support. # https://wiki.ubuntu.com/MultiarchSpec + cc = sysconfig.get_config_var('CC') + tmpfile = os.path.join(self.build_temp, 'multiarch') + if not os.path.exists(self.build_temp): + os.makedirs(self.build_temp) + ret = os.system( + '%s -print-multiarch> %s 2> /dev/null' % (cc, tmpfile)) + multiarch_path_component = '' + try: + if ret>> 8 == 0: + with open(tmpfile) as fp: + multiarch_path_component = fp.readline().strip() + finally: + os.unlink(tmpfile) + + if multiarch_path_component != '': + add_dir_to_list(self.compiler.library_dirs, + '/usr/lib/' + multiarch_path_component) + add_dir_to_list(self.compiler.include_dirs, + '/usr/include/' + multiarch_path_component) + return + if not find_executable('dpkg-architecture'): return tmpfile = os.path.join(self.build_temp, 'multiarch')

AltStyle によって変換されたページ (->オリジナル) /