diff -r 0bacbab678ed setup.py --- a/setup.py Thu Jun 28 13:53:43 2012 +0300 +++ b/setup.py Tue Aug 07 11:59:04 2012 +0200 @@ -370,6 +370,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')