mirror of
https://github.com/wesnoth/wesnoth
synced 2025-04-15 09:10:56 +00:00

This is workaround for windows style path confusing scons if they appear
in CPPATH etc. Paths without prefix still happen to be valid and they
start with "/", not "c:".
(cherry-picked from commit b347bc70b1
)
27 lines
803 B
Python
Executable File
27 lines
803 B
Python
Executable File
# vi: syntax=python:et:ts=4
|
|
|
|
import os, sys
|
|
|
|
def run_pkg_config(context, name):
|
|
env = context.env
|
|
try:
|
|
env["ENV"]["PKG_CONFIG_PATH"] = os.environ.get("PKG_CONFIG_PATH", "")
|
|
env.ParseConfig("pkg-config --libs --cflags $PKG_CONFIG_FLAGS --silence-errors $PKGCONFIG_FLAGS \"" + name + "\"")
|
|
context.Log("Found '" + name + "' with pkg-config.\n")
|
|
return True
|
|
except OSError:
|
|
context.Log("Failed to find '" + name + "' with pkg-config.\n")
|
|
return False
|
|
|
|
def CheckPKG(context, name):
|
|
env = context.env
|
|
context.Message( 'Checking for %s... ' % name )
|
|
if run_pkg_config(context, name):
|
|
context.Result("yes")
|
|
return True
|
|
else:
|
|
context.Result("no")
|
|
return False
|
|
|
|
config_checks = { "CheckPKG" : CheckPKG }
|