|
| 1 | +diff --git a/build.sh b/build.sh |
| 2 | +index e49c132e5..a035474bc 100755 |
| 3 | +--- a/build.sh |
| 4 | ++++ b/build.sh |
| 5 | +@@ -412,35 +412,8 @@ if [ "$PYTHON" != "" ] && [ "$PYTHON" != "-" ]; then |
| 6 | + |
| 7 | + # Get Python installation files |
| 8 | + if [ "$PYTHONLIBFILE" = "" ]; then |
| 9 | +- PYTHONLIBFILENAME=`$PYTHON -c "import sysconfig; print(sysconfig.get_config_vars('LDLIBRARY')[0])" 2>/dev/null` |
| 10 | +- if [ "$PYTHONLIBFILENAME" = "" ]; then |
| 11 | +- PYTHONLIBFILENAME=`$PYTHON -c "import sysconfig; print(sysconfig.get_config_vars('LIBRARY')[0])" 2>/dev/null` |
| 12 | +- fi |
| 13 | +- if [ "$PYTHONLIBFILENAME" = "" ]; then |
| 14 | +- PYTHONLIBFILENAME=`$PYTHON -c "import distutils.sysconfig; print(distutils.sysconfig.get_config_vars('LDLIBRARY')[0])" 2>/dev/null` |
| 15 | +- fi |
| 16 | +- if [ "$PYTHONLIBFILENAME" = "" ]; then |
| 17 | +- PYTHONLIBFILENAME=`$PYTHON -c "import distutils.sysconfig; print(distutils.sysconfig.get_config_vars('LIBRARY')[0])" 2>/dev/null` |
| 18 | +- fi |
| 19 | +- if [ "$PYTHONLIBFILENAME" = "" ]; then |
| 20 | +- echo "*** WARNING: Could not get Python library name" |
| 21 | +- else |
| 22 | +- PYTHONLIBFILEPATH=`$PYTHON -c "import sysconfig; print(sysconfig.get_config_vars('LIBDIR')[0])" 2>/dev/null` |
| 23 | +- if [ "$PYTHONLIBFILEPATH" = "" ]; then |
| 24 | +- PYTHONLIBFILEPATH=`$PYTHON -c "import distutils.sysconfig; print(distutils.sysconfig.get_config_vars('LIBDIR')[0])" 2>/dev/null` |
| 25 | +- fi |
| 26 | +- if [ "$PYTHONLIBFILEPATH" = "" ]; then |
| 27 | +- echo "*** WARNING: Could not get Python library path" |
| 28 | +- else |
| 29 | +- PYTHONLIBFILE="$PYTHONLIBFILEPATH/$PYTHONLIBFILENAME" |
| 30 | +- if [ ! -f "$PYTHONLIBFILE" ]; then |
| 31 | +- echo " INFO: Python library not in default path, trying to use MULTIARCH" |
| 32 | +- PYTHONMULTIARCH=`$PYTHON -c "import sysconfig; print(sysconfig.get_config_vars('MULTIARCH')[0])" 2>/dev/null` |
| 33 | +- PYTHONLIBFILE="$PYTHONLIBFILEPATH/$PYTHONMULTIARCH/$PYTHONLIBFILENAME" |
| 34 | +- fi |
| 35 | +- echo " Python library found: $PYTHONLIBFILE" |
| 36 | +- fi |
| 37 | +- fi |
| 38 | ++ PYTHONLIBFILE=-lpython`$PYTHON -c "import sysconfig; print(sysconfig.get_config_vars('LDVERSION')[0])" 2>/dev/null` |
| 39 | ++ echo " Python library found: $PYTHONLIBFILE" |
| 40 | + fi |
| 41 | + |
| 42 | + if [ "$PYTHONINCLUDE" = "" ]; then |
| 43 | +@@ -537,8 +510,8 @@ if [ "$PYTHONINCLUDE" != "" ]; then |
| 44 | + echo "*** ERROR: wrong -pyinc path: $PYTHONINCLUDE/Python does not exist or is not a file" |
| 45 | + exit 1 |
| 46 | + fi |
| 47 | +- if [ ! -f "$PYTHONLIBFILE" ]; then |
| 48 | +- echo "*** ERROR: wrong -pylib path: $PYTHONLIBFILE does not exist or not a file" |
| 49 | ++ if [[ ! ${PYTHONLIBFILE} == -lpython3* ]]; then |
| 50 | ++ echo "*** ERROR: wrong -pylib path: $PYTHONLIBFILE does not look like a python library name" |
| 51 | + exit 1 |
| 52 | + fi |
| 53 | + else |
0 commit comments