diff options
-rwxr-xr-x | configure | 23 | ||||
-rw-r--r-- | talerbuildconfig.py | 7 |
2 files changed, 22 insertions, 8 deletions
@@ -20,14 +20,29 @@ # This script checks if a suitable python3 executable is installed and then # executes the actual configure logic written in Python. -scriptpath=build-system/taler-build-scripts +build_system_dir=build-system -if ! test -d "$scriptpath"; then - echo "fatal error: taler-build-scripts not found at $scriptpath" >&2 +if ! test -d "$build_system_dir"; then + # Maybe this is not a top-level configure invocation + # For monorepos, try location from top-level + build_system_dir=../../build-system +fi + +if ! test -d "$build_system_dir"; then + echo "fatal error: build-system directory not found" >&2 + echo "hint: are you running this script from the right directory?" >&2 + exit 1 +fi + +scriptpath=$build_system_dir/taler-build-scripts +if ! test -d "$build_system_dir"; then + echo "fatal error: taler-build-scripts directory not found at $scriptpath" >&2 echo "hint: did you run './bootstrap'?" >&2 exit 1 fi +export TALERBUILDSYSTEMDIR=$build_system_dir + # Check that the python3 executable is on the PATH. # This follows PEP 394 (https://www.python.org/dev/peps/pep-0394/). if ! python3 --version >/dev/null 2>&1; then @@ -41,7 +56,5 @@ python3 "$scriptpath/pyvercheck.py" || exit $? # Allow Python to find libraries that are checked into the build system git. export PYTHONPATH="$scriptpath:${PYTHONPATH:-}" -export TALERBUILDSYSTEMDIR=./build-system - # Call configure.py, assuming all went well. python3 $TALERBUILDSYSTEMDIR/configure.py "$@" diff --git a/talerbuildconfig.py b/talerbuildconfig.py index 016feb8..d98b70f 100644 --- a/talerbuildconfig.py +++ b/talerbuildconfig.py @@ -79,6 +79,7 @@ class BuildConfig: self.args = None self.prefix_enabled = False self.configmk_enabled = False + self.dotconfigmk_enabled = False def add_tool(self, tool): """Deprecated. Prefer the 'use' method.""" @@ -155,10 +156,10 @@ class BuildConfig: print(f"found {tool.name} as {path} (version {version})") if self.configmk_enabled: - d = Path(os.environ.get("TALERBUILDSYSTEMDIR", ".")) + d = Path(".") d.mkdir(parents=True, exist_ok=True) - with open(d / "config.mk", "w") as f: - print("writing config.mk") + 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") |