Unverified Commit de39c621 authored by Karl Linden's avatar Karl Linden
Browse files

Check packages before anything else so use variables can be used in checks.

This makes sure header checks work when the third party package is
installed in a non-standard location, as long as a pkg-config file is
found.
parent 8b8be738
......@@ -187,10 +187,23 @@ class AutoOption:
"""
all_found = True
# Use-variables that should be used when checking libraries, headers and
# programs. The list will be populated when looking for packages.
use = []
# check for packages
for package,uselib_store,atleast_version in self.packages:
try:
conf.check_cfg(package=package, uselib_store=uselib_store, atleast_version=atleast_version, args='--cflags --libs')
use.append(uselib_store)
except conf.errors.ConfigurationError:
all_found = False
self.packages_not_found.append([package,atleast_version])
# check for libraries
for lib,uselib_store in self.libs:
try:
conf.check_cc(lib=lib, uselib_store=uselib_store)
conf.check_cc(lib=lib, uselib_store=uselib_store, use=use)
except conf.errors.ConfigurationError:
all_found = False
self.libs_not_found.append(lib)
......@@ -198,23 +211,15 @@ class AutoOption:
# check for headers
for header in self.headers:
try:
conf.check_cc(header_name=header)
conf.check_cc(header_name=header, use=use)
except conf.errors.ConfigurationError:
all_found = False
self.headers_not_found.append(header)
# check for packages
for package,uselib_store,atleast_version in self.packages:
try:
conf.check_cfg(package=package, uselib_store=uselib_store, atleast_version=atleast_version, args='--cflags --libs')
except conf.errors.ConfigurationError:
all_found = False
self.packages_not_found.append([package,atleast_version])
# check for programs
for program,var in self.programs:
try:
conf.find_program(program, var=var)
conf.find_program(program, var=var, use=use)
except conf.errors.ConfigurationError:
all_found = False
self.programs_not_found.append(program)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment