From eaebfbb4887d9410bc89e75bd142d5213f44296b Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Tue, 21 Apr 2020 16:13:03 +0530 Subject: remove bloat --- configure | 42 +++++++++++++++++------------------------- 1 file changed, 17 insertions(+), 25 deletions(-) (limited to 'configure') diff --git a/configure b/configure index 7749566..ef7f697 100755 --- a/configure +++ b/configure @@ -1,20 +1,7 @@ #!/bin/sh -# This file is part of TALER -# (C) 2019 GNUnet e.V. -# -# This is very simple POSIX sh script which -# identifies the first matching -# python3 identifier in $PATH and produces -# configure.py from configure.py.in, and then -# calls the new executable configure.py. -# -# It should be portable on Unices. Report bugs on -# the bugtracker if you discover that it isn't -# working as intended. -# -# Authors: -# Author: ng0 +# This file is part of GNU Taler. +# (C) 2020 Taler Systems S.A. # # Permission to use, copy, modify, and/or distribute this software for any # purpose with or without fee is hereby granted. @@ -30,24 +17,29 @@ # # SPDX-License-Identifier: 0BSD -# we invoke configure not as a symlink but as a copy, -# so we have to use a fixed location for the repository! -dir=$(dirname "$(readlink -- "$0")")/build-system/taler-build-scripts -. $dir/sh/lib.sh/existence.sh -. $dir/sh/lib.sh/existence_python.sh +# 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 if ! test -d "$scriptpath"; then echo "fatal error: taler-build-scripts not found at $scriptpath" >&2 + echo "hint: did you run './bootstrap'?" >&2 exit 1 fi +# 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 + echo "error: python3 not found" >&2 + exit 1 +fi + +# Let python3 check that its own version is okay for us. +python3 "$scriptpath/pyvercheck.py" || exit $? + +# Allow Python to find libraries that are checked into the build system git. export PYTHONPATH="$scriptpath:${PYTHONPATH:-}" # Call configure.py, assuming all went well. -# $1 is read by configure.py as the prefix. -# If $1 is empty, the python script checks the -# environment for PREFIX. We might need more -# variables and switches, such as DESTDIR. -exec "$PYTHON" ./configure.py $@ +exec python3 ./configure.py "$@" -- cgit v1.2.3