diff options
Diffstat (limited to 'configure')
-rwxr-xr-x | configure | 44 |
1 files changed, 19 insertions, 25 deletions
@@ -1,20 +1,7 @@ | |||
1 | #!/bin/sh | 1 | #!/bin/sh |
2 | 2 | ||
3 | # This file is part of TALER | 3 | # This file is part of GNU Taler. |
4 | # (C) 2019 GNUnet e.V. | 4 | # (C) 2020 Taler Systems S.A. |
5 | # | ||
6 | # This is very simple POSIX sh script which | ||
7 | # identifies the first matching | ||
8 | # python3 identifier in $PATH and produces | ||
9 | # configure.py from configure.py.in, and then | ||
10 | # calls the new executable configure.py. | ||
11 | # | ||
12 | # It should be portable on Unices. Report bugs on | ||
13 | # the bugtracker if you discover that it isn't | ||
14 | # working as intended. | ||
15 | # | ||
16 | # Authors: | ||
17 | # Author: ng0 <ng0@taler.net> | ||
18 | # | 5 | # |
19 | # Permission to use, copy, modify, and/or distribute this software for any | 6 | # Permission to use, copy, modify, and/or distribute this software for any |
20 | # purpose with or without fee is hereby granted. | 7 | # purpose with or without fee is hereby granted. |
@@ -30,24 +17,31 @@ | |||
30 | # | 17 | # |
31 | # SPDX-License-Identifier: 0BSD | 18 | # SPDX-License-Identifier: 0BSD |
32 | 19 | ||
33 | # we invoke configure not as a symlink but as a copy, | 20 | # This script checks if a suitable python3 executable is installed and then |
34 | # so we have to use a fixed location for the repository! | 21 | # executes the actual configure logic written in Python. |
35 | dir=$(dirname "$(readlink -- "$0")")/build-system/taler-build-scripts | ||
36 | . $dir/sh/lib.sh/existence.sh | ||
37 | . $dir/sh/lib.sh/existence_python.sh | ||
38 | 22 | ||
39 | scriptpath=build-system/taler-build-scripts | 23 | scriptpath=build-system/taler-build-scripts |
40 | 24 | ||
41 | if ! test -d "$scriptpath"; then | 25 | if ! test -d "$scriptpath"; then |
42 | echo "fatal error: taler-build-scripts not found at $scriptpath" >&2 | 26 | echo "fatal error: taler-build-scripts not found at $scriptpath" >&2 |
27 | echo "hint: did you run './bootstrap'?" >&2 | ||
28 | exit 1 | ||
29 | fi | ||
30 | |||
31 | # Check that the python3 executable is on the PATH. | ||
32 | # This follows PEP 394 (https://www.python.org/dev/peps/pep-0394/). | ||
33 | if ! python3 --version >/dev/null 2>&1; then | ||
34 | echo "error: python3 not found" >&2 | ||
43 | exit 1 | 35 | exit 1 |
44 | fi | 36 | fi |
45 | 37 | ||
38 | # Let python3 check that its own version is okay for us. | ||
39 | python3 "$scriptpath/pyvercheck.py" || exit $? | ||
40 | |||
41 | # Allow Python to find libraries that are checked into the build system git. | ||
46 | export PYTHONPATH="$scriptpath:${PYTHONPATH:-}" | 42 | export PYTHONPATH="$scriptpath:${PYTHONPATH:-}" |
47 | 43 | ||
44 | export TALERBUILDSYSTEMDIR=./build-system | ||
45 | |||
48 | # Call configure.py, assuming all went well. | 46 | # Call configure.py, assuming all went well. |
49 | # $1 is read by configure.py as the prefix. | 47 | python3 $TALERBUILDSYSTEMDIR/configure.py "$@" |
50 | # If $1 is empty, the python script checks the | ||
51 | # environment for PREFIX. We might need more | ||
52 | # variables and switches, such as DESTDIR. | ||
53 | exec "$PYTHON" ./configure.py $@ | ||