How to use the pkgconfig.check_package 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
if (args.exists and (args.exact_version or args.max_version)) or \
            (args.exact_version and (args.exists or args.max_version)) or \
            (args.max_version and (args.exists or args.exact_version)):
        raise error('only one of --exists, --exact-version, or --max-version')

    if args.dont_define_prefix:
        args.prefix = pkgconfig.default_prefix(False)

    exists = False

    ec = 1

    if args.atleast_pkgconfig_version:
        ec = 0
    else:
        ec, pkg, flags = pkgconfig.check_package(args.libraries, args, log, src)
        if ec == 0:
            if args.cflags:
                if len(flags['cflags']):
                    print(flags['cflags'])
                    log('cflags: %s' % (flags['cflags']))
                else:
                    log('cflags: empty')
            if args.libs:
                if len(flags['libs']):
                    print(flags['libs'])
                    log('libs: %s' % (flags['libs']))
                else:
                    log('libs: empty')

    #pkgconfig.package.dump_loaded()