automake-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: automake1.6 & AM_PATH_PYTHON & lib64


From: Alexandre Duret-Lutz
Subject: Re: automake1.6 & AM_PATH_PYTHON & lib64
Date: Thu, 16 Jan 2003 12:41:51 +0100
User-agent: Gnus/5.090008 (Oort Gnus v0.08) Emacs/21.2 (i386-pc-linux-gnu)

>>> "adl" == Alexandre Duret-Lutz <address@hidden> writes:

[...]
 Gwenole> Note: the patch assumes distutils to exist. I actually
 Gwenole> don't know when it appeared in Python
 Gwenole> history. Otherwise, we can still do the usual
 Gwenole> machinery to detect a lib64 platform or not.
[...]
 adl> So maybe we could just run your distutils query, and fall
 adl> back to the hard coded path when it doesn't run?
[...]

I've installed the following on branch-1-7 and HEAD.

2003-01-16  Alexandre Duret-Lutz  <address@hidden>

        * 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.

Index: THANKS
===================================================================
RCS file: /cvs/automake/automake/THANKS,v
retrieving revision 1.186.2.15
diff -u -r1.186.2.15 THANKS
--- THANKS      14 Jan 2003 07:27:49 -0000      1.186.2.15
+++ THANKS      16 Jan 2003 11:37:22 -0000
@@ -70,6 +70,7 @@
 Greg A. Woods          address@hidden
 Guido Draheim          address@hidden
 Gustavo Carneiro       address@hidden
+Gwenole Beauchesne      address@hidden
 H.J. Lu                        address@hidden
 H.Merijn Brand         address@hidden
 Harlan Stenn           address@hidden
Index: m4/python.m4
===================================================================
RCS file: /cvs/automake/automake/m4/python.m4,v
retrieving revision 1.9
diff -u -r1.9 python.m4
--- m4/python.m4        24 Aug 2002 12:46:03 -0000      1.9
+++ m4/python.m4        16 Jan 2003 11:37:23 -0000
@@ -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 @@
   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])
 ])



-- 
Alexandre Duret-Lutz





reply via email to

[Prev in Thread] Current Thread [Next in Thread]