extralibs.py 485 B

123456789101112131415161718
  1. def onpy_extralibs(unit, *args):
  2. """
  3. @usage: EXTRALIBS(liblist)
  4. Add external dynamic libraries during program linkage stage" }
  5. """
  6. libs = unit.get("OBJADDE_LIB_GLOBAL")
  7. changed = False
  8. if not libs:
  9. libs = ''
  10. for lib in args:
  11. if not lib.startswith('-'):
  12. lib = '-l' + lib
  13. if lib not in libs:
  14. libs = libs + ' ' + lib
  15. changed = True
  16. if changed:
  17. unit.set(["OBJADDE_LIB_GLOBAL", libs])