Andrew Geissler | 95ac1b8 | 2021-03-31 14:34:31 -0500 | [diff] [blame^] | 1 | From 61bd143910001aaf610416d7ca56c52c0b081318 Mon Sep 17 00:00:00 2001 |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 2 | From: Kumar Gala <galak@kernel.crashing.org> |
| 3 | Date: Thu, 11 Aug 2011 01:26:33 -0500 |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 4 | Subject: [PATCH] automake: Update for python.m4 to respect libdir |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 5 | |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 6 | Upstream-Status: Inappropriate [embedded specific] |
| 7 | |
| 8 | Signed-off-by: Kumar Gala <galak@kernel.crashing.org> |
| 9 | |
| 10 | Updated for automake-1.12.6 |
| 11 | |
| 12 | Signed-off-by: Marko Lindqvist <cazfi74@gmail.com> |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 13 | Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 14 | |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 15 | --- |
| 16 | m4/python.m4 | 27 +++++++-------------------- |
| 17 | 1 file changed, 7 insertions(+), 20 deletions(-) |
| 18 | |
| 19 | diff --git a/m4/python.m4 b/m4/python.m4 |
Andrew Geissler | 95ac1b8 | 2021-03-31 14:34:31 -0500 | [diff] [blame^] | 20 | index b2302ba..dbc6954 100644 |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 21 | --- a/m4/python.m4 |
| 22 | +++ b/m4/python.m4 |
Andrew Geissler | 95ac1b8 | 2021-03-31 14:34:31 -0500 | [diff] [blame^] | 23 | @@ -96,12 +96,13 @@ AC_DEFUN([AM_PATH_PYTHON], |
| 24 | [am_cv_python_version=`$PYTHON -c "import sys; print('%u.%u' % sys.version_info[[:2]])"`]) |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 25 | AC_SUBST([PYTHON_VERSION], [$am_cv_python_version]) |
| 26 | |
| 27 | - dnl Use the values of $prefix and $exec_prefix for the corresponding |
| 28 | - dnl values of PYTHON_PREFIX and PYTHON_EXEC_PREFIX. These are made |
| 29 | + dnl Use the values of $prefix, $libdir and $exec_prefix for the corresponding |
| 30 | + dnl values of PYTHON_PREFIX PYTHON_LIB_PREFIX, and PYTHON_EXEC_PREFIX. These are made |
| 31 | dnl distinct variables so they can be overridden if need be. However, |
| 32 | dnl general consensus is that you shouldn't need this ability. |
| 33 | |
| 34 | AC_SUBST([PYTHON_PREFIX], ['${prefix}']) |
| 35 | + AC_SUBST([PYTHON_LIB_PREFIX], ['${libdir}']) |
| 36 | AC_SUBST([PYTHON_EXEC_PREFIX], ['${exec_prefix}']) |
| 37 | |
| 38 | dnl At times (like when building shared libraries) you may want |
Andrew Geissler | 95ac1b8 | 2021-03-31 14:34:31 -0500 | [diff] [blame^] | 39 | @@ -146,14 +147,7 @@ except ImportError: |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 40 | else |
| 41 | am_py_prefix=$prefix |
| 42 | fi |
| 43 | - am_cv_python_pythondir=`$PYTHON -c " |
| 44 | -$am_python_setup_sysconfig |
| 45 | -if can_use_sysconfig: |
| 46 | - sitedir = sysconfig.get_path('purelib', vars={'base':'$am_py_prefix'}) |
| 47 | -else: |
| 48 | - from distutils import sysconfig |
| 49 | - sitedir = sysconfig.get_python_lib(0, 0, prefix='$am_py_prefix') |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 50 | -sys.stdout.write(sitedir)"` |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 51 | + am_cv_python_pythondir=`echo "$PYTHON_LIB_PREFIX/python$PYTHON_VERSION/site-packages"` |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 52 | case $am_cv_python_pythondir in |
| 53 | $am_py_prefix*) |
| 54 | am__strip_prefix=`echo "$am_py_prefix" | sed 's|.|.|g'` |
Andrew Geissler | 95ac1b8 | 2021-03-31 14:34:31 -0500 | [diff] [blame^] | 55 | @@ -163,7 +157,7 @@ sys.stdout.write(sitedir)"` |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 56 | case $am_py_prefix in |
| 57 | /usr|/System*) ;; |
| 58 | *) |
| 59 | - am_cv_python_pythondir=$PYTHON_PREFIX/lib/python$PYTHON_VERSION/site-packages |
| 60 | + am_cv_python_pythondir=$PYTHON_LIB_PREFIX/python$PYTHON_VERSION/site-packages |
| 61 | ;; |
| 62 | esac |
| 63 | ;; |
Andrew Geissler | 95ac1b8 | 2021-03-31 14:34:31 -0500 | [diff] [blame^] | 64 | @@ -188,14 +182,7 @@ sys.stdout.write(sitedir)"` |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 65 | else |
| 66 | am_py_exec_prefix=$exec_prefix |
| 67 | fi |
| 68 | - am_cv_python_pyexecdir=`$PYTHON -c " |
| 69 | -$am_python_setup_sysconfig |
| 70 | -if can_use_sysconfig: |
| 71 | - sitedir = sysconfig.get_path('platlib', vars={'platbase':'$am_py_prefix'}) |
| 72 | -else: |
| 73 | - from distutils import sysconfig |
| 74 | - sitedir = sysconfig.get_python_lib(1, 0, prefix='$am_py_prefix') |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 75 | -sys.stdout.write(sitedir)"` |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 76 | + am_cv_python_pyexecdir=`echo "$PYTHON_LIB_PREFIX/python$PYTHON_VERSION/site-packages"` |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 77 | case $am_cv_python_pyexecdir in |
| 78 | $am_py_exec_prefix*) |
| 79 | am__strip_prefix=`echo "$am_py_exec_prefix" | sed 's|.|.|g'` |
Andrew Geissler | 95ac1b8 | 2021-03-31 14:34:31 -0500 | [diff] [blame^] | 80 | @@ -205,7 +192,7 @@ sys.stdout.write(sitedir)"` |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 81 | case $am_py_exec_prefix in |
| 82 | /usr|/System*) ;; |
| 83 | *) |
| 84 | - am_cv_python_pyexecdir=$PYTHON_EXEC_PREFIX/lib/python$PYTHON_VERSION/site-packages |
| 85 | + am_cv_python_pyexecdir=$PYTHON_LIB_PREFIX/python$PYTHON_VERSION/site-packages |
| 86 | ;; |
| 87 | esac |
| 88 | ;; |