summaryrefslogtreecommitdiffstats
path: root/waftools/generators
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2015-01-02 03:06:06 +0100
committerwm4 <wm4@nowhere>2015-01-02 03:06:06 +0100
commita2d790b3a464837e3387cd60c056cfde59855015 (patch)
treeb106b8592da3afe98d170d9a0c595677cbf61893 /waftools/generators
parent594114e660a1b7626d8358a2b24fe000166e0ad8 (diff)
downloadmpv-a2d790b3a464837e3387cd60c056cfde59855015.tar.bz2
mpv-a2d790b3a464837e3387cd60c056cfde59855015.tar.xz
player: print config.h contents in verbose mode
It was requested that mpv should print what features etc. have been enabled at compile time. It can print the configure command line, but it obviously doesn't include autodetected features. I tried to think of a nicer way than dumping the config.h as text, but this was still the simplest way.
Diffstat (limited to 'waftools/generators')
-rw-r--r--waftools/generators/headers.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/waftools/generators/headers.py b/waftools/generators/headers.py
index 79bd71d0f0..30a4e365e4 100644
--- a/waftools/generators/headers.py
+++ b/waftools/generators/headers.py
@@ -35,10 +35,15 @@ def __write_version_h__(ctx):
__cp_to_variant__(ctx, ctx.options.variant, 'version.h')
ctx.end_msg("version.h", "PINK")
+# Approximately escape the string as C string literal
+def __escape_c_string(s):
+ return s.replace("\"", "\\\"").replace("\n", "\\n")
+
def __add_mplayer_defines__(ctx):
from sys import argv
ctx.define("CONFIGURATION", " ".join(argv))
ctx.define("MPLAYER_CONFDIR", ctx.env.CONFDIR)
+ ctx.define("FULLCONFIG", "\\n" + __escape_c_string(ctx.get_config_header()) + "\\n")
def configure(ctx):
__add_mplayer_defines__(ctx)