Ein Roboter mit bürstenlosem Antrieb, differenzial und NRF24L01 Funk. Großflächig gebaut um ein großes Solarpanel aufzunehmen. https://gitlab.informatik.hs-fulda.de/fdai5253/roboter
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

38 lines
1.8 KiB

  1. import sys
  2. from distutils import unixccompiler
  3. from distutils import ccompiler
  4. def register():
  5. sys.modules['distutils.crossunixccompiler'] = sys.modules[__name__]
  6. ccompiler.compiler_class['crossunix'] = (__name__,
  7. 'CrossUnixCCompiler',
  8. 'UNIX-style compiler for cross compilation')
  9. def try_remove_all(lst, starts):
  10. lst[:] = [x for x in lst if not x.startswith(starts)]
  11. class CrossUnixCCompiler(unixccompiler.UnixCCompiler):
  12. def _compile(self, obj, src, ext, cc_args, extra_postargs, pp_opts):
  13. try_remove_all(self.compiler_so, ('-m64', '-fstack-protector-strong', '-mtune=generic'))
  14. try_remove_all(cc_args, '-I/usr')
  15. try_remove_all(pp_opts, '-I/usr')
  16. return unixccompiler.UnixCCompiler._compile(self, obj, src, ext, cc_args, extra_postargs, pp_opts)
  17. def link(self, target_desc, objects,
  18. output_filename, output_dir=None, libraries=None,
  19. library_dirs=None, runtime_library_dirs=None,
  20. export_symbols=None, debug=0, extra_preargs=None,
  21. extra_postargs=None, build_temp=None, target_lang=None):
  22. try_remove_all(self.library_dirs, ('/usr'))
  23. return unixccompiler.UnixCCompiler.link(self, target_desc, objects, output_filename, output_dir, libraries,
  24. library_dirs, runtime_library_dirs, export_symbols, debug,
  25. extra_preargs, extra_postargs, build_temp, target_lang)
  26. def _fix_lib_args(self, libraries, library_dirs, runtime_library_dirs):
  27. self.__class__ = unixccompiler.UnixCCompiler
  28. ret = unixccompiler.UnixCCompiler._fix_lib_args(self, libraries, library_dirs, runtime_library_dirs)
  29. self.__class__ = CrossUnixCCompiler
  30. return ret