python-2.7-003-no-import-when-cross-compiling.patch 1003 B

1234567891011121314151617181920212223242526
  1. Disable import check when cross-compiling
  2. Once Python has compiled an extension (i.e some C code, potentially
  3. linked to a library), it tries to import it. This cannot work in
  4. cross-compilation mode, so we just disable this check.
  5. Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
  6. ---
  7. setup.py | 4 ++++
  8. 1 file changed, 4 insertions(+)
  9. Index: Python-2.7.2/setup.py
  10. ===================================================================
  11. --- Python-2.7.2.orig/setup.py
  12. +++ Python-2.7.2/setup.py
  13. @@ -304,6 +304,10 @@
  14. self.announce('WARNING: skipping import check for Cygwin-based "%s"'
  15. % ext.name)
  16. return
  17. + if os.environ.get('CROSS_COMPILING') == 'yes':
  18. + self.announce('WARNING: skipping import check for cross compiled "%s"'
  19. + % ext.name)
  20. + return
  21. ext_filename = os.path.join(
  22. self.build_lib,
  23. self.get_ext_filename(self.get_ext_fullname(ext.name)))