build-common

Shared build system code (usually as a git submodule)
Log | Files | Refs | README | LICENSE

commit 281e3352e030d06943ea8615b78fa21ca63bc2bc
parent 62a0f36589b25a23680d59c7c30bf42891a17131
Author: Florian Dold <florian@dold.me>
Date:   Fri, 28 Oct 2022 14:39:28 +0200

compatibility with old scripts

Diffstat:
Mtalerbuildconfig.py | 13+++++++++----
1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/talerbuildconfig.py b/talerbuildconfig.py @@ -79,7 +79,7 @@ class BuildConfig: self.args = None self.prefix_enabled = False self.configmk_enabled = False - self.dotconfigmk_enabled = False + self.configmk_dotfile = False def add_tool(self, tool): """Deprecated. Prefer the 'use' method.""" @@ -109,9 +109,10 @@ class BuildConfig: def _error(self, msg): print("Error", msg) - def enable_configmk(self): + def enable_configmk(self, dotfile=False): """If enabled, output the config.mk makefile fragment.""" self.configmk_enabled = True + self.configmk_dotfile = dotfile def run(self): parser = argparse.ArgumentParser() @@ -156,10 +157,14 @@ class BuildConfig: print(f"found {tool.name} as {path} (version {version})") if self.configmk_enabled: - d = Path(".") + if self.configmk_dotfile: + print("writing .config.mk") + d = Path(".") + else: + print("writing config.mk") + d = Path(os.environ.get("TALERBUILDSYSTEMDIR", ".")) d.mkdir(parents=True, exist_ok=True) with open(d / ".config.mk", "w") as f: - print("writing .config.mk") f.write("# this makefile fragment is autogenerated by configure.py\n") if self.prefix_enabled: f.write(f"prefix = {args.prefix}\n")