diff options
author | Chris Johns <chrisj@rtems.org> | 2014-06-15 17:40:34 +1200 |
---|---|---|
committer | Chris Johns <chrisj@rtems.org> | 2014-06-15 17:40:34 +1200 |
commit | 0ffee1931680e92757a4d91199e2517f05e7364d (patch) | |
tree | 0a0447a40008a02e238bfa55ab0c7a413de4b47a /source-builder/pkg-config | |
parent | sb: Tighten the canadian cross compile detection. (diff) | |
download | rtems-source-builder-0ffee1931680e92757a4d91199e2517f05e7364d.tar.bz2 |
sb: Add support for building RTEMS 3rd party packages.
Remove the 'opt' from various macros and shell variables.
Add pkgconfig to the checks to make it clear the check is a
pkgconfig check.
Add NTP support as the first package to be built using the RSB.
Split the RTEMS URL's out from the base bset file into a separate
file that be included by other files.
Add an RTEMS BSP configuration file to help abstract the process
of building 3rd party packages.
Clean the cross and canadian cross support up so we can cleanly support
cross and canadian cross building.
Refactor the pkgconfig support and clean up the PC file handling of
loading modules.
Add support for %{?..} to return false if a macro is %{nil}.
Add %{pkgconfig ..} support to allow better control of access RTEMS
pkgconfig files.
Diffstat (limited to 'source-builder/pkg-config')
-rwxr-xr-x | source-builder/pkg-config | 51 |
1 files changed, 7 insertions, 44 deletions
diff --git a/source-builder/pkg-config b/source-builder/pkg-config index 21c63d7..a10dc9b 100755 --- a/source-builder/pkg-config +++ b/source-builder/pkg-config @@ -58,13 +58,18 @@ trace = True trace_stdout = False logfile = 'pkg-config.log' out = None +srcfd = None # # Write all the package source parsed to a single file. # trace_src = True if trace_src: - src = open('pkg-src.txt', 'w') + srcfd = open('pkg-src.txt', 'w') + +def src(text): + if srcfd: + srcfs.writelines(text) def log(s, lf = True): global trace, logfile, out @@ -83,48 +88,6 @@ def log(s, lf = True): print s, print >> out, s, -def _check_package(libraries, args): - ec = 1 - pkg = None - flags = { 'cflags': '', - 'libs': '' } - log('libraries: %s' % (libraries)) - libs = pkgconfig.package.splitter(libraries) - for lib in libs: - log('pkg: %s' % (lib)) - pkg = pkgconfig.package(lib[0], prefix = args.prefix, output = log, src = src) - if args.dump: - log(pkg) - if pkg.exists(): - if len(lib) == 1: - if args.exact_version: - if pkg.check('=', args.exact_version): - ec = 0 - elif args.atleast_version: - if pkg.check('>=', args.atleast_version): - ec = 0 - elif args.max_version: - if pkg.check('<=', args.max_version): - ec = 0 - else: - ec = 0 - else: - if len(lib) != 3: - raise error('invalid package check: %s' % (' '.join(lib))) - if pkg.check(lib[1], lib[2]): - ec = 0 - if ec == 0: - cflags = pkg.get('cflags') - if cflags: - flags['cflags'] += cflags - libs = pkg.get('libs', private = False) - if libs: - flags['libs'] += libs - break - if ec > 0: - break - return ec, pkg, flags - def run(argv): class version_action(argparse.Action): @@ -224,7 +187,7 @@ def run(argv): if args.atleast_pkgconfig_version: ec = 0 else: - ec, pkg, flags = _check_package(args.libraries, args) + ec, pkg, flags = pkgconfig.check_package(args.libraries, args, log, src) if ec == 0: if args.cflags: if len(flags['cflags']): |