]> sourceware.org Git - automake.git/commitdiff
* m4/python.m4 (AM_PATH_PYTHON): Query distutils for `pythondir'
authorAlexandre Duret-Lutz <adl@gnu.org>
Thu, 16 Jan 2003 11:40:15 +0000 (11:40 +0000)
committerAlexandre Duret-Lutz <adl@gnu.org>
Thu, 16 Jan 2003 11:40:15 +0000 (11:40 +0000)
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.

ChangeLog
THANKS
m4/python.m4

index 1c4a27b503b3852ac0a92656565ba75ae30410b6..02f4dadaa2939ef324896781541e6b481ef55a5e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2003-01-16  Alexandre Duret-Lutz  <adl@gnu.org>
+
+       * 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.
+
 2003-01-14  Alexandre Duret-Lutz  <adl@gnu.org>
 
        For PR automake/382:
diff --git a/THANKS b/THANKS
index 7d22ad69e6f0eba09266e3ead44f558ee3046ce0..18dc47179773d3614c21e5cc055b39fb48efee22 100644 (file)
--- a/THANKS
+++ b/THANKS
@@ -70,6 +70,7 @@ Gordon Sadler         gbsadler1@lcisp.com
 Greg A. Woods          woods@most.weird.com
 Guido Draheim          guidod@gmx.de
 Gustavo Carneiro       gjc@inescporto.pt
+Gwenole Beauchesne      gbeauchesne@mandrakesoft.com
 H.J. Lu                        hjl@lucon.org
 H.Merijn Brand         h.m.brand@hccnet.nl
 Harlan Stenn           Harlan.Stenn@pfcs.com
index 6014902e4cbfbcac1d5865ed675d4f724b6d17c7..cc8c951ec5a0f68af183e0a2aa2c79c6325843de 100644 (file)
@@ -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])
 ])
This page took 0.033051 seconds and 5 git commands to generate.