diff options
author | Tom Rondeau <trondeau@vt.edu> | 2011-10-24 20:00:04 -0400 |
---|---|---|
committer | Tom Rondeau <trondeau@vt.edu> | 2011-10-24 20:00:04 -0400 |
commit | 1c51b4166f80147b179670ae015f445e9ef5103a (patch) | |
tree | a880ab7fd4d962e2bfb2d9934dee1785f8d34c50 /config/gr_python.m4 | |
parent | a0b212eba6e8676e95fc92aba997561a0ff69cea (diff) |
build: fix autotools to install python scripts into the right path based on what Python says.
Diffstat (limited to 'config/gr_python.m4')
-rw-r--r-- | config/gr_python.m4 | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/config/gr_python.m4 b/config/gr_python.m4 index 7aef1662e0..d89f4c504a 100644 --- a/config/gr_python.m4 +++ b/config/gr_python.m4 @@ -49,6 +49,22 @@ AC_DEFUN([PYTHON_DEVEL],[ if (echo $pyexecdir | grep -q lib64); then pythondir="$pyexecdir" fi + else + # Let Python tell us where the install directory is; + # i.e., don't trust AM_PATH_PYTHON + python_cmd=' +import distutils.sysconfig +import os +path = distutils.sysconfig.get_python_lib() +pypath = distutils.sysconfig.get_config_var("exec_prefix") +path = path.split(pypath)[[1]] +if os.sep == "\\": + path = path.replace("\\", "/") +print path +' + pyexecdir=$prefix`$PYTHON -c "$python_cmd"` + pythondir=$pyexecdir + fi # Check for Python include path |