File: 3rdparty_libraries.py

package info (click to toggle)
openmsx 20.0%2Bdfsg-1.2
  • links: PTS
  • area: main
  • in suites: forky, sid, trixie
  • size: 27,544 kB
  • sloc: cpp: 236,922; xml: 49,948; tcl: 15,056; python: 5,385; perl: 281; sh: 77; makefile: 53
file content (35 lines) | stat: -rw-r--r-- 995 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# Prints which 3rd party libraries are desired for the given configuration.

from components import requiredLibrariesFor
from configurations import getConfiguration
from libraries import allDependencies, librariesByName
from packages import iterDownloadablePackages

def main(platform, linkMode):
	configuration = getConfiguration(linkMode)
	components = configuration.iterDesiredComponents()

	# Compute the set of all directly and indirectly required libraries,
	# then filter out system libraries.
	thirdPartyLibs = set(
		makeName
		for makeName in allDependencies(requiredLibrariesFor(components))
		if not librariesByName[makeName].isSystemLibrary(platform)
		)

	print(' '.join(sorted(thirdPartyLibs)))

if __name__ == '__main__':
	import sys
	if len(sys.argv) == 3:
		try:
			main(*sys.argv[1 : ])
		except ValueError as ex:
			print(ex, file=sys.stderr)
			sys.exit(2)
	else:
		print(
			'Usage: python3 3rdparty_libraries.py TARGET_OS LINK_MODE',
			file=sys.stderr
			)
		sys.exit(2)