Debian Codegraph @

python-config-wrapper

raw symbols SCIP
1 #!/bin/sh
2 # python3-config wrapper script to support Python 3.8
3 # Works around https://bugs.python.org/issue36721
4
5 set -e
6
7 usage() {
8 echo "Usage: $0 [python3-config] (--libs|--includes)"
9 exit 1
10 }
11
12 if [ $# -ne 2 ]; then
13 usage
14 fi
15
16 PYTHON_CONFIG="$1"
17 shift
18
19 WHICH_FLAG="$1"
20 shift
21
22 case "$WHICH_FLAG" in
23 --libs)
24 # Python 3.8 needs --embed, but previous versions do not have it:
25 # https://github.com/python/cpython/pull/13500
26 if "$PYTHON_CONFIG" --ldflags --libs --embed >/dev/null 2>&1; then
27 "$PYTHON_CONFIG" --ldflags --libs --embed
28 else
29 "$PYTHON_CONFIG" --ldflags --libs
30 fi
31 ;;
32 --includes)
33 "$PYTHON_CONFIG" --includes
34 ;;
35 *)
36 usage
37 ;;
38 esac