player: dump list of satisfied deps instead of config.h with -v

Starting to get tired of seeing the full config.h in verbose output
every time. Make it slightly more elegant by outputting the list of
satisfied dependencies instead.
This commit is contained in:
wm4 2015-03-11 23:33:05 +01:00
parent 7e9c441d41
commit 8a4239e0c2
2 changed files with 12 additions and 2 deletions

View File

@ -130,7 +130,7 @@ void mp_print_version(struct mp_log *log, int always)
// Only in verbose mode.
if (!always) {
mp_msg(log, MSGL_V, "Configuration: " CONFIGURATION "\n");
mp_msg(log, MSGL_V, "config.h:\n%s\n", FULLCONFIG);
mp_msg(log, MSGL_V, "List of enabled features: %s\n", FULLCONFIG);
}
}

View File

@ -39,11 +39,21 @@ def __write_version_h__(ctx):
def __escape_c_string(s):
return s.replace("\"", "\\\"").replace("\n", "\\n")
def __get_features_string__(ctx):
from inflectors import DependencyInflector
stuff = []
for dependency_identifier in ctx.satisfied_deps:
defkey = DependencyInflector(dependency_identifier).define_key()
if ctx.is_defined(defkey) and ctx.get_define(defkey) == "1":
stuff.append(dependency_identifier)
stuff.sort()
return " ".join(stuff)
def __add_mpv_defines__(ctx):
from sys import argv
ctx.define("CONFIGURATION", " ".join(argv))
ctx.define("MPV_CONFDIR", ctx.env.CONFDIR)
ctx.define("FULLCONFIG", "\\n" + __escape_c_string(ctx.get_config_header()) + "\\n")
ctx.define("FULLCONFIG", __escape_c_string(__get_features_string__(ctx)))
def configure(ctx):
__add_mpv_defines__(ctx)