How to use the pkgconfig.error function in pkgconfig

To help you get started, we’ve selected a few pkgconfig examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github RTEMS / rtems-source-builder / source-builder / sb / cmd-pkg-config.py View on Github external
#pkgconfig.package.dump_loaded()

    return ec

try:
    log('-' * 40)
    log('pkg-config', lf = False)
    for a in sys.argv[2:]:
        log(' "%s"' % (a), lf = False)
    log('')
    ec = run(sys.argv[1:])
    log('ec = %d' % (ec))
except ImportError:
    print("incorrect package config installation", file = sys.stderr)
    sys.exit(1)
except pkgconfig.error as e:
    print('error: %s' % (e), file = sys.stderr)
    sys.exit(1)
sys.exit(ec)
github RTEMS / rtems-examples / rtems_waf / rtems.py View on Github external
def _load_flags_set(flags, arch_bsp, conf, config, pkg):
    conf.to_log('%s ->' % flags)
    if pkg is not None:
        flagstr = ''
        try:
            flagstr = pkg.get(flags)
        except pkgconfig.error as e:
            conf.to_log('pkconfig warning: ' + e.msg)
        conf.to_log('  ' + flagstr)
    else:
        flags_map = { 'CFLAGS': '--cflags',
                      'LDFLAGS': '--ldflags',
                      'LIB': '--libs' }
        ab = arch_bsp.split('-')
        #conf.check_cfg(path = config,
        #               package = '',
        #               uselib_store = 'rtems',
        #               args = '--bsp %s/%s %s' % (ab[0], ab[2], flags_map[flags]))
        #print conf.env
        #print '%r' % conf
        #flagstr = '-l -c'
        flagstr = subprocess.check_output([config, '--bsp', '%s/%s' % (ab[0], ab[2]), flags_map[flags]])
        #print flags, ">>>>", flagstr
github RTEMS / rtems-source-builder / source-builder / sb / config.py View on Github external
if not self._cross_compile() or self.pkgconfig_crosscompile:
            try:
                pkg = pkgconfig.package(test[0],
                                        prefix = self.pkgconfig_prefix,
                                        output = self._output,
                                        src = log.trace)
                if len(test) != 1 and len(test) != 3:
                    self._error('malformed check: %s' % (' '.join(test)))
                else:
                    op = '>='
                    ver = '0'
                    if len(test) == 3:
                        op = test[1]
                        ver = self.macros.expand(test[2])
                    ok = pkg.check(op, ver)
            except pkgconfig.error as pe:
                self._error('pkgconfig: check: %s' % (pe))
            except:
                raise error.internal('pkgconfig failure')
        if ok:
            return '1'
        return '0'