diff options
author | Alexandre Duret-Lutz <adl@gnu.org> | 2003-01-16 11:40:42 +0000 |
---|---|---|
committer | Alexandre Duret-Lutz <adl@gnu.org> | 2003-01-16 11:40:42 +0000 |
commit | 29ccf3d9ffed4f462ce4da7aa89f8759508e7f81 (patch) | |
tree | 040dc0821870a600b318c9414688b8ee15c69dbf /m4 | |
parent | 33aa85b64701acdaf953340f88ef52b0f110a898 (diff) | |
download | automake-29ccf3d9ffed4f462ce4da7aa89f8759508e7f81.tar.gz |
* m4/python.m4 (AM_PATH_PYTHON): Query distutils for `pythondir'
or `pyexecdir', for the sake of 64-bit distributions that usually
use lib64/ instead of lib/. Fall back to the default directory
if it doesn't work.
Suggested by Gwenole Beauchesne.
Diffstat (limited to 'm4')
-rw-r--r-- | m4/python.m4 | 30 |
1 files changed, 18 insertions, 12 deletions
diff --git a/m4/python.m4 b/m4/python.m4 index 6014902e4..cc8c951ec 100644 --- a/m4/python.m4 +++ b/m4/python.m4 @@ -4,7 +4,7 @@ ## Updated by James Henstridge ## ------------------------ -# Copyright 1999, 2000, 2001, 2002 Free Software Foundation, Inc. +# Copyright 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -113,28 +113,34 @@ AC_DEFUN([AM_PATH_PYTHON], dnl site-packages directory, not the python standard library dnl directory like in previous automake betas. This behaviour dnl is more consistent with lispdir.m4 for example. - dnl - dnl Also, if the package prefix isn't the same as python's prefix, - dnl then the old $(pythondir) was pretty useless. - AC_SUBST([pythondir], - [$PYTHON_PREFIX"/lib/python"$PYTHON_VERSION/site-packages]) + dnl Query distutils for this directory. distutils does not exist in + dnl Python 1.5, so we fall back to the hardcoded directory if it + dnl doesn't work. + AC_CACHE_CHECK([for $am_display_PYTHON script directory], + [am_cv_python_pythondir], + [am_cv_python_pythondir=`$PYTHON -c "from distutils import sysconfig; print sysconfig.get_python_lib(0,0,prefix='$PYTHON_PREFIX')" 2>/dev/null || + echo "$PYTHON_PREFIX/lib/python$PYTHON_VERSION/site-packages"`]) + AC_SUBST([pythondir], [$am_cv_python_pythondir]) dnl pkgpythondir -- $PACKAGE directory under pythondir. Was dnl PYTHON_SITE_PACKAGE in previous betas, but this naming is dnl more consistent with the rest of automake. - dnl Maybe this should be put in python.am? AC_SUBST([pkgpythondir], [\${pythondir}/$PACKAGE]) dnl pyexecdir -- directory for installing python extension modules - dnl (shared libraries) Was PYTHON_SITE_EXEC in previous betas. - - AC_SUBST([pyexecdir], - [${PYTHON_EXEC_PREFIX}/lib/python${PYTHON_VERSION}/site-packages]) + dnl (shared libraries) + dnl Query distutils for this directory. distutils does not exist in + dnl Python 1.5, so we fall back to the hardcoded directory if it + dnl doesn't work. + AC_CACHE_CHECK([for $am_display_PYTHON extension module directory], + [am_cv_python_pyexecdir], + [am_cv_python_pyexecdir=`$PYTHON -c "from distutils import sysconfig; print sysconfig.get_python_lib(1,0,prefix='$PYTHON_EXEC_PREFIX')" 2>/dev/null || + echo "${PYTHON_EXEC_PREFIX}/lib/python${PYTHON_VERSION}/site-packages"`]) + AC_SUBST([pyexecdir], [$am_cv_python_pyexecdir]) dnl pkgpyexecdir -- $(pyexecdir)/$(PACKAGE) - dnl Maybe this should be put in python.am? AC_SUBST([pkgpyexecdir], [\${pyexecdir}/$PACKAGE]) ]) |