1From 05194070775b597829abfa0d9a5f96d19cc064b8 Mon Sep 17 00:00:00 2001
2From: Kumar Gala <galak@kernel.crashing.org>
3Date: Thu, 11 Aug 2011 01:26:33 -0500
4Subject: [PATCH 2/6] automake: Update for python.m4 to respect libdir
5
6Upstream-Status: Inappropriate [embedded specific]
7
8Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
9
10Updated for automake-1.12.6
11
12Signed-off-by: Marko Lindqvist <cazfi74@gmail.com>
13Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
14---
15 m4/python.m4 | 32 ++++++--------------------------
16 1 file changed, 6 insertions(+), 26 deletions(-)
17
18diff --git a/m4/python.m4 b/m4/python.m4
19index 0b1db26..07db0eb 100644
20--- a/m4/python.m4
21+++ b/m4/python.m4
22@@ -99,6 +99,8 @@ AC_DEFUN([AM_PATH_PYTHON],
23     [am_cv_python_version=`$PYTHON -c "import sys; print ('%u.%u' % sys.version_info[[:2]])"`])
24   AC_SUBST([PYTHON_VERSION], [$am_cv_python_version])
25
26+  AC_SUBST([PYTHON_LIB_PREFIX], ['${libdir}'])
27+
28   dnl At times, e.g., when building shared libraries, you may want
29   dnl to know which OS platform Python thinks this is.
30   dnl
31@@ -268,18 +270,7 @@ except ImportError:
32    else
33      am_py_prefix=$am_cv_python_prefix
34    fi
35-   am_cv_python_pythondir=`$PYTHON -c "
36-$am_python_setup_sysconfig
37-if can_use_sysconfig:
38-  try:
39-    $am_python_setup_scheme
40-    sitedir = sysconfig.get_path('purelib', scheme, vars={'base':'$am_py_prefix'})
41-  except:
42-    sitedir = sysconfig.get_path('purelib', vars={'base':'$am_py_prefix'})
43-else:
44-  from distutils import sysconfig
45-  sitedir = sysconfig.get_python_lib(0, 0, prefix='$am_py_prefix')
46-sys.stdout.write(sitedir)"`
47+   am_cv_python_pythondir=`echo "$PYTHON_LIB_PREFIX/python$PYTHON_VERSION/site-packages"`
48    #
49    case $am_cv_python_pythondir in
50    $am_py_prefix*)
51@@ -289,7 +280,7 @@ sys.stdout.write(sitedir)"`
52    *)
53      case $am_py_prefix in
54        /usr|/System*) ;;
55-       *) am_cv_python_pythondir="\${PYTHON_PREFIX}/lib/python$PYTHON_VERSION/site-packages"
56+       *) am_cv_python_pythondir=$PYTHON_LIB_PREFIX/python$PYTHON_VERSION/site-packages
57           ;;
58      esac
59      ;;
60@@ -315,18 +306,7 @@ sys.stdout.write(sitedir)"`
61    else
62      am_py_exec_prefix=$am_cv_python_exec_prefix
63    fi
64-   am_cv_python_pyexecdir=`$PYTHON -c "
65-$am_python_setup_sysconfig
66-if can_use_sysconfig:
67-  try:
68-    $am_python_setup_scheme
69-    sitedir = sysconfig.get_path('platlib', scheme, vars={'platbase':'$am_py_exec_prefix'})
70-  except:
71-    sitedir = sysconfig.get_path('platlib', vars={'platbase':'$am_py_exec_prefix'})
72-else:
73-  from distutils import sysconfig
74-  sitedir = sysconfig.get_python_lib(1, 0, prefix='$am_py_exec_prefix')
75-sys.stdout.write(sitedir)"`
76+   am_cv_python_pyexecdir=`echo "$PYTHON_LIB_PREFIX/python$PYTHON_VERSION/site-packages"`
77    #
78    case $am_cv_python_pyexecdir in
79    $am_py_exec_prefix*)
80@@ -336,7 +316,7 @@ sys.stdout.write(sitedir)"`
81    *)
82      case $am_py_exec_prefix in
83        /usr|/System*) ;;
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      ;;
89--
902.39.2
91
92