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.
This commit is contained in:
Chris Johns
2014-06-15 17:40:34 +12:00
parent 339f92f89f
commit 0ffee19316
24 changed files with 441 additions and 164 deletions

View File

@@ -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']):