File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -312,6 +312,9 @@ Tests
312312Build
313313-----
314314
315+ - Issue #11715: Fix multiarch detection without having Debian development
316+ tools (dpkg-dev) installed.
317+
315318- Issue #15037: Build OS X installers with local copy of ncurses 5.9 libraries
316319 to avoid curses.unget_wch bug present in older versions of ncurses such as
317320 those shipped with OS X.
Original file line number Diff line number Diff line change @@ -379,6 +379,27 @@ def build_extension(self, ext):
379379 def add_multiarch_paths (self ):
380380 # Debian/Ubuntu multiarch support.
381381 # https://wiki.ubuntu.com/MultiarchSpec
382+ cc = sysconfig .get_config_var ('CC' )
383+ tmpfile = os .path .join (self .build_temp , 'multiarch' )
384+ if not os .path .exists (self .build_temp ):
385+ os .makedirs (self .build_temp )
386+ ret = os .system (
387+ '%s -print-multiarch > %s 2> /dev/null' % (cc , tmpfile ))
388+ multiarch_path_component = ''
389+ try :
390+ if ret >> 8 == 0 :
391+ with open (tmpfile ) as fp :
392+ multiarch_path_component = fp .readline ().strip ()
393+ finally :
394+ os .unlink (tmpfile )
395+
396+ if multiarch_path_component != '' :
397+ add_dir_to_list (self .compiler .library_dirs ,
398+ '/usr/lib/' + multiarch_path_component )
399+ add_dir_to_list (self .compiler .include_dirs ,
400+ '/usr/include/' + multiarch_path_component )
401+ return
402+
382403 if not find_executable ('dpkg-architecture' ):
383404 return
384405 opt = ''
You can’t perform that action at this time.
0 commit comments