3rdparty_libraries.py 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. # Prints which 3rd party libraries are desired for the given configuration.
  2. from components import requiredLibrariesFor
  3. from configurations import getConfiguration
  4. from libraries import allDependencies, librariesByName
  5. from packages import iterDownloadablePackages
  6. def main(platform, linkMode):
  7. configuration = getConfiguration(linkMode)
  8. components = configuration.iterDesiredComponents()
  9. # Compute the set of all directly and indirectly required libraries,
  10. # then filter out system libraries.
  11. thirdPartyLibs = set(
  12. makeName
  13. for makeName in allDependencies(requiredLibrariesFor(components))
  14. if not librariesByName[makeName].isSystemLibrary(platform)
  15. )
  16. # ALSA exists on Linux only.
  17. # While Android has the necessary kernel interfaces, the lib doesn't
  18. # support Android.
  19. if platform != 'linux':
  20. thirdPartyLibs.discard('ALSA')
  21. print ' '.join(sorted(thirdPartyLibs))
  22. if __name__ == '__main__':
  23. import sys
  24. if len(sys.argv) == 3:
  25. try:
  26. main(*sys.argv[1 : ])
  27. except ValueError, ex:
  28. print >> sys.stderr, ex
  29. sys.exit(2)
  30. else:
  31. print >> sys.stderr, (
  32. 'Usage: python 3rdparty_libraries.py TARGET_OS LINK_MODE'
  33. )
  34. sys.exit(2)